     <? if($_SESSION['page'] == '3' and $_SESSION['section'] == '1') { ?>
<link href="../admin.css" rel="stylesheet" type="text/css" />

	
    <table width="95%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
      <tr>
        <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td class="Main_Text">Administrators</td>
            <td width="10%" class="Main_Text"><div align="right"><img src="image/more_info.gif" width="32" height="32" border="0" /></a></div></td>
          </tr>
          <tr>
            <td colspan="2">
            
            <? if ($_GET['stat'] == '') { ?>
            
            <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="image/subheader_icon.gif" width="12" height="12" /><strong class="text2">&nbsp;&nbsp;&nbsp;The list of all product</strong></p>
              <table width="95%" border="0" align="center">
                <tr>
                  <td  class="Main_Text1">User Name</td>
                  <td  class="Main_Text1">name</td>
                  <td  class="Main_Text1">E-mail</td>
                  <td  class="Main_Text1">Country</td>
                  <td  class="Main_Text1">active</td>
                  <td  class="Main_Text1">Edit</td>
                </tr>
                    <? 
					 $result1 = mysql_query("SELECT * FROM ".$dcm_table_start."userlist",$db); 
						while($row = mysql_fetch_array($result1)){ 
						?>
                            <tr class="Main_SText">
                              <td  class="Main_SText">&nbsp;<strong><? echo $row['username']; ?></strong></td>
                              <td  class="Main_SText">&nbsp;<strong><? echo $row['fname']; ?>&nbsp;<? echo $row['lname']; ?></strong></td>
                              <td  class="Main_SText">&nbsp;<strong><? echo $row['email']; ?></strong></td>
                              <td>&nbsp;<strong><? echo $row['country']; ?></strong></td>
                              <td>&nbsp;<? 
									  				if ($row['Available'] == 0)
														{
															echo "Yes";
									  					}else{
															echo "No";
														} ?></td>
                              <td  class="Main_Text"><a href="index.php?stat=edit&id=<? echo $row['user_id'];?>"><img src="image/edit.gif" width="24" height="24" border="0" /></a></td>
                            </tr>                                    
						<?
						}
						?>
              </table>
              <? } 
			  if ($_GET['stat'] == 'edit' ) {
					  $id=$_GET['id'];
			  		  $resultinfo = mysql_query("SELECT * FROM ".$dcm_table_start."userlist where user_id =$id",$db); 
				
			  ?>
              
   
 	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          
          <tr>
            <td colspan="2">
			<form id="form1" name="form1" method="post" action="index.php?stat=update">
			  
               <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="image/subheader_icon.gif" width="12" height="12" /><strong class="text2">&nbsp;&nbsp;&nbsp;User account info</strong></p>
              <table width="95%" border="0" align="center">
                <tr>
                  <td width="250" class="Main_Text1">This account is active</td>
                  <td width="80%"  class="text_row1"><input name="active" type="checkbox" id="active" value="1" checked="checked" /></td>
                </tr>
                <tr>
                  <td class="Main_Text1">Account type</td>
                  <td class="text_row1"><select name="account_type" class="text_box" id="account_type">
                    <option value="1" <? if ( mysql_result($resultinfo,0,"account_type")== "1" ){ ?> selected <? } ?>>Customer</option>
                    <option value="2" <? if ( mysql_result($resultinfo,0,"account_type")== "2" ){ ?> selected <? } ?>>Administrator</option>
                  </select>                  </td>
                </tr>
                <tr>
                  <td class="Main_Text1">Username</td>
                  <td class="text_row1"><span id="sprytextfield1">
                    <input name="username" type="text" class="text_box1" id="username" size="40" value="<? echo mysql_result($resultinfo,0,"username") ?>" />
                  <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                </tr>
                <tr>
                  <td class="Main_Text1">Password</td>
                  <td class="text_row1"><input name="password" type="password" class="textbox1" id="password" size="40" /></td>
                </tr>
              </table>
              <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="image/subheader_icon.gif" width="12" height="12" /><strong class="text2">&nbsp;&nbsp;&nbsp;Contact information</strong></p>
              <table width="95%" border="0" align="center">
                <tr>
                  <td width="250" class="Main_Text1">First name</td>
                  <td width="80%"  class="text_row1"><span id="sprytextfield3">
                    <input name="fname" type="text" class="text_box1" id="fname" size="40" value="<? echo mysql_result($resultinfo,0,"fname") ?>" />
                  <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                </tr>
                <tr>
                  <td class="Main_Text1">Last name</td>
                  <td class="text_row1"><span id="sprytextfield4">
                    <input name="lname" type="text" class="text_box1" id="lname" size="40" value="<? echo mysql_result($resultinfo,0,"lname") ?>" />
                  <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                </tr>
                <tr>
                  <td class="Main_Text1">E-mail</td>
                  <td class="text_row1"><span id="sprytextfield5">
                  <input name="email" type="text" class="text_box1" id="email" size="40" value="<? echo mysql_result($resultinfo,0,"email") ?>" />
                  <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
                </tr>
                <tr>
                  <td class="Main_Text1">Phone</td>
                  <td class="text_row1"><span id="sprytextfield6">
                  <input name="phone" type="text" class="text_box1" id="phone" size="40" value="<? echo mysql_result($resultinfo,0,"phone") ?>" />
                  <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
                </tr>
                </table>
              <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="image/subheader_icon.gif" width="12" height="12" /><strong class="text2">&nbsp;&nbsp;&nbsp;Billing address</strong></p>
              <table width="95%" border="0" align="center">
                <tr>
                  <td width="250" class="Main_Text1">Address</td>
                  <td width="80%"  class="text_row1"><span id="sprytextfield7">
                    <input name="address1" type="text" class="text_box1" id="address1" size="40" value="<? echo mysql_result($resultinfo,0,"address1") ?>" />
                  <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                </tr>
                <tr>
                  <td class="Main_Text1">Address, line 2</td>
                  <td class="text_row1"><span id="sprytextfield8">
                    <input name="address2" type="text" class="text_box1" id="address2" size="40" value="<? echo mysql_result($resultinfo,0,"address2") ?>" />
                  </span></td>
                </tr>
                <tr>
                  <td class="Main_Text1">City</td>
                  <td class="text_row1"><span id="sprytextfield9">
                    <input name="city" type="text" class="text_box1" id="city" size="40" value="<? echo mysql_result($resultinfo,0,"city") ?>" />
                  <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                </tr>
                <tr>
                  <td class="Main_Text1">Country</td>
                  <td class="text_row1"><span id="sprytextfield10">
                    <input name="country" type="text" class="text_box1" id="country" size="40" value="<? echo mysql_result($resultinfo,0,"country") ?>" />
                  <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                </tr>
              </table><p>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="Submit" type="submit" class="Button1" id="Submit" value="Update" />
                <input name="id" type="hidden" id="id" value="<? echo $_GET['id']; ?>" />
              </p>
			</form>
            </td>
          </tr>
        </table>
			 <script type="text/javascript">
            <!--
            var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
            var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
            var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
            var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "email");
            var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "integer", {useCharacterMasking:true});
            var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7");
            var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8", "none", {isRequired:false});
            var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9");
            var sprytextfield10 = new Spry.Widget.ValidationTextField("sprytextfield10");
            //-->
            </script>
	 		<? } ?>
     <? } ?>
