예제 #1
0
 public function actionIndex()
 {
     /*
     $dataProvider=new CActiveDataProvider('Expense');
     $this->render('index',array(
         'dataProvider'=>$dataProvider,
     ));
     */
     $newModel = Expense::model()->findAll(array('condition' => 'kind = 0', 'group' => 'date(order_date)'));
     $model = new Expense('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Expense'])) {
         $model->attributes = $_GET['Expense'];
     }
     $this->render('index', array('model' => $model, 'newModel' => $newModel));
 }
예제 #2
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Expense('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Expense'])) {
         $model->attributes = $_GET['Expense'];
     }
     $this->render('admin', array('model' => $model));
 }