Файл: gonki.us/tuning.php
Строк: 184
<?php
require_once('system/incfiles/core.php');
if(empty($user)) header('Location: /auth.php');
if(isset($_POST['sname'])){
if($user['dollars'] < 100) $err .= '<div class="error">Недостаточно баксов!</div>';
if($_POST['name'] == NULL) $err .= '<div class="error">Заполните название!</div>';
if(empty($err)){
$db->query("UPDATE `my_auto` SET `name` = '$_POST[name]' WHERE `id` = '$user[auto]'");
$db->query("UPDATE `user` SET `dollars` = `dollars` - 100 WHERE `id` = '$user[id]'");
header('Location: ?act=name');
}
}
if(isset($_POST['sclass'])){
if($user['dollars'] < 50) $err .= '<div class="error">Недостаточно баксов!</div>';
if($_POST['class'] == NULL) $err .= '<div class="error">Заполните класс!</div>';
if(empty($err)){
$db->query("UPDATE `my_auto` SET `class` = '$_POST[class]' WHERE `id` = '$user[auto]'");
$db->query("UPDATE `user` SET `dollars` = `dollars` - 50 WHERE `id` = '$user[id]'");
header('Location: ?act=class');
}
}
if(isset($_POST['sneon'])){
if($_POST['neon'] != NULL) $neon = '/auto/neon/'.$_POST['neon'];
else $neon = '/auto/neon/black.png';
if($user['dollars'] < 5) $err .= '<div class="error">Недостаточно баксов!</div>';
if(empty($err)){
$db->query("UPDATE `my_auto` SET `neon` = '$neon' WHERE `id` = '$user[auto]'");
$db->query("UPDATE `user` SET `dollars` = `dollars` - 5 WHERE `id` = '$user[id]'");
header('Location: ?act=neon');
}
}
$title = $copy.': Тюнинг';
require_once(ROOT.'system/incfiles/header.php');
echo '<div class="razd5">Тюнинг</div>';
if($user['lvl'] < 4){
echo '<div class="error">Для доступа к тюнингу вам необходимо достичь 4 уровень!</div>';
require_once(ROOT.'system/incfiles/footer.php');
exit;
}
if(isset($err)) echo $err;
echo '<div class="garage"><span class="fl" style="margin-top:10px; margin-right:10px;"><span class="class">'.$usauto['class'].'</span><span class="name">'.$usauto['name'].'</span></span>
<br /><br /><br /><center><img src="'.$usauto['img'].'" style="width:200px;" alt="" /> <img src="'.$usauto['neon'].'" alt="" style="width:200px; margin-top:-17px;"/></center></div>';
switch($_GET['act']){
default:
echo '<div class="menu_j"><a href="?act=name" class="top_menu_j"><span style="float:right"><img src="/system/design/ico/dollars.png" alt=""/> <font color="darkgreen">100</font></span> Название</a><a href="?act=class" class="top_menu_j"><span style="float:right"><img src="/system/design/ico/dollars.png" alt=""/> <font color="darkgreen">50</font></span>Класс</a><a href="?act=neon" class="top_menu_j"><span style="float:right"><img src="/system/design/ico/dollars.png" alt=""/> <font color="darkgreen">5</font></span> Неон</a></div>';
break;
case 'name':
echo '<div class="razd4"><center>Название:<br /><form method="post"><input type="text" name="name" value="'.$usauto['name'].'"/><br /><input type="submit" name="sname" value="Go!" /></form></center></div>';
break;
case 'class':
echo '<div class="razd4"><center>Класс:<br /><form method="post"><input type="text" name="class" value="'.$usauto['class'].'"/><br /><input type="submit" name="sclass" value="Go!" /></form></center></div>';
break;
case 'neon':
echo '<div class="razd4"><center>Неон:<br /><form method="post"><img src="/system/design/ico/neon/green.png" alt=""> <input type="radio" name="neon" value="green.png">
<img src="/system/design/ico/neon/yellow.png" alt=""> <input type="radio" name="neon" value="yellow.png">
<img src="/system/design/ico/neon/pink.png" alt=""> <input type="radio" name="neon" value="pink.png">
<img src="/system/design/ico/neon/white.png" alt=""> <input type="radio" name="neon" value="white.png"><br />
<img src="/system/design/ico/neon/blue.png" alt=""> <input type="radio" name="neon" value="blue.png">
<img src="/system/design/ico/neon/red.png" alt=""> <input type="radio" name="neon" value="red.png">
<img src="/system/design/ico/neon/purple.png" alt=""> <input type="radio" name="neon" value="purple.png">
<img src="/system/design/ico/neon/orange.png" alt=""> <input type="radio" name="neon" value="orange.png"><br /><input type="submit" name="sneon" value="Go!" /></form></center></div>';
break;
}
require_once(ROOT.'system/incfiles/footer.php');
?>