File size: 2.15Kb
<?
session_start();
include "file/db.php";
include "file/config.php";
include "file/aut.php";
include "style/".$autorize['skin']."/head.php";
$mesto=mysql_query("SELECT COUNT(*) FROM `uzvers` where `allmonth`>'0';");
$res=mysql_result($mesto, 0);
echo "</center><div class='menu'><center>Рейтинг юзеров<div class='hr'></div>В рейтинге участвуют <b>$res</b> ";
if ($res>4)
{
print "партнёров";
}
else
{
print "партнёра";
}
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 `allmonth`>'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 `allmonth`>'0' ORDER BY `allmonth` DESC LIMIT $start, $num;");
if(mysql_affected_rows()==0)
{
echo "<b>Рейтинг пуст..</b><br/>";
}
else
{
while($go = mysql_fetch_array($result))
{
print '<b>Логин:</b> <a href="anketa.php?id='.$go['id'].'&'.session_name().'='.session_id().'"><u>'.$go['log'].'</u></a><br />
<b>Сайт: </b><u><a href="'.$go['site'].'">'.$go['site'].'</a></u>
<br /><b>Баланс:</b> <u>'.round($go['allmonth'],2).' WMZ = '.round($go['allmonth']*$dol).' WMR</u><br />';
print "<div class='hr'></div>";
}
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";
?>