<?
include './system/common.php';
include './system/functions.php';
include './system/user.php';
?>
<?
$action = _string($_GET['action']);
switch($action) {
default:
break;
case'donation':
$title = 'Лучшие донат';
include './system/h.php';
echo'<div class="content">
<div class="h-navig"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td class="h-navig-item" style="font-size:16px;"><a href="?action=donation"><b>₽</b></a></td><td class="h-navig-item"><a href="?action=d"><img src="/images/icons/donate.png"></a></td><td class="h-navig-item"><a href="?cop=3">Подвал</a></td><td class="h-navig-item"><a href="?cop=4">Улучшение</a></td></tr></tbody></table></div><div class="line"></div>
<div class="block">
';
$max = 30;
$count = mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `donation` > 0'),0);
$pages = ceil($count/$max);
$page = _string(_num($_GET['page']));
if($page > $pages) {
$page = $pages;
}
if($page < 1) {
$page = 1;
}
$start = $page * $max - $max;
if($page == 1) {
$i = $page - 1;
}
elseif($page == 2) {
$i = ($page + 28);
}
else
{
$i = ($page * 30) - 29;
}
$q = mysql_query('SELECT * FROM `users` WHERE `donation` > 0 ORDER BY `donation` DESC LIMIT '.$start.', '.$max.'');
while($row = mysql_fetch_array($q)) {
$i++;
?>
<div>
<?=$i?>. <?
$ban = mysql_fetch_array(mysql_query('SELECT * FROM `ban` WHERE `user` = "'.$row['id'].'"'));
if($ban['user'] && $ban['time'] > time()){
?>
<img src="/images/icons/man_blocked.png" width="16" height="16" alt=""> <?
}else{
$zags = mysql_fetch_array(mysql_query('SELECT * FROM `zags` WHERE `id` = "'.$row['zags'].'"'));
if($zags['user'] && $zags['ring'] == 1){
?>
<img src='/images/zags/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' alt='*'/> <?
}else{
?>
<?
if($row['access'] == 1) {
?>
<img src='/images/mod/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' alt='*'/>
<?}
if($row['access'] == 5) {
?>
<img src='/images/man_blocked.png' alt='*'/>
<?}
if($row['access'] == 2) {
?>
<img src='/images/mod/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' alt='*'/>
<?}
if($row['access'] == 4) {
?>
<img src='/images/sys/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' width="16" height="16" alt="">
<?}
if($row['access'] == 3) {
?>
<img src='/images/adminy/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' alt='*'/>
<?}
if($row['vip'] == 0 && $row['access'] == 0){
?>
<img src='/images/icons/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' alt='*'/>
<?}
if($row['vip'] == 1 && $row['access'] == 0){
?>
<img src='/images/vip/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' alt='*'/>
<?}
?>
<?
}
}
?>
<a href="/user/<?=$row['id']?>/"><u><?=$row['login']?></u></a> <b> ₽ <?=($row['donation'])?></b></div>
<?
}
?>
</div>
<div class="line"></div>
<ul class="pagination center"><li class="next"><?=pages('/best?action=donation&');?></li></ul>
</div>
<?
include './system/f.php';
break;
case'd':
$title = 'Лучшие сгущёнка';
include './system/h.php';
echo'<div class="content">
<div class="h-navig"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td class="h-navig-item" style="font-size:16px;"><a href="?action=donation"><b>₽</b></a></td><td class="h-navig-item"><a href="?action=d"><img src="/images/icons/donate.png"></a></td><td class="h-navig-item"><a href="?cop=3">Подвал</a></td><td class="h-navig-item"><a href="?cop=4">Улучшение</a></td></tr></tbody></table></div><div class="line"></div>
<div class="block">';
$max = 30;
$count = mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `d` > 0'),0);
$pages = ceil($count/$max);
$page = _string(_num($_GET['page']));
if($page > $pages) {
$page = $pages;
}
if($page < 1) {
$page = 1;
}
$start = $page * $max - $max;
if($page == 1) {
$i = $page - 1;
}
elseif($page == 2) {
$i = ($page + 28);
}
else
{
$i = ($page * 30) - 29;
}
switch($sort) {
default:
$q = mysql_query('SELECT * FROM `users` WHERE `d` > 0 ORDER BY `d` DESC LIMIT '.$start.', '.$max.'');
break;
}
while($row = mysql_fetch_array($q)) {
$i++;
?>
<div>
<?=$i?>. <?
$ban = mysql_fetch_array(mysql_query('SELECT * FROM `ban` WHERE `user` = "'.$row['id'].'"'));
if($ban['user'] && $ban['time'] > time()){
?>
<img src="/images/icons/man_blocked.png" width="16" height="16" alt=""> <?
}else{
$zags = mysql_fetch_array(mysql_query('SELECT * FROM `zags` WHERE `id` = "'.$row['zags'].'"'));
if($zags['user'] && $zags['ring'] == 1){
?>
<img src='/images/zags/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' alt='*'/> <?
}else{
?>
<?
if($row['access'] == 1) {
?>
<img src='/images/mod/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' alt='*'/>
<?}
if($row['access'] == 5) {
?>
<img src='/images/man_blocked.png' alt='*'/>
<?}
if($row['access'] == 2) {
?>
<img src='/images/mod/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' alt='*'/>
<?}
if($row['access'] == 4) {
?>
<img src='/images/sys/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' width="16" height="16" alt="">
<?}
if($row['access'] == 3) {
?>
<img src='/images/adminy/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' alt='*'/>
<?}
if($row['vip'] == 0 && $row['access'] == 0){
?>
<img src='/images/icons/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' alt='*'/>
<?}
if($row['vip'] == 1 && $row['access'] == 0){
?>
<img src='/images/vip/<?=$row['r'].($row['online'] > (time() - 3540) ? '':'-off')?>.png' alt='*'/>
<?}
?>
<?
}
}
?>
<a href="/user/<?=$row['id']?>/"><u><?=$row['login']?></u></a> <b> <img src="/images/icons/donate.png"><?=n_f($row['d'])?></b></div>
<?
}
?>
</div>
<div class="line"></div>
<ul class="pagination center"><li class="next"><?=pages('/best?action=d&');?></li></ul>
</div>
</div></div>
<?
include './system/f.php';
break;
}
?>