コード例 #1
0
ファイル: PagoController.php プロジェクト: jcesarrc/killbill
 /**
  * Creates a new Pago model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate($academia = 0)
 {
     $model = new Pago();
     $model->academia = $academia;
     $searchModel = new PagoSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $model_detalle_academia = Academia::findOne(['id' => $academia]);
     $meses_a_pagar = Pago::calcularMesesDeuda($academia);
     $periodo_a_pagar = Pago::calcularPeriodoAPagar($academia);
     $valor_a_pagar = Pago::calcularValorAPagar($academia);
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->refresh();
     } else {
         return $this->render('create', ['model' => $model, 'model_detalle_academia' => $model_detalle_academia, 'meses_a_pagar' => $meses_a_pagar, 'periodo_a_pagar' => $periodo_a_pagar, 'valor_a_pagar' => $valor_a_pagar, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
     }
 }
コード例 #2
0
 public function actionExcel()
 {
     $searchModel = new PagoSearch();
     $dataProvider = $searchModel->excel(['ModelSearch']);
     return $this->renderPartial('excel', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }