<?
session_start();
if(strlen($brcode)<=0)
{
  alert('Session timed out');
  return;
}
include("../opendb.php");
include("../test.php");
if($del && $pswd=='del')
{
$jvres=mysqli_query($db,"select jvno from sparetransout where tr_no='$trno' and brcode='$brcode'");
$jvrow=mysqli_fetch_row($jvres);
$sql="delete from sparetransout where tr_no='$trno' and brcode='$brcode'";
//print $sql;
mysqli_query($db,$sql) or die('err1'.mysqli_error());
$sql="delete from journal2 where jvno='$jvrow[0]' and brcode='$brcode'";
//print $sql;
mysqli_query($db,$sql) or die('err2'.mysqli_error());
print "<br>";
$sql="update purorder_spare set sup_qty='0',sup_purno='0',sup_date='0',trans_type='' where sup_purno='$trno' and orderto='$brcode' ";
//print $sql;
mysqli_query($db,$sql) or die('err3'.mysqli_error());
log_entry($brcode,$user,$REMOTE_ADDR,"Del trans out trno:$trno, Journal: $jvrow[0]");

print "<script> document.location='transoutrepo.php'; </script>";
}
?>
 
<form action='<?print $PHP_SELF?>'>
<input type=hidden name='trno' value='<?print $trno ?>'>
Enter Password <input type=password name='pswd'>
<input type=submit value='Del' name='del'>
</form>
 
