<!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=utf-8" />


<?php
$_SESSION['current_page']   = "admin";
include ("../navigation/header.php");

$page_name = "AD-user list";
include ("../navigation/access.php");

$table_name = $_SESSION['db_prefix']."_users";
$user_query = "SELECT username, email, home_page  FROM  $table_name WHERE username <> 'system_manager'";
$user_result = mySQL_query($user_query);
$user_num = mysql_num_rows($user_result);


?>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
</head>

<?php 
if ($permission_num==1) {
	include ("../navigation/admin_sidebar.php");
?>

<body>

<div class="main_frame">
  <div class="page_head_frame">
        <table width="600" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="385"><label class="label_page_head">Users</label></td>
            <td align="right">&nbsp;</td>
            </tr>
        </table>
      </div><br />
<div class="page_middle_frame">
     <table width="690" id="table_list" class="sortable-onload-0 rowstyle-alt no-arrow "  >
      <tr>
        <th class="sortable-text">Name</th>
        <th class="sortable-numeric">email</th>
        <th class="sortable-date-dmy">home page</th>
       </tr>
      <?php 
$i=0;
while ($i<$user_num) {
	$a0 = mysql_result($user_result, $i, "username");
	$a1 = mysql_result($user_result, $i, "email");
	$a2 = mysql_result($user_result, $i, "home_page");
	
	?>
      <tr>
        <td width="186" align="left"><?php echo $a0 ?></td>
        <td width="256" align="left"><?php echo $a1 ?></td>
        <td width="232" align="left"><?php echo $a2 ?></td>
       </tr>
      <?php
  $i++;
}
?>
    </table>
    
</div>    
  
</div>

<?php include ('../navigation/side_bar.php'); ?>
</body>

<?php } else {
	
$_SESSION['denied_return'] = $_SESSION['location'];	
include ("../navigation/store_sidebar.php");?>
<?php include ('../navigation/side_bar.php'); ?>
	<body onload="accessdenied(); return false">
	</body>
<?php }
?>


</html>