OverLord Shell

Path : G:/PleskVhosts/jaincensus.com/macciaweb.ultraliant.com/businessforum/
File Upload :
Current File : G:/PleskVhosts/jaincensus.com/macciaweb.ultraliant.com/businessforum/contactedit_save.php

<?php session_start();
//modify by priyanka vaishnav
//on:20 sep 2018
//print_r($_POST);exit;
if(!isset($_SESSION['company_id']) || !isset($_SESSION['loggedin_user'])){session_destroy();header("location:login.php");}
//if($_SERVER['REQUEST_METHOD']!='POST' || empty($_POST)){echo "404.php";exit;}
require_once("db/conn.php");

$uid=$_SESSION['mid'];
$cname='India';
$proposer=$_POST['proposer'];
$signator=$_POST['signator'];
$mobno=$_POST['mobno'];
$faxno=$_POST['faxno'];
$landlineno=$_POST['landlineno'];
$email=filter_var(filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL), FILTER_VALIDATE_EMAIL);
$gender=$_POST['gender'];
$address=$_POST['address'];
$state=$_POST['state'];
if(isset($_POST['city']))$city=$_POST['city'];
if(isset($_POST['area']))$area=$_POST['area'];
$pincode=$_POST['pincode'];
$dob=date('Y-m-d',strtotime($_POST['dob']));
$doa=date('Y-m-d',strtotime($_POST['doa']));
$district=$_POST['district'];
$profession=$_POST['profession'];
$qualification=$_POST['qualification'];
$pancard=$_POST['pancard'];
$aadhaar=$_POST['aadhaar'];
$passport=$_POST['passport'];
$license=$_POST['license'];
$voterid=$_POST['voterid'];


$selr=$connection_jc->query("SELECT con_sr_no FROM otms_mst_contact WHERE con_sr_no!=".$uid." AND su_sr_no=1 AND active='y' AND fname='".$fname."' AND lname='".$lname."' AND mobno='".$mobno."'");
if($selr->num_rows!=0)echo "Duplicate First Name, Last Name and Mobile Number combination";
else{
	//checking for duplicate Membership code
	$chkr=$connection_jc->query("SELECT con_sr_no FROM otms_mst_contact WHERE con_sr_no!=".$uid." AND su_sr_no=1 AND active='y' AND memcode='$memcode'");
	if($chkr->num_rows!=0){
		echo "Duplicate Membership No.";
		$chkr->free();
		exit;
	}$chkr->free();
	
	if(isset($_POST['buss']))$buss=implode(',',$_POST['buss']);

	$updateq="UPDATE otms_mst_contact SET ";

	if(!empty($_POST['rep_name']))$updateq.="rep_name='".$_POST['rep_name']."',";else $updateq.="rep_name=NULL,";
	if(!empty($_POST['rep_mobno']))$updateq.="rep_mobno='".$_POST['rep_mobno']."',";else $updateq.="rep_mobno=NULL,";
	if(!empty($_POST['rep_email']))$updateq.="rep_email='".$_POST['rep_email']."',";else $updateq.="rep_email=NULL,";
	if(!empty($_POST['bus_type']))$updateq.="bus_type='".$_POST['bus_type']."',";else $updateq.="bus_type=NULL,";
	if(!empty($_POST['buscat_name']))$updateq.="buscat_name='".$_POST['buscat_name']."',";else $updateq.="buscat_name=NULL,";
	if(!empty($buss))$updateq.="business='".$buss."',";else $updateq.="business=NULL,";
	if(!empty($_POST['email']))$updateq.="email='$email',";else $updateq.="email=NULL,";
	
	
	$updateq.="mobno='$mobno',";
	if(!empty($faxno))$updateq.="faxno='$faxno',";else $updateq.="faxno=NULL,";
	if(!empty($landlineno))$updateq.="landlineno='$landlineno',";else $updateq.="landlineno=NULL,";
	$updateq.="gender='$gender',";
	if(!empty($address))$updateq.="address='$address',";else $updateq.="address=NULL,";
	if(!empty($state))$updateq.="statesrno='$state',";else $updateq.="statesrno=NULL,";
	if(isset($_POST['city']) && !empty($_POST['city']))$updateq.="citysrno='$city',";else $updateq.="citysrno=NULL,";
	if(!empty($pincode))$updateq.="pincode='$pincode',";else $updateq.="pincode=NULL,";
	if(!empty($_POST['dob']))$updateq.="dob='$dob',";else $updateq.="dob=NULL,";
	if(!empty($_POST['doa']))$updateq.="doa='$doa',";else $updateq.="doa=NULL,";
	if(!empty($profession))$updateq.="profession='$profession',";else $updateq.="profession=NULL,";
	if(!empty($qualification))$updateq.="qualification='$qualification',";else $updateq.="qualification=NULL,";
	if(!empty($pancard))$updateq.="pancard='$pancard',";else $updateq.="pancard=NULL,";
	if(!empty($aadhaar))$updateq.="aadhaarcard='$aadhaar',";else $updateq.="aadhaarcard=NULL,";
	if(!empty($passport))$updateq.="passport='$passport',";else $updateq.="passport=NULL,";
	if(!empty($license))$updateq.="driverlicense='$license',";else $updateq.="driverlicense=NULL,";
	if(!empty($voterid))$updateq.="votercard='$voterid',";else $updateq.="votercard=NULL,";
	
	for($x=1;$x<=20;$x++){
		if(isset($_POST['col'.$x])){
			if($x<=16){
				if(!empty($_POST['col'.$x]))$updateq.="col".$x."='".$_POST['col'.$x]."',";
				else $updateq.="col".$x."=NULL,";
			}
			else{
				if(!empty($_POST['col'.$x]))$updateq.="col".$x."='".date('Y-m-d H:i:s',strtotime($_POST['col'.$x]))."',";
				else $updateq.="col".$x."=NULL,";
			}
		}
	}
 $updateq.="update_dt='".date("Y-m-d H:i:s")."',update_by='".$_SESSION['id']."' WHERE con_sr_no=".$uid;
	$updater=$connection_jc->query($updateq);
	if($updater){
        echo"success";
    }   
       
	
}
$selr->free();
$connection_jc->close();
?>

xRyukZ - Copyright 2k19