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 domains list
$q1 = "select * from domain_domains order by domainname limit $Start,$ByPage";
$r1 = mysql_query($q1) or die(mysql_error());
if(mysql_num_rows($r1) == '0')
{
echo "
There are no posted domains, yet!\n";
exit();
}
?>
| Domain |
Vote |
$col = "white";
while($a1 = mysql_fetch_array($r1))
{
if($col == "white")
{
$col = "#dddddd";
}
else
{
$col = "white";
}
//get the votes
$q2 = "select sum(vote)/count(voterid) as AvaragePrice, count(voterid) as other from domain_vote where domainid = '$a1[domainid]' ";
$r2 = mysql_query($q2) or die(mysql_error());
$a2 = mysql_fetch_array($r2);
echo "\n\t| $a1[domainname] | \n\t$$a2[AvaragePrice] ($a2[other]) | \n
\n\n";
}
echo "
";
//build the "next" - "prev" navigatioin
$qnav = "select count(*) from domain_domains";
$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;
}
?>