| Server IP : 92.204.40.98 / Your IP : 216.73.216.201 Web Server : LiteSpeed System : Linux amster.dnsfors.com 4.18.0-553.111.1.el8_10.x86_64 #1 SMP Sun Mar 8 20:06:07 EDT 2026 x86_64 User : tmksyste ( 2190) PHP Version : 8.3.31 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/tmksyste/domains/tmksystems.in/public_html/applications/ |
Upload File : |
<?php
include('connection.php');
$order_no=$_POST['order_no'];
$address=$_POST['address'];
$customer=$_POST['customer'];
$contact=$_POST['contact'];
$city=$_POST['city'];
$state=$_POST['state'];
$pin=$_POST['pin'];
$gst=$_POST['gst'];
$program=$_POST['program'];
$program_date=$_POST['program_date'];
$totalamount=$_POST['totalamount'];
$famount=$_POST['famount'];
$cid=$_REQUEST['id'];
$lid=$_POST['lid'];
$remarks=$_POST['remarks'];
$sql2="select * from customer_details where cid='$cid'";
$result2=mysql_query($sql2)or die(mysql_error());
$row2=mysql_fetch_array($result2);
$file1=$row2['file1'];
$file2=$row2['file2'];
if(!empty($_FILES["file1"]["tmp_name"]))
{
$uploads_dir = 'uploads/customer';
$tmp_name = $_FILES["file1"]["tmp_name"];
// basename() may prevent filesystem traversal attacks;
// further validation/sanitation of the filename may be appropriate
$name = basename($_FILES["file1"]["name"]);
$random_digit=rand(0000,9999);
$new_file_name1=$random_digit.$name;
move_uploaded_file($tmp_name, "$uploads_dir/$new_file_name1");
unlink('uploads/customer/'.$file1);
if(empty($new_file_name1))
$new_file_name1=$file1;
}
else
$new_file_name1=$file1;
if(!empty($_FILES["file2"]["tmp_name"]))
{
$uploads_dir = 'uploads/customer';
$tmp_name = $_FILES["file2"]["tmp_name"];
// basename() may prevent filesystem traversal attacks;
// further validation/sanitation of the filename may be appropriate
$name = basename($_FILES["file2"]["name"]);
$random_digit=rand(0000,9999);
$new_file_name2=$random_digit.$name;
move_uploaded_file($tmp_name, "$uploads_dir/$new_file_name2");
unlink('uploads/customer/'.$file2);
if(empty($new_file_name2))
$new_file_name2=$file2;
}
else
$new_file_name2=$file2;
if(isset($_REQUEST['submit']))
{
if(empty($lid))
{
$sql="update customer_details set order_no='$order_no',address='$address',city='$city',state='$state',pin='$pin',gst='$gst',program='$program',pdate='$program_date',total_amount='$totalamount',famount='$famount',remarks='$remarks' ,`file1`='$new_file_name1',`file2`='$new_file_name2',`customer`='$customer', `phone`='$contact' where cid='$cid'";
}
else
{
$sql="update customer_details set lid='$lid',order_no='$order_no',address='$address',city='$city',state='$state',pin='$pin',gst='$gst',program='$program',pdate='$program_date',total_amount='$totalamount',famount='$famount',remarks='$remarks' ,`file1`='$new_file_name1',`file2`='$new_file_name2',`customer`='$customer', `phone`='$contact' where cid='$cid'";
}
mysql_query($sql);
header('location:customer_management.php?log=edit');
echo '<META HTTP-EQUIV="Refresh" Content="0; URL=customer_management.php?log=edit">';
}
?>