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


PHP customer::updateCustomer方法代码示例

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


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

             }
             $responce = array('status' => 'failed', 'error' => $error_message, 'data' => array());
         }
     } else {
         $responce = array('status' => 'failed', 'error' => 'Data missing', 'data' => array());
     }
 } else {
     if ($form_id == 6) {
         ///edit customer
         if (isset($_POST['customer_id']) and !empty($_POST['customer_id']) and isset($_POST['customer_name']) and !empty($_POST['customer_name']) and isset($_POST['contact_number']) and !empty($_POST['contact_number'])) {
             $customer = new customer();
             $customer->id = $_POST['customer_id'];
             $customer->getCustomer();
             $customer->customer_name = $_POST['customer_name'];
             $customer->contact_number = $_POST['contact_number'];
             if ($customer->updateCustomer()) {
                 $message = "Customer Updated Successfuly";
                 $responce = array('status' => 'success', 'error' => '', 'data' => array("message" => $message, "id" => $customer->id));
             } else {
                 $description = "Customer update failed, Customer : " . $customer->to_string();
                 Log::e($tag, $description);
                 $mysql_error = mysql_error();
                 if (empty($mysql_error)) {
                     $error_message = 'Some server error occured';
                 } else {
                     $error_message = $mysql_error;
                 }
                 $responce = array('status' => 'failed', 'error' => $error_message, 'data' => array());
             }
         } else {
             $responce = array('status' => 'failed', 'error' => 'Data missing', 'data' => array());
开发者ID:sakkeerhussain,项目名称:online_ims,代码行数:31,代码来源:update_form_data.php

示例3: elseif

} elseif (isset($_GET['action']) && $_GET['action'] == 'edit') {
    $id = $_GET['id'];
    $smarty->assign('customer', $customer->getCustomer($id));
    $smarty->assign('billing', $customer->getCustomerBilling($id));
    $smarty->assign('shipping', $customer->getCustomerShipping($id));
    $smarty->assign('tax', $customer->getCustomerTax($id));
    $smarty->assign('content', $smarty->fetch('editcustomer.tpl'));
} elseif (isset($_POST['action']) && $_POST['action'] == 'add') {
    $data = $_POST['data']['Customer'];
    if ($customer->addCustomer($data)) {
        header('Location: ' . FRONTEND . 'customer.php');
        exit;
    }
} elseif (isset($_POST['action']) && $_POST['action'] == 'update') {
    $data = $_POST['data']['Customer'];
    if ($customer->updateCustomer($data)) {
        header('Location: ' . FRONTEND . 'customer.php');
        exit;
    }
} elseif (isset($_GET['action']) && $_GET['action'] == 'search') {
    $keyword = $_POST['keywords'];
    $smarty->assign('customer', $customer->getSearchCustomers($keyword));
    $smarty->assign('content', $smarty->fetch('customerlist.tpl'));
} else {
    $page = 1;
    if (isset($_GET['page'])) {
        $page = $_GET['page'];
    }
    $customers = $customer->getCustomers($page, $offset = 10);
    $smarty->assign('customercount', $customer->getCustomersCount());
    $smarty->assign('page', $page);
开发者ID:roshanbhgt,项目名称:erp,代码行数:31,代码来源:customer.php


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