<?php include_once $BL->props->get_page("templates/alp_admin/html/header.php"); ?>
<div id="content">
    <div id="display_list">
      <div class="tabs" name='tt1' id='tt1' onmouseover="javascript:this.className='tabs1';" onmouseout="javascript:this.className='tabs';" ><a href="admin.php?cmd=viewcustomers" class="add_link"><?php echo $BL->props->lang['^customers']; ?></a></div>
      <div class="tab_separator">&nbsp;</div>
      <div class="tabs2" name='tt2' id='tt2' onmouseover="javascript:this.className='tabs1';" onmouseout="javascript:this.className='tabs2';" ><?php echo $title; ?></div>
      <div class="tab_separator">&nbsp;</div>
    </div>
    <div id="display_list">
    <form name='form1' id='form1' method='POST' action="<?php echo $PHP_SELF; ?>">
    <table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' class="list_table">
        <tr> 
            <td colspan='2' class="tdheading">
                &nbsp;
            </td>
        </tr>
        <tr> 
            <td colspan='2' class="text_grey">
                <img src="elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>spacer.gif" alt="" width="100%" height="1" />
            </td>
        </tr>
        <?php if (isset($err) && !empty($err)) { ?>
        <tr> 
            <td colspan='2' class="text_grey" height="30">
                <font color="red"><b><?php echo $err; ?></b></font>
            </td>
        </tr>
        <tr> 
            <td colspan='2' class='text_grey'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
            </td>
        </tr> 
        <?php } ?>
        <tr> 
          <td class='text_grey' valign='top' width='1%'>
            <div align='center'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
            </div>
          </td>
          <td valign='top' class='text_grey'>
          <div id="form1_label">
           <?php echo $BL->props->lang['signup']; ?><font color='red'>*</font> 
          </div>
          <div id="form1_field">
           <?php echo $BL->utils->datePicker($date, $month, $year, "search"); ?>
          </div>
          </td>
        </tr>
        <tr> 
            <td colspan='2' class='text_grey'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
            </td>
        </tr> 
        <tr> 
          <td class='text_grey' valign='top'>
            <div align='center'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
            </div>
          </td>
          <td valign='top' class='text_grey'>
          <div id="form1_label">
            <?php echo $BL->props->lang['Email']; ?><font color='red'>*</font>         
          </div>
          <div id="form1_field">
              <input name='email' id='email' type='text' class='search' size='45' value="<?php echo isset($REQUEST['email'])?$REQUEST['email']:""; ?>" />   
          </div>
          </td>
        </tr>
        <tr> 
            <td colspan='2' class='text_grey'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
            </td>
        </tr> 
        <tr> 
          <td class='text_grey' valign='top'>
            <div align='center'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
            </div>
          </td>
          <td valign='top' class='text_grey'>
          <div id="form1_label">
          <?php echo $BL->props->lang['Password']; ?><font color='red'>*</font>       
          </div>
          <div id="form1_field">
              <input name='password1' id='password1' type='password' class='search' size='10' />
          </div>
          </td>
        </tr>
        <tr> 
            <td colspan='2' class='text_grey'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
            </td>
        </tr> 
        <tr> 
          <td class='text_grey' valign='top'>
            <div align='center'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
            </div>
          </td>
          <td valign='top' class='text_grey'> 
          <div id="form1_label">
            <?php echo $BL->props->lang['password_confirm']; ?><font color='red'>*</font>
          </div>
          <div id="form1_field">
              <input name='password2' id='password2' type='password' class='search' size='10' />
          </div>
          </td>
        </tr>
        <tr> 
            <td colspan='2' class='text_grey'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
            </td>
        </tr> 
        
