<?php
session_start(); 

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

	
include("connect.php");
	
	date_default_timezone_set("Asia/Kolkata");
	$mdate= date('Y-m-d H:i:s');

	
	$bidid=$_GET['id'];
	
	
	
	
		$_SESSION['msg'] = "Book Returned Successfull";
		
	    $eve2 = "update res_bookissue_detail set bookreturndatetime='$mdate',ibstatus='Returned' where bidid=$bidid";
		$re2 = mysqli_query($conn, $eve2);
		
		
		$eve4 = "select * from res_bookissue_detail where  bidid=$bidid";
						$re4 = mysqli_query($conn, $eve4);
						while($rt4 = mysqli_fetch_assoc($re4))
						{
							
							$bookmid=$rt4['bookmid'];
							$stiqmid=$rt4['stiqmid'];
						}
						
						
						$eve5 = "update res_book_master set bookquantity=bookquantity+1 where bookmid=$bookmid";
		$re5 = mysqli_query($conn, $eve5);
		header("Location: coachinginquirydetail.php?id=$stiqmid");
		
		
		
		
		
		
			
		
		

?>	