<?php
 	session_start();

		include("connect.php");
		include("removespecial.php");
	if(!isset($_SESSION['linkarisecrm']))
	{
		header('Location: index.php');
		return;
	}
	
	$brmid=$_SESSION['linkarisebranchid'];
	$umid = $_SESSION['linkariseumid'];
    date_default_timezone_set("Asia/Singapore");
				$mdate1= date('Y-m-d H:i:s');
				$mdate= date('d-m-Y');


	$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));


	

	$partyinqdate=date("Y-m-d", strtotime($_POST['idate'])); 

	
    $partyinqbudget=$_POST['ibudge'];
	$itype="";
	$partymid=$_POST['partymid'];
	$partyname=removespecialchar($_POST['cmpname']);
	$partyaddress=$_POST['paddress'];
	$partycity="";
	
	$partyemail=$_POST['pemail'];
	$partymobile=$_POST['pmobile'];
	$cpincode="";
	$partystate=$_POST['state'];
	$cstatecode="";
	
			$function=$_POST['function'];
		$spotmid=$_POST['spotmid'];
		$pax=$_POST['pax'];
		$fstartdate=date("Y-m-d", strtotime($_POST['functionstartdate'])); 
		$fenddate=date("Y-m-d", strtotime($_POST['functionenddate'])); 
	 $eve = "update res_party_master set partyname='$partyname', partyaddress='$partyaddress', partycity='$partycity', partycpname='$partycpname', partyemail='$partyemail', partymobile='$partymobile', partypincode='$cpincode', partystate='$partystate', partystatecode='$cstatecode', partygstno='$partygstno',partyrequirement='$partyrequirement',partyinqdate='$partyinqdate',partyinqbudget='$partyinqbudget',partyupdatedby=$umid,partyupdatedon='$mdate1',function='$function',spotmid='$spotmid',pax='$pax',fstartdate='$fstartdate',fenddate='$fenddate' where brmid=$brmid and partymid=$partymid";
	
 

	if ($conn->query($eve) === TRUE)
	{
		$_SESSION['msg'] = "Record has been updated successfully";
			header('Location: inquiry.php');
		
	}else{
				$_SESSION['msg1'] = "Error";

	}
	
	

?>
