<?php
	session_start();

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

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

	
	
	$query="delete from res_agentcomission_master where acsdid =$acsdid ";
	$result= mysqli_query($conn, $query) or die("Error");

	$query1="delete from res_agentcomissionslab_detail where acsdid =$acsdid ";
	$result1= mysqli_query($conn, $query1) or die("Error");

	$_SESSION['msg'] = "Record deleted successfully";
	
	if($_SESSION['frompage']=='Userdetail')
	{
		header("Location: userdetail.php?id=$umid");
	}else{
		
	header("Location: agentdetail.php?id=$umid");
	}
	
	

?>