Exemplo n.º 1
0
 public function IsUserWasPro($status = self::STATUS_RESERVE)
 {
     $use_reserve_pro = $this->search(self::$frl_default_service['pro'], $status);
     return payed::IsUserWasPro($this->user['uid']) || !empty($use_reserve_pro);
 }
Exemplo n.º 2
0
        $teasers = $teasersEmp;
    } else {
        $teasers = $teasersFrl;
    }
} else {
    $teasers = $teasersEmp;
}
// для про пользователей не показвыаем рекламу ПРО аккаунта
if (is_pro()) {
    if ($_SESSION['pro_test'] === 'f') {
        // тизер ПРО показываем если куплен тестовый ПРО
        $teasersExclude[] = 'pro';
    }
    $teasersExclude[] = 'test-pro';
    $teasersExclude[] = 'offers';
} elseif (!payed::IsUserWasPro($uid)) {
    $teasersExclude[] = 'test-pro';
}
// формируем массив из прошедших фильтрацию тизеров
foreach ($teasers as $key => $teaser) {
    $ok = true;
    foreach ($teaser['exclude'] as $filter) {
        if (isset($teasersExclude) && in_array($filter, $teasersExclude)) {
            $ok = false;
            break;
        }
    }
    if ($ok) {
        $filteredTeasers[] = $teaser;
    }
}
Exemplo n.º 3
0
    $_SESSION['payed_to'] = $_SESSION['pro_last']['cnt'];
}
$_SESSION['pro_last'] = $_SESSION['pro_last']['is_freezed'] ? false : $_SESSION['pro_last']['cnt'];
$userdata = new users();
$_SESSION['pro_test'] = $userdata->GetField($user_id, $error2, 'is_pro_test', false);
// цены на PRO
$prices = $prof->GetProPrice(true);
// текущая сумма оплаты
$cost = $prices[$oppro] * $mnth;
if ($ok) {
    $account = new account();
    $account->GetInfo($uid, true);
    $payed_list = payed::getPayedPROList(is_emp() ? 'emp' : 'frl');
    $is_not_enough = array('' => 'default');
    foreach ($payed_list as $value) {
        if ($value['is_test'] && payed::IsUserWasPro($uid)) {
            continue;
        }
        $dcost = $value['cost'] - $account->sum;
        if ($dcost <= 0) {
            continue;
        }
        $is_not_enough[$value['opcode']] = $dcost;
    }
    payed::UpdateProUsers();
    $result['success'] = true;
    $result['opcode'] = $oppro;
    $result['transaction'] = $account->start_transaction($uid, $tr_id);
    $result['acc_sum'] = $account->sum;
    $result['pro_last'] = date('d.m.Y', strtotime($is_freezed ? $_SESSION['payed_to'] : $_SESSION['pro_last']));
    $result['date_max_limit'] = 'date_max_limit_' . date('Y_m_d', strtotime($is_freezed ? $_SESSION['payed_to'] : $_SESSION['pro_last']));