當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Customers::updateCustomer方法代碼示例

本文整理匯總了PHP中Customers::updateCustomer方法的典型用法代碼示例。如果您正苦於以下問題:PHP Customers::updateCustomer方法的具體用法?PHP Customers::updateCustomer怎麽用?PHP Customers::updateCustomer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Customers的用法示例。


在下文中一共展示了Customers::updateCustomer方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: list

$tpl->Assign('SavedContragent', $SavedContragent->fields);
$tpl->Assign('DeliveryMethod', $DeliveryMethod->list);
$tpl->Assign('SavedDeliveryMethod', $SavedDeliveryMethod->fields);
if (isset($_POST['apply'])) {
    require_once $GLOBALS['PATH_block'] . 't_fnc.php';
    // для ф-ции проверки формы
    $nocheck[] = 'keystring';
    if (isset($_POST['passwd']) && $_POST['passwd'] == '') {
        $nocheck[] = 'passwdconfirm';
        $nocheck[] = 'passwd';
    }
    list($err, $errm) = Register_form_validate($nocheck);
    if (!$err) {
        $tpl->Assign('msg', 'Информация обновлена.');
        $User->updateUser($_POST);
        $Customer->updateCustomer($_POST);
        $Customer->updateContPerson($_POST['cont_person']);
        $Customer->updatePhones($_POST['phones']);
        $Customer->updateContragent($_POST['id_manager']);
        $Customer->updateCity($_POST['id_delivery_department']);
        $Customer->updateDelivery($_POST['id_delivery']);
        if (!$Customer->fields['bonus_card']) {
            $Customer->registerBonus($_POST);
        } else {
            $Customer->updateBonus($_POST['bonus_card']);
        }
        header("Location: " . _base_url . "/cabinet");
    } else {
        // показываем все заново но с сообщениями об ошибках
        $tpl->Assign('msg', 'Информация не обновлена.');
        $tpl->Assign('errm', $errm);
開發者ID:Arikito,項目名稱:webking.xt,代碼行數:31,代碼來源:cp_cab_inf_customer.php

示例2: Add

 public function Add($arr = null)
 {
     global $Cart;
     global $Products;
     global $Users;
     if (isset($arr)) {
         $GetCartForPromo = $Cart->GetCartForPromo($arr);
         $OrderCart = array();
         foreach ($GetCartForPromo['products'] as $k => $v) {
             $OrderCart[$v['id_product']] = $v;
         }
         //unset($GetCartForPromo);
         $jo_order = 1;
     }
     $OrderCart = $arr === null ? $_SESSION['cart']['products'] : $OrderCart;
     // Если список товаров в корзине пуст
     if (empty($OrderCart)) {
         print_r('products error');
         return false;
     }
     if (isset($_SESSION['cart']['promo']) && substr($_SESSION['cart']['promo'], 0, 2) == 'AG') {
         if (!$Users->SubscribeAgentUser($_SESSION['member']['id_user'], substr($_SESSION['cart']['promo'], 2))) {
             print_r('agent subscription error');
             return false;
         }
     }
     // $discount = 0;
     // if(isset($_SESSION['cart']['discount'])){
     // 	if(isset($_SESSION['price_mode']) && $_SESSION['price_mode'] == 1){
     // 		$discount = 1;
     // 	}else{
     // 		$discount = $_SESSION['cart']['discount'];
     // 	}
     // }
     // $this->UpdateSuppliersTurn();
     // Пересмотреть проверку актуальности цен
     // $Cart->IsActualPrices($err, $warn, $errm, $warnings);
     // if($err){
     // 	if(isset($_SESSION['errm'])){
     // 		$_SESSION['errm'] = array_merge($_SESSION['errm'], $errm);
     // 	}else{
     // 		$_SESSION['errm'] = $errm;
     // 		header('Location: '._base_url.'/cart/');
     // 		exit();
     // 	}
     // }
     // isset($_SESSION['member']['id_user']) ? $_SESSION['member']['id_user'] : $_SESSION['member']['id_user'] = $_POST['id_user'];
     // isset($arr['discount']) ? $arr['discount']  : $arr['discount'] = 0;
     // Определяем статус будущего заказа
     $order_status = 0;
     // Если у клиента есть промо-код - 11
     if (isset($_SESSION['cart']['promo_code']) && $_SESSION['cart']['promo_code'] != '') {
         // Написать проверку промо-кода
         $f['id_order_status'] = $order_status = 11;
         // Промо-заказ
     } else {
         $f['id_order_status'] = $order_status = 1;
         // Обычный заказ
     }
     // Сохраняем номер заказа, на основании которого был создан текущщий
     if (isset($_SESSION['cart']['base_order'])) {
         $f['base_order'] = $_SESSION['cart']['base_order'];
     }
     $f['target_date'] = $target_date = strtotime('+2 day', time());
     $f['creation_date'] = time();
     $f['id_customer'] = isset($_SESSION['cart']['id_customer']) ? $_SESSION['cart']['id_customer'] : $_SESSION['member']['id_user'];
     $Customers = new Customers();
     $Customers->SetFieldsById($f['id_customer']);
     $customer = $Customers->fields;
     // Определяем адрес по-умолчанию
     $Address = new Address();
     if ($customer_address = $Address->GetPrimaryAddress($f['id_customer'])) {
         $_SESSION['member']['id_address'] = $f['id_addrress'] = $customer_address['id'];
     }
     // Обновляем контрагента у покупателя
     if (isset($_SESSION['cart']['id_contragent'])) {
         $array['id_contragent'] = $_SESSION['cart']['id_contragent'];
         if ($_SESSION['member']['gid'] == _ACL_CUSTOMER_) {
             $_SESSION['member']['contragent']['id_user'] = $_SESSION['cart']['id_contragent'];
             $array['id_user'] = $_SESSION['member']['id_user'];
         } elseif ($_SESSION['member']['gid'] == _ACL_CONTRAGENT_ && !empty($_SESSION['cart']['id_customer'])) {
             $array['id_user'] = $_SESSION['cart']['id_customer'];
         }
     } elseif ($_SESSION['member']['gid'] == _ACL_CONTRAGENT_ && !empty($_SESSION['cart']['id_customer'])) {
         $array['id_contragent'] = $_SESSION['member']['id_user'];
         $array['id_user'] = $_SESSION['cart']['id_customer'];
     }
     if (isset($array['id_user'])) {
         $Customers->updateCustomer($array);
     }
     // Определяем контрагента
     if (isset($_SESSION['cart']['id_contragent'])) {
         $id_contragent = $_SESSION['cart']['id_contragent'];
     } else {
         if ($_SESSION['member']['gid'] == _ACL_CONTRAGENT_) {
             $id_contragent = $_SESSION['member']['id_user'];
         } else {
             //Определяем выходной или рабочий день у контрагента
             $date = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y")));
             $sql = "SELECT work_day FROM " . _DB_PREFIX_ . "calendar_contragent\r\n\t\t\t\t\tWHERE id_contragent = " . $customer['id_contragent'] . " AND date = '" . $date . "'";
//.........這裏部分代碼省略.........
開發者ID:Arikito,項目名稱:webking.xt,代碼行數:101,代碼來源:orders_c.php

示例3: Customers

             $err = 1;
             $errm['email'] = 'Пользователь с таким email уже зарегистрирован!';
         }
     }
     if ($unique_phone !== true) {
         $err = 1;
         $errm['phone'] = 'Пользователь с таким номером телефона уже зарегистрирован!';
     }
     if (!$err) {
         $Customers = new Customers();
         $_POST['cont_person'] = (isset($_POST['first_name']) ? trim($_POST['first_name']) : null) . ' ' . (isset($_POST['middle_name']) ? trim($_POST['middle_name']) : null) . ' ' . (isset($_POST['last_name']) ? trim($_POST['last_name']) : null);
         //Перезаписываем данные в сессии
         $_SESSION['member']['name'] = $_POST['cont_person'];
         $_SESSION['member']['email'] = $_POST['email'];
         $_SESSION['member']['phone'] = $_POST['phone'];
         if ($Customers->updateCustomer($_POST) && $Users->UpdateUser($_POST)) {
             echo json_encode('true');
         }
         if (isset($_POST['avatar'])) {
             $old_path = $GLOBALS['PATH_global_root'] . $_POST['avatar'];
             $new_path = $GLOBALS['PATH_global_root'] . 'images/avatars/' . $_SESSION['member']['id_user'] . '.jpeg';
             if (copy($old_path, $new_path)) {
                 unlink($old_path);
             }
         }
     } else {
         echo json_encode($errm);
     }
     break;
 case 'AccessCode':
     $Users = new Users();
開發者ID:Arikito,項目名稱:webking.xt,代碼行數:31,代碼來源:cabinet.php


注:本文中的Customers::updateCustomer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。