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


PHP Commande::model方法代码示例

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


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

示例1: actionEditService

 public function actionEditService($id)
 {
     // Get id of logged in user
     $user_id = Yii::app()->user->getId();
     $customer = Customer::model()->findByPk($user_id);
     // Verify service number belongs to logged in customer
     $commande = Commande::model()->findByPk($id);
     if ($commande->bilkey != $user_id) {
         // TODO: Prolly '404 here.
         echo "You do not have permission to access this record.";
         die;
     }
     if (isset($_POST['Commande'])) {
         // Set the scenario to limit the attributes we suck in from
         //  the POST array.  This protects us against injection attacks.
         $commande->setScenario('user_edit');
         // Populate our new models from the input arrays
         $commande->attributes = $_POST['Commande'];
         // We selectively save the attributes on the model to
         //  prevent against injection attacks
         if ($commande->save()) {
             // Send email to info@mailnetwork and client
             $this->actionEmailChanges('commande', $commande, $customer);
             $this->redirect(array('user/info'));
         }
     }
     $this->render('//shared/modify-service', array('customer_model' => $customer, 'commande_model' => $commande));
 }
开发者ID:E-SOFTinc,项目名称:Mailnetwork_Yii,代码行数:28,代码来源:UserController.php

示例2: getServiceEndingDates

 public function getServiceEndingDates($bilkey)
 {
     $records = Commande::model()->findAllByAttributes(array('bilkey' => $bilkey));
     $dates = "";
     if ($records) {
         foreach ($records as $record) {
             $dates .= $record->comfin . "<br />";
         }
     }
     return $dates;
 }
开发者ID:E-SOFTinc,项目名称:Mailnetwork_Yii,代码行数:11,代码来源:Customer.php

示例3: actionSendStatement

 /**
  *
  */
 public function actionSendStatement($id)
 {
     // Look up customer information
     $customer = Customer::model()->findByPk($id);
     $commande = Commande::model()->findAllByAttributes(array('bilkey' => $id));
     $service_details = Customer::model()->getCustomerServiceDetails($id);
     $shipment_details = Customer::model()->getShipmentsByCustomerBilkeyClient($id);
     // TODO: Make sure these are correct
     $message = new YiiMailMessage();
     $message->view = 'template';
     //userModel is passed to the view
     $message->setBody(array('include' => 'statement.php', 'customer' => $customer, 'commande' => $commande, 'service_details' => $service_details, 'shipment_details' => $shipment_details), 'text/html');
     $message->addTo($customer->bilemail);
     $message->addFrom(Yii::app()->params['adminEmail']);
     $message->setSubject("Statement of Account");
     Yii::app()->mail->send($message);
     $this->redirect(array('update', 'id' => $id));
 }
开发者ID:E-SOFTinc,项目名称:Mailnetwork_Yii,代码行数:21,代码来源:CustomerController.php

示例4: loadModel

 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Commande::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
开发者ID:E-SOFTinc,项目名称:Mailnetwork_Yii,代码行数:13,代码来源:CommandeController.php


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