<?php
	session_start();

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

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