<?php
session_start();

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

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

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

?>