Файл: gonki.us/diler.php
Строк: 67
<?php
require_once('system/incfiles/core.php');
if(empty($user)) header('Location: /auth.php');
if(isset($_GET['baks']) && is_numeric($_GET['baks'])){
if($user['dollars'] < $_GET['bak']){
$title = $copy.': Дилер';
require_once(ROOT.'system/incfiles/header.php');
echo '<div class="razd5">Дилер</div>';
echo '<div class="error">Недостаточно баксов для обмена!</div>';
require_once(ROOT.'system/incfiles/footer.php');
exit;
}
$db->query('UPDATE `user` SET `dollars` = `dollars` - '.$_GET['baks'].', `money` = `money` + '.($_GET['baks']*1000).' WHERE `id` = "'.$user['id'].'"');
header('Location: /diler.php');
}
if(isset($_GET['session'])){
unset($_SESSION['ok']);
unset($_SESSION['err']);
header('Location: /giler.php');
}
$title = $copy.': Дилер';
require_once(ROOT.'system/incfiles/header.php');
echo '<div class="razd5">Дилер</div>';
if(!empty($_SESSION['ok'])){
echo '<div class="ok"><span style="float:right"><a href="?session">X</a></span>'.$_SESSION['ok'].'</div>';
}
if(!empty($_SESSION['err'])){
echo '<div class="err"><span style="float:right"><a href="?session">X</a></span>'.$_SESSION['err'].'</div>';
}
echo '<div class="razd4"><center><form action="/worldkassa/index.php" method="get">Пополнить баксы:<br /><input type="text" name="dollars" value="100"/><br /><input type="submit" value="Go!" /></form></center></div>';
echo '<div class="menu_j">
<a class="top_menu_j" href="?baks=1">Обменять <img src="/system/design/ico/dollars.png" alt="" /><font color="darkgreen">1</font> на <img src="/system/design/ico/money.png" alt="" /><font color="white">1000</font></a>
<a class="top_menu_j" href="?baks=10">Обменять <img src="/system/design/ico/dollars.png" alt="" /><font color="darkgreen">10</font> на <img src="/system/design/ico/money.png" alt="" /><font color="white">10000</font></a>
<a class="top_menu_j" href="?baks=100">Обменять <img src="/system/design/ico/dollars.png" alt="" /><font color="darkgreen">100</font> на <img src="/system/design/ico/money.png" alt="" /><font color="white">100000</font></a></div>';
require_once(ROOT.'system/incfiles/footer.php');
?>