<?
require_once 'system/common.php';
require_once 'system/functions.php';
require_once 'system/user.php';
$title = 'Турнир';
require_once 'system/h.php';
?>
<div class="content"><div class="block center header">Турнир лучший Авторитет</div>
<div class="dotted"></div>
<div class="block">
<?
$price = array (1 => '15000', 2 => '10000', 3 => '5000');
$sort = _string($_GET['sort']);
$max = 30;
$count = mysql_result(mysql_query('SELECT COUNT(*) FROM `users` WHERE `avtor` > 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) - 9;
}
switch($sort) {
default:
$q = mysql_query('SELECT * FROM `users` WHERE `avtor` > 0 ORDER BY `avtor` 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=""> <?
if($user['access'] >= 2){
echo'['._times(time() - $row['online']).']';}
}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']?>/"><span><u><?=$row['login']?></u></span></a> <b> <img src='/images/icons/experience.png' alt=''/> <?=($row['avtor'])?></b><span class="right"><?=($price[$i] != 0 ? ' <img src="/images/icons/gold.png" alt=""/> '.$price[$i]. '' : '')?></span>
</div>
<?
}
?>
<?
for($i = 1; $i <= 3; $i++){
?>
<?
}
?>
</div><div class="dotted"></div>
<ul class="pagination center"><li class="next"><?=pages('?');?></li></ul>
</div>
<?require_once 'system/f.php';?>