• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP customer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: addSales

 function addSales($sale = null)
 {
     if ($sale == null) {
         $sale = $this;
     }
     $sale_id = $this->db_handler->add_model($sale);
     if (is_array($this->sales_items) and count($this->sales_items) != 0) {
         foreach ($this->sales_items as $sales_item) {
             $sales_item->sale_id = $sale_id;
             $sales_item->company_id = $sale->company_id;
             $sales_item->addSaleItem();
             $inv = new inventry();
             $inv->company_id = $sale->company_id;
             $inv->item_id = $sales_item->item_id;
             $invs = $inv->getInventryForSpecificCompanyAndItem();
             $inv = $invs[0];
             $inv->in_stock_count = $inv->in_stock_count - $sales_item->quantity;
             $inv->updateInventry();
         }
     }
     $description = "Added new Sale (" . $sale->to_string() . ")";
     $customer = new customer();
     $customer->id = $sale->customer_id;
     $customer->getCustomer();
     $customer->total_purchace_amount = $customer->total_purchace_amount + $sale->amount;
     $customer->updateCustomer();
     Log::i($this->tag, $description);
     return $sale_id;
 }
开发者ID:sakkeerhussain,项目名称:online_ims,代码行数:29,代码来源:sales.php


示例2: get

		public static function get($nocache = false) {
			static $customer;
			if(!$nocache && !is_null($customer)) {
				return $customer;
			}

			$objects = umiObjectsCollection::getInstance();
			$permissions = permissionsCollection::getInstance();

			if($permissions->isAuth()) {
				$userId = $permissions->getUserId();
				$object = $objects->getObject($userId);
			} else {
				$object = self::getCustomerId();

				//Second try may be usefull to avoid server after-reboot conflicts
				if($object === false) $object = self::getCustomerId(true);
			}

			if($object instanceof iUmiObject) {
				$customer = new customer($object);
				$customer->tryMerge();
				return $customer;
			}
		}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:25,代码来源:customer.php


示例3: store

 public function store(Request $request)
 {
     $customer = new customer(array('customer' => $request->get('customer'), 'street' => $request->get('street'), 'city' => $request->get('city'), 'state' => $request->get('state'), 'zip' => $request->get('zip')));
     $customer->save();
     Toastr::success('Customer created.');
     return redirect('/customers');
 }
开发者ID:petrovitch,项目名称:chess,代码行数:7,代码来源:CustomersController.php


示例4: store

 public static function store()
 {
     $params = $_POST;
     //Kint::dump($params);
     $attributes = array('name' => $params['name'], 'phone' => $params['phone'], 'e_mail' => $params['e_mail']);
     $customer = new customer($attributes);
     $errors = $customer->errors();
     if (count($errors) == 0) {
         $customer->save();
         Redirect::to('/waybill/new', array('message' => 'Asiakas on lisätty onnistuneesti!'));
     } else {
         View::make('/customer/new.html', array('errors' => $errors, 'attributes' => $attributes));
     }
 }
开发者ID:tihig,项目名称:Tsoha-Bootstrap,代码行数:14,代码来源:customer_controller.php


