<? 
session_start();
include("../opendb.php");
include("../test.php");
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}
?>
<style>
body,td,th{font-family:'arial narrow';letter-spacing:1;font-size:14}
th{background-color:green;color:white}
.mnu{margin-left:5}
</style>
<body bgcolor='ivory'>
deleting...
<?
$sql="update veh_purchase set invno='0' where msno='$da' and brcode='$brcode'";
mysqli_query($db,$sql)or die(mysqli_error());
$sql="update vehopstock set invno='0' where msno='$da' and brcode='$brcode'";
mysqli_query($db,$sql)or die(mysqli_error());
$sql="delete from veh_invoice where msno='$da' and invno='$invno' and brcode='$brcode'";
mysqli_query($db,$sql)or die(mysqli_error());
$sql="delete from journal2 where jvno='$jvno' and tr_no='$invno' and brcode='$brcode'";
print $sql;
mysqli_query($db,$sql)or die(mysqli_error());
log_entry($brcode,$user,$REMOTE_ADDR,"Del Veh Invoice -$da");
print "<font color=red>Record has been deleted</font";
include("seainvoice.php");
?>
