Файл: monst/core/pag/shop/vip.php
Строк: 38
<?
if ( isset($_GET['buy']) AND isset($_GET['day']) AND !empty($_GET['day']) ) {
$day = (int)$_GET['day'];
if ( $day != 1 AND $day != 7 AND $day != 31 ) {
$day = 31;
}
$cost_array = [
1 => 200,
7 => 1200,
31 => 4999
];
$cost = $cost_array[$day];
if ( $user['gold'] < $cost ) {
?>
<div class='error_box'>
<?=$lang['shop.php']['no_gold']?><br/>
<a href='/gold'><?=$lang['shop.php']['buy_gold']?> <img src='<?=$gold_icon?>' alt='' width='15'/></a>
</div>
<?
} else {
if ( $user['vip_time'] == 0 OR $user['vip_time'] < time() ) {
$vip_time = time() + 60 * 60 * 24 * $day;
} else {
$vip_time = $user['vip_time'] + 60 * 60 * 24 * $day;
}
$_users -> update(
[
'id' => $user['id']
],
[
'$set' => [
'gold' => $user['gold'] - $cost,
'vip_time' => $vip_time
]
]
);
g('/shop/vip?buy_ok');
}
}
if ( isset($_GET['buy_ok']) ) {
?>
<div class='ok_box'>
<?=$lang['shop.php']['vip']['vip_is_buy']?><br/>
</div>
<?
}
?>
<div style='text-align: center; font-size: 20px;'>
<?=$lang['shop.php']['vip']['title']?>
</div>
<div class='padding'>
<?=$lang['shop.php']['vip']['desc']?>
</div>
<br/>
<?
if ( $user['vip_time'] > time() ) {
?>
<div style='text-align: center;'>
<span style='color: yellowgreen;'>
<?=$lang['shop.php']['vip']['vip_active_to']?> <?=hm($user['vip_time'] - time(), 1, 1, 1, 1)?><br/>
</span>
</div>
<?
}
?>
<br/>
<a href='/shop/vip?buy&day=1'><div class='bt_gray'><?=$lang['shop.php']['vip']['buy_on']?> <?=$lang['shop.php']['vip']['1day']?> <img src='<?=$gold_icon?>' alt='' width='15'/><span class='gold_color'>200</span></div></a>
<br/>
<a href='/shop/vip?buy&day=7'><div class='bt_gray'><?=$lang['shop.php']['vip']['buy_on']?> <?=$lang['shop.php']['vip']['7day']?> <img src='<?=$gold_icon?>' alt='' width='15'/><span class='gold_color'>1200</span></div></a>
<br/>
<a href='/shop/vip?buy&day=31'><div class='bt_gray'><?=$lang['shop.php']['vip']['buy_on']?> <?=$lang['shop.php']['vip']['31day']?> <img src='<?=$gold_icon?>' alt='' width='15'/><span class='gold_color'>4999</span></div></a>
<br/>
<a href='/shop'><div class='bt_black'><?=$lang['shop.php']['back']?></div></a>
<?