<? ob_start();
session_start();
require_once("../dbconnect.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<?php include_once("title.php");?>

<script type="text/javascript" src="../copyreg.js"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />




<script language="javascript">
function validate(myform){
var err="";
if(myform.fname.value==""){

myform.fname.className='balis';
myform.fname.focus();
return false;
}
if(myform.lname.value==""){
myform.lname.className='balis';
myform.lname.focus();
return false;
}

if(myform.phone.value==""){
myform.phone.className='balis';
myform.phone.focus();
return false;}
/*var phone=myform.phone.value;
if(parseInt(phone)!=phone){
myform.phone.className='balis';
myform.phone.focus();
return false;}*/






if(myform.baddress1.value==""){
alert("laxman");

myform.baddress1.className='balis';
myform.baddress1.focus();
return false;
}
if(myform.bcity.value==""){
myform.bcity.className='balis';
myform.bcity.focus();
return false;
}
if(myform.bcity.value==""){
myform.bcity.className='balis';
myform.bcity.focus();
return false;
}
if(myform.bstate.value==""){
myform.bstate.className='balis';
myform.bstate.focus();
return false;
}
if(myform.bzip.value==""){
myform.bzip.className='balis';
myform.bzip.focus();
return false;

}


var bzip=myform.bzip.value;
/*if(parseInt(bzip)!=bzip){
myform.bzip.className='balis';
myform.bzip.focus();
return false;}*/

if(1)
{
     reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);

     if (!reZip.test(bzip)) {
          myform.bzip.className='balis';
		  //myform.bzip.focus();
		  //alert("Zip Code Is Not Valid");
          return false;
     }

}


if(myform.bcountry.value==""){

myform.bcountry.className='balis';
myform.bcountry.focus();
return false;
}
if(myform.bphone.value==""){
myform.bphone.className='balis';
myform.bphone.focus();
return false;
}
/*var bphone=myform.bphone.value;
if(parseInt(bphone)!=bphone){
myform.bphone.className='balis';
myform.bphone.focus();
return false;}*/

//shipping


if(myform.saddress1.value==""){
myform.saddress1.className='balis';
myform.saddress1.focus();
return false;
}
if(myform.scity.value==""){
myform.scity.className='balis';
myform.scity.focus();
return false;
}
if(myform.scity.value==""){
myform.scity.className='balis';
myform.scity.focus();
return false;
}
if(myform.sstate.value==""){
myform.sstate.className='balis';
myform.sstate.focus();
return false;
}
if(myform.szip.value==""){
myform.szip.className='balis';
myform.szip.focus();
return false;
}
/*var szip=myform.szip.value;
if(parseInt(szip)!=szip){
myform.szip.className='balis';
myform.szip.focus();
return false;}*/

if(1)
{



var szip=myform.szip.value;

     reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);

     if (!reZip.test(szip)) 
	 {
         myform.szip.className='balis';
         myform.szip.focus();
		  //alert("Zip Code Is Not Valid");
		  
          return false;
     }


}





if(myform.scountry.value==""){
myform.scountry.className='balis';
myform.scountry.focus();
return false;
}
if(myform.sphone.value==""){
myform.sphone.className='balis';
myform.sphone.focus();
return false;
}
/*var sphone=myform.sphone.value;
if(parseInt(sphone)!=sphone){
myform.sphone.className='balis';
myform.sphone.focus();
return false;
}*/

return true;
}





</script>
<link href="css.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
.style2 {color: #FF0000}
a:link {
	text-decoration: none;
}
a:visited {

	text-decoration: none;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
.style1 {font-weight: bold}
-->
</style>


</head>
<body>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><? require_once("header.php"); ?></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">



              <tr>
                <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="30" class="cate_pro">&nbsp;</td>
                      <td>&nbsp;</td>
                      <td class="index_text" align="right">&nbsp;</td>
                      <td width="20">&nbsp;</td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="100%" valign="top" style="padding-right:1px;">
	
	
	
	
	
					<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F2F1EE">
                        <tr>
                          <td height="40" colspan="7" align="center" bgcolor="#D7D6CC" class="cate_pro">Customers </td>
                          </tr>
                        <tr>
                          <td colspan="7" align="left">
						  <? 
				
				 $des=mysql_fetch_array(mysql_query("select * from register where user_id=".$_GET['userid']));
					   
						
						  ?>
						  
				<form action="custmerinsert.php?action=cusedit" name="lgn" method="post" onSubmit="return validate(this);">
                                                                <table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
                                                                  <tr>
                                                                    <td align="left" valign="top" style="padding:5px; "><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                        <tr>
                                                                          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                              <tr align="left" valign="top">
                                                                                <td width="6"></td>
                                                                                <td valign="middle" ><strong>Fill out the form below to begin signup!</strong></td>
                                                                                <td width="6">&nbsp;</td>
                                                                              </tr>
                                                                          </table></td>
                                                                        </tr>
                                                                        <tr>
                                                                          <td height="5"></td>
                                                                        </tr>
                                                                        <tr>
                                                                          <td align="left" valign="top" style="border:#666666 solid 1px; padding:2px;"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#333333">
                                                                              <tbody>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle" bgcolor="#F2F1EE">First Name</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"> <input name="fname" type="text" id="fname" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }" 
																				  value="<? echo $des["Fname"];?>" />
                                                                                      <span class="style2"> *</span></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">Last Name</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="lname" type="text" id="lname" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }" 
																				  value="<? echo $des["Lname"];?>"  />
                                                                                      <span class="style2"> *</span></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">Phone Number</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="phone" type="text" id="phone" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }" 
																				  value="<? echo $des["Phone"];?>" />
                                                                                      <span class="style2"> *</span></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">Fax Number</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="fax" type="text" id="fax" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }"  
																				  value="<? echo $des["Fax"];?>" /></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">Email Address</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="email" type="text" id="email" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }" 
																				  onblur="dochange(this.value);" readonly="yes"
																				  value="<? echo $des["Email"];?>"/>                                            <span class="style2"> *</span>                                                                                <div id="usernameResult"></div>	
																				  
																			<!--<input type="hidden" id="emailresult" value=""  name="emailresult"/>-->																				  </td>
                                                                                </tr>
                                                                              </tbody>
                                                                          </table></td>
                                                                        </tr>
                                                                    </table></td>
                                                                  </tr>
                                                                  <tr>
                                                                    <td height="10" align="center" valign="middle"><span class="style2">*</span> Fields marked with  	asterisk are mandatory</td>
                                                                  </tr>
                                                                  <tr>
                                                                    <td height="5"></td>
                                                                  </tr>
                                                                  <tr>
                                                                    <td align="left" valign="top" style="padding:5px; "><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                        <tr>
                                                                          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                              <tr align="left" valign="top">
                                                                                <td width="6">&nbsp;</td>
                   <td valign="middle"  style="background:url(<? echo $baseurl; ?>images/box_bg.jpg) repeat-x;"><strong>Default Billing Information</strong></td>
                                                                                <td width="6">&nbsp;</td>
                                                                              </tr>
                                                                          </table></td>
                                                                        </tr>
                                                                        <tr>
                                                                          <td height="5"></td>
                                                                        </tr>
                                                                        <tr>
                                                                          <td align="left" valign="top" style="border:#666666 solid 1px; padding:2px;"><table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
                                                                              <tbody>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">Address</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="baddress1" type="text" id="baddress1" size="25"  onKeyUp=" if(this.className=='balis') {this.className='none'; }" 
										value="<? echo $des["billingaddress1"];?>"/>
                                                                                      <span class="style2"> *</span></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">Address 2</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="baddress2" type="text" id="baddress2" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }"  
																				 value="<? echo $des["billingaddress2"];?>"/></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">City</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="bcity" type="text" id="bcity" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }"  
																				  value="<? echo $des["billingcity"];?>"/>
                                                                                      <span class="style2"> *</span></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">State</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="bstate" type="text" id="bstate" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }"  
																				  value="<? echo $des["billingstate"];?>"/>
                                                                                      <span class="style2"> *</span></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle"><label for="form_myaccount_zip">ZIP Code</label></td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="bzip" type="text" id="bzip" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }" 
									value="<? echo $des["billingzip"];?>" />
                                                                                      <span class="style2"> *</span></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">Country</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"> <input name="bcountry" type="text" id="bcountry" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }" 
										value="<? echo $des["billingcountry"];?>" />
                                                                                      <span class="style2"> *</span></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">Phone</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="bphone" type="text" id="bphone" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }"  
							value="<? echo $des["billingphone"];?>"/>
                                                                                      <span class="style2"> *</span>
								<input type="hidden" name="sale" />													  
																					  
																				  </td>
                                                                                </tr>
                                                                              </tbody>
                                                                          </table></td>
                                                                        </tr>
                                                                    </table></td>
                                                                  </tr>
                                                                  <tr>
                                                                    <td height="5"></td>
                                                                  </tr>
                                                                  <tr>
                                                                    <td height="10" align="center" valign="middle"><span class="style2">*</span> Fields marked with  	asterisk are mandatory</td>
                                                                  </tr>
                                                                  <tr>
                                                                    <td align="left" valign="top" style="padding:5px; "><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                        <tr>
                                                                          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                              <tr align="left" valign="top">
                                                                                <td width="6">&nbsp;</td>
                                                                                <td valign="middle"><strong>Default Shipping Information</strong></td>
                                                                                <td width="6">&nbsp;</td>
                                                                              </tr>
                                                                          </table></td>
                                                                        </tr>
                                                                        <tr>
                                                                          <td height="5"></td>
                                                                        </tr>
                                                                        <tr>
                                                                          <td align="left" valign="top" style="border:#666666 solid 1px; padding:2px;" ><table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
                                                                              <tbody>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">Same as Billing</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"> <input type="checkbox" name="same" id="same" onclick="copyall()" /></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">Address </td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="saddress1" type="text" id="saddress1" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }"  
																			value="<? echo $des["shippingaddress1"];?>"/></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td height="30" align="right" valign="middle">Address 2</td>
                                                                                  <td align="center" valign="middle">:</td>
                                                                                  <td align="left" valign="middle"><input name="saddress2" type="text" id="saddress2" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }"  
											value="<? echo $des["shippingaddress2"];?>"/></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">City</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="scity" type="text" id="scity" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }"  
																				  
																		value="<? echo $des["shippingcity"];?>"/>
                                                                                      <span class="style2"> *</span></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">State</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="sstate" type="text" id="sstate" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }"  
																				  
																				 value="<? echo $des["shippingstate"];?>"/>
                                                                                      <span class="style2"> *</span></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle"><label for="form_myaccount_zip">ZIP Code</label></td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="szip" type="text" id="szip" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }"  value="<? echo $des["shippingzip"];?>"/>
                                                                                      <span class="style2"> *</span></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">Country</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="scountry" type="text" id="scountry" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }" 
																				  value="<? echo $des["shippingcountry"];?>" />
                                                                                      <span class="style2"> *</span></td>
                                                                                </tr>
                                                                                <tr>
                                                                                  <td width="49%" height="30" align="right" valign="middle">Phone</td>
                                                                                  <td width="5" align="center" valign="middle">:</td>
                                                                                  <td width="49%" align="left" valign="middle"><input name="sphone" type="text" id="sphone" size="25" onKeyUp=" if(this.className=='balis') {this.className='none'; }"  value="<? echo $des["shippingphone"];?>"/>
                                                                                      <span class="style2"> *</span>
																					  
								<input type="hidden" name="userid" value="<? echo $_GET['userid'];?>"  />
																					  
					        	<input type="hidden" name="page" value="<? echo $_GET['page'];?>"  />		
																  </td>
                                                                                </tr>
                                                                              </tbody>
                                                                          </table></td>
                                                                        </tr>
                                                                    </table></td>
                                                                  </tr>
                                                                  <tr>
                                                                    <td height="10" align="center" valign="middle"><span class="style2">*</span> Fields marked with  	asterisk are mandatory</td>
                                                                  </tr>
                                                                  <tr>
                                                                    <td height="5" align="center" valign="top"></td>
                                                                  </tr>
                                                                  <tr>
                                                                    <td align="center" valign="middle">
										
				<input type="image" src="<? echo $baseurl; ?>images/button_update.gif" border="0" alt="Update" title="Update" name="submit"/>
				&nbsp;&nbsp;
				<a href="customers.php">
				<img src="<? echo $baseurl; ?>images/button_cancel.gif" border="o"/>
				</a>
				
									                                </td>
                                                                  </tr>
                                      </table>
									  
									  
					 </form>
						</td>
                          </tr>
                      </table>
				
					  
					  </td>
                    <td width="0%" valign="top"><!---->
                      
                      <!----></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>

          <tr>
            <td><? require_once("footer.php"); ?></td>
          </tr>
          <tr>
            <td height="200">&nbsp; </td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
