Файл: accmarket.net/game/top.php
Строк: 137
<?php
define('_ON_CMS', 1);
require_once '../includes/start.php';
require_once '../includes/function.php';
require_once '../includes/header.php';
if($level==0 OR $ban!=0){
header('Location: ../index.php');
}
$rs=check($_GET['rs']);
if($rs=='' OR $rs>3 OR $rs<1)$rs=$rasa;
$rswiew=''.check($rs).'';
if($rs==4)$rswiew='0';
switch ($act) {
default:
echo '<div class="top"><img src="../images/rate.gif" alt="image" /> Зал славы | <img src="../images/terran.png" alt="image" /> <a href="?rs=1">Терраны</a> <img src="../images/protoss.png" alt="image" /> <a href="?rs=2">Протоссы</a> <img src="../images/zerg.png" alt="image" /> <a href="?rs=3">Зерги</a></div>';
echo '<div class="conts">';
echo ''.rasa($rs).' <a href="?act=old&rs='.$rs.'">Самые старые игроки</a><br/>';
echo ''.rasa($rs).' <a href="?act=planet&rs='.$rs.'">Больше всего планет</a><br/>';
echo ''.rasa($rs).' <a href="?act=res&rs='.$rs.'">Больше всего ресурсов</a><br/>';
echo ''.rasa($rs).' <a href="?act=people&rs='.$rs.'">Самые населенные планеты</a><br/>';
echo ''.rasa($rs).' <a href="?act=hero&rs='.$rs.'">Самые развитые герои</a><br/>';
echo ''.rasa($rs).' <a href="?act=runit&rs='.$rs.'">Самые развитые войска</a><br/>';
echo ''.rasa($rs).' <a href="?act=uarmy&rs='.$rs.'">Самые большие отряды</a><br/>';
echo ''.rasa($rs).' <a href="?act=moon&rs='.$rs.'">Самые большие луны</a><br/>';
echo '</div>';
break;
case 'old':
echo '<div class="top"><img src="../images/rate.gif" alt="image" /> <a href="?rs='.$rs.'">Зал славы</a> | <img src="../images/terran.png" alt="image" /> <a href="?act=old&rs=1">Терраны</a> <img src="../images/protoss.png" alt="image" /> <a href="?act=old&rs=2">Протоссы</a> <img src="../images/zerg.png" alt="image" /> <a href="?act=old&rs=3">Зерги</a></div>';
echo '<div class="cont">Самые старые игроки:</div>';
$PAGINGS = mysql_query("SELECT * FROM `users` WHERE `game`!=0 AND `rasa`='".$rswiew."' ORDER BY `newtime` ASC LIMIT 10");
if($PAGINGS > 0)
{
while($row = mysql_fetch_array($PAGINGS))
{
echo '<div class="conts">'.rasa($row['rasa']).' <a href="../p/anketa.php?id='.$row['id'].'"> <span class="'.crasa($row['rasa']).'">'.$row['login'].'</span></a> (нач. '.dates($row['newtime']).')</div>';
}
}
break;
case 'planet':
echo '<div class="top"><img src="../images/rate.gif" alt="image" /> <a href="?rs='.$rs.'">Зал славы</a> | <img src="../images/terran.png" alt="image" /> <a href="?act=planet&rs=1">Терраны</a> <img src="../images/protoss.png" alt="image" /> <a href="?act=planet&rs=2">Протоссы</a> <img src="../images/zerg.png" alt="image" /> <a href="?act=planet&rs=3">Зерги</a></div>';
echo '<div class="cont">Больше всего планет:</div>';
$PAGINGS = mysql_query("SELECT * FROM `users` WHERE `game`!=0 AND `rasa`='".$rswiew."' ORDER BY `planet` DESC LIMIT 10");
if($PAGINGS > 0)
{
while($row = mysql_fetch_array($PAGINGS))
{
echo '<div class="conts">'.rasa($row['rasa']).' <a href="../p/anketa.php?id='.$row['id'].'"> <span class="'.crasa($row['rasa']).'">'.$row['login'].'</span></a> ('.$row['planet'].' планет)</div>';
}
}
break;
case 'res':
echo '<div class="top"><img src="../images/rate.gif" alt="image" /> <a href="?rs='.$rs.'">Зал славы</a> | <img src="../images/terran.png" alt="image" /> <a href="?act=res&rs=1">Терраны</a> <img src="../images/protoss.png" alt="image" /> <a href="?act=res&rs=2">Протоссы</a> <img src="../images/zerg.png" alt="image" /> <a href="?act=res&rs=3">Зерги</a></div>';
echo '<div class="cont">Больше всего ресурсов:</div>';
$PAGINGS = mysql_query("SELECT * FROM `users` WHERE `game`!=0 AND `rasa`='".$rswiew."' ORDER BY `min`+`gas`+`kred`+`prov`+`metall`+`water` DESC LIMIT 10");
if($PAGINGS > 0)
{
while($row = mysql_fetch_array($PAGINGS))
{
echo '<div class="conts">'.rasa($row['rasa']).' <a href="../p/anketa.php?id='.$row['id'].'"> <span class="'.crasa($row['rasa']).'">'.$row['login'].'</span></a> ('.($row['gas']+$row['min']+$row['kred']+$row['prov']+$row['metall']+$row['water']).' ед.)</div>';
}
}
break;
case 'people':
echo '<div class="top"><img src="../images/rate.gif" alt="image" /> <a href="?rs='.$rs.'">Зал славы</a> | <img src="../images/terran.png" alt="image" /> <a href="?act=people&rs=1">Терраны</a> <img src="../images/protoss.png" alt="image" /> <a href="?act=people&rs=2">Протоссы</a> <img src="../images/zerg.png" alt="image" /> <a href="?act=people&rs=3">Зерги</a></div>';
echo '<div class="cont">Самые населенные планеты:</div>';
$PAGINGS = mysql_query("SELECT * FROM `planet` WHERE `rasa`='".$rswiew."' ORDER BY `peo` DESC LIMIT 10");
if($PAGINGS > 0)
{
while($row = mysql_fetch_array($PAGINGS))
{
$q = mysql_query("SELECT * FROM `users` WHERE `id`='".$row['uid']."'");
$u = mysql_fetch_array($q);
echo '<div class="conts">'.rasa($row['rasa']).' <a href="../game/sector.php?x='.$row['x'].'&y='.$row['y'].'"><span class="'.crasa($row['rasa']).'">'.$row['name'].'</span></a> игрока <a href="../p/anketa.php?id='.$row['uid'].'"> <span class="'.crasa($row['rasa']).'">'.$u['login'].'</span></a> ('.$row['peo'].' населения)</div>';
}
}
break;
case 'hero':
echo '<div class="top"><img src="../images/rate.gif" alt="image" /> <a href="?rs='.$rs.'">Зал славы</a> | <img src="../images/terran.png" alt="image" /> <a href="?act=hero&rs=1">Терраны</a> <img src="../images/protoss.png" alt="image" /> <a href="?act=hero&rs=2">Протоссы</a> <img src="../images/zerg.png" alt="image" /> <a href="?act=hero&rs=3">Зерги</a></div>';
echo '<div class="cont">Самые развитые герои:</div>';
$PAGINGS = mysql_query("SELECT * FROM `users` WHERE `game`!=0 AND `rasa`='".$rswiew."' AND `hero`!='' ORDER BY `lvl_hero` DESC LIMIT 10");
if($PAGINGS > 0)
{
while($row = mysql_fetch_array($PAGINGS))
{
echo '<div class="conts">'.rasa($row['rasa']).' Герой <span class="'.crasa($row['rasa']).'">'.$row['hero'].'</span> игрока <a href="../p/anketa.php?id='.$row['id'].'"> <span class="'.crasa($row['rasa']).'">'.$row['login'].'</span></a> ('.$row['lvl_hero'].' уровень)</div>';
}
}
break;
case 'runit':
echo '<div class="top"><img src="../images/rate.gif" alt="image" /> <a href="?rs='.$rs.'">Зал славы</a> | <img src="../images/terran.png" alt="image" /> <a href="?act=runit&rs=1">Терраны</a> <img src="../images/protoss.png" alt="image" /> <a href="?act=runit&rs=2">Протоссы</a> <img src="../images/zerg.png" alt="image" /> <a href="?act=runit&rs=3">Зерги</a></div>';
echo '<div class="cont">Самые развитые войска:</div>';
$PAGINGS = mysql_query("SELECT * FROM `units` WHERE `rasa`='".$rswiew."' ORDER BY `r1`+`r2`+`r3`+`r4`+`r5`+`r6`+`r7`+`r8`+`r9`+`r10`+`r11`+`r12` DESC LIMIT 10");
if($PAGINGS > 0)
{
while($row = mysql_fetch_array($PAGINGS))
{
$q = mysql_query("SELECT * FROM `users` WHERE `id`='".$row['uid']."'");
$u = mysql_fetch_array($q);
echo '<div class="conts">'.rasa($row['rasa']).' Войска игрока <a href="../p/anketa.php?id='.$row['uid'].'"> <span class="'.crasa($row['rasa']).'">'.$u['login'].'</span></a> (сум.ранг '.($row['r1']+$row['r2']+$row['r3']+$row['r4']+$row['r5']+$row['r6']+$row['r7']+$row['r8']+$row['r9']+$row['r10']+$row['r11']+$row['r12']).' ед.)</div>';
}
}
break;
case 'uarmy':
echo '<div class="top"><img src="../images/rate.gif" alt="image" /> <a href="?rs='.$rs.'">Зал славы</a> | <img src="../images/terran.png" alt="image" /> <a href="?act=uarmy&rs=1">Терраны</a> <img src="../images/protoss.png" alt="image" /> <a href="?act=uarmy&rs=2">Протоссы</a> <img src="../images/zerg.png" alt="image" /> <a href="?act=uarmy&rs=3">Зерги</a></div>';
echo '<div class="cont">Самые большие отряды:</div>';
$PAGINGS = mysql_query("SELECT * FROM `army` WHERE `rasa`='".$rswiew."' ORDER BY `u1`+`u2`+`u3`+`u4`+`u5`+`u6`+`u7`+`u8`+`u9`+`u10`+`u11`+`u12` DESC LIMIT 10");
if($PAGINGS > 0)
{
while($row = mysql_fetch_array($PAGINGS))
{
$q = mysql_query("SELECT * FROM `users` WHERE `id`='".$row['uid']."'");
$u = mysql_fetch_array($q);
echo '<div class="conts">'.rasa($row['rasa']).' Отряд <span class="'.crasa($row['rasa']).'">'.$row['name'].'</span> игрока <a href="../p/anketa.php?id='.$row['uid'].'"> <span class="'.crasa($row['rasa']).'">'.$u['login'].'</span></a> ('.($row['u1']+$row['u2']+$row['u3']+$row['u4']+$row['u5']+$row['u6']+$row['u7']+$row['u8']+$row['u9']+$row['u10']+$row['u11']+$row['u12']).' юнитов)</div>';
}
}
break;
case 'moon':
echo '<div class="top"><img src="../images/rate.gif" alt="image" /> <a href="?rs='.$rs.'">Зал славы</a> | <img src="../images/terran.png" alt="image" /> <a href="?act=moon&rs=1">Терраны</a> <img src="../images/protoss.png" alt="image" /> <a href="?act=moon&rs=2">Протоссы</a> <img src="../images/zerg.png" alt="image" /> <a href="?act=moon&rs=3">Зерги</a></div>';
echo '<div class="cont">Самые большие луны:</div>';
$PAGINGS = mysql_query("SELECT * FROM `moon` WHERE `rasa`='".$rswiew."' ORDER BY `diameter` DESC LIMIT 10");
if($PAGINGS > 0)
{
while($row = mysql_fetch_array($PAGINGS))
{
$q = mysql_query("SELECT * FROM `users` WHERE `id`='".$row['uid']."'");
$u = mysql_fetch_array($q);
echo '<div class="conts">'.rasa($row['rasa']).' Луна планеты <span class="'.crasa($row['rasa']).'">'.$row['name_planet'].'</span> игрока <a href="../p/anketa.php?id='.$row['uid'].'"> <span class="'.crasa($row['rasa']).'">'.$u['login'].'</span></a> ('.$row['diameter'].' км)</div>';
}
}
break;
}
div('<a href="../">В игру</a>','conts');
require_once '../includes/footer.php';
?>