Файл: 402m/auto.php
Строк: 93
<?
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;
}
$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'];
$dollars=$arr['dollars'];
$win=$arr['win'];
$lose=$arr['lose'];
$level=$arr['level'];
$type=$arr['type'];
}
if($level=='0'){
mysql_query("UPDATE `xrexmy` SET `bl`='1', `level`='1', `type`='f' WHERE `id`='".$user['id']."' LIMIT 1");
}
$s=htmlspecialchars(trim($_GET['s']));
$p=intval(abs($_GET['p']));
if($p!='0' && mysql_result(mysql_query("SELECT COUNT(*) FROM `xrexmash` WHERE `id`='$p'"), 0)!='0'){
$all4=mysql_query("SELECT * FROM `xrexmash` WHERE `id`='$p'");
while($arr4=mysql_fetch_array($all4)){
echo "<img src='avto/$arr4[name].jpg' /> <br/> $arr4[name]<br/>
Скорость : $arr4[speed]<br/>
Цена : $arr4[cena]";
if($level>=$arr4['level'] && $dollars>=$arr4['cena']){
echo "<form method='post' action='?p=$p&$passgen'>
<input type='submit' value='Купить' name='subb'/>
</form><hr/>";
}
else{
echo "<font color='red'>Вы не можете купить эту машину!</font><br/>";
}
if(isset($_POST['subb']) && $level>=$arr4['level'] && $dollars>=$arr4['cena']){
// mysql_query("UPDATE `xrexmy` SET `id_w`='$arr4[id_w]', `dollars`=`dollars`-".$arr4['cena'].", `level`='".$arr4['level']."', `type`='".$arr4['type']."' WHERE `id`='".$user['id']."' LIMIT 1");
mysql_query("INSERT INTO `xrexcars`(`proizv`,
`name`,
`cena`,
`id_u`,
`speed`,
`sost_auto`,
`sost_pokr`,
`benzin`,
`level`,
`type`) VALUES('$arr4[proizv]', '$arr4[name]', '$arr4[cena]', '".$user['id']."', '$arr4[speed]', '100', '100', '100', '$arr4[level]', '$arr4[type]')");
$insertid=mysql_insert_id();
mysql_query("UPDATE `xrexmy` SET `id_w`='$insertid', `dollars`=`dollars`-".$arr4['cena'].", `level`='".$arr4['level']."', `type`='".$arr4['type']."' WHERE `id`='".$user['id']."' LIMIT 1");
echo "Машина куплена!<br/>";
}
} }
if($s!='' && $s!='UnlimitedStreet' && $s!='FastStreet_D' && $s!='FastStreet_C' && $s!='FastStreet_B' && $s!='FastStreet_A' && $s!='StreetLight'){
$s=='';
}
if($s!=''){
$s=my_esc($s);
$all3=mysql_query("SELECT * FROM `xrexmash` WHERE `type`='$s'");
while($arr3=mysql_fetch_array($all3)){
echo "<img src='avto/$arr3[name].jpg' /> <br/><a href='?p=$arr3[id]'><font color='SeaShell'> $arr3[name]</font></a><br/>
Скорость : $arr3[speed]<br/>
Цена : $arr3[cena]<hr/>";
}
}
if(isset($_POST['sub'])){
echo "<center>
В начале игры вам доступны машины уровня StreetLight
</center><br/>";
}
$all2=mysql_query("SELECT * FROM `xrexmash` WHERE `id`!='' GROUP BY `type`");
while($arr2=mysql_fetch_array($all2)){
echo "<dl class='mai2n'>
<dt></dt>";
echo "<a href='?s=$arr2[type]'><dt><img src='img/$arr2[type].png'/><font color='SeaShell'>$arr2[type]</font></dt></a></TABLE>";
}
echo "<img src='img/i_back.gif'/><a href='index.php'>Главная</a></div>";
include_once '../sys/inc/tfoot.php';
?>