<?php
 	session_start();
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);	

	if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;
	}

	
	
	$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));
	
	
	include("connect.php");
include("mylibrary.php");
	//$umid=$_SESSION['umid'];
	
	 $umid = $_POST['umid'];
	 $contactmid = $_POST['contactmid'];
	 
	
	 
	$scontactname=checkvalidstring ($_POST['scontactname']);
	
	
	$scmiddlename=checkvalidstring ($_POST['scmiddlename']);
	
	
	$scsurname=checkvalidstring ($_POST['scsurname']);
	
	
		$scontactnumber=checkvalidstring ($_POST['scontactnumber']);
	$scontactnumber=checkvalidstring ($scontactnumber);
	
	$scmobilenumber=checkvalidstring ($_POST['scmobilenumber']);
	
	
	$scontactemail=checkvalidstring ($_POST['scontactemail']);
	
	$scaltenateemail=checkvalidstring ($_POST['scaltenateemail']);
	
	$scontactdepartmnet=checkvalidstring ($_POST['scontactdepartmnet']);
	
	$scposition=checkvalidstring ($_POST['scposition']);
	
	$scremarks=checkvalidstring ($_POST['scremarks']);
	
	
	
	$scmsgappname=checkvalidstring ($_POST['scmsgappname']);
	
	$scmsgappid=checkvalidstring($_POST['scmsgappid']);
	
	
	$scvideoappname=checkvalidstring ($_POST['scvideoappname']);
	
	
	$scvideoappid=checkvalidstring($_POST['scvideoappid']);
	
	 $eve3 = "Update res_contact_master set contactname='$scontactname', contactemail='$scontactemail',contactnumber='$scontactnumber',cmobilenumber='$scmobilenumber',contactdepartmnet='$scontactdepartmnet',cposition='$scposition',cremarks='$scremarks',caltenateemail='$scaltenateemail',cmiddlename='$scmiddlename',csurname='$scsurname',cmsgappname='$scmsgappname',cmsgappid='$scmsgappid',cvideoappname='$scvideoappname',cvideoappid='$scvideoappid' where contactmid=$contactmid";
			
		
		$re3 = mysqli_query($conn, $eve3);
			
		
		
		
		
		
		header('Location: agentdetail.php?id='.$umid);
	
?>