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


PHP Customers::find方法代码示例

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


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

示例1: deleteAction

 /**
  * Delete a customer record
  */
 public function deleteAction()
 {
     $customersTable = new Customers();
     $customer = $customersTable->find($this->_getParam('id'))->current();
     !is_null($customer) && $customer->delete();
     $this->_redirect('/customers');
 }
开发者ID:carriercomm,项目名称:billing-6,代码行数:10,代码来源:CustomersController.php

示例2: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $validator = Validator::make(Input::all(), Customers::$rules);
     if ($validator->passes()) {
         $customer = Customers::find($id);
         $customer->name = Input::get('name');
         $customer->address = Input::get('address');
         $customer->contact = Input::get('contact');
         $customer->save();
         return Redirect::route('customers.index')->with('success', 'Customer updated successfully');
     } else {
         return Redirect::route('customers.edit', $id)->withErrors($validator)->withInput(Input::all());
     }
 }
开发者ID:nurulimamnotes,项目名称:point-of-sale,代码行数:20,代码来源:CustomersController.php

示例3: addSchedule

 static function addSchedule($inputs)
 {
     $introVisit = new IntroVisit();
     $introVisit['customer_id'] = $inputs['customerId'];
     $introVisit->student_id = $inputs['studentIdIntroVisit'];
     $introVisit->class_id = $inputs['eligibleClassesCbx'];
     $introVisit->batch_id = $inputs['introbatchCbx'];
     //$introVisit->status             = 'ACTIVE/SCHEDULED';
     $introVisit->franchisee_id = Session::get('franchiseId');
     $introVisit->iv_date = date('Y-m-d', strtotime($inputs['introVisitTxtBox']));
     $introVisit->created_by = Session::get('userId');
     $introVisit->created_at = date("Y-m-d H:i:s");
     $introVisit->save();
     $customerObj = Customers::find($inputs['customerId']);
     if ($customerObj) {
         $customerObj->stage = "IV SCHEDULED";
         $customerObj->save();
     }
     return $introVisit;
 }
开发者ID:Headrun-php,项目名称:TLG,代码行数:20,代码来源:IntroVisit.php

