<?
include_once('includes/top.php');
include_once('opendb.php');
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
$code=$_REQUEST['code'];
$cname=$_REQUEST['cname'];
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}

?>
<title>Khadi</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript" src="scripts/jquery-latest.js"></script>
<link type="text/css" href="includes/style1.css" rel="stylesheet" />
<link rel="stylesheet" href="css/form.css" type="text/css" />
<script type="text/javascript">
        $(function() {
          if ($.browser.msie && $.browser.version.substr(0,1)<7)
          {
			$('li').has('ul').mouseover(function(){
				$(this).children('ul').show();
				}).mouseout(function(){
				$(this).children('ul').hide();
				})
          }
        });        
</script>
<style>
#txt{
font-family: Arial, Helvetica;
background-color: #F2F2F2;

}
</style>
<body background="back_ground.jpg">

<?php //include('includes/top.php'); ?>

<table class="container"><tr><td>
<font style="font-family: 'Trebuchet MS',Verdana,Helvetica,sans-serif; font-size:15px;">  &nbsp;&nbsp;Master >> Customer >>Edit Customer</font>
<br>
<?
$sql="select * from customer where code='$code' ";
$re=mysqli_query($db,$sql)or die(mysqli_error($db));
$row=mysqli_fetch_array($re);
$dt1=explode('-',$row['crdate']);
?>

<center>
<form action='updcustomer.php' onSubmit="return valid()">
<input type=hidden name='code' value='<?print $code?>'>
<table cellspacing=1 cellpadding=2 class='form'>
<tr height=21><td colspan=2 align=center bgcolor='steelblue'><FONT COLOR=IVORY><B>EDIT CUSTOMER DETAILS</td></tr>

<tr><td>Customer Name</td><td><input type=text name='cname' size=40 value='<?print $row['cname']?>' readonly></td></tr>

<tr><td>Customer Code</td><td><input type=text name='cccode' size=40 value='<?print $row['code']?>' readonly></td></tr>

<tr><td>A/C Name</td><td><input type=text name='acname' size=40 value='<?print $row['acname']?>' readonly></td></tr>

<tr><td>TCS Applicable </td><td><select name='corp'><option><?print $row['corp']?></option><option>No</option><option>Yes</option>
<?/*
$re1=mysqli_query($db,"select * from corp_master where branch='$brcode' order by corpname");
while($row1=mysqli_fetch_row($re1))
{
 print "<option>$row1[1]</option>";
}*/
?>
</select>
</td></tr>
<tr><td>Address1</td><td><input type=text name='addr1' size=40 value='<? echo $row['addr1']?>'></td></tr>
<tr><td>Address2</td><td><input type=text name='addr2' size=40 value='<? echo $row['addr2']?>'></td></tr>
<tr><td>Address3</td><td><input type=text name='addr3' size=40 value='<? echo $row['addr3']?>'></td></tr>
<tr><td>District</td><td><input type=text name='dist1' size=40 value='<?print $row['dist1']?>'></td></tr>
<tr><td>State</td><td><input type=text name='state1' size=40 value='<?print $row['state1']?>'></td></tr>
<tr><td>Pin</td><td><input type=text name='pin1' size=6 value='<?print $row['pin1']?>'></td></tr>
<tr><td>Phone</td><td><input type=text name='phone1' size=40 value='<?print $row['phone1']?>'></td></tr>
<tr><td>Email_id </td><td><input type=text name='email' size=40 value='<?print $row['email']?>'></td></tr>
<tr><td>
GSTIN </td><td><input type=text name='cst' size=20 value='<?print $row['cst']?>'>
</td></tr>

<?if($level>=5)
{
?>
<tr><td colspan=2>Credit Amt <input type=text name='cramt' size=10 value='<?print $row['cramt']?>'>
Credit Days <input type=text name='crdays' size=10 value='<?print $row['crdays']?>'></td></tr>
<?
}
?>
<?if($level<=4)
{
?>
<tr><td colspan=2>Credit Amt <input type=text readonly name='cramt' size=10 value='<?print $row['cramt']?>'>
Credit Days <input type=text readonly name='crdays' size=10 value='<?print $row['crdays']?>'></td></tr>
<?
}
if($brcode=='3776')
{
?>
<tr><td colspan=2>DSR Name <input type=text name='tin' size=10 value='<?print $row['tin']?>'></td></tr>
<?}?>

<tr><td colspan=2 align=center bgcolor='lightsteelblue'>
<input type=submit value='Save' name='upd'> 
<input type=button value='Cancel' onClick=history.go(-1)>
</td></tr>
</table>
</form>
</table>
</td></tr></table>

