<?php
	session_start();

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

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

	$eve1="select levelofstudy from res_course_master where levelofstudy='$losmid'";
	$re1 = mysqli_query($conn, $eve1);
	$course=mysqli_num_rows($re1);
	
	if($course==0)
	{
		$query="delete from res_levelofstudy_master where losmid=$losmid";
		$result= mysqli_query($conn, $query) or die("Error");
		$_SESSION['msg']="Record deleted successfully";
	}
	else
	{
		$_SESSION['msg1']="This Data already used.";
	}
	
	header('Location: lstudy.php');
	

?>