<?
session_start();
if(strlen($brcode)<=0)
{
  print "<script> alert('Invalid User'); parent.document.location='ind.php' </script>";
  return;
}
include("../opendb.php");
include("../test.php");
$recdate=$ry.'-'.$rm.'-'.$rd;

if($recdate=='0000-00-00')
{
mysqli_query($db,"delete from breco where jvno='$jvno' and bank='$bank' and brcode='$brcode'");

}

else
{
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')";
mysqli_query($db,$sql) or die(mysqli_error());
}
?>
<script>
 document.location='breco.php?df=<?print $df?>&dto=<?print $dto?>&bnk=<?print $bank?>';
</script>
