Beispiel #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Comissao::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->joinWith(['usuario']);
     // grid filtering conditions
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'usuario.name', $this->idProfessor]);
     return $dataProvider;
 }
Beispiel #2
0
        echo Html::a('Disciplinas', ['/disciplina/index'], ['class' => 'btn btn-success']);
        ?>
</p>
            <p><?php 
        echo Html::a('Disciplinas para Monitoria', ['/disciplina-periodo/index'], ['class' => 'btn btn-success']);
        ?>
</p>
            <p><?php 
        echo Html::a('Comissão Avaliadora', ['/comissao/index'], ['class' => 'btn btn-success']);
        ?>
</p>

            <?php 
        //Pega professor baseando-se no CPF do usuário logado
        $professor = Usuario::findOne(['CPF' => Yii::$app->user->identity->cpf]);
        $comissao = Comissao::findOne(['idProfessor' => $professor->id]);
        if ($comissao != null && $comissao->idProfessor != null) {
            ?>
                <p> <?php 
            echo Html::a('Julgar Inscrições', ['avaliador'], ['class' => 'btn btn-success']);
            ?>
 </p>
            <?php 
        }
        ?>
            
            <p><?php 
        echo Html::a('Gerenciar Monitorias - Secretaria', ['secretaria'], ['class' => 'btn btn-success']);
        ?>
</p>
            <p> <?php 
Beispiel #3
0
 public function actionAvaliador()
 {
     //Pega professor baseando-se no CPF do usuário logado
     $professor = Usuario::findOne(['CPF' => Yii::$app->user->identity->cpf]);
     $comissao = Comissao::findOne(['idProfessor' => $professor->id]);
     if ($comissao != null && $comissao->idProfessor != null) {
         //Seleciona o último período de inscrição
         $periodoInscricao = PeriodoInscricaoMonitoria::find()->orderBy(['id' => SORT_DESC])->one();
         $searchModel = new AlunoMonitoriaSearch();
         $dataProvider = $searchModel->searchAvaliador(Yii::$app->request->queryParams + ['AlunoMonitoriaSearch' => ['=', 'periodo' => $periodoInscricao->ano . '/' . $periodoInscricao->periodo]]);
         return $this->render('avaliador', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
     }
 }
Beispiel #4
0
 /**
  * Finds the Comissao model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Comissao the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Comissao::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }