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


PHP customer::save方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: save

 public function save($id = 0, $name = '', $id_external = '', $billing_name1 = '', $billing_name2 = '', $billing_address = '', $billing_postcode = '', $billing_city = '', $billing_country = '', $billing_email_address = '', $billing_phone = '', $billing_fax = '', $billing_show_logo = true)
 {
     // Create new customer, fill and save it
     if ($id != 0) {
         // Create, fill and save customer
         $customer = new customer($id);
         $customer->fill($name, $id_external, $billing_name1, $billing_name2, $billing_address, $billing_postcode, $billing_city, $billing_country, $billing_email_address, $billing_phone, $billing_fax, $billing_show_logo);
         $customer->save();
     } else {
         $database = $_SESSION['database'];
         // Insert a new entry if one does not exist or update the existing one
         if (!$this->id_exists($this->id)) {
             // The entry does not exist
             $database->query("insert into " . TABLE_CUSTOMERS . " (customers_id, customers_name, customers_id_external, customers_billing_name1, customers_billing_name2, customers_billing_address, customers_billing_postcode, customers_billing_city, customers_billing_country, customers_billing_email_address, customers_billing_phone, customers_billing_fax, customers_billing_show_logo) values ('" . $this->id . "', '" . $database->input($this->name) . "', '" . $database->input($this->id_external) . "', '" . $database->input($this->billing_name1) . "', '" . $database->input($this->billing_name2) . "', '" . $database->input($this->billing_address) . "', '" . $database->input($this->billing_postcode) . "', '" . $database->input($this->billing_city) . "', '" . $database->input($this->billing_country) . "', '" . $database->input($this->billing_email_address) . "', '" . $database->input($this->billing_phone) . "', '" . $database->input($this->billing_fax) . "', '" . ($this->billing_show_logo ? 1 : 0) . "')");
         } else {
             // The entry exists, update the contents
             $activity_query = $database->query("update " . TABLE_CUSTOMERS . " set customers_id='" . $this->id . "', customers_name='" . $database->input($this->name) . "', customers_id_external='" . $database->input($this->id_external) . "', customers_billing_name1='" . $database->input($this->billing_name1) . "', customers_billing_name2='" . $database->input($this->billing_name2) . "', customers_billing_address='" . $database->input($this->billing_address) . "', customers_billing_postcode='" . $database->input($this->billing_postcode) . "', customers_billing_city='" . $database->input($this->billing_city) . "', customers_billing_country='" . $database->input($this->billing_country) . "', customers_billing_email_address='" . $database->input($this->billing_email_address) . "', customers_billing_phone='" . $database->input($this->billing_phone) . "', customers_billing_fax='" . $database->input($this->billing_fax) . "', customers_billing_show_logo='" . ($this->billing_show_logo ? 1 : 0) . "' where customers_id = '" . (int) $this->id . "'");
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:bitts-svn,代码行数:20,代码来源:customer.php

示例5: mailActive

 function mailActive()
 {
     $code = $this->uri->segment(2);
     $customer = new customer();
     $customer->get_by_emailActiveCode($code);
     $msg = "";
     if ($customer->exists()) {
         if ($customer->isEmailActive == 0) {
             $customer->isEmailActive = 1;
             $customer->save();
             $this->_loginUser($customer);
             $msg = "Chúc mừng " . $customer->name . " đã kích hoạt thành công tài khoản.";
             $msg .= "<br />Click vào đây để về trang chủ:<a href='" . base_url() . "' >Về trang chủ</a>";
         } else {
             $msg = "Tài khoản của bạn đã được kích hoạt từ trước. Liên kết này không có hiệu lực nữa.";
         }
     } else {
         $msg = "Tài khoản của bạn không tồn tại trong hệ thống.";
     }
     $dis['customer'] = $customer;
     $dis['base_url'] = base_url();
     $dis['view'] = 'user/activeEmail';
     //$dis['step'] = $step;
     $dis['msg'] = $msg;
     $this->viewfront($dis);
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:26,代码来源:fuser.php


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