Location: PHPKode > projects > PHP Enter > www/admin/user.php
<?php include('header.php'); include('options.php'); ?>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="8" bgcolor="#FFFFFF">
<tr><td><strong>Members</strong></td><tr>
<tr><td width="450px">
<?php
$rowsPerPage = 8;
$pageNum = 1;
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}
$offset = ($pageNum - 1) * $rowsPerPage;
$result = mysql_query("SELECT * FROM users ORDER by usid desc LIMIT $offset, $rowsPerPage") 
or die(mysql_error()); 
while($row=mysql_fetch_array($result))
{
?>
<b>Username: <?php echo $row['username'] ?></b><br />
Email: <?php echo $row['email'] ?><br />
Active: <?php echo $row['active'] ?> | 

<?php
if($row['active'] == 0){

?>
<a href="activate_user.php?id=<?php echo $row['usid'] ?>">Activate (email not confirmed)</a><br />

<?php
}else{
echo "<font color=\"green\">Active. Email-confirmed user</font>";
}
?>

Level: <?php echo $row['privilege'] ?><br />
<a href="deluser.php?id=<?php echo $row['usid'] ?>"><font color="red">Delete User <?php $row['username'] ?></font></a><br /><br />

<?php
}
$query   = "SELECT COUNT(usid) AS numrows FROM users";
$result  = mysql_query($query) or die('Error, query failed');
$row     = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];
$maxPage = ceil($numrows/$rowsPerPage);
$self = $_SERVER['PHP_SELF'];
$nav  = '';
for($page = 1; $page <= $maxPage; $page++)
{
   if ($page == $pageNum)
   {
      $nav .= " $page ";
   }
   else
   {
      $nav .= " <a href=\"$self?page=$page\">$page</a> ";
   } 
}
if ($pageNum > 1)
{
   $page  = $pageNum - 1;
   $prev  = " <a href=\"$self?page=$page\">[Prev]</a> ";
   $first = " <a href=\"$self?page=1\">[First Page]</a> ";
} 
else
{
   $prev  = '&nbsp;';
   $first = '&nbsp;'; 
}
if ($pageNum < $maxPage)
{
   $page = $pageNum + 1;
   $next = " <a href=\"$self?page=$page\">[Next]</a> ";
   $last = " <a href=\"$self?page=$maxPage\">[Last Page]</a> ";
} 
else
{
   $next = '&nbsp;'; 
   $last = '&nbsp;'; 
}
echo $first . $prev . $nav . $next . $last;
 
?>
  </td>
 </tr>
</table>   
Return current item: PHP Enter