View file sdark.mobi/clan/rating.php

File size: 3.21Kb
<?php
require_once '../core/system.php';
echo only_reg();
echo ban();
$header = 'Рейтинг кланов';
if($user['mesto']!='Рейтинг кланов')	mysql_query("UPDATE `user` set `mesto` = 'Рейтинг кланов' where `id` = '".$user['id']."'");
require_once '../core/head.php';

if($user['plem'] == 'ogn'){$rat = 0;} else { $rat = 1;}
?>
<table class="foot center" width="100%" border="0" style="padding-top: 5px;" cellpadding="2px" cellspacing="2px">
<tbody>
<tr>
<td width="33%">
<a class="fight" href="?"><img src="/images/icon/rating_<?=$rat?>.png"> Рейтинг</a>
</td>
<td width="33%">
<a class="fight" href="?offensive"><img src="/images/icon/stat/sila.png"> Наступления</a>
</td>
<td width="33%">
<a class="fight" href="?achivments"><img src="/images/icon/exp.png"> Достижения</a>
</td>
</tr></tbody>
</table>
<hr>
<?php

$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `clan`"), 0);
$k_page = k_page($k_post, 10);
$page = page($k_page);
$start = 10*$page-10;
if($page==1){
$i = 0;
} else { 
$i = ($page-1)*10;
} 

if(isset($_GET['offensive'])){
$q = mysql_query("SELECT `id`,`plem`,`name`,`offen` FROM `clan`  ORDER BY `offen` DESC LIMIT ".$start.", 10");
echo"<div class='head center' style='padding:7px;'>
Список лучших кланов по наступлениям
</div>
<hr>";
while($post = mysql_fetch_array($q)) {
$i++;
echo'<div class="but-list">
<a href="/clan/'.$post['id'].'/">'.$i.'. <img src="/images/icon/race/'.$post['plem'].'.png"> '.$post['name'].' <span class="float-right"> <img src="/images/icon/stat/sila.png"> '.$post['offen'].'</a></span></div>';
}	
}elseif(isset($_GET['achivments'])){
$q = mysql_query("SELECT `id`,`plem`,`name`,`dost` FROM `clan`  ORDER BY `dost` DESC LIMIT ".$start.", 10");
echo"<div class='head center' style='padding:7px;'>
Статистика кланов по очкам достижений
</div>
<hr>";
while($post = mysql_fetch_array($q)) {
$i++;
echo'<div class="but-list">
<a href="/clan/'.$post['id'].'/">'.$i.'. <img src="/images/icon/race/'.$post['plem'].'.png"> '.$post['name'].' <span class="float-right"> <img src="/images/icon/exp.png"> '.$post['dost'].'</a></span></div>';
}	
} else {
$q = mysql_query("SELECT `id`,`plem`,`name`,`rating` FROM `clan`  ORDER BY `rating` DESC LIMIT ".$start.", 10");
echo"<div class='head center' style='padding:7px;'>
Список лучших кланов по набранному рейтингу
</div>
<hr>";
while($post = mysql_fetch_array($q)) {
$i++;
echo'<div class="but-list">
<a href="/clan/'.$post['id'].'/">'.$i.'. <img src="/images/icon/race/'.$post['plem'].'.png"> '.$post['name'].' <span class="float-right"> <img src="/images/icon/rating_'.$post['plem'].'.png"> '.$post['rating'].'</a></span></div>';
}
}
if(isset($_GET['achivments'])){$rab='achivments';}
if(isset($_GET['offensive'])){$rab='offensive';}
if ($k_page > 1){
echo "<hr>";
str('?'.$rab.'&',$k_page,$page);
}

echo"<div class='but-list-light'>
<hr>
<a href='/clan/search'><img src='/images/icon/search.png'> Поиск кланов</a>";
if(empty($user['clan']))echo "<a href='/clan/new'><img src='/images/icon/ok.png'> Создать клан <img src='/images/icon/gold.png'>500</a>";
echo "</div>";

require_once '../core/foot.php';
?>