Файл: public_html/modules/vip.php
Строк: 39
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include_once ($root.'/core/base.php');
falseauth();
$header = "Зелья";
include_once ($root.'/core/head.php');
$costs = [null,25,120,400];
$days = [null,2,7,14];
if(isset($_GET['buy']))
{
$type = fl($_GET['type']);
if(!in_array($type, [1,2,3])) redirect('/vip');
if($u['vip_type'] > 0 && $u['vip_time'] > time()) redirect('/vip', 'Вы уже использовали зелье');
if($u['gold'] < $costs[$type]) redirect('/vip', 'Недостаточно гемов');
$db->query("UPDATE `users` SET `gold` = `gold` - '".$costs[$type]."', `vip_type` = '".$type."', `vip_time` = '".(time()+86400*$days[$type])."' WHERE `id` = '".$u['id']."'");
redirect('/potions', 'Зелье использовано');
}
if($u['vip_type'] > 0 && $u['vip_time'] > time())
{
echo '<div class="b">
Зелье ещё действует!<br>
До окончания: '.tl($u['vip_time']-time()).'
</div>';
}
else
{
echo '
<div class="b">
<table width="100%">
<tr>
<td width="60px" valign="top">
<img width="80px" src="/images/vip-1.png"/>
</td>
<td valign="top">
<big> <font color = "white">Трявяное зелье </font></big>
<div class="txt">
(1 ингредиент)</br>
+15% опыта и серебра<br>
+10% к покупке гемов<br>
+30 к параметрам<br>
Срок действия: 2 дня<br>
Стоимость: 25 гемов<br><br>
</div>
</td>
</tr>
</table>
<center><a href="/potions/buy1"><input type="submit" value="Купить"></a></center></div>
';
echo '
<div class="b">
<table width="100%">
<tr>
<td width="60px" valign="top">
<img width="80px" src="/images/vip-2.png"/>
</td>
<td valign="top">
<big> <font color = "white">Травяное зелье</font></big>
<div class="txt">
(x5 ингредиенты)<br>
+15% опыта и серебра<br>
+50% опыта и серебра<br>
+30% к покупке гемов<br>
+70 к параметрам<br>
Срок действия: 7 дней<br>
Стоимость: 120 гемов<br><br>
</div>
</td>
</tr>
</table>
<center><a href="/potions/buy2"><input type="submit" value="Купить"></a></center></div>
';
echo '
<div class="b">
<table width="100%">
<tr>
<td width="60px" valign="top">
<img width="80px" src="/images/vip-3.png"/>
</td>
<td valign="top">
<big> <font color = "white">Трявяное зелье</font></big>
<div class="txt">
(x24 ингредиенты)<br>
+15% опыта и серебра<br>
+100% опыта и серебра<br>
+50% к покупке гемов<br>
+300 к параметрам<br>
Срок действия: 14 дней<br>
Стоимость: 400 гемов<br><br>
</div>
</td>
</tr>
</table>
<center><a href="/potions/buy3"><input type="submit" value="Купить"></a></center></div>
<div class = "line"></div>
';
}
include_once ($root.'/core/foot.php');