<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='ind.php'; </script>";
 return;
}
$pswd=$_REQUEST['pswd'];
$led=$_REQUEST['led'];
if($pswd=='clt')
{
 $sql1="delete from journal2 where partic='$led' and brcode='$brcode'";
 $sql2="delete from ledger where led='$led' and brcode='$brcode'";
}
else
{
 print "<center><blink><font face='verdana' color=red size=6>Invalid Password</font></blink>";
 return;
}
include("opendb.php");
include("test.php");
mysqli_query($db,$sql1) or die(mysqli_error());
mysqli_query($db,$sql2) or die(mysqli_error());
print "<font color=green face='verdana'>Transaction and Ledger ($led) has been deleted </font>";

log_entry($brcode,$user,$REMOTE_ADDR,"ledger delete: $led");
include("ledge.php");
?>
