<?php
if (!defined('WEB_ROOT')) {
	exit;
}

$sql = "SELECT *
        FROM tbl_user
		ORDER BY user_id";
$result = dbQuery($sql);

?> 
<p>&nbsp;</p>
<form action="processUser.php?action=addUser" method="post"  name="frmListUser" id="frmListUser">
 <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="text">
  <tr align="center" id="listTableHeader"> 
   <td width="363">User Name</td>
   <td width="199">Register Date</td>
   <td width="224">Last login</td>
   <td width="168">Action</td>
  </tr>
<?php
while($row = dbFetchAssoc($result)) {
	extract($row);
	
	if ($i%2) {
		$class = 'row1';
	} else {
		$class = 'row2';
	}
	
	$i += 1;
?>
  <tr class="<?php echo $class; ?>"> 
   <td style="padding-left:10px"><?php echo $user_name; ?></td>
   <td width="199" align="center"><?php echo $user_regdate; ?></td>
   <td width="224" align="center"><?php echo $user_last_login; ?></td>
   <td width="168" align="center">
   	<a href="javascript:changePassword(<?php echo $user_id; ?>);"><img src="../images/modify.png" alt="Change Password" border="0" /></a> &nbsp; <a href="javascript:deleteUser(<?php echo $user_id; ?>);"><img src="../images/delete.png" border="0" alt="Delete" /></a></td>
   
  </tr>
<?php
} // end while

?>
  <tr> 
   <td colspan="5">&nbsp;</td>
  </tr>
  <tr> 
   <td colspan="5" align="right"><input name="btnAddUser" type="button" id="btnAddUser" value="Add User" class="button" onClick="addUser()"></td>
  </tr>
 </table>
 <p>&nbsp;</p>
</form>