Просмотр файла gta/city1/rating.php

Размер файла: 5.07Kb
<?php

include "./../ini3.php";
include "./../includes/header$h.php";
include "./../includes/inc_online.php";



$id=cyr(htmlspecialchars(stripslashes(trim($id))));
$login=cyr(htmlspecialchars(stripslashes(trim($login))));
$pass=cyr(htmlspecialchars(stripslashes(trim($pass))));

if(!empty($login)) 
{  
$q = mysql_query("select * from users where login='".cyr($login)."';");
}
elseif(!empty($id)) 
{
$q = mysql_query("select * from users where id='".$id."';");
}
else
{
die ($lang['empty_login']."</body></html>");
}

$data = mysql_fetch_array($q);

$id=$data['id'];
$login=$data['login'];
$status=$data['status'];
$reg_data=$data['reg_data'];
$money=$data['money'];
$level=$data['level'];
$police=$data['police'];
$health=$data['health'];
$cars=$data['cars'];
$guns=$data['guns'];
$band=$data['band'];
$energy=$data['energy'];
$secur=$data['secur'];
$admin=$data['admin'];
$ban=$data['ban'];
$lsd=$data['lsd'];
$zav=$data['zav'];
$lvl=$data['lvl'];
$gold=$data['gold'];
$school=$data['school'];
$ref=$data['ref'];
$antikiller=$data['antikiller'];
$lox=$data['lox'];

if(md5($pass)!=$data['pass'])
{
die ($lang['empty_login']."</body></html>");
}

mysql_query("update users set last='".time()."',city='1' where id='".$id."';");

include "./../includes/inc_secur.php";
include "./../includes/inc_energy.php";
include "./../includes/inc_hospital.php";
include "./../includes/inc_police.php";
include "./../includes/inc_die.php";
include "./../includes/inc_voodoo.php";
include "./../includes/inc_attack.php";
include "./../includes/inc_mes.php";

switch($mode)
{
default:
print "<u>[Доска почета]</u><br/>";
print "На доске почета написаны имена лучших гангстеров<br/>";
print "<a href=\"rating.php?id=$id&amp;pass=$pass&amp;mode=money\">Самые богатые</a><br/>";
print "<a href=\"rating.php?id=$id&amp;pass=$pass&amp;mode=level\">Самые крутые</a><br/>";
print "<a href=\"rating.php?id=$id&amp;pass=$pass&amp;mode=ref\">Победители мафии</a><br/>";
print "<a href=\"rating.php?id=$id&amp;pass=$pass&amp;mode=cops\">Самые опасные</a><br/>";
print "<a href=\"rating.php?id=$id&amp;pass=$pass&amp;mode=bands\">Самые крутые банды</a><br/>";
print "<a href=\"rating.php?id=$id&amp;pass=$pass&amp;mode=lvl\">Лучшие работники</a><br/><br/>";
break;
case "money":
print "<u>[Самые богатые]</u><br/>";
$pr_q=mysql_query("select login,money,gold from users order by money desc limit 10;");
while($pr_ar=mysql_fetch_array($pr_q))
{
++$i;
print "<b>".$i.".</b>".$pr_ar['login']."<br/>Деньги:<b>".$pr_ar['money']."</b><br/>Золото:<b>".$pr_ar['gold']."</b><br/>-------<br/>";
}
break;
case "level":
print "<u>[Самые крутые]</u><br/>";
$pr_q=mysql_query("select login,level from users order by level desc limit 10;");

while($pr_ar=mysql_fetch_array($pr_q))
{
++$i;
print "<b>".$i.".</b>".$pr_ar['login']."<br/>Авторитет:<b>".$pr_ar['level']."</b><br/>-----<br/>";
}
break;
case "ref":
print "<u>[Победители мафии]</u><br/>";
print "В этот рейтинг попадают гангстеры,выигравшие хотя бы один сезон конкурса \"Борьба с мафией\"<br/>";
$pr_q=mysql_query("select userid,text,date,type from medals where type='7' order by id desc limit 10;");
while($pr_ar=mysql_fetch_array($pr_q))
{
++$i;
$uid=$pr_ar['userid'];
$mtext=$pr_ar['text'];
$mdate=$pr_ar['date'];
$mtype=$pr_ar['type'];
$pr2=mysql_fetch_array(mysql_query("select login from users where id='$uid';"));
$ulogin=$pr2['login'];
print "<b>$i</b>. <b>$ulogin</b><br/><img src='a href=\./../../medals/$mtype.gif' title='$mtext'/>\"$mtext\"<br/>Награжден:$mdate<br/>-----<br/>";
}
break;
case "cops":
print "<u>[Самые опасные]</u><br/>";
$pr_q=mysql_query("select login,police from users order by police desc limit 10;");

while($pr_ar=mysql_fetch_array($pr_q))
{
++$i;
print "<b>".$i.".</b>".$pr_ar['login']."<br/>Преступность:<b>".$pr_ar['police']."</b><br/>-----<br/>";
}
break;
case "bands":
print "<u>[Самые крутые банды]</u><br/>";
$pr_q=mysql_query("select name,boss,blvl from bands order by blvl desc limit 10;");

while($pr_ar=mysql_fetch_array($pr_q))
{
++$i;
print "<b>".$i.".</b>".$pr_ar['name']."<br/>Босс:<b>".$pr_ar['boss']."</b><br/>Уровень:<b>".$pr_ar['blvl']."</b><br/>-----<br/>";
}
break;
case "lvl":
print "<u>[Лучшие работники]</u><br/>";
$pr_q=mysql_query("select login,lvl from users order by lvl desc limit 10;");

while($pr_ar=mysql_fetch_array($pr_q))
{
++$i;
print "<b>".$i.".</b>".$pr_ar['login']."<br/>Рабочий стаж:<b>".$pr_ar['lvl']."</b><br/>-----<br/>";
}
break;
}

print "---<br/>&gt;<a href=\"index.php?id=$id&amp;pass=$pass\">".$lang['in_city']."</a>";
print "<br/>&gt;&gt;<a href=\"./../game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
print "<br/>---";

mysql_close();
include "./../includes/footer2.php";
?>