<?php
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/adm_check.php';
include_once '../sys/inc/user.php';
?>
<title>Супер гонки</title>
<?
?>
<link rel="stylesheet" href="style000.css" type="text/css" />
<?
if(!isset($user)){
echo '<table class="wdt msg-table">
<tr>
<td align="left" style="vertical-align: top; width: 10%">
<img src="icon/face-mex.png">
</td>
<td align="left" style="vertical-align: top">
Играть могут лишь зарегистрированные пользователи!</td>
</tr>
</table>';
exit;
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `supergonki` WHERE `id_u`='".$user['id']."'"),0)==0)
mysql_query("INSERT INTO `supergonki`(`id_u`) VALUES('".$user['id']."')");
  $arr=mysql_fetch_array(mysql_query("SELECT * FROM `supergonki` WHERE `id_u`='".$user['id']."'"));
   $car=mysql_fetch_array(mysql_query("SELECT * FROM `super_car` WHERE `id`='".$arr['car']."'"));
if($arr['color']!='0'){
if($arr['color']==1)
$color='red_';
elseif($arr['color']==2)
$color='blue_';
elseif($arr['color']==3)
$color='green_'; 
}

?>

<table class="wdt black">
<tr>
<td class="yellow" align="left" style="vertical-align: top; padding-bottom: 0px">
<img src="icon/fuelico.png"><span id="FUELCNT">
<?
echo"".$arr['exp']."";
?>
</span>
</td>
<td class="orange" align="left"  style="vertical-align: top;  padding-bottom: 0px">
<img src="icon/2.png">
<?
echo"".$arr['speed']."";
?> км.ч.
</td>
<td class="white"  style="vertical-align: top;  padding-bottom: 0px">
ур.
<?
echo"".$arr['level']."";
?>
</td>
<td class="white" align="right"  style="vertical-align: top; padding-bottom: 0px">
<img src="icon/1.png">
<?
echo"".$arr['money']."";
?>
</td>
<td class="green" align="right"  style="vertical-align: top; padding-bottom: 0px">
<img src="icon/goldico.png">
<?
echo"".$user['balls']."";
?>
</td>
</tr>
<tr>
<td align="left" class="white" style="vertical-align: top; padding: 0px; height: 3px" colspan="5" height="3px">
<img src="icon/expline.png" width="35%" height="3px" style="height: 3px;">
</td>
</tr>
</table>

<table class="wdt black" style="border-bottom: 1px solid #767676;">
<tr>
<td class="white" align="left" style="padding-top: 0px;">
<a class="green" style="font-weight: bold;" href="index.php">Гараж</a>
</td>
<td class="white" align="left" style="padding-top: 0px;">
<a class="white" href="race.php">Гонки</a>
</td>
<td class="gray" align="left" style="padding-top: 0px;">
<a class="white" href="bank.php">Дилер</a>
</td>
<td class="gray" align="right" style="padding-top: 0px;">
<a class="white" href="rate.php">Топ</a>
</td>
</tr>
</table>




<?
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `supergonki` WHERE `id_u`='".$user['id']."'"),0)==0)
mysql_query("INSERT INTO `supergonki`(`id_u`) VALUES('".$user['id']."')");
  $arr=mysql_fetch_array(mysql_query("SELECT * FROM `supergonki` WHERE `id_u`='".$user['id']."'"));
  $car=mysql_fetch_array(mysql_query("SELECT * FROM `super_car` WHERE `id`='".$arr['car']."'")); 
  if($arr['color']!='0'){
if($arr['color']==1)
$color='red_';
elseif($arr['color']==2)
$color='blue_';
elseif($arr['color']==3)
$color='green_'; 
}
if(isset($_GET['tun'])){
if(isset($_GET['cz'])){
?>
<table class="wdt msg-table">
<tr>
<td align="left" style="vertical-align: top; width: 10%">
<img src="icon/face-mex.png">
</td>
<td align="left" style="vertical-align: top">
Здесь ты можешь улучшить cцепление на своей машине!</br>
<?
if(isset($_POST['submit'])){
if($arr['cz']<6){
if($arr['money']>=intval($arr['cz']*2700)){
mysql_query("UPDATE `supergonki` SET `speed`=`speed`+".($arr['cz']*7).", `uprav`=`uprav`+".intval($arr['cz']*4).", `money`=`money`-".($arr['cz']*2700).", `cz`=`cz`+1 WHERE `id_u`='".$user['id']."'");
msg('Тюнинг прошел успешно!');
}
else
{
echo "Нехватает денег для покупки<br/>";
}}
else
{
echo "Детали успешно обновлены до самого высокого уровня<br/>";
}
}
?>

</td>
</tr>
</table>

<table class="wdt garage-table">
<tr>
<td align="right"  style="padding-top: 10px;">
<table class="wdt">
<tr>
<td style="vertical-align: top; padding-left: 10px;" align="left" rowspan="4">
</td>
<td align="left" class="white" style="vertical-align: top" width="40%"><b>
<?
echo"".$car['name']."";
?>
</b>
</td>
</tr>
<tr>
<td align="left" class="white" nowrap="nowrap" style="font-size: 14px">Мощность:&nbsp;<img src="icon/power-ic.png"><b class="orange">
<?
echo"".$arr['speed']."";
?> км.ч.</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Уровень: <img src="icon/raiting-.png"><b class="yellow">
<?
echo"".$arr['level']."";
?>
</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Опыт: <img src="icon/fuel-ico.png"><b class="yellow" style="color: #000"><span id="FUELTIME">
<?
echo"".$arr['exp']."";
?></span></b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" style="padding-bottom: 0px; padding-left: 10px; padding-right: 10px;" valign="bottom">
<?
echo"<img class='wdt' src='car/".(isset($color) ? "".$color."".$car['screen']."" : "".$car['screen']."")."' alt=''/> <br/>";
?>
</br>
<img class="wdt" style="margin-top: -18px;" src="icon/car_shad.png">
</td>
</tr>
</table>
<table class="wdt main-menu">
<tr>
<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="gorod.php"><img src="icon/map-ico0.png"><br>
Город</a></b>
</td>

<td class="gray" align="center" style="width:25%; border-right: solid 1px #bebebf; vertical-align: bottom;">
</td>
<td class="gray" align="center" style="width:25%">
</td>
</tr>
</table>


<table class="wdt gray-table" style="font-size: 10pt">
</table>
<table class="wdt brown-header">
<tr>
<td align="left">Детали улучшают характеристики:</td>
</tr>
</table>




<table class="wdt gray-table" style="font-size: 10pt">
<tr>
<td class="white td-cell" align="center" style="width: 60px; padding-right: 0px">
<img src="ico/cz.png">
</td>
<td class="td-cell white" align="left" style="vertical-align: top">
<br>
<img src="icon/power-ic.png"><b class="orange">
Сцепление
</b><br>
<img src="icon/power-wh.png">
<b><?
echo"".$arr['cz']."";
?> уровень </b><br>
<img src="icon/power-wh.png">
<b>скорость + <?
echo"".intval($arr['cz']*7)."";
?> </b><br>
<img src="icon/money-ic.png">
<b class="orange"><?
echo"".intval($arr['cz']*2700)."";
?> </b><br>
</td>
<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">
<form action="index.php?tun&amp;cz" method="post">
<input type="submit" name='submit' class="upgrade-btn" value="Улучшить">
</form>
</td>
</tr>
</table>

<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php?tun" method="post">
<input type="submit" class="wdt race-btn" value="Тюнинг"/>
</form>
</td>
</tr>
</table>
<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php" method="post">
<input type="submit" class="wdt race-btn" value="В гараж"/>
</form>
</td>
</tr>
</table>
<?


exit;
}


if(isset($_GET['vpusk'])){

?>
<table class="wdt msg-table">
<tr>
<td align="left" style="vertical-align: top; width: 10%">
<img src="icon/face-mex.png">
</td>
<td align="left" style="vertical-align: top">
Здесь ты можешь улучшить Впрыск на своей машине!</br>
<?

if(isset($_POST['submit'])){
if($arr['vpusk']<6){
if($arr['money']>=intval($arr['vpusk']*2500)){
mysql_query("UPDATE `supergonki` SET `speed`=`speed`+".($arr['vpusk']*7).", `uprav`=`uprav`+".intval($arr['vpusk']*1).", `money`=`money`-".($arr['vpusk']*2500).", `vpusk`=`vpusk`+1 WHERE `id_u`='".$user['id']."'");
msg('Тюнинг прошел успешно!');
}
else
{
echo "Нехватает денег для покупки<br/>";
}}
else
{
echo "Детали успешно обновлены до последнего уровня<br/>";
}
}
?>

</td>
</tr>
</table>

<table class="wdt garage-table">
<tr>
<td align="right"  style="padding-top: 10px;">
<table class="wdt">
<tr>
<td style="vertical-align: top; padding-left: 10px;" align="left" rowspan="4">
</td>
<td align="left" class="white" style="vertical-align: top" width="40%"><b>
<?
echo"".$car['name']."";
?>
</b>
</td>
</tr>
<tr>
<td align="left" class="white" nowrap="nowrap" style="font-size: 14px">Мощность:&nbsp;<img src="icon/power-ic.png"><b class="orange">
<?
echo"".$arr['speed']."";
?> км.ч.</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Уровень: <img src="icon/raiting-.png"><b class="yellow">
<?
echo"".$arr['level']."";
?>
</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Опыт: <img src="icon/fuel-ico.png"><b class="yellow" style="color: #000"><span id="FUELTIME">
<?
echo"".$arr['exp']."";
?></span></b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" style="padding-bottom: 0px; padding-left: 10px; padding-right: 10px;" valign="bottom">
<?
echo"<img class='wdt' src='car/".(isset($color) ? "".$color."".$car['screen']."" : "".$car['screen']."")."' alt=''/> <br/>";
?>
</br>
<img class="wdt" style="margin-top: -18px;" src="icon/car_shad.png">
</td>
</tr>
</table>
<table class="wdt main-menu">
<tr>
<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="gorod.php"><img src="icon/map-ico0.png"><br>
Город</a></b>
</td>

<td class="gray" align="center" style="width:25%; border-right: solid 1px #bebebf; vertical-align: bottom;">
</td>
<td class="gray" align="center" style="width:25%">
</td>
</tr>
</table>


<table class="wdt gray-table" style="font-size: 10pt">
</table>
<table class="wdt brown-header">
<tr>
<td align="left">Детали улучшают характеристики:</td>
</tr>
</table>




<table class="wdt gray-table" style="font-size: 10pt">
<tr>
<td class="white td-cell" align="center" style="width: 60px; padding-right: 0px">
<img src="ico/vpusk.png">
</td>
<td class="td-cell white" align="left" style="vertical-align: top">
<br>
<img src="icon/power-ic.png"><b class="orange">
Впрыск
</b><br>
<img src="icon/power-wh.png">
<b><?
echo"".$arr['vpusk']."";
?> уровень </b><br>
<img src="icon/power-wh.png">
<b>скорость + <?
echo"".intval($arr['vpusk']*7)."";
?> </b><br>
<img src="icon/money-ic.png">
<b class="orange"><?
echo"".intval($arr['vpusk']*2500)."";
?> </b><br>
</td>
<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">
<form action="index.php?tun&amp;vpusk" method="post">
<input type="submit" name='submit' class="upgrade-btn" value="Улучшить">
</form>
</td>
</tr>
</table>


<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php?tun" method="post">
<input type="submit" class="wdt race-btn" value="Тюнинг"/>
</form>
</td>
</tr>
</table>
<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php" method="post">
<input type="submit" class="wdt race-btn" value="В гараж"/>
</form>
</td>
</tr>
</table>
<?
exit;
}
if(isset($_GET['podv'])){

?>
<table class="wdt msg-table">
<tr>
<td align="left" style="vertical-align: top; width: 10%">
<img src="icon/face-mex.png">
</td>
<td align="left" style="vertical-align: top">
Здесь ты можешь улучшить Подвеску на своей машине!</br>
<?

if(isset($_POST['submit'])){
if($arr['podv']<6){
if($arr['money']>=intval($arr['podv']*1000)){
mysql_query("UPDATE `supergonki` SET `speed`=`speed`+".($arr['podv']*2).", `uprav`=`uprav`+".intval($arr['podv']*5).", `money`=`money`-".($arr['podv']*1000).", `podv`=`podv`+1 WHERE `id_u`='".$user['id']."'");
msg('Тюнинг прошел успешно!');
}
else
{
echo "Нехватает денег для покупки<br/>";
}}
else
{
echo "Детали успешно обновленны до последнего уровня<br/>";
}
}

?>

</td>
</tr>
</table>

<table class="wdt garage-table">
<tr>
<td align="right"  style="padding-top: 10px;">
<table class="wdt">
<tr>
<td style="vertical-align: top; padding-left: 10px;" align="left" rowspan="4">
</td>
<td align="left" class="white" style="vertical-align: top" width="40%"><b>
<?
echo"".$car['name']."";
?>
</b>
</td>
</tr>
<tr>
<td align="left" class="white" nowrap="nowrap" style="font-size: 14px">Мощность:&nbsp;<img src="icon/power-ic.png"><b class="orange">
<?
echo"".$arr['speed']."";
?> км.ч.</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Уровень: <img src="icon/raiting-.png"><b class="yellow">
<?
echo"".$arr['level']."";
?>
</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Опыт: <img src="icon/fuel-ico.png"><b class="yellow" style="color: #000"><span id="FUELTIME">
<?
echo"".$arr['exp']."";
?></span></b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" style="padding-bottom: 0px; padding-left: 10px; padding-right: 10px;" valign="bottom">
<?
echo"<img class='wdt' src='car/".(isset($color) ? "".$color."".$car['screen']."" : "".$car['screen']."")."' alt=''/> <br/>";
?>
</br>
<img class="wdt" style="margin-top: -18px;" src="icon/car_shad.png">
</td>
</tr>
</table>
<table class="wdt main-menu">
<tr>
<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="gorod.php"><img src="icon/map-ico0.png"><br>
Город</a></b>
</td>

<td class="gray" align="center" style="width:25%; border-right: solid 1px #bebebf; vertical-align: bottom;">
</td>
<td class="gray" align="center" style="width:25%">
</td>
</tr>
</table>


<table class="wdt gray-table" style="font-size: 10pt">
</table>
<table class="wdt brown-header">
<tr>
<td align="left">Детали улучшают характеристики:</td>
</tr>
</table>




<table class="wdt gray-table" style="font-size: 10pt">
<tr>
<td class="white td-cell" align="center" style="width: 60px; padding-right: 0px">
<img src="ico/podv.png">
</td>
<td class="td-cell white" align="left" style="vertical-align: top">
<br>
<img src="icon/power-ic.png"><b class="orange">
Подвеска
</b><br>
<img src="icon/power-wh.png">
<b><?
echo"".$arr['podv']."";
?> уровень </b><br>
<img src="icon/power-wh.png">
<b>скорость + <?
echo"".intval($arr['podv']*5)."";
?> </b><br>
<img src="icon/money-ic.png">
<b class="orange"><?
echo"".intval($arr['podv']*1000)."";
?> </b><br>
</td>
<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">
<form action="index.php?tun&amp;podv" method="post">
<input type="submit" name='submit' class="upgrade-btn" value="Улучшить">
</form>
</td>
</tr>
</table>

<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php?tun" method="post">
<input type="submit" class="wdt race-btn" value="Тюнинг"/>
</form>
</td>
</tr>
</table>
<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php" method="post">
<input type="submit" class="wdt race-btn" value="В гараж"/>
</form>
</td>
</tr>
</table>
<?
exit;
}
if(isset($_GET['za'])){

?>
<table class="wdt msg-table">
<tr>
<td align="left" style="vertical-align: top; width: 10%">
<img src="icon/face-mex.png">
</td>
<td align="left" style="vertical-align: top">
Здесь ты можешь улучшить Зажигание на своей машине!</br>
<?

if(isset($_POST['submit'])){
if($arr['za']<6){
if($arr['money']>=intval($arr['za']*1000)){
mysql_query("UPDATE `supergonki` SET `speed`=`speed`+".($arr['za']*5).", `uprav`=`uprav`+".intval($arr['za']*1).", `money`=`money`-".($arr['za']*1000).", `za`=`za`+1 WHERE `id_u`='".$user['id']."'");
msg('Тюнинг прошел успешно!');
}
else
{
echo "Нехватает денег для покупки<br/>";
}}
else
{
echo "Детали успешно обновлены до последнего уровня<br/>";
}
}

?>

</td>
</tr>
</table>

<table class="wdt garage-table">
<tr>
<td align="right"  style="padding-top: 10px;">
<table class="wdt">
<tr>
<td style="vertical-align: top; padding-left: 10px;" align="left" rowspan="4">
</td>
<td align="left" class="white" style="vertical-align: top" width="40%"><b>
<?
echo"".$car['name']."";
?>
</b>
</td>
</tr>
<tr>
<td align="left" class="white" nowrap="nowrap" style="font-size: 14px">Мощность:&nbsp;<img src="icon/power-ic.png"><b class="orange">
<?
echo"".$arr['speed']."";
?> км.ч.</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Уровень: <img src="icon/raiting-.png"><b class="yellow">
<?
echo"".$arr['level']."";
?>
</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Опыт: <img src="icon/fuel-ico.png"><b class="yellow" style="color: #000"><span id="FUELTIME">
<?
echo"".$arr['exp']."";
?></span></b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" style="padding-bottom: 0px; padding-left: 10px; padding-right: 10px;" valign="bottom">
<?
echo"<img class='wdt' src='car/".(isset($color) ? "".$color."".$car['screen']."" : "".$car['screen']."")."' alt=''/> <br/>";
?>
</br>
<img class="wdt" style="margin-top: -18px;" src="icon/car_shad.png">
</td>
</tr>
</table>
<table class="wdt main-menu">
<tr>
<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="gorod.php"><img src="icon/map-ico0.png"><br>
Город</a></b>
</td>

<td class="gray" align="center" style="width:25%; border-right: solid 1px #bebebf; vertical-align: bottom;">
</td>
<td class="gray" align="center" style="width:25%">
</td>
</tr>
</table>


<table class="wdt gray-table" style="font-size: 10pt">
</table>
<table class="wdt brown-header">
<tr>
<td align="left">Детали улучшают характеристики:</td>
</tr>
</table>


<table class="wdt gray-table" style="font-size: 10pt">
<tr>
<td class="white td-cell" align="center" style="width: 60px; padding-right: 0px">
<img src="ico/za.png">
</td>
<td class="td-cell white" align="left" style="vertical-align: top">
<br>
<img src="icon/power-ic.png"><b class="orange">
Зажигание
</b><br>
<img src="icon/power-wh.png">
<b><?
echo"".$arr['za']."";
?> уровень </b><br>
<img src="icon/power-wh.png">
<b>скорость + <?
echo"".intval($arr['za']*5)."";
?> </b><br>
<img src="icon/money-ic.png">
<b class="orange"><?
echo"".intval($arr['za']*1000)."";
?> </b><br>
</td>
<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">
<form action="index.php?tun&amp;za" method="post">
<input type="submit" name='submit' class="upgrade-btn" value="Улучшить">
</form>
</td>
</tr>
</table>

<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php?tun" method="post">
<input type="submit" class="wdt race-btn" value="Тюнинг"/>
</form>
</td>
</tr>
</table>
<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php" method="post">
<input type="submit" class="wdt race-btn" value="В гараж"/>
</form>
</td>
</tr>
</table>
<?
exit;
}
if(isset($_GET['zak'])){

?>
<table class="wdt msg-table">
<tr>
<td align="left" style="vertical-align: top; width: 10%">
<img src="icon/face-mex.png">
</td>
<td align="left" style="vertical-align: top">
Здесь ты можешь купить Азот для своей машины!</br>
<?

if(isset($_POST['submit'])){
if($arr['zak']<6){
if($arr['money']>=intval($arr['zak']*1500)){
mysql_query("UPDATE `supergonki` SET `speed`=`speed`+".($arr['zak']*5).", `uprav`=`uprav`+".intval($arr['zak']*1).", `money`=`money`-".($arr['zak']*1500).", `zak`=`zak`+1 WHERE `id_u`='".$user['id']."'");
msg('Тюнинг прошел успешно!');
}
else
{
echo "Нехватает денег для покупки<br/>";
}}
else
{
echo "Детали успешно обновлены до последнего уровня<br/>";
}
}

?>

</td>
</tr>
</table>

<table class="wdt garage-table">
<tr>
<td align="right"  style="padding-top: 10px;">
<table class="wdt">
<tr>
<td style="vertical-align: top; padding-left: 10px;" align="left" rowspan="4">
</td>
<td align="left" class="white" style="vertical-align: top" width="40%"><b>
<?
echo"".$car['name']."";
?>
</b>
</td>
</tr>
<tr>
<td align="left" class="white" nowrap="nowrap" style="font-size: 14px">Мощность:&nbsp;<img src="icon/power-ic.png"><b class="orange">
<?
echo"".$arr['speed']."";
?> км.ч.</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Уровень: <img src="icon/raiting-.png"><b class="yellow">
<?
echo"".$arr['level']."";
?>
</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Опыт: <img src="icon/fuel-ico.png"><b class="yellow" style="color: #000"><span id="FUELTIME">
<?
echo"".$arr['exp']."";
?></span></b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" style="padding-bottom: 0px; padding-left: 10px; padding-right: 10px;" valign="bottom">
<?
echo"<img class='wdt' src='car/".(isset($color) ? "".$color."".$car['screen']."" : "".$car['screen']."")."' alt=''/> <br/>";
?>
</br>
<img class="wdt" style="margin-top: -18px;" src="icon/car_shad.png">
</td>
</tr>
</table>
<table class="wdt main-menu">
<tr>
<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="gorod.php"><img src="icon/map-ico0.png"><br>
Город</a></b>
</td>

<td class="gray" align="center" style="width:25%; border-right: solid 1px #bebebf; vertical-align: bottom;">
</td>
<td class="gray" align="center" style="width:25%">
</td>
</tr>
</table>


<table class="wdt gray-table" style="font-size: 10pt">
</table>
<table class="wdt brown-header">
<tr>
<td align="left">Детали улучшают характеристики:</td>
</tr>
</table>



<table class="wdt gray-table" style="font-size: 10pt">
<tr>
<td class="white td-cell" align="center" style="width: 60px; padding-right: 0px">
<img src="ico/zak.png">
</td>
<td class="td-cell white" align="left" style="vertical-align: top">
<br>
<img src="icon/power-ic.png"><b class="orange">
Азот
</b><br>
<img src="icon/power-wh.png">
<b><?
echo"".$arr['zak']."";
?> уровень </b><br>
<img src="icon/power-wh.png">
<b>скорость + <?
echo"".intval($arr['zak']*5)."";
?> </b><br>
<img src="icon/money-ic.png">
<b class="orange"><?
echo"".intval($arr['zak']*1500)."";
?> </b><br>
</td>
<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">
<form action="index.php?tun&amp;zak" method="post">
<input type="submit" name='submit' class="upgrade-btn" value="Улучшить">
</form>
</td>
</tr>
</table>


<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php?tun" method="post">
<input type="submit" class="wdt race-btn" value="Тюнинг"/>
</form>
</td>
</tr>
</table>
<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php" method="post">
<input type="submit" class="wdt race-btn" value="В гараж"/>
</form>
</td>
</tr>
</table>
<?
exit;
}
if(isset($_GET['shina'])){

?>
<table class="wdt msg-table">
<tr>
<td align="left" style="vertical-align: top; width: 10%">
<img src="icon/face-mex.png">
</td>
<td align="left" style="vertical-align: top">
Здесь ты можешь улучшить Шины на своей машине!</br>
<?

if(isset($_POST['submit'])){
if($arr['shina']<6){
if($arr['money']>=intval($arr['shina']*500)){
mysql_query("UPDATE `supergonki` SET `speed`=`speed`+".($arr['shina']*2).", `uprav`=`uprav`+".intval($arr['shina']*3).", `money`=`money`-".($arr['shina']*500).", `shina`=`shina`+1 WHERE `id_u`='".$user['id']."'");
msg('Тюнинг прошел успешно!');
}
else
{
echo "Нехватает денег для покупки<br/>";
}
}
else
{
echo "Детали успешно обновлены до последнего уровня<br/>";
}
}

?>

</td>
</tr>
</table>

<table class="wdt garage-table">
<tr>
<td align="right"  style="padding-top: 10px;">
<table class="wdt">
<tr>
<td style="vertical-align: top; padding-left: 10px;" align="left" rowspan="4">
</td>
<td align="left" class="white" style="vertical-align: top" width="40%"><b>
<?
echo"".$car['name']."";
?>
</b>
</td>
</tr>
<tr>
<td align="left" class="white" nowrap="nowrap" style="font-size: 14px">Мощность:&nbsp;<img src="icon/power-ic.png"><b class="orange">
<?
echo"".$arr['speed']."";
?> км.ч.</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Уровень: <img src="icon/raiting-.png"><b class="yellow">
<?
echo"".$arr['level']."";
?>
</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Опыт: <img src="icon/fuel-ico.png"><b class="yellow" style="color: #000"><span id="FUELTIME">
<?
echo"".$arr['exp']."";
?></span></b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" style="padding-bottom: 0px; padding-left: 10px; padding-right: 10px;" valign="bottom">
<?
echo"<img class='wdt' src='car/".(isset($color) ? "".$color."".$car['screen']."" : "".$car['screen']."")."' alt=''/> <br/>";
?>
</br>
<img class="wdt" style="margin-top: -18px;" src="icon/car_shad.png">
</td>
</tr>
</table>
<table class="wdt main-menu">
<tr>
<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="gorod.php"><img src="icon/map-ico0.png"><br>
Город</a></b>
</td>

<td class="gray" align="center" style="width:25%; border-right: solid 1px #bebebf; vertical-align: bottom;">
</td>
<td class="gray" align="center" style="width:25%">
</td>
</tr>
</table>


<table class="wdt gray-table" style="font-size: 10pt">
</table>
<table class="wdt brown-header">
<tr>
<td align="left">Детали улучшают характеристики:</td>
</tr>
</table>


<table class="wdt gray-table" style="font-size: 10pt">
<tr>
<td class="white td-cell" align="center" style="width: 60px; padding-right: 0px">
<img src="ico/shina.png">
</td>
<td class="td-cell white" align="left" style="vertical-align: top">
<br>
<img src="icon/power-ic.png"><b class="orange">
Шины
</b><br>
<img src="icon/power-wh.png">
<b><?
echo"".$arr['shina']."";
?> уровень </b><br>
<img src="icon/power-wh.png">
<b>скорость + <?
echo"".intval($arr['shina']*2)."";
?> </b><br>
<img src="icon/money-ic.png">
<b class="orange"><?
echo"".intval($arr['shina']*500)."";
?> </b><br>
</td>
<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">
<form action="index.php?tun&amp;shina" method="post">
<input type="submit" name='submit' class="upgrade-btn" value="Улучшить">
</form>
</td>
</tr>
</table>
<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php?tun" method="post">
<input type="submit" class="wdt race-btn" value="Тюнинг"/>
</form>
</td>
</tr>
</table>
<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php" method="post">
<input type="submit" class="wdt race-btn" value="В гараж"/>
</form>
</td>
</tr>
</table>
<?
exit;
}
?>
<table class="wdt msg-table">
<tr>
<td align="left" style="vertical-align: top; width: 10%">
<img src="icon/face-mex.png">
</td>
<td align="left" style="vertical-align: top">
Здесь ты можешь улучшить свою машину!</td>
</tr>
</table>

<table class="wdt garage-table">
<tr>
<td align="right"  style="padding-top: 10px;">
<table class="wdt">
<tr>
<td style="vertical-align: top; padding-left: 10px;" align="left" rowspan="4">
</td>
<td align="left" class="white" style="vertical-align: top" width="40%"><b>
<?
echo"".$car['name']."";
?>
</b>
</td>
</tr>
<tr>
<td align="left" class="white" nowrap="nowrap" style="font-size: 14px">Мощность:&nbsp;<img src="icon/power-ic.png"><b class="orange">
<?
echo"".$arr['speed']."";
?> км.ч.</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Уровень: <img src="icon/raiting-.png"><b class="yellow">
<?
echo"".$arr['level']."";
?>
</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Опыт: <img src="icon/fuel-ico.png"><b class="yellow" style="color: #000"><span id="FUELTIME">
<?
echo"".$arr['exp']."";
?></span></b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" style="padding-bottom: 0px; padding-left: 10px; padding-right: 10px;" valign="bottom">
<?
echo"<img class='wdt' src='car/".(isset($color) ? "".$color."".$car['screen']."" : "".$car['screen']."")."' alt=''/> <br/>";
?>
</br>
<img class="wdt" style="margin-top: -18px;" src="icon/car_shad.png">
</td>
</tr>
</table>
<table class="wdt main-menu">
<tr>
<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="gorod.php"><img src="icon/map-ico0.png"><br>
Город</a></b>
</td>

<td class="gray" align="center" style="width:25%; border-right: solid 1px #bebebf; vertical-align: bottom;">
</td>
<td class="gray" align="center" style="width:25%">
</td>
</tr>
</table>


<table class="wdt gray-table" style="font-size: 10pt">
</table>
<table class="wdt brown-header">
<tr>
<td align="left">Детали улучшают характеристики:</td>
</tr>
</table>


<table class="wdt gray-table" style="font-size: 10pt"><tr>

<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">




<table class="wdt gray-table" style="font-size: 10pt">
<tr>
<td class="white td-cell" align="center" style="width: 60px; padding-right: 0px">
<img src="ico/shina.png">
</td>
<td class="td-cell white" align="left" style="vertical-align: top">
<br>
<img src="icon/power-ic.png"><b class="orange">
Шины</b><br>
<img src="icon/power-wh.png">
<b><?
echo"".$arr['shina']."";
?> уровень </b>
</td>
<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">
<form action="?tun&amp;shina" method="post">
<input type="submit" class="upgrade-btn" value="Улучшить">
</form>
</td>
</tr>

<table class="wdt gray-table" style="font-size: 10pt">
<tr>
<td class="white td-cell" align="center" style="width: 60px; padding-right: 0px">
<img src="ico/zak.png">
</td>
<td class="td-cell white" align="left" style="vertical-align: top">
<br>
<img src="icon/power-ic.png"><b class="orange">
Азот
</b><br>
<img src="icon/power-wh.png">
<b><?
echo"".$arr['zak']."";
?> уровень </b><br>
</td>
<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">
<form action="?tun&amp;zak" method="post">
<input type="submit" class="upgrade-btn" value="Улучшить">
</form>
</td>
</tr>

<table class="wdt gray-table" style="font-size: 10pt">
<tr>
<td class="white td-cell" align="center" style="width: 60px; padding-right: 0px">
<img src="ico/podv.png">
</td>
<td class="td-cell white" align="left" style="vertical-align: top">
<br>
<img src="icon/power-ic.png"><b class="orange">
Подвеска
</b><br>
<img src="icon/power-wh.png">
<b><?
echo"".$arr['podv']."";
?> уровень </b><br>
</td>
<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">
<form action="?tun&amp;podv" method="post">
<input type="submit" class="upgrade-btn" value="Улучшить">
</form>
</td>
</tr>

<table class="wdt gray-table" style="font-size: 10pt">
<tr>
<td class="white td-cell" align="center" style="width: 60px; padding-right: 0px">
<img src="ico/vpusk.png">
</td>
<td class="td-cell white" align="left" style="vertical-align: top">
<br>
<img src="icon/power-ic.png"><b class="orange">
Впрыск
</b><br>
<img src="icon/power-wh.png">
<b><?
echo"".$arr['vpusk']."";
?> уровень </b><br>
</td>
<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">
<form action="?tun&amp;vpusk" method="post">
<input type="submit" class="upgrade-btn" value="Улучшить">
</form>
</td>
</tr>

<table class="wdt gray-table" style="font-size: 10pt">
<tr>
<td class="white td-cell" align="center" style="width: 60px; padding-right: 0px">
<img src="ico/cz.png">
</td>
<td class="td-cell white" align="left" style="vertical-align: top">
<br>
<img src="icon/power-ic.png"><b class="orange">
Сцепление
</b><br>
<img src="icon/power-wh.png">
<b><?
echo"".$arr['cz']."";
?> уровень </b><br>
</td>
<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">
<form action="?tun&amp;cz" method="post">
<input type="submit" class="upgrade-btn" value="Улучшить">
</form>
</td>
</tr>

<table class="wdt gray-table" style="font-size: 10pt">
<tr>
<td class="white td-cell" align="center" style="width: 60px; padding-right: 0px">
<img src="ico/za.png">
</td>
<td class="td-cell white" align="left" style="vertical-align: top">
<br>
<img src="icon/power-ic.png"><b class="orange">
Зажигание</b><br>
<img src="icon/power-wh.png">
<b><?
echo"".$arr['za']."";
?> уровень </b><br>
</td>
<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">
<form action="?tun&amp;za" method="post">
<input type="submit" class="upgrade-btn" value="Улучшить">
</form>
</td>
</tr>
<tr>
</table>
</table>

</td>
</tr>
</table>


<tr>
<td class="white td-cell" align="center" style="height:30px;">
<form action="" method="get">
<input type="submit" class="wdt race-btn" value="В гараж"/>
</form>
</td>
</tr>
</table>


<?
}
?>
<?
if(isset($_GET['sost'])){
?>
<table class="wdt green-table">
<tr>
<td class="white td-cell" align="left" style="width: 140px">
<table>
<table class="wdt green-header">
<tr>
<td align="left">Состояние авто:</td>
</tr>
</table>


<?
echo "
<img src='icon/point-ic.png' alt=''/> Скорость : ".$arr['speed']." км/ч<br/>
<img src='icon/point-ic.png' alt=''/> Управление : ".$arr['uprav']."<br/>
<img src='icon/point-ic.png' alt=''/> Окись азота : ".$arr['zak']." ур<br/>
<img src='icon/point-ic.png' alt=''/> Сцепление : ".$arr['cz']." ур<br/>
<img src='icon/point-ic.png' alt=''/> Подвеска : ".$arr['podv']." ур<br/>
<img src='icon/point-ic.png' alt=''/> Впрыск : ".$arr['vpusk']." ур<br/>
<img src='icon/point-ic.png' alt=''/> Шины : ".$arr['shina']." ур<br/>
<img src='icon/point-ic.png' alt=''/> Зажигание : ".$arr['za']." ур<br/>";
?>
<table class="wdt green-header">
<tr>
<td align="left">Гонщик:</td>
</tr>
</table>
<?
echo"
<img src='icon/point-ic.png' alt=''/> Побед : ".$arr['win']."/".$arr['nextlevel']." ".($arr['win']>=$arr['nextlevel'] ? "" : "")."<br/>
<img src='icon/point-ic.png' alt=''/> Поражений : ".$arr['lose']."<br/>
<img src='icon/point-ic.png' alt=''/> Опыт : ".$arr['exp']."<br/>
<img src='icon/point-ic.png' alt=''/> Уровень : ".$arr['level']."<br/>
<img src='icon/point-ic.png' alt=''/> Деньги : ".$arr['money']."<br/>
<img src='icon/point-ic.png' alt=''/> Репутация : ".$arr['resp']."<br/>
<img src='icon/point-ic.png' alt=''/> Самообладание : ".$arr['samoobl']."<br/>
<img src='icon/point-ic.png' alt=''/> Реакция : ".$arr['reak']."</div>";
?>
</td>
</table>
<td class="white td-cell" align="center" style="height:30px;">
<form action="index.php" method="get">
<input type="submit" class="wdt race-btn" value="В гараж"/>
</form>
</td>
</tr>
</table>
<?
}


 if(!isset($_GET['tun']) && !isset($_GET['sost']) && !isset($_GET['color'])){

?>

<table class="wdt msg-table">
<tr>
<td align="left" style="vertical-align: top; width: 10%">
<img src="icon/face-mex.png">
</td>
<td align="left" style="vertical-align: top">
В гараже ты можешь улучшить, посмотреть состояние своей машины! </br></td>
</tr>
</table>

<table class="wdt garage-table">
<tr>
<td align="right"  style="padding-top: 10px;">
<table class="wdt">
<tr>
<td style="vertical-align: top; padding-left: 10px;" align="left" rowspan="4">
</td>
<td align="left" class="white" style="vertical-align: top" width="40%"><b>
<?
echo"".$car['name']."";
?>
</b>
</td>
</tr>
<tr>
<td align="left" class="white" nowrap="nowrap" style="font-size: 14px">Мощность:&nbsp;<img src="icon/power-ic.png"><b class="orange">
<?
echo"".$arr['speed']."";
?> км.ч.</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Уровень: <img src="icon/raiting-.png"><b class="yellow">
<?
echo"".$arr['level']."";
?>
</b></td>
</tr>
<tr>
<td align="left" class="white" style="font-size: 14px">Опыт: <img src="icon/fuel-ico.png"><b class="yellow" style="color: #000"><span id="FUELTIME">
<?
echo"".$arr['exp']."";
?></span></b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" style="padding-bottom: 0px; padding-left: 10px; padding-right: 10px;" valign="bottom">
<?
echo"<img class='wdt' src='car/".(isset($color) ? "".$color."".$car['screen']."" : "".$car['screen']."")."' alt=''/> <br/>";
?>
</br>
<img class="wdt" style="margin-top: -18px;" src="icon/car_shad.png">
</td>
</tr>
</table>
<table class="wdt main-menu">
<tr>
<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="gorod.php"><img src="icon/map-ico0.png"><br>
Город</a></b>
</td>

<td class="gray" align="center" style="width:25%; border-right: solid 1px #bebebf; vertical-align: bottom;">
</td>
<td class="gray" align="center" style="width:25%">
</td>
</tr>
</table>


<table class="wdt gray-table" style="font-size: 10pt">
</table>
<table class="wdt brown-header">
<tr>
<td align="left">Детали улучшают характеристики:</td>
</tr>
</table>
<table class="wdt gray-table" style="font-size: 10pt"><tr>

<td class="td-cell" align="right" style="padding-right: 10px; width: 45%">




<form action="?tun" method="post">
<input type="submit" class="upgrade-btn" value="Тюнинг">
</form>

<form action="?sost" method="post">
<input type="submit" class="upgrade-btn" value="Состояние">
</form>
</td>
</tr>
</table>
<td class="white td-cell" align="center" style="height:30px;">
<form action="/index.php" method="get">
<input type="submit" class="wdt race-btn" value="На сайт"/>
</form>
</td>
</tr>
</table>
<?
}
?>
