<?php
	session_start();

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

	include("connect.php");
	
	$jobworkmid=(int)mysqli_real_escape_string($conn,$_GET['id']);
	
	
	
	$query="delete from res_jobwork_master where jobworkmid=$jobworkmid";
	$result= mysqli_query($conn, $query) or die("Error");
	
	$query1="delete from res_jobwork_detail where jobworkmid=$jobworkmid";
	$result1= mysqli_query($conn, $query1) or die("Error");
	
	$query2="delete from res_jobworkitem_detail where jobworkmid=$jobworkmid";
	$result2= mysqli_query($conn, $query2) or die("Error");
		
	$_SESSION['msg'] = "Record deleted successfully";
	
	header('Location: jobwork.php');
	
?>