<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='inde.php'; </script>";
 return;
}
include_once('opendb.php');
$code=$_REQUEST['code'];


$find_jv=mysqli_query($db,"select * from gst_expense where refno='$code' and brcode='$brcode'");
$irow=mysqli_fetch_array($find_jv);

$j_no=$irow['jvno'];


if($j_no>0)
	{
		mysqli_query($db,"delete from journal2 where jvno='$j_no' and brcode='$brcode'");
  	}
mysqli_query($db,"delete from gst_expense where refno='$code' and brcode='$brcode'");

print "<script> alert('Data Has been Deleted');document.location='gstmultislct2.php'; </script>";

?>
