<? 
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...
<?
if($del && $pswd=='vehdel')
{
$sql="update veh_purchase set sale_invoice='-' where da='$da' and brcode='$brcode'";
mysqli_query($db,$sql)or die(mysqli_error());
$sql="update vehopstock set sold='-' where dano='$da' and brcode='$brcode'";
mysqli_query($db,$sql)or die(mysqli_error());
$sql="delete from veh_invoice where da='$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'";
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");
}
else 
print "Invalid Password";
?>
<form action='<?print $PHP_SELF?>'>
<?
$da=str_replace('*',' ',$da);
?>
<input type=hidden name='da' value='<?print $da?>'>
<input type=hidden name='invno' value='<?print $invno?>'>
<input type=hidden name='jvno' value='<?print $jvno?>'>

Enter password <input type=password name='pswd'>
<input type=submit value='Del' name='del'>
</form>