示例4: insert

 public function insert($params)
 {
     $this->authenticate();
     $form = new Api_Form_CustomerForm(array('action' => '#', 'method' => 'post'));
     #Add email validator
     $mailValidator = new Shineisp_Validate_Email();
     $form->getElement('email')->addValidator($mailValidator);
     $form->addElement('password', 'password', array('filters' => array('StringTrim'), 'required' => true, 'decorators' => array('Composite'), 'validators' => array(array('regex', false, '/^[a-zA-Z0-9\\-\\_\\.\\%\\!\\$]{6,20}$/')), 'description' => 'Write here your password. (min.6 chars - max.20 chars)', 'label' => 'Password', 'class' => 'text-input large-input'));
     if (array_key_exists('countrycode', $params)) {
         $country_id = Countries::getIDbyCode($params['countrycode']);
         if ($country_id == null) {
             throw new Shineisp_Api_Exceptions(400005, ":: 'countrycode' not valid");
             exit;
         }
         unset($params['coutrycode']);
         $params['country_id'] = $country_id;
     }
     if (array_key_exists('provincecode', $params) && $params['provincecode'] != "") {
         $params['area'] = $params['provincecode'];
         unset($params['provincecode']);
     }
     if ($form->isValid($params)) {
         if ($params['status'] == false) {
             $params['status'] = 'disabled';
         }
         $idcustomers = Customers::Create($params);
         $customer = Customers::find($idcustomers);
         return $customer['uuid'];
     } else {
         $errors = $form->getMessages();
         $message = "";
         foreach ($errors as $field => $errorsField) {
             $message .= "Field '{$field}'<br/>";
             foreach ($errorsField as $error => $describe) {
                 $message .= " => {$error} ({$describe})";
             }
         }
         throw new Shineisp_Api_Exceptions(400004, ":\n{$message}");
         exit;
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:41,代码来源:Customers.php

示例5: saveCustomers

 static function saveCustomers($inputs)
 {
     $customer = Customers::find($inputs['customerId']);
     $customer->franchisee_id = Session::get('franchiseId');
     $customer->customer_name = $inputs['customerName'];
     $customer->customer_lastname = $inputs['customerLastName'];
     $customer->customer_email = $inputs['customerEmail'];
     $customer->mobile_no = $inputs['customerMobile'];
     $customer->building = $inputs['building'];
     $customer->apartment_name = $inputs['apartment'];
     $customer->lane = $inputs['lane'];
     $customer->locality = $inputs['locality'];
     if ($inputs['state'] == '') {
         $customer->state = 0;
     } else {
         $customer->state = $inputs['state'];
     }
     if (isset($inputs['city'])) {
         if ($inputs['city'] == '') {
             $customer->city = 0;
         } else {
             $customer->city = $inputs['city'];
         }
     }
     $customer->zipcode = $inputs['zipcode'];
     $customer->source = $inputs['source'];
     //$customer->stage          = 'inquire';
     $customer->referred_by = $inputs['referredBy'];
     $customer->created_by = Session::get('userId');
     $customer->updated_at = date("Y-m-d H:i:s");
     /* if(isset($inputs['eventsId']) && $inputs['eventsId'] != ""){
     		
     		$customer->source_event     = $inputs['eventsId'];
     		
     		} */
     $customer->save();
     return $customer;
 }
开发者ID:Headrun-php,项目名称:TLG,代码行数:38,代码来源:Customers.php

示例6: insert

 public function insert($params)
 {
     $this->authenticate();
     $form = new Api_Form_CustomerForm(array('action' => '#', 'method' => 'post'));
     if (array_key_exists('countrycode', $params)) {
         $country_id = Countries::getIDbyCode($params['countrycode']);
         if ($country_id == null) {
             throw new Shineisp_Api_Exceptions(400005, ":: 'countrycode' not valid");
             exit;
         }
         unset($params['coutrycode']);
         $params['country_id'] = $country_id;
     }
     if (array_key_exists('provincecode', $params) && $params['provincecode'] != "") {
         $params['area'] = $params['provincecode'];
         unset($params['provincecode']);
     }
     if ($form->isValid($params)) {
         if ($params['status'] == false) {
             $params['status'] = 'disabled';
         }
         $idcustomers = Customers::Create($params);
         $customer = Customers::find($idcustomers);
         return $customer['uuid'];
     } else {
         $errors = $form->getMessages();
         $message = "";
         foreach ($errors as $field => $errorsField) {
             $message .= "Field '{$field}'<br/>";
             foreach ($errorsField as $error => $describe) {
                 $message .= " => {$error} ({$describe})";
             }
         }
         throw new Shineisp_Api_Exceptions(400004, ":\n{$message}");
         exit;
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:37,代码来源:Customers.php

示例7: create

 public function create($params)
 {
     $this->authenticate();
     $uuid = $params['uuid'];
     $customers = Customers::find($uuid);
     if (empty($customers)) {
         throw new Shineisp_Api_Exceptions(400006, ":: 'uuid' not valid");
         exit;
     }
     $trancheid = intval($params['trancheid']);
     $tranche = ProductsTranches::getTranchebyId($trancheid);
     if (empty($tranche)) {
         throw new Shineisp_Api_Exceptions(400006, ":: 'trancheid' not valid");
         exit;
     }
     #Check Products
     if (empty($params['products']) && !is_array($params['products'])) {
         throw new Shineisp_Api_Exceptions(400006, ":: not 'products' choose");
         exit;
     }
     foreach ($params['products'] as $product) {
         $productid = intval($product['productid']);
         $billingid = intval($product['billingid']);
         $ttry = ProductsTranches::getTranchesBy_ProductId_BillingId($productid, $billingid);
         if (empty($ttry)) {
             throw new Shineisp_Api_Exceptions(400006, ":: 'productid' or 'bilingid' not valid");
             exit;
         }
         $ttry = array_shift($ttry);
         if ($ttry['tranche_id'] != $trancheid) {
             throw new Shineisp_Api_Exceptions(400006, ":: 'bilingid' not valid");
             exit;
         }
     }
     $id = $customers['customer_id'];
     $isVATFree = Customers::isVATFree($id);
     if ($params['status'] == "complete") {
         $status = Statuses::id('complete', 'orders');
     } else {
         $status = Statuses::id('tobepaid', 'orders');
     }
     $theOrder = Orders::create($customers['customer_id'], $status, $params['note']);
     foreach ($params['products'] as $product) {
         $productid = intval($product['productid']);
         $billingid = intval($product['billingid']);
         $quantity = intval($product['quantity']);
         $p = Products::getAllInfo($productid);
         Orders::addItem($productid, $quantity, $billingid, $trancheid, $p['ProductsData'][0]['name'], array());
     }
     $orderID = $theOrder['order_id'];
     if ($params['sendemail'] == 1) {
         Orders::sendOrder($orderID);
     }
     $banks = Banks::find($params['payment'], "*", true);
     if (!empty($banks[0]['classname'])) {
         $class = $banks[0]['classname'];
         if (class_exists($class)) {
             // Get the payment form object
             $banks = Banks::findbyClassname($class);
             $gateway = new $class($orderID);
             $gateway->setFormHidden(true);
             $gateway->setRedirect(true);
             $gateway->setUrlOk($_SERVER['HTTP_HOST'] . "/orders/response/gateway/" . md5($banks['classname']));
             $gateway->setUrlKo($_SERVER['HTTP_HOST'] . "/orders/response/gateway/" . md5($banks['classname']));
             $gateway->setUrlCallback($_SERVER['HTTP_HOST'] . "/common/callback/gateway/" . md5($banks['classname']));
             return $gateway->CreateForm();
         }
     }
     throw new Shineisp_Api_Exceptions(400006, ":: bad request");
     exit;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:71,代码来源:Orders.php

示例8: actionUpdatekat

 public function actionUpdatekat($id)
 {
     $readonly = Customers::find()->where(['CUST_KD' => $id])->asArray()->one();
     // data for view
     $model = $this->findModelcust($id);
     $model->scenario = "updatekat";
     $dropparentkategori = ArrayHelper::map(Kategoricus::find()->where('CUST_KTG_PARENT = CUST_KTG')->asArray()->all(), 'CUST_KTG', 'CUST_KTG_NM');
     if ($model->load(Yii::$app->request->post())) {
         $tanggal = \Yii::$app->formatter->asDate($model->JOIN_DATE, 'Y-M-d');
         $model->JOIN_DATE = $tanggal;
         if ($model->validate()) {
             $model->UPDATED_AT = date("Y-m-d H:i:s");
             $model->UPDATED_BY = Yii::$app->user->identity->username;
             if ($model->save()) {
                 echo 1;
             } else {
                 echo 0;
             }
         }
         //  return $this->redirect(['index']);
     } else {
         return $this->renderAjax('type', ['model' => $model, 'dropparentkategori' => $dropparentkategori, 'readonly' => $readonly]);
     }
 }
开发者ID:adem-team,项目名称:advanced,代码行数:24,代码来源:KategoriCustomersCrmController.php

示例9: getCustomerList

 public function getCustomerList()
 {
     $customers = Customers::find()->where(['user_id' => Yii::$app->user->id])->all();
     return ArrayHelper::map($customers, 'id', 'name');
 }
开发者ID:ni032mas,项目名称:emtol_yii2,代码行数:5,代码来源:Objreservation.php

示例10: linkAction

 public function linkAction()
 {
     $request = $this->getRequest();
     $NS = new Zend_Session_Namespace('Default');
     try {
         $code = $request->getParam('id');
         $link = Fastlinks::findbyCode($code);
         $auth = Zend_Auth::getInstance();
         $auth->setStorage(new Zend_Auth_Storage_Session('default'));
         if (!empty($link[0]['controller'])) {
             $customer = Customers::find($link[0]['customer_id']);
             //TODO: GUEST - ALE - 20130516: remove access for disabled customers
             if (isset($customer) && in_array($customer['status_id'], array(Statuses::id("active", "customers"), Statuses::id("disabled", "customers")))) {
                 $NS->customer = $customer;
                 Fastlinks::updateVisits($link[0]['fastlink_id']);
                 $this->_helper->redirector($link[0]['action'], $link[0]['controller'], 'default', json_decode($link[0]['params'], true));
             } else {
                 header('location: /customer/login');
                 die;
             }
         } else {
             header('location: /customer/login');
             die;
         }
     } catch (Exception $e) {
         echo $e->getMessage();
         die;
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:29,代码来源:IndexController.php

示例11: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int $id
  * @return Response
  */
 public function update($id)
 {
     $validator = Validator::make(Input::all(), Sales::$rules);
     if ($validator->passes()) {
         $customerId = Input::get('customer_id', null);
         // Create customer if required
         $customer = new Customers();
         if ($customerId) {
             $customer = Customers::find($customerId);
         }
         if (Input::get('name')) {
             $customer->name = Input::get('name');
             $customer->address = Input::get('address');
             $customer->contact = Input::get('contact');
             $customer->save();
         }
         $sale = Sales::find($id);
         $sale->customer_id = $customer->id ? $customer->id : 0;
         $sale->outlet_id = $this->user->outlet_id;
         $sale->paid = Input::get('paid');
         $sale->notes = Input::get('notes');
         $sale->status = Input::get('paid') == Input::get('grandtotal') ? 'completed' : 'credit';
         $sale->save();
         return Redirect::route('sales.edit', $id)->with('success', 'Sale updated successfully');
     } else {
         return Redirect::route('sales.edit', $id)->withErrors($validator)->withInput(Input::all());
     }
 }
开发者ID:nurulimamnotes,项目名称:point-of-sale,代码行数:34,代码来源:SalesController.php

示例12: ownerGrid

 /**
  * ownerGrid
  * Get the customer/owner information.
  * @return array
  */
 private function ownerGrid($customerid)
 {
     if (is_numeric($customerid)) {
         $customer = Customers::find($customerid, 'company, firstname, lastname, email');
         if (isset($customer)) {
             return array('records' => array($customer), 'editpage' => 'customers');
         }
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:14,代码来源:ServicesController.php

示例13: enrollKid

 public function enrollKid()
 {
     $inputs = Input::all();
     $batch_data = Batches::find($inputs['batchCbx']);
     $eachClassCost = $batch_data->class_amount;
     //return Response::json(array('status'=>$inputs));
     //$inputs['discountPercentage']=$inputs['discountP'];
     $studentClasses['classId'] = $inputs['eligibleClassesCbx'];
     $studentClasses['batchId'] = $inputs['batchCbx'];
     $studentClasses['studentId'] = $inputs['studentId'];
     $season_data = Seasons::find($inputs['SeasonsCbx']);
     //$inputs['enrollmentEndDate']=$season_data->end_date;
     //$studentClasses['enrollment_start_date'] = date('Y-m-d', strtotime($inputs['enrollmentStartDate']));
     //return Response::json(array('status'=>'working'));
     //$studentClasses['enrollment_end_date']   = date('Y-m-d', strtotime($inputs['enrollmentEndDate']));
     $studentClasses['selected_sessions'] = $inputs['selectedSessions'];
     $studentClasses['seasonId'] = $inputs['SeasonsCbx'];
     //for proper enrollment start date and end date
     $end = Carbon::now();
     $start = Carbon::now();
     $start->year = date('Y', strtotime($inputs['enrollmentStartDate']));
     $start->month = date('m', strtotime($inputs['enrollmentStartDate']));
     $start->day = date('d', strtotime($inputs['enrollmentStartDate']));
     $end->year = date('Y', strtotime($inputs['enrollmentEndDate']));
     $end->month = date('m', strtotime($inputs['enrollmentEndDate']));
     $end->day = date('d', strtotime($inputs['enrollmentEndDate']));
     $batch_data = BatchSchedule::where('batch_id', '=', $inputs['batchCbx'])->where('schedule_date', '>=', $start->toDateString())->where('schedule_date', '<=', $end->toDateString())->where('holiday', '!=', 1)->orderBy('id')->get();
     $studentClasses['enrollment_start_date'] = $batch_data[0]['schedule_date'];
     $studentClasses['enrollment_end_date'] = $batch_data[count($batch_data) - 1]['schedule_date'];
     //Batch Start date
     $BatchDetails = Batches::where('id', '=', $inputs['batchCbx'])->first();
     $reminderStartDate = $BatchDetails->start_date;
     $enrollment = StudentClasses::addStudentClass($studentClasses);
     $paymentDuesInput['student_id'] = $inputs['studentId'];
     $paymentDuesInput['customer_id'] = $inputs['customerId'];
     $paymentDuesInput['batch_id'] = $inputs['batchCbx'];
     $paymentDuesInput['class_id'] = $inputs['eligibleClassesCbx'];
     $paymentDuesInput['selected_sessions'] = $inputs['selectedSessions'];
     $paymentDuesInput['seasonId'] = $inputs['SeasonsCbx'];
     $paymentDuesInput['each_class_cost'] = $eachClassCost;
     $order['customer_id'] = $inputs['customerId'];
     $order['student_id'] = $inputs['studentId'];
     $order['seasonId'] = $inputs['SeasonsCbx'];
     $order['student_classes_id'] = $enrollment->id;
     $order['payment_mode'] = $inputs['paymentTypeRadio'];
     $order['payment_for'] = "enrollment";
     $order['card_last_digit'] = $inputs['card4digits'];
     $order['card_type'] = $inputs['cardType'];
     $order['bank_name'] = $inputs['bankName'];
     $order['cheque_number'] = $inputs['chequeNumber'];
     //$order['each_class_cost']   =$eachClassCost;
     if (isset($inputs['membershipType'])) {
         $order['membershipType'] = $inputs['membershipType'];
     }
     $paydue_id;
     if ($inputs['paymentOptionsRadio'] == 'singlepay') {
         // for starting and end date of enrollment
         $enddate = Carbon::now();
         $startdate = Carbon::now();
         $startdate->year = date('Y', strtotime($inputs['enrollmentStartDate']));
         $startdate->month = date('m', strtotime($inputs['enrollmentStartDate']));
         $startdate->day = date('d', strtotime($inputs['enrollmentStartDate']));
         $enddate->year = date('Y', strtotime($inputs['enrollmentEndDate']));
         $enddate->month = date('m', strtotime($inputs['enrollmentEndDate']));
         $enddate->day = date('d', strtotime($inputs['enrollmentEndDate']));
         $batch_data = BatchSchedule::where('batch_id', '=', $inputs['batchCbx'])->where('schedule_date', '>=', $startdate->toDateString())->where('schedule_date', '<=', $enddate->toDateString())->where('holiday', '!=', 1)->orderBy('id')->get();
         $paymentDuesInput['start_order_date'] = $batch_data[0]['schedule_date'];
         $paymentDuesInput['end_order_date'] = $batch_data[count($batch_data) - 1]['schedule_date'];
         $paymentDuesInput['payment_due_amount'] = $inputs['singlePayAmount'];
         $paymentDuesInput['payment_type'] = $inputs['paymentOptionsRadio'];
         $paymentDuesInput['payment_status'] = "paid";
         $paymentDuesInput['discount_applied'] = $inputs['discountPercentage'];
         $paymentDuesInput['student_class_id'] = $enrollment->id;
         $paymentDuesInput['selected_order_sessions'] = $inputs['selectedSessions'];
         //$paymentDuesInput['start_order_date']=$studentClasses['enrollment_start_date'];
         //$paymentDuesInput['end_order_date']=$studentClasses['enrollment_end_date'];
         $paymentDuesInput['discount_amount'] = $inputs['discountPercentage'] / 100 * $inputs['singlePayAmount'];
         $order['amount'] = $inputs['singlePayAmount'];
         if ($inputs['CustomerType'] == 'OldCustomer') {
             $paymentDuesInput['created_at'] = date('Y-m-d H:i:s', strtotime($inputs['OrderDate']));
             $order['created_at'] = $paymentDuesInput['created_at'];
         }
         $paymentDuesResult = PaymentDues::createPaymentDues($paymentDuesInput);
         $order['payment_dues_id'] = $paymentDuesResult->id;
         $order['order_status'] = "completed";
         if ($inputs['selectedSessions'] > 8) {
             // creating followup for the single pay
             $presentDate = Carbon::now();
             $startdate = Carbon::now();
             $startdate->year = date('Y', strtotime($inputs['enrollmentStartDate']));
             $startdate->month = date('m', strtotime($inputs['enrollmentStartDate']));
             $startdate->day = date('d', strtotime($inputs['enrollmentStartDate']));
             $batch_schedule_data = BatchSchedule::where('batch_id', '=', $inputs['batchCbx'])->where('schedule_date', '>=', $startdate->toDateString())->where('holiday', '!=', 1)->orderBy('id')->get();
             $session_number = (int) ($inputs['selectedSessions'] / 2);
             $reminder_date = $batch_schedule_data[$session_number]['schedule_date'];
             $customer_log_data['customer_id'] = $paymentDuesResult->customer_id;
             $customer_log_data['student_id'] = $paymentDuesResult->student_id;
             $customer_log_data['franchisee_id'] = Session::get('franchiseId');
             $customer_log_data['followup_type'] = 'PAYMENT';
             $customer_log_data['followup_status'] = 'REMINDER_CALL';
//.........这里部分代码省略.........
开发者ID:Headrun-php,项目名称:TLG,代码行数:101,代码来源:StudentsController.php

示例14: editAction

 /**
  * editAction
  * Get a record and populate the application form 
  * @return unknown_type
  */
 public function editAction()
 {
     $form = $this->getForm('/admin/orders/process');
     $currency = Shineisp_Registry::getInstance()->Zend_Currency;
     $customer = null;
     $createInvoiceConfirmText = $this->translator->translate('Are you sure you want to create or overwrite the invoice for this order?');
     $id = intval($this->getRequest()->getParam('id'));
     $this->view->description = $this->translator->translate("Here you can edit the selected order.");
     if (!empty($id) && is_numeric($id)) {
         $rs = $this->orders->find($id);
         if (!empty($rs)) {
             $rs = $rs->toArray();
             $rs['setupfee'] = Orders::getSetupfee($id);
             $rs['order_date'] = Shineisp_Commons_Utilities::formatDateOut($rs['order_date']);
             $rs['expiring_date'] = Shineisp_Commons_Utilities::formatDateOut($rs['expiring_date']);
             $rs['received_income'] = 0;
             $rs['missing_income'] = $rs['grandtotal'];
             $rs['order_number'] = !empty($rs['order_number']) ? $rs['order_number'] : Orders::formatOrderId($rs['order_id']);
             $payments = Payments::findbyorderid($id, 'income', true);
             if (isset($payments)) {
                 foreach ($payments as $payment) {
                     $rs['received_income'] += isset($payment['income']) ? $payment['income'] : 0;
                     $rs['missing_income'] -= isset($payment['income']) ? $payment['income'] : 0;
                 }
             }
             $rs['profit'] = $rs['total'] - $rs['cost'];
             $rs['profit'] = $currency->toCurrency($rs['profit'], array('currency' => Settings::findbyParam('currency')));
             // set the default income to prepare the payment task
             $rs['income'] = $rs['missing_income'];
             $rs['missing_income'] = sprintf('%.2f', $rs['missing_income']);
             unset($payments);
             $parent = Customers::find($rs['customer_id']);
             //if customer comes from reseller
             if ($parent['parent_id']) {
                 $rs['customer_parent_id'] = $parent['parent_id'];
             } else {
                 $rs['customer_parent_id'] = $rs['customer_id'];
             }
             $link = Fastlinks::findlinks($id, $rs['customer_id'], 'Orders');
             if (isset($link[0])) {
                 $rs['fastlink'] = $link[0]['code'];
                 $rs['visits'] = $link[0]['visits'];
             }
             $form->populate($rs);
             $this->view->id = $id;
             $this->view->customerid = $rs['customer_id'];
             if (!empty($rs['fastlink'])) {
                 $this->view->titlelink = "/index/link/id/" . $rs['fastlink'];
             }
             if (!empty($rs['order_number'])) {
                 $this->view->title = $this->translator->_("Order nr. %s", $rs['order_number']);
             }
             $this->view->messages = Messages::getbyOrderId($id);
             $createInvoiceConfirmText = $rs['missing_income'] > 0 ? $this->translator->translate('Are you sure you want to create or overwrite the invoice for this order? The order status is: not paid.') : $createInvoiceConfirmText;
             $customer = Customers::get_by_customerid($rs['customer_id'], 'company, firstname, lastname, email');
         } else {
             $this->_helper->redirector('list', 'orders', 'admin');
         }
     }
     $this->view->mex = urldecode($this->getRequest()->getParam('mex'));
     $this->view->mexstatus = $this->getRequest()->getParam('status');
     // Create the buttons in the edit form
     $this->view->buttons = array(array("url" => "#", "label" => $this->translator->translate('Save'), "params" => array('id' => 'submit', 'css' => array('btn btn-success'))), array("url" => "/admin/orders/print/id/{$id}", "label" => $this->translator->translate('Print'), "params" => array('css' => null)), array("url" => "/admin/orders/dropboxit/id/{$id}", "label" => $this->translator->translate('Dropbox It'), "params" => array('css' => null)), array("url" => "/admin/orders/clone/id/{$id}", "label" => $this->translator->translate('Clone'), "params" => array('css' => null)), array("url" => "/admin/orders/sendorder/id/{$id}", "label" => $this->translator->translate('Email'), "params" => array('css' => array('btn btn-danger'))), array("url" => "/admin/orders/confirm/id/{$id}", "label" => $this->translator->translate('Delete'), "params" => array('css' => array('btn btn-danger'))), array("url" => "/admin/orders/new/", "label" => $this->translator->translate('New'), "params" => array('css' => null)));
     // Check if the order has been invoiced
     $invoice_id = Orders::isInvoiced($id);
     if ($invoice_id) {
         $this->view->buttons[] = array("url" => "/admin/orders/sendinvoice/id/{$invoice_id}", "label" => $this->translator->translate('Email invoice'), "params" => array('css' => array('btn btn-danger')));
         $this->view->buttons[] = array("url" => "/admin/invoices/print/id/{$invoice_id}", "label" => $this->translator->translate('Print invoice'), "params" => array('css' => null));
     } else {
         // Order not invoiced, show button to create a new invoice
         $this->view->buttons[] = array("url" => "/admin/orders/createinvoice/id/{$id}", "label" => $this->translator->translate('Invoice'), "params" => array('css' => array('btn btn-danger')), 'onclick' => "return confirm('" . $createInvoiceConfirmText . "')");
     }
     $this->view->customer = array('records' => $customer, 'editpage' => 'customers');
     $this->view->ordersdatagrid = $this->orderdetailGrid();
     $this->view->paymentsdatagrid = $this->paymentsGrid();
     $this->view->statushistory = StatusHistory::getStatusList($id);
     // Get Order status history
     $this->view->filesgrid = $this->filesGrid();
     $this->view->statushistorygrid = $this->statusHistoryGrid();
     $this->view->form = $form;
     $this->render('applicantform');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:87,代码来源:OrdersController.php

示例15: uploadProfilePicture

 public function uploadProfilePicture()
 {
     $file = Input::file('profileImage');
     $destinationPath = 'upload/profile/customer/';
     $filename = $file->getClientOriginalName();
     $fileExtension = '.' . $file->getClientOriginalExtension();
     $customerId = Input::get('customerId');
     $filename = 'customer_profile_' . $customerId . '_medium' . $fileExtension;
     $result = Input::file('profileImage')->move($destinationPath, $filename);
     if ($result) {
         $customer = Customers::find($customerId);
         $customer->profile_image = $filename;
         $customer->save();
     }
     Session::flash('imageUploadMessage', "Profile picture updated successfully.");
     return Redirect::to("/customers/view/" . $customerId);
 }
开发者ID:Headrun-php,项目名称:TLG,代码行数:17,代码来源:CustomersController.php


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