Файл: 402m/garage.php
Строк: 98
<?
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/user.php';
$set['title']='Гараж';
include_once '../sys/inc/thead.php';
err();
aut();
//header("Content-type: application/vnd.wap.xhtml+xml");
header("Content-type: text/html");
echo "<link rel='stylesheet' href='style.css' type='text/css' />";
echo '<div id="cnt"><div id="hdr"><div class="hdr"><div></div></div>';
echo"<div class='loc'><img alt='.' height='50' src='shop_162.png' width='162' /></div><hr/><dl class='mai2n'>";
if(!isset($user)){
echo "Секретная зона! Доступна после авторизации";
include_once '../sys/inc/tfoot.php';
break;
}
$all345=mysql_query("SELECT * FROM `xrexmy` WHERE `id`='".$user['id']."'");
while($arr345=mysql_fetch_array($all345)){
$id_w=$arr345['id_w'];
$dollars=$arr345['dollars'];
$type=$arr345['type'];
}
echo "";
$all1345=mysql_query("SELECT * FROM `xrexcars` WHERE `id`='".$id_w."'");
while($arr1345=mysql_fetch_array($all1345)){
$proizv=$arr1345['proizv'];
$name=$arr1345['name'];
$arest=$arr1345['arest'];
}
echo "";
$q=mysql_result(mysql_query("SELECT COUNT(*) FROM `xrexmy` WHERE `id`='".$user['id']."'"), 0);
if($q=='0'){
mysql_query("INSERT INTO `xrexmy`(`id`, `nick`) VALUES('".$user['id']."', '".$user['nick']."')");
header("Location:carrer.php?$passgen");
exit();
}
$all=mysql_query("SELECT * FROM `xrexmy` WHERE `id`='".$user['id']."'");
while($arr=mysql_fetch_array($all)){
$id_w=$arr['id_w'];
$speed=$arr['speed'];
$win=$arr['win'];
$lose=$arr['lose'];
$level=$arr['level'];
$type=$arr['type'];
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `xrexcars` WHERE `id_u`='".$user['id']."'"), 0);
$k_page=k_page($k_post,1);
$page=page($k_page);
$start=1*$page-1;
$all1=mysql_query("SELECT * FROM `xrexcars` WHERE `id_u`='".$user['id']."' ORDER BY `cena` DESC LIMIT $start,1");
$arr1=mysql_fetch_array($all1);
echo "<img src='avto/$name.jpg' /><br/>";
$mod=htmlspecialchars(trim($_GET['mod']));
if($mod=='p'){
echo "Продать машину? <a href='?mod=f&car=$arr1[car]&page=$page'>Да </a> <br/>";
}
if($mod=='v'){
mysql_query("UPDATE `xrexmy` SET `id_w`='$arr1[id]' WHERE `id`='$user[id]' LIMIT 1");
echo "Успешно <br/>";
}
if($mod=='f'){
$moneya=$arr1['cena']-($arr1['cena']/10);
mysql_query("UPDATE `xrexmy` SET `id_w`='0', `dollars`=`dollars`+$moneya WHERE `id`='$user[id]' LIMIT 1");
mysql_query("DELETE FROM `xrexcars` WHERE `id`='$arr1[id]' LIMIT 1");
echo "Успешно <br/>";
}
if($mod=='benzin'){
$moneya=(100-$arr1['benzin'])*10;
if($dollars>=$moneya){
mysql_query("UPDATE `xrexmy` SET `dollars`=`dollars`-$moneya WHERE `id`='$user[id]' LIMIT 1");
mysql_query("UPDATE `xrexcars` SET `benzin`='100' WHERE `id`='$arr1[id]' LIMIT 1");
echo "Успешно <br/>";
}
else
{
echo "Нехватает денег<br/>";
}
}
if($mod=='sa'){
$moneya=(100-$arr1['sost_auto'])*50;
if($dollars>=$moneya){
mysql_query("UPDATE `xrexmy` SET `dollars`=`dollars`-$moneya WHERE `id`='$user[id]' LIMIT 1");
mysql_query("UPDATE `xrexcars` SET `sost_auto`='100' WHERE `id`='$arr1[id]' LIMIT 1");
echo "Успешно <br/>";
}
else
{
echo "Нехватает денег<br/>";
}
}
if($mod=='sp'){
$moneya=(100-$arr1['sost_pokr'])*60;
if($dollars>=$moneya){
mysql_query("UPDATE `xrexmy` SET `dollars`=`dollars`-$moneya WHERE `id`='$user[id]' LIMIT 1");
mysql_query("UPDATE `xrexcars` SET `sost_pokr`='100' WHERE `id`='$arr1[id]' LIMIT 1");
echo "Успешно <br/>";
}
else
{
echo "Нехватает денег<br/>";
}
}
echo "<img src='img/i_h_money2.gif'/><a href='?mod=p&car=$arr1[car]&page=$page'>Продать машину за ".round($arr1[cena]-($arr1[cena]/10))."$ </a><br/>";
echo "<img src='img/i_cars.gif'/><a href='?mod=v&car=$arr1[car]&page=$page'>Выбрать</a><br/><hr/>";
echo "<img src='img/i_cars.gif'/>Скорость: $arr1[speed]<br/>";
echo "<img src='img/i_cars.gif'/>Цена: $arr1[cena]<br/>";
echo "<img src='img/i_cars.gif'/>Арестов: $arr1[arest]<br/>";
echo "<img src='img/i_cars.gif'/>Бензин: $arr1[benzin]<br/>";
echo "<img src='img/i_cars.gif'/>Состояние: $arr1[sost_auto]<br/>";
echo "<img src='img/i_cars.gif'/>Покрышки: $arr1[sost_pokr]<br/><hr/>";
echo "<img src='img/i_h_money2.gif'/><a href='?mod=benzin&car=$arr1[car]&page=$page'>Заправить ".round((100-$arr1[benzin])*10)."$ </a><br/>";
echo "<img src='img/i_h_money2.gif'/><a href='?mod=sa&car=$arr1[car]&page=$page'>Ремонтировать ".round((100-$arr1[sost_auto])*50)."$ </a><br/>";
echo "<img src='img/i_h_money2.gif'/><a href='?mod=sp&car=$arr1[car]&page=$page'>Сменить покрышки ".round((100-$arr1[sost_pokr])*60)."$ </a><br/>";
echo "<img src='img/i_back.gif'/><a href='index.php'>На главную</a><br/>";
include_once '../sys/inc/tfoot.php';
?>