/** * Updates an existing Exame model. * If update is successful, the browser will be redirected to the 'view' page. * @param string $id * @return mixed */ public function actionUpdate($id) { $model = $this->findModel($id); $searchCalendario = new CalendarioSearch(); $searchCalendario->exame_idexame = $id; // filtra a passagem para somente o exame selecionado $dataCalendario = $searchCalendario->search(Yii::$app->request->queryParams); $searchHorario = new HorarioSearch(); $searchHorario->exame_idexame = $id; // filtra a passagem para somente o exame selecionado $dataHorario = $searchHorario->search(Yii::$app->request->queryParams); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->idexame]); } else { return $this->render('update', ['model' => $model, 'searchCalendario' => $searchCalendario, 'dataCalendario' => $dataCalendario, 'searchHorario' => $searchHorario, 'dataHorario' => $dataHorario]); } }
/** * Lists all Calendario models. * @return mixed */ public function actionIndex() { $searchModel = new CalendarioSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }