当前位置: 首页>>代码示例>>PHP>>正文


PHP payed::freezeProStop方法代码示例

本文整理汇总了PHP中payed::freezeProStop方法的典型用法代码示例。如果您正苦于以下问题:PHP payed::freezeProStop方法的具体用法?PHP payed::freezeProStop怎么用?PHP payed::freezeProStop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在payed的用法示例。


在下文中一共展示了payed::freezeProStop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: freezePro


//.........这里部分代码省略.........
        $from_time += 24 * 3600;
        $to_time += 24 * 3600;
    }
    $from_time = date('Y-m-d', $from_time);
    $to_time = date('Y-m-d', $to_time);
    //if (date('Ymd', strtotime($_SESSION['pro_last'])) == date('Ymd'))
    //@todo: выключаем возможность заморозки
    //https://beta.free-lance.ru/mantis/view.php?id=29292
    $freeze_allow = false;
    if ($action == 'freeze' && $freeze_allow) {
        $fstart = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y'));
        if ($from_date && $to_date && strtotime($from_date) >= $fstart) {
            if ($to_date != 1 && $to_date != 2 && $to_date != 3 && $to_date != 4) {
                $to_date = 1;
            }
            //if ($to_date == 2 && ceil($last_freeze['freezed_days'] / 7) == 1) {
            //    $to_date = 1;
            //}
            $ft = strtotime($from_date);
            $freeze_days = (int) $to_date * 7;
            $to_date = date('Y-m-d', mktime(0, 0, 0, date('m', $ft), date('d', $ft) + intval($to_date) * 7, date('Y', $ft)));
            payed::freezePro($uid, $from_date, $to_date);
            $from_time = $from_date;
            $to_time = $to_date;
            $freeze_set = true;
            $freeze_act = 'freeze_cancel';
            $pro_last = payed::ProLast($_SESSION['login']);
            if ($pro_last['freeze_to']) {
                $_SESSION['freeze_from'] = $pro_last['freeze_from'];
                $_SESSION['freeze_to'] = $pro_last['freeze_to'];
                $_SESSION['is_freezed'] = $pro_last['is_freezed'];
                $_SESSION['payed_to'] = $pro_last['cnt'];
            }
            $_SESSION['pro_last'] = $pro_last['is_freezed'] ? false : $pro_last['cnt'];
            $text = 'Ваш аккаунт будет заморожен с <b>' . date('d.m.Y', strtotime($from_date)) . "</b> на <b>{$freeze_days} дней</b>";
            $objResponse->call('freezeDisabled', $freeze_act);
            $objResponse->assign('freeze_info', 'innerHTML', $text);
        } elseif (strtotime($from_date) > strtotime($_SESSION['pro_last']) || strtotime($from_date) < $fstart) {
            $freeze_error = 'Неверная дата начала заморозки.';
        } else {
            $freeze_error = 'Ошибка, не указана одна из дат.';
        }
    }
    if ($action == 'freeze_cancel' && $freeze_set) {
        if (!payed::freezeProCancel($uid, $last_freeze_id)) {
            $freeze_error = 'Невозможно отменить заморозку.';
        } else {
            $freeze_set = false;
            $freeze_allow = true;
            $from_time = $to_time = date('Y-m-d', time() + 24 * 3600);
            $_SESSION['pro_last'] = payed::ProLast($_SESSION['login']);
            if (isset($_SESSION['freeze_from'])) {
                unset($_SESSION['freeze_from']);
            }
            if (isset($_SESSION['freeze_to'])) {
                unset($_SESSION['freeze_to']);
            }
            if (isset($_SESSION['is_freezed'])) {
                unset($_SESSION['is_freezed']);
            }
            $_SESSION['pro_last'] = $_SESSION['pro_last']['is_freezed'] ? false : $_SESSION['pro_last']['cnt'];
            $objResponse->call('freezeEnabled', strtotime('+1 day') * 1000);
        }
    }
    if ($action == 'freeze_stop' && $freezed_now) {
        if (!payed::freezeProStop($uid, $last_freeze_id)) {
            $freeze_error = 'Невозможно разморозить аккаунт.';
        } else {
            $pro_last = payed::ProLast($_SESSION['login']);
            if (!$pro_last['freeze_to']) {
                if (isset($_SESSION['freeze_from'])) {
                    unset($_SESSION['freeze_from']);
                }
                if (isset($_SESSION['freeze_to'])) {
                    unset($_SESSION['freeze_to']);
                }
                if (isset($_SESSION['is_freezed'])) {
                    unset($_SESSION['is_freezed']);
                }
            } else {
                $_SESSION['freeze_from'] = $pro_last['freeze_from'];
                $_SESSION['freeze_to'] = $pro_last['freeze_to'];
                $_SESSION['is_freezed'] = $pro_last['is_freezed'];
                $_SESSION['payed_to'] = $pro_last['cnt'];
            }
            $_SESSION['pro_last'] = $pro_last['is_freezed'] ? false : $pro_last['cnt'];
            $freezed_now = $freeze_allow = false;
            if ($last_freeze['freezed_cnt'] >= 2) {
                $objResponse->call('freezeClosed');
            } else {
                $objResponse->call('freezeEnabled', strtotime('+1 day') * 1000);
            }
        }
    }
    if ($freeze_error) {
        $objResponse->call('alert', $freeze_error);
    }
    $objResponse->script("disabled_btn['freeze'] = false;");
    return $objResponse;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:101,代码来源:professions.server.php

示例2: unset

        $_SESSION['pro_last'] = payed::ProLast($_SESSION['login']);
        if (isset($_SESSION['freeze_from'])) {
            unset($_SESSION['freeze_from']);
        }
        if (isset($_SESSION['freeze_to'])) {
            unset($_SESSION['freeze_to']);
        }
        if (isset($_SESSION['is_freezed'])) {
            unset($_SESSION['is_freezed']);
        }
        $_SESSION['pro_last'] = $_SESSION['pro_last']['is_freezed'] ? false : $_SESSION['pro_last']['cnt'];
        header_location_exit($location);
    }
}
if ($action == 'freeze_stop' && $freezed_now) {
    if (!payed::freezeProStop($uid, $last_freeze_id)) {
        $freeze_error = 'Невозможно разморозить аккаунт.';
    } else {
        $pro_last = payed::ProLast($_SESSION['login']);
        if (!$pro_last['freeze_to']) {
            if (isset($_SESSION['freeze_from'])) {
                unset($_SESSION['freeze_from']);
            }
            if (isset($_SESSION['freeze_to'])) {
                unset($_SESSION['freeze_to']);
            }
            if (isset($_SESSION['is_freezed'])) {
                unset($_SESSION['is_freezed']);
            }
        } else {
            $_SESSION['freeze_from'] = $pro_last['freeze_from'];
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:freeze.php


注:本文中的payed::freezeProStop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。