Файл: colxoz.ru/worldkassa/buy.php
Строк: 155
<?
include '../system/common.php';
include '../system/functions.php';
include '../system/user.php';
if(!$user) {
header('location: /');
exit;
}
switch($_GET['action']) {
default:
$title = 'Заказ золотых';
include '../system/h.php';
?>
<div class='title'><?=$title?></div>
<div class='line'></div>
<div class='content' align='center'>
<font color='#9bc'>Золото самый ценный ресурс!</font>
</div>
<div class='line'></div>
<div class='list'>
<li><a href='/exchange.php'><img src='/images/icon/gold.png' alt='*'/> Обменник золота</a></li>
<div class='content' align='center'>Купить золото</div>
</div>
<div class='line'></div>
<div class='menu'>
<a href='index.php?gold=105'><div class='block_zero'><img class='float-left' src='http://konovalov.aux.su/image/donat/0.png' style='margin-left:1px; margin-right:10px;' alt='*'><span style='color: #ffffff;'><b>Горсть золота</b><br><img src='/images/icon/gold.png' alt='*'> 100 золота<br><span style='color: #9bc;'>5%</span> бонус</div><div class='dot-line'></div></a></span>
<a href='index.php?gold=550'><div class='block_zero'><img class='float-left' src='http://konovalov.aux.su/image/donat/-1.png' style='margin-left:1px; margin-right:10px;' alt='*'><span style='color: #ffffff;'><b>Мешок золота</b><br><img src='/images/icon/gold.png' alt='*'> 500 золота<br><span style='color: #9bc;'>10%</span> бонус</div><div class='dot-line'></div></a></span>
<a href='index.php?gold=1150'><div class='block_zero'><img class='float-left' src='http://konovalov.aux.su/image/donat/-2.png' style='margin-left:1px; margin-right:10px;' alt='*'><span style='color: #ffffff;'><b>Ларец золота</b><br><img src='/images/icon/gold.png' alt='*'> 1000 золота<br><span style='color: #9bc;'>15%</span> бонус</div><div class='dot-line'></div></a></span>
<a href='index.php?gold=6000'><div class='block_zero'><img class='float-left' src='http://konovalov.aux.su/image/donat/-3.png' style='margin-left:1px; margin-right:10px;' alt='*'><span style='color: #ffffff;'><b>Сундук золота</b><br><img src='/images/icon/gold.png' alt='*'> 5000 золота<br><span style='color: #9bc;'>20%</span> бонус</div><div class='dot-line'></div></a></span>
<a href='index.php?gold=125000'><div class='block_zero'><img class='float-left' src='http://konovalov.aux.su/image/donat/-4.png' style='margin-left:1px; margin-right:10px;' alt='*'><span style='color: #ffffff;'><b>Сокровище богов</b><br><img src='/images/icon/gold.png' alt='*'> 100000 золота<br><span style='color: #9bc;'>25%</span> бонус</span></span></div></a>
</div>
<?
include '../system/f.php';
break;
case 'exchange':
$title = 'Обменник';
include '../system/h.php';
$course = 500;
$g = _string(_num($_GET['g']));
if($g) {
if($_GET['buy'] == true) {
if($user['s'] < $course * $g) {
header('location: /trade/exchange/');
exit;
}
mysql_query('UPDATE `users` SET `g` = "'.($user['g'] + $g).'", `s` = "'.($user['s'] - $course * $g).'" WHERE `id` = "'.$user['id'].'"');
}
else
{
if($user['g'] < $g) {
header('location: /trade/exchange/');
exit;
}
mysql_query('UPDATE `users` SET `g` = "'.($user['g'] - $g).'", `s` = "'.($user['s'] + $course * $g).'" WHERE `id` = "'.$user['id'].'"');
}
header('location: /trade/exchange/');
}
?>
<div class='title'><?=$title?></div>
<div class='line'></div>
<div class='content' align='center'>
<img src='/images/town/gold.png' alt='*'/>
</div>
<div class='line'></div>
<div class='list'>
<div class='content' align='center'><font color='#9bc'>Обмен <img src='/images/icon/silver.png' alt='*'/> серебра на <img src='/images/icon/gold.png' alt='*'/> золото</font></div>
<div class='line'></div>
<?
for($i = 1; $i <= ($user['level'] > 10 ? 10:$user['level']); $i++) {
if($i == 1 OR $i == 5 OR $i == 10) {
if($user['s'] > $course * $i) {
?>
<li><a href='/trade/exchange/<?=$i?>/?buy=true'><img src='/images/icon/arrow.png' alt='*'/> <img src='/images/icon/silver.png' alt='*'/> <font color='#ffffff'><?=n_f($course * $i)?> → <img src='/images/icon/gold.png' alt='*'/> <?=$i?> </font></a></li>
<?
}
}
}
?>
<li class='no_b'></li>
</div>
<div class='line'></div>
<div class='list'>
<div class='content' align='center'><font color='#9bc'>Купить <img src='/images/icon/silver.png' alt='*'/> серебро</font></div>
<div class='line'></div>
<?
for($i = 1; $i <= ($user['level'] > 10 ? 10:$user['level']); $i++) {
if($i == 1 OR $i == 5 OR $i == 10) {
if($user['g'] >= $i) {
?>
<li><a href='/trade/exchange/<?=$i?>/'><img src='/images/icon/arrow.png' alt='*'/> <font color='#ffffff'><img src='/images/icon/gold.png' alt='*'/> <?=$i?> → <img src='/images/icon/silver.png' alt='*'/> <?=n_f($course * $i)?></font></a></li>
<?
}
}
}
?>
<li class='no_b'></li>
</div>
<?
include '../system/f.php';
break;
}
?>