<?php include_once $BL->props->get_page("templates/".THEMEDIR."/html/user/header.php"); ?>
<script language="JavaScript" type="text/javascript">
var tabs = ["tab1"];
var t    = ["t1"];
</script>  
<!--tabs//-->
<div class="tabs" name='t1' id='t1' onclick="javascript:showTab('tab1', tabs, 't1', t);" onmouseover="javascript:overTab('t1', t);" onmouseout="javascript:outTab(t);" ><?php echo $BL->props->lang['Edit_Profile']; ?></div>
<div class="tab_separator">&nbsp;</div>
<div>
<div id="tab1" name="tab1" class="tabContent" style="display:none">
		  <form name='form1' id='form1' method='post' action='<?php echo $PHP_SELF; ?>'>
		  <table width='100%' border='0' cellspacing='0' cellpadding='0'>
              <tr> 
                <td height='22' colspan='2' class='accountlabPlanDataHTD'>
                &nbsp;&nbsp;<?php echo $BL->props->lang['Edit_Details']; ?>
                </td>
              </tr>
              <tr> 
                <td height='22' class='accountlabAltDataTD'><?php echo $BL->props->lang['Email']; ?><font color="red"><b>*</b></font></td>
                <td class='accountlabAltDataTD'>
                <input name='email' type='text' class='accountlabInput' id='email' value='<?php echo $customer['email']; ?>' size='30' />
                </td>
              </tr>
              <tr> 
                <td height='22' class='accountlabDataTD'><?php echo $BL->props->lang['password']; ?><font color="red"><b>*</b></font></td>
                <td class='accountlabDataTD'>
                *******
                </td>
              </tr>
              <tr> 
                <td height='22' class='accountlabAltDataTD'><?php echo $BL->props->lang['New_password']; ?></td>
                <td class='accountlabAltDataTD'>
                <input name='password1' type='password' class='accountlabInput' id='password1' size='10' />
                </td>
              </tr>
              <tr> 
                <td height='22' class='accountlabDataTD'><?php echo $BL->props->lang['Confirm_password']; ?></td>
                <td class='accountlabDataTD'>
                <input name='password2' type='password' class='accountlabInput' id='password2' size='10' />
                </td>
              </tr>
              
              
            <?php
            foreach($custom_fields as $cf){ 
                if($cf['field_name']!="country" && $cf['field_name']!="state" && $cf['field_name']!="vat_no"){
            ?>
              <tr> 
                <td height='22' class='accountlabAltDataTD'><?php echo $BL->props->parseLang($cf['field_name']); ?><?php if(!$cf['field_optional'])echo "<font color='red'>*</font>"; ?></td>
                <td class='accountlabAltDataTD'>
                  <?php if($cf['field_type']=="text"){ ?>
                     <input name='<?php echo $cf['field_name']; ?>' id='<?php echo $cf['field_name']; ?>' type='text' class='accountlabInput' size='25' value="<?php echo isset($customer[$cf['field_name']])?$customer[$cf['field_name']]:""; ?>"  />
                  <?php }else{ ?>
                    <select name='<?php echo $cf['field_name']; ?>' id='<?php echo $cf['field_name']; ?>' class='accountlabInput'>
                    <?php 
                    $values = $BL->utils->Get_Trimmed_Array(explode(",",$cf['field_value'])); 
                    $BL->utils->Remove_Empty_Elements($values);
                    foreach($values as $value){
                    ?>
                    <option value='<?php echo $value; ?>' <?php if(isset($customer[$cf['field_name']]) && $customer[$cf['field_name']]==$value)echo "selected"; ?>><?php echo $BL->props->parseLang($value); ?></option>
                    <?php
                    }
                    ?>
                    </select>
                  <?php } ?>
                </td>
              </tr>
              <?php }elseif($cf['field_name']=="country"){ ?>
              <tr> 
                <td height='22' class='accountlabAltDataTD'><?php echo $BL->props->parseLang($cf['field_name']); ?><?php if(!$cf['field_optional'])echo "<font color='red'>*</font>"; ?></td>
                <td class='accountlabAltDataTD'>
                  <select name='country' id='country' class='accountlabInput' onblur="javascript:updateStates(this.options[this.selectedIndex].value);">
                    <option><?php echo $BL->props->lang['select_country']; ?></option>
                    <?php foreach ($BL->props->country as $key => $value) { ?>
                     <option value='<?php echo $key; ?>' <?php if(isset($customer[$cf['field_name']]) && $customer[$cf['field_name']]==$key)echo "selected"; ?> ><?php echo $value; ?></option>
                    <?php } ?>
                  </select>
                  <?php if(isset($customer[$cf['field_name']])){ ?>
                  <script language="JavaScript" type="text/javascript">updateStates('<?php echo $customer[$cf['field_name']]; ?>');</script>
                  <?php } ?>
                </td>
              </tr>
              <?php }elseif($cf['field_name']=="state"){ ?>
              <tr> 
                <td height='22' class='accountlabAltDataTD'><?php echo $BL->props->parseLang($cf['field_name']); ?><?php if(!$cf['field_optional'])echo "<font color='red'>*</font>"; ?></td>
                <td class='accountlabAltDataTD'>
                  <select name="state" id="state" size="1" class="search">
                    <option><?php echo $BL->props->lang['select']; ?></option>
                  </select>  
                </td>
              </tr>
              <?php }elseif($cf['field_name']=="vat_no"){ ?>        
                <?php if ($BL->conf['en_vat'] == 1) { ?>
              <tr> 
                <td height='22' class='accountlabAltDataTD'><?php echo $BL->props->parseLang($cf['field_name']); ?><?php if(!$cf['field_optional'])echo "<font color='red'>*</font>"; ?></td>
                <td class='accountlabAltDataTD'>
                  <input name='vat_no' id='vat_no' class='accountlabInput' type='text'  size='25' value="<?php echo isset($customer['vat_no'])?$customer['vat_no']:""; ?>" /> 
                </td>
              </tr>
                <?php } ?>
              <?php } ?>
            <?php } ?>
            
            
              <tr>
                <td height='22' class='accountlabDataTD'>&nbsp;</td>
                <td class='accountlabDataTD'>
                  <input name='id' id='id' type='hidden' value='<?php echo $customer['id']; ?>' />
                  <input name='cmd' id='cmd' type='hidden' value='<?php echo $cmd; ?>' />
                  <input name='submit' id='submit' type='submit' class='accountlabButton' value='<?php echo $BL->props->lang['submit']; ?>' />
                </td>
              </tr>
            </table>
            </form>
            </div>
            </div>
<script language="JavaScript" type="text/javascript">
  showTab('tab1', tabs, 't1', t);
</script>
<?php include_once $BL->props->get_page("templates/".THEMEDIR."/html/user/footer.php"); ?>