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


PHP Provider::getProvList方法代码示例

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


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

示例1: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $products = new Products();
     $provider = new Provider();
     $prodList = $products->getUseProdList();
     $provList = $provider->getProvList();
     $model = new Realize();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['provider'])) {
         $fakturaId = $this->beforeSave($_POST['provider']);
         $currentDate = date('Y-m-d');
         //echo $fakturaId;
         $transaction = Yii::app()->db->beginTransaction();
         try {
             $messageType = 'warning';
             $message = "There are some errors " . count($_POST['product_id']);
             if ($_POST['product_id']) {
                 for ($i = 0; $i < count($_POST['product_id']); $i++) {
                     $models = new Realize();
                     $models->faktura_id = $fakturaId;
                     $models->prod_id = $_POST['product_id'][$i];
                     $models->price = $_POST['price'][$i];
                     $models->count = $this->changeToFloat($_POST['count'][$i]);
                     if ($models->save()) {
                         $messageType = 'success';
                         $message = "<strong>Well done!</strong> You successfully create data ";
                     }
                 }
             }
             Yii::app()->user->setFlash($messageType, $message);
             $transaction->commit();
             $this->redirect(array('dishes/checkMargin'));
         } catch (Exception $e) {
             $transaction->rollBack();
             Yii::app()->user->setFlash('error', "{$e->getMessage()}");
             //$this->refresh();
         }
     }
     $this->render('create', array('model' => $model, 'prodList' => $prodList, 'provList' => $provList));
 }
开发者ID:azizbekvahidov,项目名称:foods,代码行数:45,代码来源:RealizeController.php

示例2: actionRequest

 public function actionRequest()
 {
     $products = new Products();
     $provider = new Provider();
     $prodList = $products->getUseProdList();
     $provList = $provider->getProvList();
     $depId = Department::model()->findAll();
     $dates = date('Y-m-d H:i:s');
     $command = Yii::app()->db->createCommand();
     $expense = new Expense();
     if (isset($_POST['request'])) {
         $command->insert('request', array('req_date' => $dates, 'provider_id' => $_POST['provider']));
         $lastId = Yii::app()->db->lastInsertID;
         foreach ($_POST['request'] as $key => $val) {
             foreach ($val as $keys => $value) {
                 $count = $expense->changeToFloat($value['count']);
                 $command->insert('request_prod', array('request_id' => $lastId, 'prod_id' => $keys, 'depId' => $key, 'count' => $count));
             }
         }
         $this->redirect(array('view', 'id' => $lastId));
     }
     $this->render('request', array('depId' => $depId, 'prodList' => $prodList, 'provList' => $provList));
 }
开发者ID:azizbekvahidov,项目名称:foods,代码行数:23,代码来源:FakturaController.php


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