/** * Updates an existing Calendario 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); $searchProva = new ProvaSearch(); $searchProva->calendario_idcalendario = $id; // filtra a passagem para somente o exame selecionado $dataProva = $searchProva->search(Yii::$app->request->queryParams); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['/exame/update', 'id' => $model->exame_idexame]); } else { return $this->render('update', ['model' => $model, 'searchProva' => $searchProva, 'dataProva' => $dataProva]); } }
public function actionFiltro($tipo) { $provaModel = new ProvaSearch(); $provaProvider = $provaModel->search(Yii::$app->request->queryParams); $ditems = ArrayHelper::map(Disciplina::find()->all(), 'nome', 'nome'); $citems = ArrayHelper::map(Curso::find()->all(), 'idcurso', 'nome'); $pitems = ArrayHelper::map(Predio::find()->where(['unidade' => '1'])->all(), 'idpredio', 'nome'); $sitems = ArrayHelper::map(Sala::find()->all(), 'idsala', 'nome'); $eitems = ArrayHelper::map(Exame::find()->all(), 'idexame', 'nome'); if ($provaModel->load(Yii::$app->request->get())) { return $this->render('frequencia', ['dataProvider' => $provaProvider, 'searchModel' => $provaModel]); } else { return $this->render('filtro', ['provaModel' => $provaModel, 'provaProvider' => $provaProvider, 'ditems' => $ditems, 'citems' => $citems, 'pitems' => $pitems, 'sitems' => $sitems, 'eitems' => $eitems, 'tipo' => $tipo]); } }
/** * Lists all Prova models. * @return mixed */ public function actionIndex() { $searchModel = new ProvaSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }