require_once("../conn.php");
require_once("access.php");
require_once("AdminNavigation.php");
$ByPage = "25";
if(!empty($_GET[Start]))
{
$Start = $_GET[Start];
}
else
{
$Start = "0";
}
//get the users list
$q1 = "select * from domain_members order by names limit $Start, $ByPage";
$r1 = mysql_query($q1) or die(mysql_error());
if(mysql_num_rows($r1) == '0')
{
echo "
There are no registered members, yet!";
exit();
}
?>
| Name |
Username |
Email |
Domains |
$col = "white";
while($a1 = mysql_fetch_array($r1))
{
if($col == "white")
{
$col = "#dddddd";
}
else
{
$col = "white";
}
//count the user's domains
$q2 = "select count(*) from domain_domains where memberid = '$a1[memberid]' ";
$r2 = mysql_query($q2) or die(mysql_error());
$a2 = mysql_fetch_array($r2);
$domains = $a2[0];
echo "\n\t| $a1[names] | \n\t$a1[username] | \n\t$a1[email] | \n\t$domains | \n
\n\n";
}
?>
//build the "next" - "prev" navigatioin
$qnav = "select count(*) from domain_members";
$rnav = mysql_query($qnav) or die(mysql_error());
$anav = mysql_fetch_array($rnav);
$rows = $anav[0];
if($rows > $ByPage)
{
$NextPrev = "
";
$NextPrev .= "| | ";
$pages = ceil($rows/$ByPage);
for($i = 0; $i <= ($pages); $i++)
{
$PageStart = $ByPage*$i;
$i2 = $i + 1;
if($PageStart == $Start)
{
$links[] = " $i2\n\t ";
}
elseif($PageStart < $rows)
{
$links[] = " $i2\n\t ";
}
}
$links2 = implode(" | ", $links);
$NextPrev .= $links2;
$NextPrev .= "| | ";
$NextPrev .= "
\n";
echo $NextPrev;
}
?>