Вход Регистрация
Файл: dev/change_car.php
Строк: 215
<?
include_once '../sys/core/start.php';
include_once 
'../sys/core/compress.php';
include_once 
'../sys/core/sess.php';
include_once 
'../sys/core/home.php';
include_once 
'../sys/core/settings.php';
include_once 
'../sys/core/db_connect.php';
include_once 
'../sys/core/ipua.php';
include_once 
'../sys/core/fnc.php';
include_once 
'../sys/core/user.php';
include_once 
'../sys/inc/fnc_game.php';
include_once 
'../sys/inc/thead.php';
include_once 
'../sys/inc/uhead.php';
only_reg();




if(
$count_car <= 1){
header("Location:/dev/garage.php?");
}


if(isset(
$_GET['change']) && intval($_GET['change'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `garage` WHERE `id` = '".intval($_GET['change'])."' AND `id_user` = '".$user['id']."'"),0)!=0)
{
$change_one=mysql_fetch_array(mysql_query("SELECT * FROM `garage` WHERE `id`='".intval($_GET['change'])."' AND `id_user` = '".$user['id']."'"));
if(
$change_one['id_user']==$user['id'])
{
mysql_query("UPDATE `user` SET `car_id` = '".$change_one['id']."' WHERE `id` = '".$user['id']."' LIMIT 1");
header("Location:/dev/garage.php");
}
}


echo 
"<table class='wdt garage-table'><tr><td align='right' style='padding-top: 4px; padding-left: 10px'>";

echo 
"<table class='wdt'>";
echo 
"<tr><td style='vertical-align: top;padding-top: 3px;' align='left' rowspan='4'><table>";


echo 
"</table>";
echo 
"<td align='left' class='white' style='vertical-align: top' width='40%'><b>$mycar[name]</b> <b class='class-$mycar[class] bold-text'>$mycar[class]</b></td></tr>";
echo 
"<tr><td align='left' class='white' style='font-size: 12px'>Рейтинг: <b class='yellow'><img src='/style/img/icons/rating.png' alt='Rating'> $user[rating]</b></td></tr><tr>";

echo 
"<td align='left' style='font-size: 12px'> Бензин: <img src='/style/img/icons/fuel.png' alt='ing'> <b>$user[fuel]/$user[max_fuel]</b></td></tr></table></td></tr><tr><td></td></tr>";

echo 
"<tr><td><table class='wdt'>";
echo 
"<tr><td align='center' style='padding-bottom: 0px; padding-left: 10px; padding-right: 10px;' valign='bottom'></br><img class='wdt' src='/style/img/car/$mycar[screen].png' alt='car'>";

echo 
"<img class='wdt' style='margin-top: -19px;' src='/style/img/images/car_shadow.png' alt='t'></td></tr></table></td></tr></table>";

echo 
"<table class='wdt main-menu'><tr>";

echo 
"<td class='white' align='center' style='width:25%; border-right: solid 1px #bebebf; vertical-align: bottom;'><b><a style='text-decoration: none; color: #000' href='/dev/map.php'><img src='/style/img/icons/map.png'><br>Город</a></b></td>";

echo 
"<td class='white' align='center' style='width:25%; border-right: solid 1px #bebebf; vertical-align: bottom;'><b><a style='text-decoration: none; color: #000' href='/dev/quest.php'><img src='/style/img/icons/quest.png'><br>Задания</a></b></td>";
if(
$user['level']>=5){
echo 
"<td class='white' align='center' style='width:25%; border-right: solid 1px #bebebf; vertical-align: bottom;'><b><a style='text-decoration: none; color: #000' href='/dev/taxi.php'><img src='/style/img/icons/taxi.png'><br>Такси</a></b></td>";
}
if(
mysql_result(mysql_query("SELECT COUNT(*) FROM `turnir` WHERE `time_start` <= '$time' AND `time_end` >= '$time'"),0)!=0)
{
echo 
"<td class='gray' align='center' style='width:25%'><b><a style='text-decoration: none; color: #000' href='/dev/tournament.php'><img src='/style/img/icons/tournament_on.gif'><br>Турнир</a></b></td></tr></table>";
}
else
{
echo 
"<td class='gray' align='center' style='width:25%'><b><a style='text-decoration: none; color: #000' href='/dev/tournament.php'><img src='/style/img/icons/tournament.png'><br>Турнир</a></b></td></tr></table>";
}
echo 
"<table class='wdt gray-table' style='font-size: 10pt'><tr><td colspan='3' style='padding: 0px'>";
echo 
"<table class='wdt brown-header'><tr><td align='left'>Твой автопарк: </td></tr></table></td></tr><tr>";


$k_post mysql_result(mysql_query("SELECT COUNT(*) FROM `garage` WHERE `id_user` = '$user[id]' AND `id` != '$user[car_id]'"),0);
if (
$k_post==0)
{
echo 
"<table class='wdt'>";
echo 
"<td class='white' align='left' style='background-color: #222222'>У тебя лишь одна машина!</td></tr><tr></table>";
}
$q=mysql_query("SELECT * FROM `garage` WHERE `id_user` = '$user[id]' AND `id` != '$user[car_id]' ORDER BY `power` DESC");
while(
$post=mysql_fetch_array($q)){
$stock=$post['stock_power']+1061;
$settuning=$post['power'];
echo 
"<table class='wdt gray-table'><tr>";


echo 
"<td class='white td-cell' colspan='3'><img class='wdt' src='/style/img/car/$post[screen].png' alt=''>";
if(
$post['neon']!=0){
echo 
"<img class='wdt' style='margin-top: -15px;' src='/style/img/images/neon/$post[neon].png' alt='t'>";
}
else
{
echo 
"<img class='wdt' style='margin-top: -15px;' src='/style/img/images/car_shadow.png' alt='t'>";
}

echo 
"</td></td></tr><tr><td class='white' width='60%'><b class='class-$post[class] bold-text'>$post[class]</b> <b>$post[name]</b><br>";

if(
$settuning >= $stock)
{
echo 
"<img src='/style/img/icons/fire.png'>";
}
else
{
echo 
"<img src='/style/img/icons/power.png'>";
}
echo 
"<b class='orange'>$post[power] л.с.</b></td>";
echo 
"<td class='white' width='120px' align='right'>";

if(
$post['gos_region']>0)        
{
if(
$post['gos_region_transit']>0)
{
if(
$post['gos_region']<10)        
{
echo 
"<img width='120' src='http://club2108.ru/numgen/index.php?num=$post[gos_bb_one]$post[gos_number]$post[gos_bb_two]$post[gos_bb_free]0$post[gos_region]&b=7' alt='number'><br/>";
}
else
{
echo 
"<img width='120' src='http://club2108.ru/numgen/index.php?num=$post[gos_bb_one]$post[gos_number]$post[gos_bb_two]$post[gos_bb_free]$post[gos_region]&b=7' alt='number'><br/>";
}
}
else
{
if(
$post['gos_region']<10)        
{
echo 
"<img width='120' src='http://club2108.ru/numgen/index.php?num=$post[gos_bb_one]$post[gos_number]$post[gos_bb_two]$post[gos_bb_free]0$post[gos_region]&b=1' alt='number'><br/>";
}
else
{
echo 
"<img width='120' src='http://club2108.ru/numgen/index.php?num=$post[gos_bb_one]$post[gos_number]$post[gos_bb_two]$post[gos_bb_free]$post[gos_region]&b=1' alt='number'><br/>";
}
}
}


echo 
"</td><td align='right'><a href='/dev/change_car.php?change=".$post['id']."'><img src='/style/img/icons/enter.png' alt='d'></a></td></tr></table>";
}

echo 
"<table class='wdt gray-table'>";
echo 
"<tr><td class='white td-cell' align='center' style='height:30px;'><form action ='/dev/garage.php' method='post'><input class='no-btn' type='submit' value='Назад'></form></td></tr></table>";                                                                                                
include_once 
'../sys/inc/tfoot.php';
                    
?>
Онлайн: 0
Реклама