<?php
 	session_start(); 

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


date_default_timezone_set("Asia/Kolkata");
$mdate1= date('Y-m-d H:i:s');
$mdate= date('d-m-Y');
$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));
	
	$umid = $_SESSION['umid'];
	include("connect.php");

	
	//$cmname=$_POST['cmname'];
	
	 $stiqmid=$_POST['stiqmid'];
	$eve2 = "select imid from res_studentinquiry_detail where stiqmid=$stiqmid";
	$re2 = mysqli_query($conn, $eve2);
	while($rt2 = mysqli_fetch_assoc($re2))

	{
		$imid1 = $rt2['imid'];
	}
	
	$testmid=$_POST['testmid'];
	$tbookingrefnumber=$_POST['tbookingrefnumber'];
	
	
	
	
		 $eve1 = "INSERT INTO res_testallocation_detail (imid,stiqmid,testmid,taaddedon,taddedby,taupdatedon,taupdatedby,tbookingrefnumber) VALUES('$imid1','$stiqmid','$testmid','$mdate1','$umid','$mdate1','$umid','$tbookingrefnumber')";
		
		
		if ($conn->query($eve1) === TRUE)
		{
			
			
		}
		else
		{
			$_SESSION['msg1'] = "Error";
		}
	
	header("Location: coachinginquirydetail.php?id=$stiqmid");
			
	
?>