<?
session_start();
include("../opendb.php");
include("../test.php");

$rs=mysqli_query($db,"select jvno from veh_transin where da='$da' and trans_no='$pno' and brcode='$brcode'")or die (mysqli_error());
$jv_row=mysqli_fetch_row($rs);


mysqli_query($db,"delete from veh_transin where da='$da' and trans_no='$pno' and brcode='$brcode'")or die (mysqli_error());
mysqli_query($db,"delete from veh_purchase where da='$da' and brcode='$brcode' and type='trans-in'")or die (mysqli_error());

mysqli_query($db,"delete from journal2 where jvno='$jv_row[0]' and brcode='$brcode'") or die('JV Error'.mysqli_error());

log_entry($brcode,$user,$REMOTE_ADDR,"Del veh trans in-$da");
print "<font color=red>Record has been deleted</font";
include("veh_transin.php");
?>
