Файл: dev/gas.php
Строк: 88
<?
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($user['fuel_today']<200)
{
if($set['every_day_bonus']=='2')
{
$price_fuel=1;
}
else
{
$price_fuel=2;
}
if(isset($_GET['buy_fuel']))
{
$tek_fuel=$user['fuel'];
$mx_fuel=$user['max_fuel'];
if($tek_fuel != $mx_fuel)
{
if($user['baks']>=$price_fuel)
{
mysql_query("UPDATE `user` SET `baks` = '".($user['baks']-$price_fuel)."' WHERE `id`='".$user['id']."'");
mysql_query("UPDATE `user` SET `fuel` = '$mx_fuel' WHERE `id` = '".$user['id']."'");
$_SESSION['fuel_ok']=1;
header("Location: /dev/race.php");
}
else
{
$_SESSION['no_money']=1;
header("Location: /dev/garage.php");
}
}
else
{
header("Location: /dev/garage.php");
}
}
echo "<table class='wdt msg-table'><tr><td align='left' style='vertical-align: top; width: 10%'><img src='/style/img/images/face-benz.png'></td><td align='left' style='vertical-align: top'>";
echo "Хочешь заправить полный бак?<br>Ты использовал $user[fuel_today] из 200 заправок </td></tr></table></td></tr></table>";
echo "<td align='center'><img src='/style/theme/gas_station.jpg'></td>";
echo "<table class='wdt brown-header'><tr><td align='left'>Покупка бензина: </td></tr></table>";
echo "<table class='wdt gray-table' style='font-size: 10pt'><tr><td class='td-cell'><table><tr><td class='engine-td'><img src='/style/img/images/kanistra.png'></td></tr></table></td>";
echo "<td class='td-cell white' align='left' style='font-weight:bold'><table cellpadding='0' cellspacing='0'><tr><td>Бензин</td></tr><tr><img src='/style/img/icons/fuel.png'>Полный бак</td></tr><tr><td><img src='/style/img/icons/baks.png'>$price_fuel</td></tr></table></td>";
echo "<td class='td-cell' align='left' width='40%'><form action='/dev/gas.php?buy_fuel' method='post'><input class='yes-btn' type='submit' value='Заправить'></form>";
if($user['auto_fuel'] == 0){
echo '<b class="white" aligh="center"> авто <a href="?auto_fuel=on"><img src="/style/img/icons/off.png" height="20px" style="padding-top:4px;"></a></b>';
}else{
echo '<b class="white" aligh="center"> авто <a href="?auto_fuel=off"><img src="/style/img/icons/on.png" height="20px" style="padding-top:4px;"></a></b>';
}
echo"</td></tr></table>";
echo "<table class='wdt gray-table'>";
echo "<tr><td class='white td-cell' align='center' style='height:30px;'><form action ='/dev/map.php' method='post'><input class='no-btn' type='submit' value='Назад'></form></td></tr></table>";
include_once '../sys/inc/tfoot.php';
}
else
{
header("Location: /dev/garage.php");
}
?>