| Current Path : /home2/wtmwscom/public_html/admin/ |
| Current File : /home2/wtmwscom/public_html/admin/lead_edit_model.php |
<?php
session_start();
include('../connection.php');
include '../function_lib.php';
include './imageresize.php';
if(!isset($_POST['uid']) || empty($_SESSION['adminid'])){
redirect('./lead_report.php');
}
$uid = $_POST['uid'];
$name = $_POST['name'];
$dob = $_POST['dob'];
$sex = $_POST['sex'];
$email = $_POST['email'];
$mobile = $_POST['mobile'];
$address = $_POST['address'];
$city = $_POST['city'];
$country = $_POST['country'];
$pan_no = $_POST['pan_no'];
$aadhar_no = $_POST['aadhar_no'];
$smallImage ="";
if (!empty($_FILES['receipt']) && isset($_FILES['receipt']['name']) && array_search($_FILES['receipt']['type'], array("image/gif", "image/jpeg", "image/png", "image/jpg")) !== FALSE) {
$resize = new resizeImage();
// upload image in three dimesions
//$largePath = "uploads/news/large/";
//$largeImage = $resize->do_resize(500,400 ,$_FILES['receipt'],$largePath,0,"large");
$smallPath = "../member/uploads/";
$smallImage = $resize->do_resize(800, 500, $_FILES['receipt'], $smallPath, 0, "thumb", 90);
}
//update lead
$sql = "UPDATE lead SET name='".$name."',dob='".$dob."',gender='".$sex."',email='".$email."',mobile='".$mobile."',address='".$address."',city='".$city."',country='".$country."',pan_no='".$pan_no."', aadhar_no='".$aadhar_no."', filename='".$smallImage."' WHERE uid='".$uid."'";
mysqli_query($connection, $sql);
setMessage('Lead edited successfully.', 'alert-msg success');
redirect('./lead_report.php');
?>