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


PHP G::IsLogged方法代码示例

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


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

示例1: unset

<?php

if (isset($GLOBALS['REQAR'][1]) && $GLOBALS['REQAR'][1] == 'clear') {
    unset($_SESSION['Cart']);
}
if (!G::IsLogged()) {
    $_SESSION['from'] = 'cart';
    header('Location: ' . _base_url . '/login/');
    exit;
} else {
    $User = new Users();
    $User->SetUser($_SESSION['member']);
    $current_user = $User->fields;
    $tpl->Assign('User', $User->fields);
}
unset($parsed_res);
$Page = new Page();
$Page->PagesList();
$tpl->Assign('list_menu', $Page->list);
$GLOBALS['IERA_LINKS'] = array();
$GLOBALS['IERA_LINKS'][1]['title'] = "Корзина";
if ($User->fields['gid'] == _ACL_CUSTOMER_ || $User->fields['gid'] == _ACL_ANONYMOUS_ || $User->fields['gid'] == _ACL_DILER_ || $User->fields['gid'] == _ACL_CONTRAGENT_) {
    $Customer = new Customers();
    $Customer->SetFieldsById($User->fields['id_user']);
    $SavedCity = new Citys();
    $SavedCity->GetSavedFields($Customer->fields['id_city']);
    $SavedContragent = new Contragents();
    $SavedContragent->GetSavedFields($Customer->fields['id_contragent']);
    $DeliveryMethod = new Delivery();
    $DeliveryMethod->SetDeliveryList();
    $SavedDeliveryMethod = new Delivery();
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:promo_cart.php

示例2: HasAgent

 public static function HasAgent()
 {
     global $db;
     if (G::IsLogged() && $db->GetArray("SELECT * FROM " . _DB_PREFIX_ . "user_agent WHERE id_user = " . $_SESSION['member']['id_user'])) {
         return true;
     }
     return false;
 }
开发者ID:Arikito,项目名称:webking.xt,代码行数:8,代码来源:global_c.php

示例3: array

             $Users->SendPassword($data['passwd'], $data['phone']);
         }
         $data = array('email' => $phone, 'passwd' => $pass);
         // авторизуем покупателя в его новый аккаунт
         if ($Users->CheckUser($data)) {
             G::Login($Users->fields);
             _acl::load($Users->fields['gid']);
             $res['new_user'] = true;
             unset($_POST['phone']);
         }
     } else {
         $res['message'] = 'Пользователь с таким номером телефона уже зарегистрирован!';
         $res['status'] = 501;
     }
 }
 if (G::IsLogged()) {
     if (isset($_POST['phone'])) {
         $unique_phone = $Users->CheckPhoneUniqueness($_POST['phone']);
         if ($unique_phone === true) {
             $date = array('id_user' => $_SESSION['member']['id_user'], 'phone' => $_POST['phone']);
             if (!$Users->UpdateUser($date)) {
                 $res['message'] = 'Возникла ошибка при сохранении телефона!';
                 $res['status'] = 500;
                 echo json_encode($res);
                 exit;
             }
         } else {
             $res['message'] = 'Пользователь с таким номером телефона уже зарегистрирован!';
             $res['status'] = 501;
             echo json_encode($res);
             exit;
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:cart.php

示例4: CheckPromo

 public function CheckPromo($promo)
 {
     switch (substr($promo, 0, 2)) {
         case 'JO':
             if (!($res = $this->db->GetOneRowArray("SELECT * FROM " . _DB_PREFIX_ . "cart WHERE promo = '" . $promo . "' AND adm = 1 AND status = '10'"))) {
                 return false;
             }
             $status = 10;
             break;
         case 'AG':
             $self = $has_orders = false;
             if (G::IsLogged()) {
                 $self = $_SESSION['member']['id_user'] == substr($promo, 2);
                 $orders = $this->db->GetOneRowArray("SELECT COUNT(*) AS cnt FROM " . _DB_PREFIX_ . "order WHERE id_customer = " . $_SESSION['member']['id_user']);
                 $has_orders = $orders['cnt'] > 0;
             }
             $no_promo = !$this->db->GetOneRowArray("SELECT * FROM " . _DB_PREFIX_ . "promo_code WHERE code = '" . $promo . "' AND active = 1");
             if ($self || $has_orders || G::HasAgent() || $no_promo) {
                 return false;
             }
             $status = 0;
             break;
         default:
             if (!($res = $this->db->GetOneRowArray("SELECT * FROM " . _DB_PREFIX_ . "promo_code WHERE code = '" . $promo . "' AND active = 1"))) {
                 return false;
             }
             break;
     }
     if (!$this->UpdateCart($promo, $status)) {
         return false;
     }
     $_SESSION['cart']['promo'] = $promo;
     return $promo;
 }
开发者ID:Arikito,项目名称:webking.xt,代码行数:34,代码来源:cart_c.php

示例5:

											<div class="buy_buttons">
												<!--удаление товара оптом из корзины-->
												<a href="#" class="icon-font" onClick="ChangeCartQty($(this).closest('.product_buy').data('idproduct'), 0);return false;">remove</a>
												<input type="text" class="qty_js" value="<?=!$in_cart?$item['inbox_qty']:$_SESSION['cart']['products'][$item['id_product']]['quantity'];?>">
												<a href="#"	class="icon-font" onClick="ChangeCartQty($(this).closest('.product_buy').data('idproduct'), 1);return false;">add</a>
												<!--количество заказываемых товаров-->
											</div>
											<?if(!$in_cart){?>
												<div class="buy_btn_block">
													<button class="btn-m-orange buy_btn_js" type="button">Купить</button>
													<a href="<?=_base_url?>/cart/" class="in_cart_js hidden<?=G::IsLogged()?null:' open_modal" data-target="login_form';?>" title="Перейти в корзину">В корзине</a>
												</div>
											<?}else{?>
												<div class="buy_btn_block">
													<button class="btn-m-orange buy_btn_js hidden" type="button">Купить</button>
													<a href="<?=_base_url?>/cart/" class="in_cart_js <?=G::IsLogged()?null:' open_modal" data-target="login_form';?>" title="Перейти в корзину">В корзине</a>
												</div>
											<?}?>
										<?}else{?>
											<!--Если опт НЕ доступен-->
											<div class="not_available">Товара нет в наличии</div>
										<?}?> <!--проверка доступности опта-->
									</div>
									<div class="other_price <?=$item['price_opt'] == 0 && $item['price_mopt'] == 0?'hidden':null?>">
										<input class="mopt_cor_set_js" type="hidden" value="<?=$GLOBALS['CONFIG']['correction_set_'.$item['mopt_correction_set']]?>">
										<input class="price_mopt_js" type="hidden" value="<?=$item['price_mopt']?>">
										<p>
											<span class="price_js"><?=$in_cart?number_format($_SESSION['cart']['products'][$item['id_product']]['other_prices'][$_COOKIE['sum_range']], 2, ".", ""):number_format($item['price_mopt']*explode(';', $GLOBALS['CONFIG']['correction_set_'.$item['mopt_correction_set']])[$_COOKIE['sum_range']], 2, ".", "");?></span>
											<!--noindex--> грн.<!--/noindex-->
											<span class="mode_js"><?=$in_cart && $_SESSION['cart']['products'][$item['id_product']]['mode'] == 'mopt'?'от':'до';?></span>
											<?=$item['inbox_qty'].' '.$item['units']?>
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:ajaxcat.php

示例6: switch

<?php

if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
    if (isset($_POST['action'])) {
        switch ($_POST['action']) {
            case "login":
                if (isset($_COOKIE['PHPSESSID'])) {
                    $to = "cabinet/";
                    if (isset($_POST['to'])) {
                        $to = $_POST['to'];
                    }
                    if (isset($_SESSION['from']) && $_SESSION['from'] != 'login') {
                        $to = $_SESSION['from'] . '/';
                    }
                    if (G::IsLogged() && ($_SESSION['member']['gid'] != _ACL_SUPPLIER_MANAGER_ && !isset($_COOKIE['sm_login']))) {
                        header('Location: ' . _base_url . '/' . $to);
                        exit;
                    }
                    $Customers = new Customers();
                    unset($parsed_res);
                    if (isset($_SESSION['SLGN']['email']) && $_SESSION['SLGN']['passwd']) {
                        $_POST['email'] = $_SESSION['SLGN']['email'];
                        $_POST['passwd'] = $_SESSION['SLGN']['passwd'];
                        $_POST['contr'] = $_SESSION['SLGN']['contr'];
                        unset($_SESSION['SLGN']);
                    }
                    if (isset($_POST['email']) && isset($_POST['passwd'])) {
                        $User = new Users();
                        if (isset($_SESSION['member']['gid']) && $_SESSION['member']['gid'] == _ACL_SUPPLIER_MANAGER_ || isset($_COOKIE['sm_login'])) {
                            if ($User->CheckUserNoPass($_POST)) {
                                if (isset($_COOKIE['sm_login'])) {
开发者ID:Arikito,项目名称:webking.xt,代码行数:31,代码来源:ajaxlogin.php


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