<?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 = $_POST['umid'];
	
	
		
		
	
	$abcontactname=checkvalidstring ($_POST['abcontactname']);
	
	
	$abmobilenumber=checkvalidstring ($_POST['abmobilenumber']);
	
	
	$abemailid=checkvalidstring ($_POST['abemailid']);
	
	
	$bcontactdepartmnet=checkvalidstring ($_POST['bcontactdepartmnet']);
	
	
	$bcposition=checkvalidstring ($_POST['bcposition']);
	$bcremarks=checkvalidstring ($_POST['bcremarks']);
	
	
	$abname=checkvalidstring ($_POST['abname']);
		$eve2 = "insert into res_agentbranch_master (abname,agentmid,abcontactname,abmobilenumber,abemailid,abdepartment,abposition,abcremarks) values('$abname','$umid','$abcontactname','$abmobilenumber','$abemailid','$bcontactdepartmnet','$bcposition','$bcremarks')";
			$re2 = mysqli_query($conn, $eve2);
	
			
		
		
		
		
		
		header('Location: agentdetail.php?id='.$umid);
	
?>