<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='inde.php'; </script>";
 return;
}
$code=$_REQUEST['code'];
$cname=$_REQUEST['cname'];
$d=$_REQUEST['d'];
$m=$_REQUEST['m'];
$y=$_REQUEST['y'];

$d1=$_REQUEST['d1'];
$m1=$_REQUEST['m1'];
$y1=$_REQUEST['y1'];
$dob=$y1.'-'.$m1.'-'.$d1;
$crdate=$y.'-'.$m.'-'.$d;
include("../opendb.php");
if(strlen($cname)<=0)
{
 print "<script> alert('Invalid Action'); </script>";
 //return;
}
$cname=strtoupper($cname);


$corp=$_REQUEST['corp'];
$addr1=$_REQUEST['addr1'];
$dist1=$_REQUEST['dist1'];
$state1=$_REQUEST['state1'];

$pin1=$_REQUEST['pin1'];
$phone1=$_REQUEST['phone1'];
$state2=$_REQUEST['state2'];
$addr2=$_REQUEST['addr2'];
$dist2=$_REQUEST['dist2'];

$pin2=$_REQUEST['pin2'];
$phone2=$_REQUEST['phone2'];
$mob=$_REQUEST['mob'];
$relation=$_REQUEST['relation'];
$father=$_REQUEST['father'];


$email=$_REQUEST['email'];
$web=$_REQUEST['web'];
$tin=$_REQUEST['tin'];
$cst=$_REQUEST['cst'];
$kgst=$_REQUEST['kgst'];
$cramt=$_REQUEST['cramt'];
$crdays=$_REQUEST['crdays'];
$sql="update customer set cname='$cname',corp='$corp',addr1='$addr1', dist1='$dist1',state1='$state1', pin1='$pin1', phone1='$phone1', addr2='$addr2', dist2='$dist2', state2='$state2', pin2='$pin2', phone2='$phone2',mob='$mob',relation='$relation', father='$father',dob='$dob',email='$email',web='$web',tin='$tin',cst='$cst',kgst='$kgst',cramt='$cramt',crdays='$crdays' where code='$code' and brcode='$brcode'";
mysqli_query($db,$sql) or die(mysqli_error($db));
$cname="";
print "<script> document.location='custmaster.php' </script>";
?>

