<?php
session_start(); 
include("connect.php");
	if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;
	}
	
	date_default_timezone_set("Asia/Kolkata");
		$mdate1= date('Y-m-d H:i:s');
		
	
	
	if(isset($_POST['imid']))
	{
	$imid=$_POST['imid'];
	}
	
	$stiqmid=$_POST['stiqmid'];
	$eve2 = "select imid from res_studentinquiry_detail where stiqmid=$stiqmid";
	$re2 = mysqli_query($conn, $eve2);
	while($rt2 = mysqli_fetch_assoc($re2))

	{
		$imid = $rt2['imid'];
	}
	$admid= $_POST['admid'];	
	$statusmid= $_POST['statusmid'];	
	
				
	 $query = "update res_admission_master set statusmid='$statusmid' where admid=$admid";
	
	/* $query1 = "update res_bottlerecovery_master set dmid='$dmid' where omid=$omid";
	$re= $conn->query($query1); */
	if ($conn->query($query) === TRUE)
	{
		$_SESSION['msg'] = "Record has been Updated successfully";
	}
	else
	{
		$_SESSION['msg1'] = "Error";
	}
					 
	
		if($_SESSION['frompage']=='aplicationInquirydetailpage')
			{
				header("Location: applicationinquirydetail.php?id=$stiqmid");
			}else{
	header("Location: inquirydetail.php?id=$imid&tab=student_application");
			}
	
?>