Файл: public_html/exp.php
Строк: 50
<?
include './system/common.php';
include './system/functions.php';
include './system/user.php';
if(!$user) {
header('location: /');
exit;
}
$title = 'Покупка опыта';
include './system/h.php';
if($_GET['buy'] == true) {
if($user['g'] < 100) $errors[] = 'Не хватает <img src='/images/icon/g.png' alt='*'/> '.(10- $user['g']).' золота<div class='separator'></div><a href='/trade/' class='button'>Купить</a>';
if($errors) {
echo '<div class='error center' align='center'>';
foreach($errors as $error) {
echo '<img src="/images/icon/error.png"> '.$error.'<br/>';
}
}
else
{
mysql_query('UPDATE `users` SET `g` = `g` - 100 WHERE `id` = ''.$user['id'].''');
mysql_query('UPDATE `users` SET `exp` = `exp` + 10000 WHERE `id` = ''.$user['id'].''');
header('location: /exp/');
}
}
if($_GET['buy'] == true2) {
if($user['g'] < 500) $errors[] = 'Не хватает <img src='/images/icon/g.png' alt='*'/> '.(500- $user['g']).' золота<div class='separator'></div><a href='/trade/' class='button'>Купить</a>';
if($errors) {
echo '<div class='error center' align='center'>';
foreach($errors as $error) {
echo '<img src="/images/icon/error.png"> '.$error.'<br/>';
}
}
else
{
mysql_query('UPDATE `users` SET `g` = `g` - 500 WHERE `id` = ''.$user['id'].''');
mysql_query('UPDATE `users` SET `exp` = `exp` + 50000 WHERE `id` = ''.$user['id'].''');
header('location: /exp/');
}
}
echo"<img src='http://btvar.ru/css/exp.jpg' width='100%' alt='*'/>";
echo '<div class='block_zero center'>
</br>10000 опыта</br><a href='/exp/?buy=true' class='btn22'><span class="end"><span class="label">Купить</span></span></a><br/>
<font color='#909090'>Цена: <img src='/images/icon/gold.png' alt='*'/> 100 золота</font>
</div>';
echo '<div class='block_zero center'>
</br>50000 опыта</br><a href='/exp/?buy=true2' class='btn22'><span class="end"><span class="label">Купить</span></span></a><br/>
<font color='#909090'>Цена: <img src='/images/icon/gold.png' alt='*'/> 500 золота</font>
</div>';
include './system/f.php';
?>