<?
session_start();
include("../opendb.php");
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
$recv_date=$_REQUEST['recv_date'];
$recv_rem=$_REQUEST['recv_rem'];
$recv_amt=$_REQUEST['recv_amt'];
$status=$_REQUEST['status'];
$savecount=$_REQUEST['savecount'];
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}
if($savecount==0)
{
		$dbno=$_REQUEST['dbno'];
		$sql=mysqli_query($db,"update dbnote set recv_date='$recv_date',recv_rem='$recv_rem',recv_amt='$recv_amt',status='$status' where dbno='$dbno' and brcode='$brcode'");
			echo "<script>alert('Data  updated successfully');</script>";
			echo "<script>document.location='dbnote_edit1.php';</script>";
}
elseif($savecount==1)
{
	echo "Data already saved";
  	echo "<script> document.location='dbnote_edit1.php';</script>";
}
?>
