<?php
session_start(); 
	include("connect.php");
	include("connectp.php");
	if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;
	}

	date_default_timezone_set("Asia/Kolkata");
	$mdate= date('Y-m-d H:i:s');
	$mdate1= date('Y-m-d');
	
	$usermid = $_SESSION['umid'];
	
	$imid=$_GET['id'];
	
	
	$ipaddress = "";

	
	
	
	if(isset($_GET['sid'])){
		$sid=(int)mysqli_real_escape_string($conn,$_GET['sid']);
		
		
		
		$sql = "update res_counsellor_detail set coupdatedby=?,coupdatedon=?,costatus=? where coudid =?";
		$stmt = $db7->prepare($sql);
        
        $stmt->execute([$usermid,$mdate,'In Process',$sid]);
		
	}
	if(isset($_GET['hid'])){
		$hid=(int)mysqli_real_escape_string($conn,$_GET['hid']);
		
				
				 
				$sql = "update res_counsellor_detail set coupdatedby=?,coupdatedon=?,costatus=? where coudid =?";
				$stmt = $db7->prepare($sql);
				$stmt->execute([$usermid,$mdate,'Hold',$hid]);
				
				
				
				
			}
			
			if(isset($_GET['cid'])){
				$cid=(int)mysqli_real_escape_string($conn,$_GET['cid']);
				
				$sql = "update res_counsellor_detail set  coupdatedby=?,coupdatedon=?,costatus=? where coudid =?";
				$stmt = $db7->prepare($sql);
				$stmt->execute([$usermid,$mdate,'Completed',$cid]);
				
				
			}
			
			$_SESSION['msg'] = "task Status Changed";
	header("Location: inquirydetail.php?id=$imid&tab=student_councelling");
			
			
			
	
	
?>