Файл: play_gamescool/car/rate.php
Строк: 38
<?
include'../core/core.php';
include'../head.php';
if(!isset($u)){
echo 'Вы неавторизованы';
include_once '../../foot.php';
exit;
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `racing` WHERE `id_u`='".$u['id']."'"),0)==0)
mysql_query("INSERT INTO `racing`(`id_u`) VALUES('".$u['id']."')");
$array=mysql_fetch_array(mysql_query("SELECT * FROM `racing` WHERE `id_u`='".$u['id']."'"));
$car=mysql_fetch_array(mysql_query("SELECT * FROM `racing_car` WHERE `id`='".$array['car']."'"));
echo "
<div class='aut'>
| опыт:".$array['exp']."
| ур:".$array['level']."
|<img src='ico/money.gif' alt=''/>".$array['money']."
| реп: ".$array['resp']."</div>
<div class='post'>
Сортировка : <a href='rate.php?sort=1'>Уров</a>|
<a href='rate.php?sort=2'>Побед</a>|
<a href='rate.php?sort=4'>Опыт</a>|
<a href='rate.php?sort=5'>Деньги</a>|
<br/>
<br/>
<div class='aut'>
<img src='ico/bos_rey.png' alt=''/> $u[login] Привет вот рейтинг самых лучших гоншиков города <br/>
</div>
<br/>
";
if(!isset($_GET['sort']))
$sort=1;
else
$sort=abs(intval($_GET['sort']));
$kaktuz_kol=mysql_result(mysql_query("SELECT COUNT(*) FROM `racing`"),0);
$k_page=k_page($kaktuz_kol,10);
$page=page($k_page);
$start=10*$page-10;
if($sort==1 || $sort>8)
$all_kaktuz=mysql_query("SELECT * FROM `racing` ORDER BY `level` DESC LIMIT $start,10");
elseif($sort==2)
$all_kaktuz=mysql_query("SELECT * FROM `racing` ORDER BY `win` DESC LIMIT $start,10");
elseif($sort==3)
$all_kaktuz=mysql_query("SELECT * FROM `racing` ORDER BY `lose` DESC LIMIT $start,10");
elseif($sort==4)
$all_kaktuz=mysql_query("SELECT * FROM `racing` ORDER BY `exp` DESC LIMIT $start,10");
elseif($sort==5)
$all_kaktuz=mysql_query("SELECT * FROM `racing` ORDER BY `money` DESC LIMIT $start,10");
elseif($sort==6)
$all_kaktuz=mysql_query("SELECT * FROM `racing` ORDER BY `resp` DESC LIMIT $start,10");
elseif($sort==7)
$all_kaktuz=mysql_query("SELECT * FROM `racing` ORDER BY `samoobl` DESC LIMIT $start,10");
elseif($sort==8)
$all_kaktuz=mysql_query("SELECT * FROM `racing` ORDER BY `reak` DESC LIMIT $start,10");
while($arr=mysql_fetch_array($all_kaktuz)){
$cars=mysql_fetch_array(mysql_query("SELECT `name` FROM `racing_car` WHERE `id`='".$arr['car']."'"));
echo "<div class='rowup'>Гонщик :
<a href='/info.php?id=".$arr['id_u']."'>".mysql_result(mysql_query("SELECT `login` FROM `users` WHERE `id`='".$arr['id_u']."'"),0)."</a><br/>
<img src='ico/race.gif' alt=''/> Тачка : ".$cars['name']."<br/>
<img src='ico/win.gif' alt=''/> Побед : ".$arr['win']."<br/>
<img src='ico/lose.gif' alt=''/> Поражений : ".$arr['lose']."<br/>
<img src='ico/exp.gif' alt=''/> Опыт : ".$arr['exp']."<br/>
<img src='ico/level.gif' alt=''/> Уровень : ".$arr['level']."<br/>
<img src='ico/money.gif' alt=''/> Деньги : ".$arr['money']."<br/>
<img src='ico/resp.gif' alt=''/> Репутация : ".$arr['resp']."<br/>
";
}
if($k_page>1)str('?sort='.$sort.'&',$k_page,$page);
echo "<div class='aut'><a style='display:block;' href='index.php'><img src='ico/back.png' alt=''/> Назад</a></div>";
include_once '../../foot.php';
?>