<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
  print "<script> alert('Invalid User'); parent.document.location='../index.html' </script>";
  return;
}
include("opendb.php");
include("test.php");
$ry=$_REQUEST['ry'];
$rm=$_REQUEST['rm'];
$rd=$_REQUEST['rd'];
$jvno=$_REQUEST['jvno'];
$recdate=$ry.'-'.$rm.'-'.$rd;
$bank=$_REQUEST['bank'];
$df=$_REQUEST['df'];
$dto=$_REQUEST['dto'];
$bdate=$_REQUEST['bdate'];
if(strlen($recdate)>3)
{
mysqli_query($db,"delete from breco where jvno='$jvno' and bank='$bank' and brcode='$brcode'");
$sql="insert into breco values('$jvno','$bdate','$recdate','$user','$brcode','$bank','0')";
mysqli_query($db,$sql) or die(mysqli_error($db));
}
?>
<script>
 document.location='ledreco.php?df=<?print $df?>&dto=<?print $dto?>&bnk=<?print $bank?>';
</script>
