<?php
	session_start();

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

	include("connect.php");
	
	$bssdid =(int)mysqli_real_escape_string($conn,$_GET['id']);
	$stiqmid =(int)mysqli_real_escape_string($conn,$_GET['stiqmid']);

	$eve2 = "select booksetmid from res_booksettostudent_detail where bssdid =$bssdid";
	$reag1 = mysqli_query($conn, $eve2);
	if(mysqli_num_rows($reag1) > 0)
	{
		while($rtag1 = mysqli_fetch_assoc($reag1))
		{
			$booksetmid=$rtag1['booksetmid'];
		}
	}
																		 
	
	$query="delete from res_booksettostudent_detail where bssdid =$bssdid ";
	$result= mysqli_query($conn, $query) or die("Error");

	$query1="update  res_bookset_master set booksetquantity = booksetquantity + 1 where booksetmid =$booksetmid ";
	$result1= mysqli_query($conn, $query1) or die("Error");

	

	$_SESSION['msg'] = "Record deleted successfully";
	
	
	header("Location: coachinginquirydetail.php?id=$stiqmid");
	
	
	

?>