<?
session_start();
$date=explode('-',$dt);

if(!checkdate($date[1],$date[0],$date[2]))
{
 print "<script>alert('Invalid Date'); history.back(1);</script>";
 return;
}
if(strlen($amt)<=0||!is_numeric($amt)||$amt<=0)
{
 print "<script> alert('Insufficient/Invalid Amount'); history.back(1); </script>";
 return;
}

include("opendb.php");
include("test.php");

$dt=parsedate($dt);
// print $code.$dr.$cr.$amt.$dt;
$sql="update actrans set dt='$dt',dr='$dr',cr='$cr',amt='$amt',mode='edit',vouch='$vouch',narr='$narr' where code='$code' and brcode='$brcode'";
mysqli_query($db,$sql) or die(mysqli_error());
print "Data has been updated";
?>
