Файл: zfarm.mobi/inc/shop/key.php
Строк: 55
<?
$title='Ключи';
include_once '../system/config.php';
echo"<div class='rzd2'></div><div class='menuin2'>";
echo'<div class="title">Покупка ключей</h2></div>
<div class="div">';
echo'Ключи нужны для открытия сундуков.<br>';
echo "<hr color='#CCCC00' size='1'>";
$key =mysql_fetch_array(mysql_query("SELECT * FROM `key_user` WHERE `id_user` = '$ku[id]'"));
echo'<img src="/img/icons/key.png" alt="o"> Обычный ключ (у вас <img src="/img/icons/GoldKey.png" alt="o"> '.$key['normal'].')<br><a href="/shop/key/normal">купить</a> (<img src="/img/icons/ruby.png" alt="o"> 10)<br>';
echo "<hr color='#CCCC00' size='1'>";
echo'<img src="/img/icons/key.png" alt="o"> Бронзовый ключ (у вас <img src="/img/icons/GoldKey.png" alt="o"> '.$key['bronze'].')<br><a href="/shop/key/bronze">купить</a> (<img src="/img/icons/ruby.png" alt="o"> 25)<br>';
echo "<hr color='#CCCC00' size='1'>";
echo'<img src="/img/icons/key.png" alt="o"> Серебрянный ключ (у вас <img src="/img/icons/GoldKey.png" alt="o"> '.$key['silver'].')<br><a href="/shop/key/silver">купить</a> (<img src="/img/icons/ruby.png" alt="o"> 50)<br>';
echo "<hr color='#CCCC00' size='1'>";
echo'<img src="/img/icons/key.png" alt="o"> Золотой ключ (у вас <img src="/img/icons/GoldKey.png" alt="o"> '.$key['gold'].')<br><a href="/shop/key/gold">купить</a> (<img src="/img/icons/ruby.png" alt="o"> 75)<br>';
echo "<hr color='#CCCC00' size='1'>";
echo'<img src="/img/icons/key.png" alt="o"> Проклятый ключ (у вас <img src="/img/icons/GoldKey.png" alt="o"> '.$key['magic'].')<br><a href="/shop/key/magic">купить</a> (<img src="/img/icons/ruby.png" alt="o"> 80)';
echo "<hr color='#CCCC00' size='1'>";
?>
<?
if(isset($_GET['normal']) && ($ku['rubies']>9)){
$key =mysql_fetch_array(mysql_query("SELECT * FROM `key_user` WHERE `id_user` = '$ku[id]'"));
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-10)."' WHERE `id` = '".$ku['id']."'");
mysql_query("UPDATE `key_user` SET `normal` = '".($key['normal']+1)."' WHERE `id_user` = '".$ku['id']."'");
header("Location: /shop/key");
$_SESSION['msg']='Куплен обычный ключ';
}
?>
<?
if(isset($_GET['bronze']) && ($ku['rubies']>24)){
$key =mysql_fetch_array(mysql_query("SELECT * FROM `key_user` WHERE `id_user` = '$ku[id]'"));
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-25)."' WHERE `id` = '".$ku['id']."'");
mysql_query("UPDATE `key_user` SET `bronze` = '".($key['bronze']+1)."' WHERE `id_user` = '".$ku['id']."'");
header("Location: /shop/key");
$_SESSION['msg']='Куплен бронзовый ключ';
}
?>
<?
if(isset($_GET['silver']) && ($ku['rubies']>49)){
$key =mysql_fetch_array(mysql_query("SELECT * FROM `key_user` WHERE `id_user` = '$ku[id]'"));
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-50)."' WHERE `id` = '".$ku['id']."'");
mysql_query("UPDATE `key_user` SET `silver` = '".($key['silver']+1)."' WHERE `id_user` = '".$ku['id']."'");
header("Location: /shop/key");
$_SESSION['msg']='Куплен серебрянный ключ';
}
?>
<?
if(isset($_GET['gold']) && ($ku['rubies']>74)){
$key =mysql_fetch_array(mysql_query("SELECT * FROM `key_user` WHERE `id_user` = '$ku[id]'"));
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-75)."' WHERE `id` = '".$ku['id']."'");
mysql_query("UPDATE `key_user` SET `gold` = '".($key['gold']+1)."' WHERE `id_user` = '".$ku['id']."'");
header("Location: /shop/key");
$_SESSION['msg']='Куплен золотой ключ';
}
?>
<?
if(isset($_GET['magic']) && ($ku['rubies']>79)){
$key =mysql_fetch_array(mysql_query("SELECT * FROM `key_user` WHERE `id_user` = '$ku[id]'"));
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-80)."' WHERE `id` = '".$ku['id']."'");
mysql_query("UPDATE `key_user` SET `magic` = '".($key['magic']+1)."' WHERE `id_user` = '".$ku['id']."'");
header("Location: /shop/key");
$_SESSION['msg']='Куплен магический ключ';
}
?>
<img src="/img/icons/cart.png" alt="o">
<a href="/shop">В магазин</a>
</div>
</div>
<?echo"</div></div><div class='rzd2'></div>";
include_once '../system/foot.php';
?>
=