<?
//
//
if(isset($_REQUEST['ok'])){
$res = abs(intval($_POST['res']));
$coll = $res*3;
if($user['gold'] < $coll){
ruby(null);
header('location:?loc=5&err=1');
exit();
}
if($res <= 0){
header('location:?loc=5&err=2');
exit();
}
qry("UPDATE `users` SET `metal` = `metal` + ?, `gold` = `gold` - ? WHERE `id` = ? LIMIT 1", array($res,$coll,$uid));
msg2("<div style='clear:both;'></div><div class='b-notice trsmgr'><div class='notify-inner'>Покупка прошла успешно</div></div>");
header('location:?loc=5');
exit();
}
//
//
if(isset($_REQUEST['ok2'])){
$res = abs(intval($_POST['res']));
$coll = $res*3;
if($user['gold'] < $coll){
ruby(null);
header('location:?loc=5&err=1');
exit();
}
if($res <= 0){
header('location:?loc=5&err=2');
exit();
}
qry("UPDATE `users` SET `tkan` = `tkan` + ?, `gold` = `gold` - ? WHERE `id` = ? LIMIT 1", array($res,$coll,$uid));
msg2("<div style='clear:both;'></div><div class='b-notice trsmgr'><div class='notify-inner'>Покупка прошла успешно</div></div>");
header('location:?loc=5');
exit();
}
//
//
if(isset($_REQUEST['ok3'])){
$res = abs(intval($_POST['res']));
$coll = $res*3;
if($user['gold'] < $coll){
ruby(null);
header('location:?loc=5&err=1');
exit();
}
if($res <= 0){
header('location:?loc=5&err=2');
exit();
}
qry("UPDATE `users` SET `kamen` = `kamen` + ?, `gold` = `gold` - ? WHERE `id` = ? LIMIT 1", array($res,$coll,$uid));
msg2("<div style='clear:both;'></div><div class='b-notice trsmgr'><div class='notify-inner'>Покупка прошла успешно</div></div>");
header('location:?loc=5');
exit();
}
//
//
if(isset($_REQUEST['ok4'])){
$res = abs(intval($_POST['res']));
$coll = $res*3;
if($user['gold'] < $coll){
ruby(null);
header('location:?loc=5&err=1');
exit();
}
if($res <= 0){
header('location:?loc=5&err=2');
exit();
}
qry("UPDATE `users` SET `swit` = `swit` + ?, `gold` = `gold` - ? WHERE `id` = ? LIMIT 1", array($res,$coll,$uid));
msg2("<div style='clear:both;'></div><div class='b-notice trsmgr'><div class='notify-inner'>Покупка прошла успешно</div></div>");
header('location:?loc=5');
exit();
}
//
//
?>
<div class="tophead">
<div class = "ohh">
<img class='img4' src = '/images/shop5.png' widht='50px' height='50px'>
</div>
<span class="lime">
Элизабет
</span>
<br>
<small> Слушай.<br>
Не хочешь рисковать жизнью в поисках ресурсов? Ну что ж, выбирай!</small>
</div>
<br>
<div class="tophead2">
<img src="/images/ruby.png" width="17px" height="17px" alt=""> 3 рубина = 1 ресурс<br>
У вас: <img src="/images/ruby.png" width="17px" height="17px" alt=""> <?=$user['gold'];?> рубинов
</div>
<div class="tophead cntr">
Сколько <img src="/images/metal.png" width="17px" height="17px" alt=""> железа хотите купить?
<br>
<form action="" method="post">
<input class="" type="text" name="res" maxlength="50" value="" />
<input type="submit" name="ok" class="" value="Купить">
</form>
</div>
<div class="tophead cntr">
Сколько <img src="/images/tkan.png" width="17px" height="17px" alt=""> тканей хотите купить?
<br>
<form action="" method="post">
<input class="" type="text" name="res" maxlength="50" value="" />
<input type="submit" name="ok2" class="" value="Купить">
</form>
</div>
<div class="tophead cntr">
Сколько <img src="/images/kamen.png" width="17px" height="17px" alt=""> камней хотите купить?
<br>
<form action="" method="post">
<input class="" type="text" name="res" maxlength="50" value="" />
<input type="submit" name="ok3" class="" value="Купить">
</form>
</div>
<div class="tophead cntr">
Сколько <img src="/images/swit.png" width="17px" height="17px" alt=""> свитков хотите купить?
<br>
<form action="" method="post">
<input class="" type="text" name="res" maxlength="50" value="" />
<input type="submit" name="ok4" class="" value="Купить">
</form>
</div>
<a href="/shop.php" class="tophead">Вернуться назад</a>