<?php
	session_start();

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

	include("connect.php");
	
	$trolleymid=(int)mysqli_real_escape_string($conn,$_GET['id']);
	
	 $eve15="SELECT * FROM res_jobwork_detail WHERE trolleymid=$trolleymid";
	
	$re15 = mysqli_query($conn, $eve15);
	if(mysqli_num_rows($re15) > 0)
	{
			$_SESSION['msg1'] = "Trolley Already added So Record Can't be Deleted";
	}
	else
	{	
	
	$query="delete from res_trolley_master where trolleymid=$trolleymid";
	$result= mysqli_query($conn, $query) or die("Error");
		
	$_SESSION['msg'] = "Record deleted successfully";
	}
	header('Location: trolley.php');
	
?>