UnknownSec Bypass
403
:
/
var
/
www
/
jpsagrisolution
/
cpanel
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
upload_anudaanfarmer_document.php
<?php include "../panelassets/config.php"; require '../vendor/autoload.php'; use Aws\S3\S3Client; if($_FILES['aadharfile']['name']){ $error=array(); $regno=mysqli_real_escape_string($conn, $_POST['regno']); $oldimagename=""; $query = "select aadhar_imagepath from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["aadhar_imagepath"]; } if($oldimagename) { $removefilename="anudaan_document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['aadharfile']['name']; $aadhar_size=$_FILES['aadharfile']['size']; $aadhar_tmp=$_FILES['aadharfile']['tmp_name']; $aadhar_type=$_FILES['aadharfile']['type']; $file_ext=explode('.',$aadhar_name); $file_ext=strtolower(end($file_ext)); $extensions=array("jpeg","jpg","png"); if(in_array($file_ext,$extensions)===false){ $error[]="This extension file is not allowed, Please choose a JPG or PNG file."; } if($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="anudaan_document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } session_start(); $userid=$_SESSION['adminid']; $creationdatetime = date("Y-m-d H:m:s"); //$date=date("d M, Y"); $data=0; $message=""; $query = "select count(0) as count from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $message= $row["count"]; } if($message=="0") { $sql="INSERT INTO anudaanfarmerdocumenttb(regno,aadhar_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$regno}','{$aadharimage_name}','{$notdeleted}','{$userid}','{$creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>1, 'path'=>$aadharimage_name)); } } else { $sql="Update anudaanfarmerdocumenttb set aadhar_imagepath='{$aadharimage_name}' where regno='".$regno."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>1, 'path'=>$aadharimage_name)); } } } else if($_FILES['panfile']['name']){ $error=array(); $regno=mysqli_real_escape_string($conn, $_POST['regno']); $oldimagename=""; $query = "select pan_imagepath from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["pan_imagepath"]; } if($oldimagename) { $removefilename="anudaan_document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['panfile']['name']; $aadhar_size=$_FILES['panfile']['size']; $aadhar_tmp=$_FILES['panfile']['tmp_name']; $aadhar_type=$_FILES['panfile']['type']; $file_ext=explode('.',$aadhar_name); $file_ext=strtolower(end($file_ext)); $extensions=array("jpeg","jpg","png"); if(in_array($file_ext,$extensions)===false){ $error[]="This extension file is not allowed, Please choose a JPG or PNG file."; } if($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="anudaan_document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } session_start(); $userid=$_SESSION['adminid']; $creationdatetime = date("Y-m-d H:m:s"); //$date=date("d M, Y"); $data=0; $message=""; $query = "select count(0) as count from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $message= $row["count"]; } if($message=="0") { $sql="INSERT INTO anudaanfarmerdocumenttb(regno,pan_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$regno}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>2, 'path'=>$aadharimage_name)); } } else { $sql="Update anudaanfarmerdocumenttb set pan_imagepath='{$aadharimage_name}' where regno='".$regno."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>2, 'path'=>$aadharimage_name)); } } } else if($_FILES['bankfile']['name']){ $error=array(); $regno=mysqli_real_escape_string($conn, $_POST['regno']); $oldimagename=""; $query = "select bankpassbook_imagepath from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["bankpassbook_imagepath"]; } if($oldimagename) { $removefilename="anudaan_document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['bankfile']['name']; $aadhar_size=$_FILES['bankfile']['size']; $aadhar_tmp=$_FILES['bankfile']['tmp_name']; $aadhar_type=$_FILES['bankfile']['type']; $file_ext=explode('.',$aadhar_name); $file_ext=strtolower(end($file_ext)); $extensions=array("jpeg","jpg","png"); if(in_array($file_ext,$extensions)===false){ $error[]="This extension file is not allowed, Please choose a JPG or PNG file."; } if($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="anudaan_document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } session_start(); $userid=$_SESSION['adminid']; $creationdatetime = date("Y-m-d H:m:s"); //$date=date("d M, Y"); $data=0; $message=""; $query = "select count(0) as count from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $message= $row["count"]; } if($message=="0") { $sql="INSERT INTO anudaanfarmerdocumenttb(regno,bankpassbook_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$regno}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>3, 'path'=>$aadharimage_name)); } } else { $sql="Update anudaanfarmerdocumenttb set bankpassbook_imagepath='{$aadharimage_name}' where regno='".$regno."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>3, 'path'=>$aadharimage_name)); } } } else if($_FILES['khatunifile']['name']){ $error=array(); $regno=mysqli_real_escape_string($conn, $_POST['regno']); $oldimagename=""; $query = "select khatuni_imagepath from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["khatuni_imagepath"]; } if($oldimagename) { $removefilename="anudaan_document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['khatunifile']['name']; $aadhar_size=$_FILES['khatunifile']['size']; $aadhar_tmp=$_FILES['khatunifile']['tmp_name']; $aadhar_type=$_FILES['khatunifile']['type']; $file_ext=explode('.',$aadhar_name); $file_ext=strtolower(end($file_ext)); $extensions=array("jpeg","jpg","png"); if(in_array($file_ext,$extensions)===false){ $error[]="This extension file is not allowed, Please choose a JPG or PNG file."; } if($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="anudaan_document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } session_start(); $userid=$_SESSION['adminid']; $creationdatetime = date("Y-m-d H:m:s"); //$date=date("d M, Y"); $data=0; $message=""; $query = "select count(0) as count from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $message= $row["count"]; } if($message=="0") { $sql="INSERT INTO anudaanfarmerdocumenttb(regno,khatuni_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$regno}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>4, 'path'=>$aadharimage_name)); } } else { $sql="Update anudaanfarmerdocumenttb set khatuni_imagepath='{$aadharimage_name}' where regno='".$regno."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>4, 'path'=>$aadharimage_name)); } } } else if($_FILES['photofile']['name']){ $error=array(); $regno=mysqli_real_escape_string($conn, $_POST['regno']); $oldimagename=""; $query = "select photo_imagepath from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["photo_imagepath"]; } if($oldimagename) { $removefilename="anudaan_document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['photofile']['name']; $aadhar_size=$_FILES['photofile']['size']; $aadhar_tmp=$_FILES['photofile']['tmp_name']; $aadhar_type=$_FILES['photofile']['type']; $file_ext=explode('.',$aadhar_name); $file_ext=strtolower(end($file_ext)); $extensions=array("jpeg","jpg","png"); if(in_array($file_ext,$extensions)===false){ $error[]="This extension file is not allowed, Please choose a JPG or PNG file."; } if($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="anudaan_document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } session_start(); $userid=$_SESSION['adminid']; $creationdatetime = date("Y-m-d H:m:s"); //$date=date("d M, Y"); $data=0; $message=""; $query = "select count(0) as count from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $message= $row["count"]; } if($message=="0") { $sql="INSERT INTO anudaanfarmerdocumenttb(regno,photo_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$regno}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>5, 'path'=>$aadharimage_name)); } } else { $sql="Update anudaanfarmerdocumenttb set photo_imagepath='{$aadharimage_name}' where regno='".$regno."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>5, 'path'=>$aadharimage_name)); } } } else if($_FILES['signfile']['name']){ $error=array(); $regno=mysqli_real_escape_string($conn, $_POST['regno']); $oldimagename=""; $query = "select sign_imagepath from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["sign_imagepath"]; } if($oldimagename) { $removefilename="anudaan_document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['signfile']['name']; $aadhar_size=$_FILES['signfile']['size']; $aadhar_tmp=$_FILES['signfile']['tmp_name']; $aadhar_type=$_FILES['signfile']['type']; $file_ext=explode('.',$aadhar_name); $file_ext=strtolower(end($file_ext)); $extensions=array("jpeg","jpg","png"); if(in_array($file_ext,$extensions)===false){ $error[]="This extension file is not allowed, Please choose a JPG or PNG file."; } if($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="anudaan_document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } session_start(); $userid=$_SESSION['adminid']; $creationdatetime = date("Y-m-d H:m:s"); //$date=date("d M, Y"); $data=0; $message=""; $query = "select count(0) as count from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $message= $row["count"]; } if($message=="0") { $sql="INSERT INTO anudaanfarmerdocumenttb(regno,sign_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$regno}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>6, 'path'=>$aadharimage_name)); } } else { $sql="Update anudaanfarmerdocumenttb set sign_imagepath='{$aadharimage_name}' where regno='".$regno."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>6, 'path'=>$aadharimage_name)); } } } else if($_FILES['zeofile']['name']){ $error=array(); $regno=mysqli_real_escape_string($conn, $_POST['regno']); $oldimagename=""; $query = "select zeotag_location from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["zeotag_location"]; } if($oldimagename) { $removefilename="anudaan_document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['zeofile']['name']; $aadhar_size=$_FILES['zeofile']['size']; $aadhar_tmp=$_FILES['zeofile']['tmp_name']; $aadhar_type=$_FILES['zeofile']['type']; $file_ext=explode('.',$aadhar_name); $file_ext=strtolower(end($file_ext)); $extensions=array("jpeg","jpg","png"); if(in_array($file_ext,$extensions)===false){ $error[]="This extension file is not allowed, Please choose a JPG or PNG file."; } if($aadhar_size > 2097152) { $error="File size must be 2mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="anudaan_document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } session_start(); $userid=$_SESSION['adminid']; $creationdatetime = date("Y-m-d H:m:s"); //$date=date("d M, Y"); $data=0; $message=""; $query = "select count(0) as count from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $message= $row["count"]; } if($message=="0") { $sql="INSERT INTO anudaanfarmerdocumenttb(regno,zeotag_location,isdeleted,creationuserid,creationdatetime) VALUES('{$regno}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>7, 'path'=>$aadharimage_name)); } } else { $sql="Update anudaanfarmerdocumenttb set zeotag_location='{$aadharimage_name}' where regno='".$regno."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>7, 'path'=>$aadharimage_name)); } } } else if($_FILES['videofile']['name']) { // Instantiate an Amazon S3 client. $s3Client = new S3Client([ 'version' => 'latest', 'region' => 'ap-south-1', 'credentials' => [ 'key' => 'AKIAS2MWUJ4DJ67ITTXG', 'secret' => '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' ] ]); if($_SERVER["REQUEST_METHOD"] == "POST") { $error=array(); $regno=mysqli_real_escape_string($conn, $_POST['regno']); $oldimagename=""; $query = "select video_location from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["video_location"]; } if($oldimagename) { $removefilename="https://tiwariagroindustries.s3.ap-south-1.amazonaws.com/upload/".$oldimagename; unlink($removefilename); } if(isset($_FILES["videofile"])){ $allowed = array("mp4","avi","3gp","mov","mpeg"); $filename = $_FILES["videofile"]["name"]; $filetype = $_FILES["videofile"]["type"]; $filesize = $_FILES["videofile"]["size"]; // Validate file extension $ext = pathinfo($filename, PATHINFO_EXTENSION); $maxsize = 20 * 1024 * 1024; if($filesize > $maxsize) die("Error: File size is larger than the allowed limit."); if(file_exists("upload/" . $filename)){ echo $filename . " is already exists."; } else { $bucket = 'tiwariagroindustries'; $file_Path = __DIR__ . '/upload/'. $filename; //$file_Path = __DIR__ . $filename; $key = time()."-".basename($file_Path); $aadharimage_name=$key; try { $result = $s3Client->putObject([ 'Bucket' => $bucket, 'Key' => 'upload/'.$key, 'SourceFile' => $_FILES["videofile"]["tmp_name"], ]); session_start(); $userid=$_SESSION['adminid']; $creationdatetime = date("Y-m-d H:m:s"); //$date=date("d M, Y"); $data=0; $message=""; $query = "select count(0) as count from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $message= $row["count"]; } if($message=="0") { $sql="INSERT INTO anudaanfarmerdocumenttb(regno,video_location,isdeleted,creationuserid,creationdatetime) VALUES('{$regno}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>8, 'path'=>$aadharimage_name)); } } else { $sql="Update anudaanfarmerdocumenttb set video_location='{$aadharimage_name}' where regno='".$regno."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>8, 'path'=>$aadharimage_name)); } } } catch (Aws\S3\Exception\S3Exception $e) { echo "There was an error uploading the file.\n"; echo $e->getMessage(); } } } else { echo "Error: " . $_FILES["videofile"]["error"]; } } } else if($_FILES['otherphoto1']['name']){ $error=array(); $regno=mysqli_real_escape_string($conn, $_POST['regno']); $oldimagename=""; $query = "select otherphoto1_imagepath from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["otherphoto1_imagepath"]; } if($oldimagename) { $removefilename="anudaan_document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['otherphoto1']['name']; $aadhar_size=$_FILES['otherphoto1']['size']; $aadhar_tmp=$_FILES['otherphoto1']['tmp_name']; $aadhar_type=$_FILES['otherphoto1']['type']; $file_ext=explode('.',$aadhar_name); $file_ext=strtolower(end($file_ext)); $extensions=array("jpeg","jpg","png"); if(in_array($file_ext,$extensions)===false){ $error[]="File too large. File must be less than 5MB.."; } if($aadhar_size > 5242880) { $error="File size must be 5mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="anudaan_document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } session_start(); $userid=$_SESSION['adminid']; $creationdatetime = date("Y-m-d H:m:s"); //$date=date("d M, Y"); $data=0; $message=""; $query = "select count(0) as count from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $message= $row["count"]; } if($message=="0") { $sql="INSERT INTO anudaanfarmerdocumenttb(regno,otherphoto1_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$regno}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>9, 'path'=>$aadharimage_name)); } } else { $sql="Update anudaanfarmerdocumenttb set otherphoto1_imagepath='{$aadharimage_name}' where regno='".$regno."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>9, 'path'=>$aadharimage_name)); } } } else if($_FILES['otherphoto2']['name']){ $error=array(); $regno=mysqli_real_escape_string($conn, $_POST['regno']); $oldimagename=""; $query = "select otherphoto2_imagepath from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $oldimagename= $row["otherphoto2_imagepath"]; } if($oldimagename) { $removefilename="anudaan_document_images/".$oldimagename; unlink($removefilename); } $aadhar_name=$_FILES['otherphoto2']['name']; $aadhar_size=$_FILES['otherphoto2']['size']; $aadhar_tmp=$_FILES['otherphoto2']['tmp_name']; $aadhar_type=$_FILES['otherphoto2']['type']; $file_ext=explode('.',$aadhar_name); $file_ext=strtolower(end($file_ext)); $extensions=array("jpeg","jpg","png"); if(in_array($file_ext,$extensions)===false){ $error[]="File too large. File must be less than 5MB.."; } if($aadhar_size > 5242880) { $error="File size must be 5mb or lower."; } $aadharnew_name=time()."-".basename($aadhar_name); $aadhartarget="anudaan_document_images/".$aadharnew_name; $aadharimage_name=$aadharnew_name; if(empty($errors)==true){ move_uploaded_file($aadhar_tmp,$aadhartarget); }else{ print_r($error); die(); } session_start(); $userid=$_SESSION['adminid']; $creationdatetime = date("Y-m-d H:m:s"); //$date=date("d M, Y"); $data=0; $message=""; $query = "select count(0) as count from anudaanfarmerdocumenttb where regno='".$regno."' and isdeleted='".$notdeleted."'"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)) { $message= $row["count"]; } if($message=="0") { $sql="INSERT INTO anudaanfarmerdocumenttb(regno,otherphoto2_imagepath,isdeleted,creationuserid,creationdatetime) VALUES('{$regno}','{$aadharimage_name}','{$notdeleted}','{$userid}','{creationdatetime}')"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>10, 'path'=>$aadharimage_name)); } } else { $sql="Update anudaanfarmerdocumenttb set otherphoto2_imagepath='{$aadharimage_name}' where regno='".$regno."' and isdeleted='".$notdeleted."'"; if(mysqli_query($conn, $sql)) { echo json_encode(array('code'=>10, 'path'=>$aadharimage_name)); } } } else { echo json_encode(array('code'=>0, 'path'=>'File Upload failed')); } ?>
Copyright © 2025 - UnknownSec