Файл: inc/shop/fantik.php
Строк: 72
<?php
$title='Фантики';
include_once '../system/config.php';
if($_GET['type'] == 1){
if(isset($_GET['ok'])){
if($ku['rubies'] < 6){
$rm=6-$ku['rubies'];
$_SESSION['no_rubies']=$rm;
header('Location: /shop/fantik'); exit;
}
for($i=0;$i<11;$i++){
$fantik = mysql_fetch_array(mysql_query("SELECT * FROM `collections` ORDER BY RAND()"));
mysql_query("INSERT INTO `collections_users` SET
`id_user` = '".$ku['id']."',
`name` = '".$fantik['name']."',
`type` = '".$fantik['type']."',
`type_2` = '".$fantik['type_2']."'");
}
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` -6 WHERE `id` = '".$ku['id']."'");
$_SESSION['msg'] = 'Вы купили Маленький мешок. Новые фантики отправлены в колекцию';
header('Location: /shop/fantik');
}else{
echo podtv("/shop/fantik?type=1&ok","/shop/fantik");
}
}
if($_GET['type'] == 2){
if(isset($_GET['ok'])){
if($ku['rubies'] < 12){
$rm=12-$ku['rubies'];
$_SESSION['no_rubies']=$rm;
header('Location: /shop/fantik'); exit;
}
for($i=0;$i<31;$i++){
$fantik = mysql_fetch_array(mysql_query("SELECT * FROM `collections` ORDER BY RAND()"));
mysql_query("INSERT INTO `collections_users` SET
`id_user` = '".$ku['id']."',
`name` = '".$fantik['name']."',
`type` = '".$fantik['type']."',
`type_2` = '".$fantik['type_2']."'");
}
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` -12 WHERE `id` = '".$ku['id']."'");
$_SESSION['msg'] = 'Вы купили Средний мешок. Новые фантики отправлены в колекцию';
header('Location: /shop/fantik');
}else{
echo podtv("/shop/fantik?type=2&ok","/shop/fantik");
}
}
if($_GET['type'] == 3){
if(isset($_GET['ok'])){
if($ku['rubies'] < 22){
$rm=22-$ku['rubies'];
$_SESSION['no_rubies']=$rm;
header('Location: /shop/fantik'); exit;
}
for($i=0;$i<73;$i++){
$fantik = mysql_fetch_array(mysql_query("SELECT * FROM `collections` ORDER BY RAND()"));
mysql_query("INSERT INTO `collections_users` SET
`id_user` = '".$ku['id']."',
`name` = '".$fantik['name']."',
`type` = '".$fantik['type']."',
`type_2` = '".$fantik['type_2']."'");
}
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` -22 WHERE `id` = '".$ku['id']."'");
$_SESSION['msg'] = 'Вы купили Большой мешок. Новые фантики отправлены в колекцию';
header('Location: /shop/fantik');
}else{
echo podtv("/shop/fantik?type=3&ok","/shop/fantik");
}
}
echo '<div class="title">Фантики</div>';
echo '<div class="block"><table><td>
<td><img src="/img/colectibles/random_bag.png"></td>
<td><b>Маленький мешок</b><br />
10 шт. случайных фантиков<br />
<a href="/shop/fantik?type=1">Купить </a>за <img src="/img/icons/ruby.png">6</td>
</td></table></div>';
echo '<div class="block"><table><td>
<td><img src="/img/colectibles/random_bag.png"></td>
<td><b>Средний мешок</b><br />
30 шт. случайных фантиков<br />
<a href="/shop/fantik?type=2">Купить </a>за <img src="/img/icons/ruby.png">12</td>
</td></table></div>';
echo '<div class="block"><table><td>
<td><img src="/img/colectibles/random_bag.png"></td>
<td><b>Большой мешок</b><br />
72 шт. случайных фантиков<br />
<a href="/shop/fantik?type=3">Купить </a>за <img src="/img/icons/ruby.png">22</td>
</td></table></div>';
echo '<center><div style="padding:5px 0px 0px 0px;" ><a class="blockloctime" href="/collections"><span class="spec-head1">К колекциям</span></a></div></center>';
include_once '../system/foot.php';
?>