File size: 1.82Kb
<?
session_start();
include "file/db.php";
include "file/config.php";
include "file/aut.php";
include "style/".$autorize['skin']."/head.php";
echo "</center><div class='menu'><center>Рейтинг рефераловладельцеф";
echo "</center></div><div class='hr'></div><div class='tab'>";
$num = $nummer;
if(empty($_GET['page']) || $_GET['page']<0)$_GET['page']=1;
$page = intval($_GET['page']);
$results = mysql_query("SELECT * FROM `uzvers` where `partk`>'0';");
$posts = mysql_num_rows($results);
$total = intval(($posts-1)/$num)+1;
if($page>$total) $page = $total;
$start = $page*$num-$num;
$result = mysql_query("SELECT * FROM `uzvers` where `partk`>'0' ORDER BY `partk` DESC LIMIT $start, $num;");
if(mysql_affected_rows()==0)
{
echo "<b>Рейтинг пуст..</b><br/>";
}
else
{
echo "<table border ='1'><tr><td><b>Логин</b></td><td><b>Сайт</b></td><td><b>Рефералов</b></td></tr>";
while($go = mysql_fetch_array($result))
{
echo "<tr><td align='left'>".$go['id']."</td><td align='center'>".$go['log']."</td><td align='center'>".$go['partk']."</td></tr>";
}
print "</table>";
print '<div class=\'str\'>Стр:';
$num_pages=ceil($posts/$num);
if($page>$num_pages || $page<1)
{
$page=1;
$start=0;
}
for($pr='', $i=1; $i<=$num_pages; $i++)
{
print $pr=(($i == 1 || $i == $num_pages || abs($i-$page) < 2) ? ($i == $page ? " <b>$i</b> " :
' <a href="'.$_SERVER['SCRIPT_NAME'].'?page='.$i.'&'.session_name().'='.session_id().'">'.$i.'</a> ') : (($pr == ' ... ' || $pr == '')? '' : ' ... '));
}
print "</div>";
}
echo "<div class='hr'></div><img src=\"style/".$autorize['skin']."/home.png\" alt=\"*\"/><a href=\"enter.php?".session_name()."=".session_id()."\">Панель</a><br/><div class='hr'></div></div>";
include "style/".$autorize['skin']."/foot2.php";
?>