Файл: vkollektive2014/play_gamescool/car/update.php
Строк: 36
<?
include_once '../../connect.php';
include_once '../../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']."')");
$arr=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`='".$arr['car']."'"));
echo "
<div class='aut'>
<img src='ico/exp.gif' alt=''/>".$arr['exp']."
<img src='ico/level.gif' alt=''/>".$arr['level']."
<img src='ico/money.gif' alt=''/>".$arr['money']."
<img src='ico/resp.gif' alt=''/>".$arr['resp']."</div>
<center><img src='".$car['screen']."' alt=''/> <br/>".$car['name']."</center>
";
if(($arr['win']>=$arr['nextlevel'] && $arr['level']==0) || ($arr['win']>=$arr['nextlevel'] && $arr['level']==1) ||
($arr['win']>=$arr['nextlevel'] && $arr['level']==2) ||
($arr['win']>=$arr['nextlevel'] && $arr['level']==3) ||
($arr['win']>=$arr['nextlevel'] && $arr['level']==4)){
mysql_query("UPDATE `racing` SET `level`=`level`+1, `nextlevel`=`nextlevel`*3 WHERE `id_u`='".$u['id']."'");
ok('Уровень успешно повышен');
}
else
{
echo "Обновление не доступно<br/>";
}
echo "<div class='aut'><a style='display:block;' href='index.php'><img src='ico/back.png' alt=''/> Назад</a></div>";
include_once '../../foot.php';
?>