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


PHP customer类代码示例

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


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


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