<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}
include_once('opendb.php');
$code=$_REQUEST['code'];
$cname=$_REQUEST['cname'];
$acname=$_REQUEST['acname'];
$corp=$_REQUEST['corp'];
$addr1=$_REQUEST['addr1'];
$dist1=$_REQUEST['dist1'];
$state1=$_REQUEST['state1'];
$pin1=$_REQUEST['pin1'];
$phone1=$_REQUEST['phone1'];
$addr2=$_REQUEST['addr2'];
$addr3=$_REQUEST['addr3'];
$email=$_REQUEST['email'];
$tin=$_REQUEST['tin'];
$cst=$_REQUEST['cst'];
$kgst=$_REQUEST['kgst'];
$cramt=$_REQUEST['cramt'];
$crdays=$_REQUEST['crdays'];

if(strlen($cname)<=0)
{
 print "<script> alert('Invalid Action'); </script>";
 return;
}
$sql="update customer set cname='$cname',addr1='$addr1', dist1='$dist1',state1='$state1', pin1='$pin1',phone1='$phone1',addr2='$addr2',addr3='$addr3',email='$email',tin='$tin',cst='$cst',kgst='$kgst',cramt='$cramt',crdays='$crdays',corp='$corp' where code='$code'  and acname='$acname'";
mysqli_query($db,$sql) or die(mysqli_error($db));
//$sql1="update ledger set led='$cname' where code='$code' and brcode='$brcode'";
//mysqli_query($db,$sql1) or die(mysqli_error($db));
$cname="";
print "<script> document.location='custmasterbr.php' </script>";
?>

