/** * Creates a new DetalleProyecto model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate($numero) { $model = new DetalleProyecto(); $model->numero = $numero; $model->aporte_fondo = $model->total - $model->cofinanciacion; $model_faer = Faer::findOne(['numero' => $numero]); $lista_detalle_proyecto = DetalleProyecto::findAll(['numero' => $numero]); if ($model->load(Yii::$app->request->post()) && $model->save()) { $model = new DetalleProyecto(); $model->numero = $numero; $model->aporte_fondo = $model->total - $model->cofinanciacion; $this->refresh(); } return $this->render('create', ['model' => $model, 'model_faer' => $model_faer, 'lista_detalles' => $lista_detalle_proyecto]); }
/** * Displays a single Faer model. * @param integer $id * @return mixed */ public function actionView($id) { $lista_detalle_proyecto = DetalleProyecto::findAll(['numero' => $id]); return $this->render('view', ['model' => $this->findModel($id), 'lista_detalles' => $lista_detalle_proyecto]); }