<?php
include "header/config.inc.php";
include "header/function.inc.php";
include "header/header.inc.php";
include "header/connect.inc.php";
include "header/click-club.class.php";
$q=mysql_query("SELECT `id`,`login` FROM `".prefix."users` order by `id` desc;");
while ($r=mysql_fetch_array($q))
{
$n=mysql_num_rows(mysql_query("SELECT `to` FROM `".prefix."clicks` WHERE `who`='$r[id]';"));
if ($n>0)
$arr[$r[login]]=$n;
}
arsort($arr);
print '<div class="header_rek"><b>Лучшие сегодня</b></div><br/>Логин [кликов]:<br/>---<br/>';
$start=mysql_escape_string($_GET[start]);
if (empty($start))
$start=1;
foreach($arr as $key=>$value)
{
$i++;
if ($i>=$start and $i<=($start+15))
print "$i) $key [$value] <br />";
}
print "---<br />Участников: <b>$i</b><br />";
$start=$start+15;
if ($i>15)
print "<a href='day_rat.php?start=$start'>далее ....</a>";
include "header/end.inc.php";
?>