<?
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 jvno from gst_incomecust where refno='$code' and brcode='$brcode'");
while ($irow=mysqli_fetch_array($find_jv))
{

$j_no=$irow[0];


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

}
mysqli_query($db,"delete from gst_incomecust where refno='$code' and brcode='$brcode'");

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

?>
