本文整理汇总了PHP中Customers::SetFieldsById方法的典型用法代码示例。如果您正苦于以下问题:PHP Customers::SetFieldsById方法的具体用法?PHP Customers::SetFieldsById怎么用?PHP Customers::SetFieldsById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customers
的用法示例。
在下文中一共展示了Customers::SetFieldsById方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Users
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();
$SavedDeliveryMethod->GetSavedFields($Customer->fields['id_delivery']);
$Cart = new Cart();
if (isset($GLOBALS['REQAR'][1]) && is_numeric($GLOBALS['REQAR'][1])) {
if (isset($_POST['add_order'])) {
$Cart->FillByOrderId($GLOBALS['REQAR'][1], true);
} else {
$Cart->FillByOrderId($GLOBALS['REQAR'][1]);
}
示例2: array
<?php
$title = "Кабинет терминального клиента";
$tpl->Assign('h1', $title);
$GLOBALS['IERA_LINKS'] = array();
$GLOBALS['IERA_LINKS'][1]['title'] = $title;
$GLOBALS['IERA_LINKS'][1]['url'] = _base_url . '/cabinet/';
$no_tpl = '';
$Customer = new Customers();
$Customer->SetFieldsById($User->fields['id_user']);
$fields = array('date', 'id_order', 'status');
$f_assoc = array('date' => 'o.creation_date', 'id_order' => 'o.id_order', 'status' => 'o.id_order_status');
$orderby = "o.id_order desc";
// Список заказов
$orders = $Customer->GetOrdersTerminal($orderby);
if (!$no_tpl) {
$tpl->Assign('orders', $orders);
}
$Order = new Orders();
$order_statuses = $Order->GetStatuses();
if (!$no_tpl) {
$tpl->Assign('order_statuses', $order_statuses);
}
if (!$no_tpl) {
$parsed_res = array('issuccess' => TRUE, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_terminal_cab.tpl'));
}
示例3: array
if (isset($min) && isset($max) && $min != $max) {
$_SESSION['filters']['minprice'] = $min;
$_SESSION['filters']['maxprice'] = $max;
}
}
if ((!isset($_POST['pricefrom']) && !isset($_POST['priceto']) && !isset($_SESSION['filters']['pricefrom']) && !isset($_SESSION['filters']['priceto']) || $referer[1] != 'search' || $_SESSION['search']['newsearch'] == 1) && isset($_SESSION['filters']['minprice']) && isset($_SESSION['filters']['maxprice'])) {
$_SESSION['filters']['pricefrom'] = $_SESSION['filters']['minprice'];
$_SESSION['filters']['priceto'] = $_SESSION['filters']['maxprice'];
}
$tpl->Assign('header', $GLOBALS['IERA_LINKS'][1]['title']);
if (isset($_SESSION['member']) && $_SESSION['member']['gid'] == _ACL_SUPPLIER_) {
$_SESSION['price_mode'] = 3;
$parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_products.tpl'));
} elseif (isset($_SESSION['member']) && $_SESSION['member']['gid'] == _ACL_CONTRAGENT_) {
$Customer = new Customers();
$Customer->SetFieldsById($_SESSION['member']['id_user']);
$Customer->fields['discount'] = 1 - $Customer->fields['discount'] / 100;
$tpl->Assign('contragent', $Customer->fields);
if (!isset($_POST['price_mode']) && isset($_SESSION['price_mode']) && $_SESSION['price_mode'] != 3) {
$_SESSION['price_mode'] = $_SESSION['price_mode'];
} elseif (isset($_POST['price_mode'])) {
if ($_SESSION['price_mode'] != $_POST['price_mode']) {
$_SESSION['cart']['products'] = array();
}
$_SESSION['price_mode'] = $_POST['price_mode'];
setcookie('sum_range', 3, 0, '/');
header('Location: ' . $_SERVER['REQUEST_URI']);
} else {
$_SESSION['price_mode'] = 1;
}
$Status = new Status();
示例4: array
<?php
$orders = $_POST['orders'];
unset($parsed_res);
require $GLOBALS['PATH_model'] . 'invoice_c.php';
$orders_data = array();
//Тут будем хранить данные о каждом заказе
foreach ($orders as $order_id) {
$Order = new Orders();
$Order->SetFieldsById($order_id);
$orders_data[$order_id] = $Order->fields;
$User = new Users();
//Получаем клиента
$id_customer = $orders_data[$order_id]['id_customer'];
$Customer = new Customers();
$Customer->SetFieldsById($id_customer);
//Получаем контрагента
$id_contragent = $orders_data[$order_id]['id_contragent'];
$Contragent = new Contragents();
$Contragent->SetFieldsById($id_contragent);
//Получаем поля и присоединяем к данным о заказе
$customer_data = $Customer->fields;
$contragent_data = $Contragent->fields;
$orders_data[$order_id]['customer_data'] = $customer_data;
$orders_data[$order_id]['contragent_data'] = $contragent_data;
//Форматируем дату
$orders_data[$order_id]['date'] = date("d.m.Y", $orders_data[$order_id]['target_date']);
$Citys = new Citys();
$city = $Citys->SetFieldsById($orders_data[$order_id]['id_city']);
// Варианты доставки
if ($orders_data[$order_id]['id_delivery'] == 1) {
示例5: Invoice
echo "Доступ запрещен.";
exit;
}
}
$ord = $Order->fields;
$tpl->Assign("order", $ord);
$Invoice = new Invoice();
$User = new Users();
$Address = new Address();
// Получаем адреc доставки
$address = $Address->GetAddressById($ord['id_address']);
$tpl->Assign('address', $address);
// Получить данные покупателя
$id_customer = $ord['id_customer'];
$Customer = new Customers();
$Customer->SetFieldsById($id_customer, 1, true);
$tpl->Assign('Customer', $Customer->fields);
// Получить данные контрагента
$id_contragent = $ord['id_contragent'];
$Contragent = new Contragents();
if (isset($ord['id_remitter'])) {
$remitter = $Contragent->GetRemitterById($ord['id_remitter'], true);
$tpl->Assign('remitter', $remitter);
}
$Contragent->SetFieldsById($id_contragent);
$tpl->Assign('Contragent', $Contragent->fields);
$tpl->Assign('date', date('d.m.Y', $ord['target_date']));
$tpl->Assign('id_order', $ord['id_order']);
$Citys = new Citys();
$city = $Citys->SetFieldsById($ord['id_city']);
if ($ord['id_delivery'] == 1) {
示例6: 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 . "'";
//.........这里部分代码省略.........
示例7: Users
$User = new Users();
$Customer = new Customers();
// ---- center ----
unset($parsed_res);
if (isset($GLOBALS['REQAR'][1]) && is_numeric($GLOBALS['REQAR'][1])) {
$id_user = $GLOBALS['REQAR'][1];
} else {
header('Location: ' . $GLOBALS['URL_base'] . '404/');
exit;
}
$tpl->Assign('h1', 'Добавление покупателя');
$ii = count($GLOBALS['IERA_LINKS']);
$GLOBALS['IERA_LINKS'][$ii]['title'] = "Пользователи";
$GLOBALS['IERA_LINKS'][$ii++]['url'] = $GLOBALS['URL_base'] . 'adm/users/';
$GLOBALS['IERA_LINKS'][$ii]['title'] = "Редактирование покупателя";
if (!$Customer->SetFieldsById($id_user, 1)) {
die('Ошибка при выборе пользователя.');
}
if (!$User->SetFieldsById($id_user, 1)) {
die('Ошибка при выборе пользователя.');
}
$tpl->Assign('h1', 'Редактирование покупателя');
if (isset($_POST['smb'])) {
require_once $GLOBALS['PATH_block'] . 't_fnc.php';
// для ф-ции проверки формы
list($err, $errm) = Customer_form_validate(array('passwd'));
if (!$err) {
if ($id = $Customer->UpdateCustomer($_POST)) {
$tpl->Assign('msg', 'Информация обновлена.');
unset($_POST);
if (!$Customer->SetFieldsById($id_user, 1)) {
示例8: array
<?php
if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
if (!isset($_SESSION['Cart'])) {
$_SESSION['Cart']['products'] = array();
$_SESSION['Cart']['sum'] = (double) 0;
}
$Users = new Users();
$Cart = new Cart();
$Customers = new Customers();
$Products = new Products();
$Orders = new Orders();
if (G::IsLogged()) {
$Users->SetUser(G::GetLoggedData());
$Customers->SetFieldsById($Users->fields['id_user']);
$personal_discount = $Customers->fields['discount'];
}
if (isset($_POST['action'])) {
switch ($_POST['action']) {
case 'duplicate':
$Cart->FillByOrderId($_POST['id_order'], isset($_POST['add']) ? 1 : '');
$Cart->DBCart();
echo json_encode(true);
break;
case 'GetCart':
echo json_encode($_SESSION['cart']);
break;
case 'GetCartPage':
unset($parsed_res);
if (G::IsLogged()) {
$Users->SetUser(G::GetLoggedData());
示例9: isset
}
if (isset($_POST['NDS'])) {
$settings['NDS'] = $_POST['NDS'];
}
$settings['pay_form'] = isset($_POST['pay_form']) ? $_POST['pay_form'] : null;
// Получание информации о заказе
$Order = new Orders();
$Order->SetFieldsById($settings['order']);
$order_details = $Order->fields;
$Customers = new Customers();
$Address = new Address();
$address = $Address->GetAddressById($order_details['id_address']);
$tpl->Assign('address', $address);
if ($_POST['personal_client']) {
$order_details['cont_person'] = $_POST['personal_client'];
} else {
$Customers->SetFieldsById($_POST['client']);
$cstmr = $Customers->fields;
if ($cstmr) {
$tpl->Assign('cstmr', $cstmr);
$Citys = new Citys();
$Citys->SetFieldsById($cstmr['id_city']);
$order_details['address'] = $Citys->fields;
}
}
$Invoice = new Invoice();
$ord = $Invoice->GetOrderData($settings['order']);
$tpl->Assign('order_details', $order_details);
$tpl->Assign('settings', $settings);
$tpl->Assign('order', $ord);
echo $tpl->Parse($GLOBALS['PATH_tpl'] . 'tcpdf.tpl');