示例5: process

 public function process($template = null)
 {
     list($tpl_block, $tpl_item) = def_module::loadTemplates("emarket/payment/invoice/" . $template, 'legal_person_block', 'legal_person_item');
     $collection = umiObjectsCollection::getInstance();
     $types = umiObjectTypesCollection::getInstance();
     $typeId = $types->getBaseType("emarket", "legal_person");
     $customer = customer::get();
     $order = $this->order;
     $mode = getRequest('param2');
     if ($mode == 'do') {
         $personId = getRequest('legal-person');
         $isNew = $personId == null || $personId == 'new';
         if ($isNew) {
             $typeId = $types->getBaseType("emarket", "legal_person");
             $personId = $collection->addObject("", $typeId);
             $controller = cmsController::getInstance();
             $data = getRequest('data');
             if ($data && ($dataModule = $controller->getModule("data"))) {
                 $person = $collection->getObject($personId);
                 $person->setName($data['new']['name']);
                 $dataModule->saveEditedObject($personId, $isNew, true);
             }
             if ($collection->getObject($personId) instanceof umiObject) {
                 $customer = customer::get();
                 $customer->legal_persons = array_merge($customer->legal_persons, array($personId));
             }
         }
         $order->legal_person = $personId;
         $order->order();
         $order->payment_document_num = $order->id;
         $result = $this->printInvoice($order);
         $buffer = outputBuffer::current();
         $buffer->charset('utf-8');
         $buffer->contentType('text/html');
         $buffer->clear();
         $buffer->push($result);
         $buffer->end();
         return true;
     } else {
         if ($mode == 'delete') {
             $personId = (int) getRequest('person-id');
             if ($collection->isExists($personId)) {
                 $customer = customer::get();
                 $customer->legal_persons = array_diff($customer->legal_persons, array($personId));
                 $collection->delObject($personId);
             }
         }
     }
     $items = array();
     $persons = $customer->legal_persons;
     if (is_array($persons)) {
         foreach ($persons as $personId) {
             $person = $collection->getObject($personId);
             $item_arr = array('attribute:id' => $personId, 'attribute:name' => $person->name);
             $items[] = def_module::parseTemplate($tpl_item, $item_arr, false, $personId);
         }
     }
     $block_arr = array('attribute:type-id' => $typeId, 'attribute:type_id' => $typeId, 'xlink:href' => 'udata://data/getCreateForm/' . $typeId, 'subnodes:items' => $items);
     return def_module::parseTemplate($tpl_block, $block_arr);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:60,代码来源:invoice.php


示例6: new_one

 /**
  * Don't let the customer on the login page if they are already authenticated
  * @Developer brandon
  * @Date Oct 12, 2010
  */
 public function new_one()
 {
     if (customer::logged_in()) {
         url::redirect(url::site());
     }
     parent::new_one();
 }
开发者ID:ready4god2513,项目名称:scs,代码行数:12,代码来源:sessions.php


示例7: updateFromMobile

function updateFromMobile($mobile, $customer)
{
    try {
        $entity_id_array = customer::getEntityId($mobile);
        if ($entity_id_array['success'] == 0) {
            $errorcode = $entity_id_array['errorcode'];
            throw new Exception($entity_id_array['data']);
        } else {
            $entity_id = $entity_id_array['data'];
            foreach ($customer as $customer_name => $column_value) {
                $enable_list = array('sex', 'nickname', 'myimage', 'birthday');
                if (in_array($customer_name, $enable_list)) {
                    $column_tmp = customer::updateCustomerColumn($entity_id, $customer_name, $column_value);
                    if ($column_tmp['success'] == 0) {
                        $errorcode = $column_tmp['errorcode'];
                        throw new Exception($column_tmp['data']);
                    }
                }
            }
            return array("data" => 'Update customer success', "success" => 1, 'errorcode' => 0);
        }
    } catch (Exception $e) {
        return array("data" => $e->getMessage(), "success" => 0, 'errorcode' => $errorcode);
    }
}
开发者ID:HB4daemmon,项目名称:custom,代码行数:25,代码来源:customer.php


示例8: validate

 public function validate()
 {
     if (is_array($this->users)) {
         $customer = customer::get();
         return in_array($customer->id, $this->users);
     } else {
         return false;
     }
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:9,代码来源:users.php


示例9: validate

 public function validate()
 {
     $customer = customer::get();
     if (is_array($this->user_groups) && is_array($customer->groups)) {
         return sizeof(array_intersect($customer->groups, $this->user_groups));
     } else {
         return false;
     }
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:9,代码来源:userGroups.php


示例10: addCust

 /**
  * adds customer to delivery table
  */
 public function addCust()
 {
     $delivery = new delivery();
     $customer = new customer();
     $data = $this->input->post(NULL, true);
     $cdata = array('cname' => $data['cname'], 'caddress' => $data['address'] . ', ' . $data['city'] . ',' . $data['state'] . ' ' . $data['zip'], 'cphone' => $data['cphone']);
     $ddata = array('schd' => $data['schd'], 'note' => $data['note']);
     $list = $this->input->post('list');
     $customer->setData($cdata);
     $delivery->setDelv($ddata);
     $delivery->cid = $customer->cid;
     $items = $this->item->getItems($customer->bname);
     if ($list == 'Yes') {
         $this->load->view('bChkList', array('delivery' => $delivery, 'items' => $items));
     } else {
         echo 'reset';
     }
     $this->db->insert('capsql.delivery', $delivery);
 }
开发者ID:CapstoneFleetIntelligience,项目名称:Fleet,代码行数:22,代码来源:admin_controller.php


示例11: detail

 public function detail()
 {
     //get expenseaccount
     $expenseaccountobj = new expenseaccount();
     $detail['expense_account_all'] = $expenseaccountobj->get_all();
     //get customers with domain_id from session by constructor
     $customerobj = new customer();
     $detail['customer'] = $customerobj->get();
     $detail['customer_all'] = $customerobj->get_all();
     //get billers with domain_id from session by constructor
     $billerobj = new biller();
     $detail['biller_all'] = $billerobj->get_all();
     //get invoices
     $invoiceobj = new invoice();
     $detail['invoice_all'] = $invoiceobj->get_all();
     //get products
     $productobj = new product();
     $detail['product_all'] = $productobj->get_all();
     return $detail;
 }
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:20,代码来源:expense.php


示例12: __construct

 /**
  * Require administrator login
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function __construct()
 {
     parent::__construct();
     $this->template = View::factory('layouts/admin');
     meta::set_title(store::name() . ' | Admin | ' . ucwords(Router::$controller));
     // Set the route for updating and creating files
     Kohana::config_set('routes.base_crud_route', 'admin/');
     // Require an admin login if we are in production.
     if (IN_PRODUCTION) {
         customer::require_admin_login();
     }
     ORM::factory('audit_trail')->create(array('user_id' => customer::current(), 'store_id' => store::get(), 'controller' => Router::$controller, 'method' => Router::$method, 'object_id' => $this->input->post('id')));
 }
开发者ID:ready4god2513,项目名称:scs,代码行数:18,代码来源:admin.php


示例13: edit

 function edit($id = 0)
 {
     $customer = new customer($id);
     if ($_SERVER['REQUEST_METHOD'] == "GET") {
     } else {
         $customer->name = $this->input->post('name');
         $customer->address = $this->input->post('address');
         $customer->username = $this->input->post('username');
         $customer->homePhone = $this->input->post('homePhone');
         $customer->mobilePhone = $this->input->post('mobilePhone');
         $customer->email = $this->input->post('email');
         $customer->username = $this->input->post('username');
         if ($this->input->post('password') != "") {
             if ($this->input->post('password') == $this->input->post('confirmPassword')) {
                 $customer->password = md5($this->input->post('password'));
                 if ($customer->save()) {
                     redirect($this->admin . 'customers/edit/' . $customer->id);
                 }
             } else {
                 flash_message("error", "Xác nhận mật khẩu phải giống mật khẩu");
             }
         } else {
             if ($customer->save()) {
                 redirect($this->admin . 'customers/edit/' . $customer->id);
             }
         }
     }
     setPagination($this->admin . 'carts/list_all/', 1, 100000000, 4);
     $dis['carts'] = $customer->cartitem;
     $dis['nav_menu'] = array(array("type" => "back", "text" => "Back", "link" => $this->admin . 'customers/list_all/', "onclick" => ""));
     $dis['title_table'] = "Danh sách đơn hàng ";
     $dis['base_url'] = base_url();
     $dis['title'] = "Menu";
     $dis['menu_active'] = "Khách hàng";
     $dis['view'] = "customer/edit";
     $dis['object'] = $customer;
     $this->viewadmin($dis);
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:38,代码来源:customers.php


示例14: get

 /**
  * Get the cart
  * @Developer brandon
  * @Date Oct 20, 2010
  */
 public static function get()
 {
     if (customer::logged_in()) {
         return customer::current()->load_cart();
     } else {
         if (Session::instance()->get('cart_' . store::get())) {
             return ORM::factory('cart', Session::instance()->get('cart_' . store::get()));
         } else {
             $cart = ORM::factory('cart');
             $cart->save();
             Session::instance()->set('cart_' . store::get(), (string) $cart);
             return $cart;
         }
     }
 }
开发者ID:ready4god2513,项目名称:scs,代码行数:20,代码来源:cart.php


示例15: detail

 public static function detail()
 {
     //get customers
     $detail['expense_account_all'] = expenseaccount::get_all();
     //get customers
     $detail['customer'] = customer::get();
     $detail['customer_all'] = customer::get_all();
     //get billers
     $detail['biller_all'] = biller::get_all();
     //get invoices
     $detail['invoice_all'] = invoice::get_all();
     //get products
     $detail['product_all'] = product::get_all();
     return $detail;
 }
开发者ID:alachaum,项目名称:simpleinvoices,代码行数:15,代码来源:expense.php


示例16: create

 /**
  * Создать новый пустой заказ
  * @return Integer $order id нового заказа
  */
 public static function create($useDummyOrder = false)
 {
     $objectTypes = umiObjectTypesCollection::getInstance();
     $objects = umiObjectsCollection::getInstance();
     $permissions = permissionsCollection::getInstance();
     $cmsController = cmsController::getInstance();
     $domain = $cmsController->getCurrentDomain();
     $domainId = $domain->getId();
     $orderTypeId = $objectTypes->getBaseType('emarket', 'order');
     if ($useDummyOrder) {
         $sel = new selector('objects');
         $sel->types('object-type')->name('emarket', 'order');
         $sel->where('name')->equals('dummy');
         $sel->limit(0, 1);
         if ($sel->length()) {
             $orderId = $sel->first->id;
         } else {
             $orderTypeId = $objectTypes->getBaseType('emarket', 'order');
             $orderId = $objects->addObject('dummy', $orderTypeId);
             $order = $objects->getObject($orderId);
             if ($order instanceof iUmiObject == false) {
                 throw new publicException("Can't load dummy object for order #{$orderId}");
             } else {
                 $order->setValue('domain_id', $domainId);
                 $order->commit();
             }
         }
         return self::get($orderId);
     }
     $managerId = 0;
     $statusId = self::getStatusByCode('basket');
     $customer = customer::get();
     $createTime = time();
     $orderId = $objects->addObject('', $orderTypeId);
     $order = $objects->getObject($orderId);
     if ($order instanceof iUmiObject == false) {
         throw new publicException("Can't load created object for order #{$orderId}");
     }
     $order->domain_id = $domainId;
     $order->manager_id = $managerId;
     $order->status_id = $statusId;
     $order->customer_id = $customer->getId();
     $order->order_create_date = $createTime;
     $order->commit();
     $customer->setLastOrder($orderId, $domainId);
     return self::get($orderId);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:51,代码来源:order.php


示例17: getCustomerOrders

 protected function getCustomerOrders()
 {
     static $customerOrders = null;
     if (!is_null($customerOrders)) {
         return $customerOrders;
     }
     $customer = customer::get();
     $cmsController = cmsController::getInstance();
     $domain = $cmsController->getCurrentDomain();
     $domainId = $domain->getId();
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'order');
     $sel->where('customer_id')->equals($customer->id);
     $sel->where('domain_id')->equals($domainId);
     $sel->where('status_id')->equals(order::getStatusByCode('ready'));
     return $customerOrders = $sel->result;
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:17,代码来源:allOrdersPrices.php


示例18: show_user_orders

 /**
  * Функция рисует список заказов пользователя
  * @param string $template Название шаблона
  * @return mixed Список заказов пользователя
  */
 public function show_user_orders($template = 'default')
 {
     list($tpl_block, $tpl_block_empty, $tpl_item, $tpl_order_item) = def_module::loadTemplates("emarket/" . $template, 'orders_block', 'orders_block_empty', 'orders_item', 'orders_order_item');
     $cmsController = cmsController::getInstance();
     $domain = $cmsController->getCurrentDomain();
     $domainId = $domain->getId();
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'order');
     $sel->where('customer_id')->equals(customer::get()->id);
     $sel->where('name')->isNull(false);
     $sel->where('domain_id')->equals($domainId);
     if ($sel->length == 0) {
         $tpl_block = $tpl_block_empty;
     }
     $items_arr = array();
     foreach ($sel->result as $selOrder) {
         $order = order::get($selOrder->id);
         $item_arr['attribute:id'] = $order->id;
         $item_arr['attribute:name'] = $order->name;
         $item_arr['attribute:type-id'] = $order->typeId;
         $item_arr['attribute:guid'] = $order->GUID;
         $item_arr['attribute:type-guid'] = $order->typeGUID;
         $item_arr['attribute:ownerId'] = $order->ownerId;
         $item_arr['xlink:href'] = $order->xlink;
         $item_arr['attribute:delivery_allow_date'] = date('d.m.Y', $order->getValue('delivery_allow_date')->timestamp);
         //print_r($order->getValue('order_items'));
         //Получаем список товаров заказа
         $items = array();
         foreach ($order->getItems() as $orderItem) {
             //					print_r($order_item); die;
             $item_line = array();
             //					print_r(umiHierarchy::getInstance()->getObjectInstances($orderItem->id));
             $item_line['attribute:element_id'] = $orderItem->id;
             $item_line['attribute:name'] = $orderItem->name;
             $item_line['attribute:item_amount'] = $orderItem->getAmount();
             //					$item_line['attribute:options'] = $orderItem->getOptions();
             //						print_r($order_item->options);
             $items[] = def_module::parseTemplate($tpl_order_item, $item_line, false, $iOrderItemId);
             umiObjectsCollection::getInstance()->unloadObject($iOrderItemId);
         }
         $item_arr['subnodes:order_items'] = $items;
         $items_arr[] = def_module::parseTemplate($tpl_item, $item_arr, false, $order->id);
     }
     return def_module::parseTemplate($tpl_block, array('subnodes:items' => $items_arr));
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:50,代码来源:__custom.php


示例19: import_orders

 public static function import_orders($order, $product)
 {
     try {
         $conn = db_connect();
         $order_id = $order[0];
         $customer_id_return = customer::getCustomerEntityIdFromUserId($order[3]);
         if ($customer_id_return['success'] == 0) {
             $errorcode = $customer_id_return['errorcode'];
             throw new Exception($customer_id_return['data']);
         }
         $customer_id = $customer_id_return['data'];
         $order_sn = $order[2];
         $order_status_code = $order[4];
         $pay_status_code = $order[6];
         $referer = $order[44];
         $to_buyer = $order[55];
         $is_1yuan = $order[69];
         $device_id = $order[70];
         $shipping_type = $order[73];
         $create_at = date('y-m-d H:i:s', $order[45]);
         if ($order_status_code) {
         }
         $order_list = array("origin_order_id" => $order_id, "customer_id" => $customer_id, "order_sn" => $order_sn, "referer" => $referer, "to_buyer" => $to_buyer, "is_1yuan" => $is_1yuan, "device_id" => $device_id, "shipping_type" => $shipping_type, "create_at" => $create_at);
         $product_list = array();
         foreach ($product as $p) {
             $goods_id = self::getProductId($p[2]);
             $qty = array('qty', $p[6]);
             $product_list[$goods_id] = $qty;
         }
         self::createOrder($order_list, $product_list);
         $conn->close();
         return array('data' => '', "success" => 1, "errorcode" => 0);
     } catch (Exception $e) {
         $conn->close();
         return array('data' => $e->getMessage(), "success" => 0, "errorcode" => $errorcode);
     }
 }
开发者ID:HB4daemmon,项目名称:custom,代码行数:37,代码来源:orders.php


示例20: export

$biller_id = $_GET['biller_id'];
$customer_id = $_GET['customer_id'];
$filter_by_date = $_GET['filter_by_date'];
if ( $filter_by_date =="yes" )
{
	$start_date = $_GET['start_date'];
	$end_date = $_GET['end_date'];
}
$show_only_unpaid = $_GET['show_only_unpaid'];
$show_only_real = $_GET['show_only_real'];
$get_format = $_GET['format'];
$get_file_type = $_GET['filetype'];


$biller = $SI_BILLER->getBiller($_GET['biller_id']);
$customer = customer::get($_GET['customer_id']);

#create PDF name

if ($_GET['stage'] == 2 ) {

	#echo $block_stage2;


	#get the invoice id
	$export = new export();
	$export -> format = 'pdf';
	$export -> file_type = $get_file_type;
	$export -> file_location = 'file';
	$export -> module = 'statement';
	$export -> biller_id = $biller_id;
开发者ID:CalhounGaming,项目名称:simpleinvoices,代码行数:31,代码来源:email.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP dao类代码示例发布时间:2022-05-23
下一篇:
PHP custom_profile类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap