<?
include_once('includes/top.php');
include_once('opendb.php');
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
$led=$_REQUEST['led'];
$ledcode=$_REQUEST['ledcode'];
$pswd=$_REQUEST['pswd'];
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}



if($pswd=='dell')
{
 
$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;
}



mysqli_query($db,$sql1) or die(mysqli_error($db));

mysqli_query($db,$sql2) or die(mysqli_error($db));

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");
?>
<script>document.location='sealedge.php' </script>