<?php 
foreach($custom_fields as $cf){ 
    if($cf['field_name']!="country" && $cf['field_name']!="state" && $cf['field_name']!="vat_no"){
?>
        <tr> 
          <td class='text_grey' valign='top'>
            <div align='center'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
            </div>
          </td>
          <td valign='top' class='text_grey'>
          <div id="form1_label">
            <?php echo $BL->props->parseLang($cf['field_name']); ?><?php if(!$cf['field_optional'])echo "<font color='red'>*</font>"; ?>
          </div>
          <div id="form1_field">
          <?php if($cf['field_type']=="text"){ ?>
             <input name='<?php echo $cf['field_name']; ?>' id='<?php echo $cf['field_name']; ?>' type='text' class='search' size='25' value="<?php echo isset($REQUEST[$cf['field_name']])?$REQUEST[$cf['field_name']]:""; ?>"  />
          <?php }else{ ?>
            <select name='<?php echo $cf['field_name']; ?>' id='<?php echo $cf['field_name']; ?>' class='search'>
            <?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($REQUEST[$cf['field_name']]) && $REQUEST[$cf['field_name']]==$value)echo "selected"; ?>><?php echo $BL->props->parseLang($value); ?></option>
            <?php
            }
            ?>
            </select>
          <?php } ?>
          </div>
          </td>
        </tr>
    <?php }elseif($cf['field_name']=="country"){ ?>
        <tr> 
          <td class='text_grey' valign='top'>
            <div align='center'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
            </div>
          </td>
          <td valign='top' class='text_grey'>
          <div id="form1_label">
            <?php echo $BL->props->parseLang($cf['field_name']); ?><?php if(!$cf['field_optional'])echo "<font color='red'>*</font>"; ?>
          </div>
          <div id="form1_field">
              <select name='country' id='country' class='search' 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($REQUEST[$cf['field_name']]) && $REQUEST[$cf['field_name']]==$key)echo "selected"; ?> ><?php echo $value; ?></option>
                <?php } ?>
              </select>
              <?php if(isset($REQUEST[$cf['field_name']])){ ?>
              <script language="JavaScript" type="text/javascript">updateStates('<?php echo $REQUEST[$cf['field_name']]; ?>');</script>
              <?php } ?>
          </div>
          </td>
        </tr>
    <?php }elseif($cf['field_name']=="state"){ ?>
        <tr> 
          <td class='text_grey' valign='top'>
            <div align='center'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
            </div>
          </td>
          <td valign='top' class='text_grey'>
          <div id="form1_label">
            <?php echo $BL->props->parseLang($cf['field_name']); ?><?php if(!$cf['field_optional'])echo "<font color='red'>*</font>"; ?>
          </div>
          <div id="form1_field">            
          <select name="state" name="state" size="1" class="search">
            <option><?php echo $BL->props->lang['select']; ?></option>
          </select>  
          </div>
          </td>
        </tr> 
    <?php }elseif($cf['field_name']=="vat_no"){ ?>        
        <?php if ($BL->conf['en_vat'] == 1) { ?>
        <tr> 
          <td class='text_grey' valign='top'>
            <div align='center'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
            </div>
          </td>
          <td valign='top' class='text_grey'>
          <div id="form1_label">
           <?php echo $BL->props->parseLang($cf['field_name']); ?><?php if(!$cf['field_optional'])echo "<font color='red'>*</font>"; ?>
          </div>
          <div id="form1_field">
           <input name='vat_no' id='vat_no' class='search' type='text'  size='25' value="<?php echo isset($REQUEST['vat_no'])?$REQUEST['vat_no']:""; ?>" />
          </div>
          </td>
        </tr>
        <?php } ?>
    <?php } ?>
        <tr> 
          <td colspan='2' class='text_grey'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
          </td>
        </tr> 
<?php } ?>
        <tr> 
          <td class='text_grey' valign='top'>
            <div align='center'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
            </div>
          </td>
          <td valign='top' class='text_grey'>
          <div id="form1_label">
           <?php echo $BL->props->lang['trusted']; ?>
          </div>
          <div id="form1_field">
            <select name='trusted' id='trusted' class='search'>
            <option value='1' <?php if(isset($REQUEST['trusted']) && $REQUEST['trusted']==1)echo "selected=\"selected\""; ?>><?php echo  $BL->props->lang['Yes']; ?></option>
            <option value='0' <?php if(isset($REQUEST['trusted']) && $REQUEST['trusted']==0)echo "selected=\"selected\""; ?>><?php echo  $BL->props->lang['No']; ?></option>
            </select>
          </div>
          </td>
        </tr>
        <tr> 
            <td colspan='2' class='text_grey'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
            </td>
        </tr> 
        <tr> 
          <td valign='top' class='text_grey'></td>
          <td valign='top' class='text_grey'>
          <div id="form1_label">
          <?php if($cmd=="editcustomers"){ ?>
          <input name='id' type='hidden' value='<?php echo $REQUEST['id']; ?>' />
          <?php } ?>
           <input name='cmd' type='hidden' value='<?php echo $cmd; ?>' />
          </div>
          <div id="form1_field">
           <input name='submit' type='submit' class='search1' value='<?php echo ($cmd=="editcustomers")?$BL->props->lang['Update']:$BL->props->lang['add']; ?>' />
          </div>
          </td>
        </tr>
        </table>
        </form>
	</div>
</div>
<!--end content -->
<div id="navBar">
<?php include_once $BL->props->get_page("templates/alp_admin/html/_sidepanel.php"); ?>
</div>
<!--end navbar -->
<?php include_once $BL->props->get_page("templates/alp_admin/html/footer.php"); ?>