/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = PeriodoInscricaoMonitoria::find();
     $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->andFilterWhere(['ID' => $this->ID, 'dataInicio' => $this->dataInicio, 'dataFim' => $this->dataFim]);
     $query->andFilterWhere(['like', 'periodo', $this->periodo]);
     return $dataProvider;
 }
예제 #2
0
 /**
  * Creates a new Frequencia model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate($date)
 {
     $model = new Frequencia();
     $p = PeriodoInscricaoMonitoria::find()->orderBy(['id' => SORT_DESC])->one();
     //$letivo = $p->ano.'/'.$p->periodo;
     $aluno = AlunoMonitoria::find()->where(['cpf' => Yii::$app->user->identity->cpf])->andWhere(['IDperiodoinscr' => $p->id])->andFilterWhere(['or', ['like', 'status', 'Selecionado com bolsa'], ['like', 'status', 'Selecionado sem bolsa']])->one();
     // pesquisa para pegar o id do alun
     $model->dmy = $date;
     $pesquisa = Frequencia::find()->where(['IDMonitoria' => $aluno->id])->andWhere(['dmy' => $date])->one();
     // Serve para verificar se tem registro na data selecionada.
     if (empty($pesquisa)) {
         if ($model->load(Yii::$app->request->post())) {
             $numDia = date('w', strtotime($date));
             $cont = $flag = 0;
             $dia1 = strtotime('-' . $numDia . ' day', strtotime($date));
             $diaX = strtotime('+' . (6 - $numDia) . ' day', strtotime($date));
             $p = Frequencia::find()->where(['IDMonitoria' => $aluno->id])->andWhere(['>=', 'dmy', date("Y-m-d", $dia1)])->andWhere(['<=', 'dmy', date("Y-m-d", $diaX)])->all();
             foreach ($p as $f) {
                 $cont = $cont + $f->ch;
                 if ($cont > 12) {
                     $flag = 1;
                 }
             }
             if ($flag == 0 && $model->ch + $cont <= 12) {
                 $model->IDMonitoria = $aluno->id;
                 $model->save();
                 return $this->redirect(['index', 'id' => $model->IDMonitoria]);
             } else {
                 return $this->redirect(['index', 'id' => $aluno->id, 'mensagem' => 'Carga não cadastrada por conta do excesso de horas.']);
             }
         } else {
             return $this->renderAjax('create', ['model' => $model]);
         }
     } else {
         return $this->redirect(['index', 'id' => $aluno->id, 'mensagem' => 'Já existe registro nesta data para a sua monitoria.']);
     }
 }
예제 #3
0
 /**
  * Updates an existing Monitoria model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     if (Yii::$app->request->referrer != '/monitoria/minhasinscricoes') {
         $model = $this->findModel($id);
         if ($model->load(Yii::$app->request->post()) && $model->save()) {
             return $this->redirect(['view', 'id' => $model->ID]);
         } else {
             //Aluno - Pega aluno baseando-se no CPF do usuário logado
             $aluno = Aluno::findOne(['CPF' => Yii::$app->user->identity->login]);
             //Seleciona o último período de inscrição
             $periodoInscricao = PeriodoInscricaoMonitoria::find()->orderBy(['ID' => SORT_DESC])->one();
             $periodo = $periodoInscricao->ano . '/' . $periodoInscricao->periodo;
             return $this->render('update', ['model' => $model, 'periodo' => $periodo, 'matricula' => $aluno->matricula, 'banco' => $aluno->banco, 'agencia' => $aluno->agencia, 'conta' => $aluno->conta]);
         }
     }
     return $this->redirect(Yii::$app->request->referrer);
 }
 /**
  * Finds the PeriodoInscricaoMonitoria model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return PeriodoInscricaoMonitoria the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = PeriodoInscricaoMonitoria::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('A página requistada não existe.');
     }
 }
예제 #5
0
    public function actionGerarplanosemestral($id)
    {
        $modelPeriodo = DisciplinaPeriodo::find()->orderBy(['anoPeriodo' => SORT_DESC, 'numPeriodo' => SORT_DESC])->one();
        $justi = PeriodoInscricaoMonitoria::find()->where(['id' => $id])->one();
        $periodoletivo = $modelPeriodo->anoPeriodo . '/' . $modelPeriodo->numPeriodo;
        $dadosCabecalho = Periodo::find()->where(['codigo' => $periodoletivo])->one();
        if ($dadosCabecalho != null) {
            $cssfile = file_get_contents('../web/css/estilo1.css');
            $mpdf = new mPDF('utf-8', 'A4-L');
            $mpdf->title = '1. Plano Semestral de Monitoria';
            $mpdf->WriteHTML($cssfile, 1);
            $mpdf->SetHTMLHeader('
                <img src="../web/img/cabecalho1.png" alt="Universidade Federal do Amazonas...." width="980" height="100">
                ');
            $mpdf->SetHTMLFooter('<p>
                OBS.: Este plano foi aprovado em reunião departamental na data de ' . date('d') . ' / ' . date('m') . ' /' . date('Y') . '.
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                Manaus, ' . date('d') . ' / ' . date('m') . ' /' . date('Y') . '
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                _______________________________________________
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                Chefe do Depto (com carimbo) </p>
                ');
            $mpdf->WriteHTML('
                <br><br><br><br>
                <table id="cabecalho1" width="99%" height="100%">
                    <tr>
                        <td bgcolor="#e6e6e6" width="11%">DEPARTAMENTO</td>
                        <td width="40%">Coordenação Acadêmica</td>
                        <td bgcolor="#e6e6e6" width="10%">UNIDADE</td>
                        <td width="28%">Instituto de Computação - IComp</td>
                    </tr> 
                 </table>

                 <table id = "cabecalho2" width="21%" height="100%">
                    <tr>
                      <td bgcolor="#e6e6e6" width="11%">PERÍODO LETIVO</td>
                      <td width="10px">' . $modelPeriodo->anoPeriodo . '/' . $modelPeriodo->numPeriodo . ' </td> 
                    </tr> 
                 </table>
            ');
            // Tabela do meio do documento
            $mpdf->WriteHTML('
                <br>
                <table id="plano_semestral" width="1000px" height="5">
                    <tr>
                        <td bgcolor="#e6e6e6" width="389px" rowspan=2>DISCIPLINAS<br> (código e título, sem abreviações)</td>
                        <td bgcolor="#e6e6e6" width="60px" rowspan=2>QTO</td>
                        <td bgcolor="#e6e6e6" width="60px" rowspan=2>QAT</td>
                        <td bgcolor="#e6e6e6" width="60px" colspan=2>LAB.</td>
                        <td bgcolor="#e6e6e6" width="361px" rowspan=2>PROFESSOR<br>ORIENTADOR</td>
                        <td bgcolor="#e6e6e6" width="70px" colspan=2>VAGAS<br>SOLICITADAS</td>
                    </tr>
                    <tr>
                        <td bgcolor="#e6e6e6" width="3%">SIM</tr>
                        <td bgcolor="#e6e6e6" width="3%">NÃO</tr>
                        <td bgcolor="#e6e6e6" width="3%">B</tr>
                        <td bgcolor="#e6e6e6" width="3%">NB</tr>
                    </tr>
                 </table>
                 ');
            $disciplinas = Disciplina::find()->orderBy(['nomeDisciplina' => SORT_ASC])->all();
            $contador = 0;
            // O find acima pega todas as disciplinas com nome distinto
            if ($disciplinas == null) {
                return $this->render('index');
            } else {
                $contador = 0;
                foreach ($disciplinas as $disc) {
                    $contTurmas = $vagasOfertadas = $vagasBolsistas = $vagasNaoBolsistas = 0;
                    // l1t1 significa lab = 1, turma(qtde) = 1
                    $l1 = DisciplinaMonitoria::find()->where(['nomeDisciplina' => $disc->nomeDisciplina])->andWhere(['codDisciplina' => $disc->codDisciplina])->andWhere(['lab' => 1])->all();
                    $l0 = DisciplinaMonitoria::find()->where(['nomeDisciplina' => $disc->nomeDisciplina])->andWhere(['codDisciplina' => $disc->codDisciplina])->andWhere(['lab' => 0])->all();
                    if ($l1 != null) {
                        $contL1 = count($l1);
                        foreach ($l1 as $d1) {
                            $contTurmas++;
                            $vagasOfertadas = $d1->qtdVagas + $vagasOfertadas;
                            $vagasBolsistas = $d1->qtdMonitorBolsista + $vagasBolsistas;
                            $vagasNaoBolsistas = $d1->qtdMonitorNaoBolsista + $vagasNaoBolsistas;
                        }
                        if ($contL1 == 1) {
                            foreach ($l1 as $d1) {
                                $mpdf->WriteHTML('
                                    <table id="plano_semestral" width="1000px" height="5">
                                        <tr>
                                            <td width="387px" rowspan=2 style="max-width: 387px;">' . $d1->codDisciplina . ' -<br>' . $d1->nomeDisciplina . '</td>
                                            <td width="60px" rowspan=2>' . $contTurmas . '</td>
                                            <td width="60px" rowspan=2>' . $vagasOfertadas . '</td>
                                            <td width="30px">X</tr>
                                            <td width="30px"></tr>
                                            <td width="361px" rowspan=2>' . $d1->nomeProfessor . '</td>
                                            <td width="34px">' . $vagasBolsistas . '</tr>
                                            <td width="34px">' . $vagasNaoBolsistas . '</tr>
                                        </tr>
                                    </table>
                                ');
                            }
                            $contador++;
                        } else {
                            $profsDisc = DisciplinaMonitoria::find()->select('nomeProfessor')->where(['nomeDisciplina' => $disc->nomeDisciplina])->andWhere(['codDisciplina' => $disc->codDisciplina])->andWhere(['lab' => 1])->distinct()->asArray()->all();
                            $contador = count($prosDisc) + $contador;
                            $profs = $this->convert_array_imploding($profsDisc);
                            $mpdf->WriteHTML('
                                    <table id="plano_semestral" width="1000px" height="5">
                                        <tr>
                                            <td width="387px" rowspan=2 style="max-width: 387px;">' . $d1->codDisciplina . ' -<br>' . $d1->nomeDisciplina . '</td>
                                            <td width="60px" rowspan=2>' . $contTurmas . '</td>
                                            <td width="60px" rowspan=2>' . $vagasOfertadas . '</td>
                                            <td width="30px">X</tr>
                                            <td width="30px"> </tr>
                                            <td width="361px" rowspan=2>' . $profs . '</td>
                                            <td width="34px">' . $vagasBolsistas . '</tr>
                                            <td width="34px">' . $vagasNaoBolsistas . '</tr>
                                        </tr>
                                    </table>
                            ');
                        }
                        $contTurmas = $vagasOfertadas = $vagasBolsistas = $vagasNaoBolsistas = 0;
                    }
                    if ($l0 != null) {
                        foreach ($l0 as $d0) {
                            $contTurmas++;
                            $vagasOfertadas = $d0->qtdVagas + $vagasOfertadas;
                            $vagasBolsistas = $d0->qtdMonitorBolsista + $vagasBolsistas;
                            $vagasNaoBolsistas = $d0->qtdMonitorNaoBolsista + $vagasNaoBolsistas;
                            $contador++;
                        }
                        $contL0 = count($l0);
                        if ($contL0 == 1) {
                            foreach ($l0 as $d0) {
                                $mpdf->WriteHTML('
                                    <table id="plano_semestral" width="1000px" height="5">
                                        <tr>
                                            <td width="387px" rowspan=2 style="max-width: 387px;">' . $d0->codDisciplina . ' -<br>' . $d0->nomeDisciplina . '</td>
                                            <td width="60px" rowspan=2>' . $contTurmas . '</td>
                                            <td width="60px" rowspan=2>' . $vagasOfertadas . '</td>
                                            <td width="30px"> </tr>
                                            <td width="30px">X</tr>
                                            <td width="361px" rowspan=2>' . $d0->nomeProfessor . '</td>
                                            <td width="34px">' . $vagasBolsistas . '</tr>
                                            <td width="34px">' . $vagasNaoBolsistas . '</tr>
                                        </tr>
                                    </table>
                                ');
                                $contador++;
                            }
                        } else {
                            $profsDisc = DisciplinaMonitoria::find()->select('nomeProfessor')->where(['nomeDisciplina' => $disc->nomeDisciplina])->andWhere(['codDisciplina' => $disc->codDisciplina])->andWhere(['lab' => 0])->distinct()->asArray()->all();
                            $contador = count($prosDisc) + $contador;
                            $profs = $this->convert_array_imploding($profsDisc);
                            $mpdf->WriteHTML('
                                    <table id="plano_semestral" width="1000px" height="5">
                                        <tr>
                                            <td width="387px" rowspan=2 style="max-width: 387px;">' . $d0->codDisciplina . ' -<br>' . $d0->nomeDisciplina . '</td>
                                            <td width="60px" rowspan=2>' . $contTurmas . '</td>
                                            <td width="60px" rowspan=2>' . $vagasOfertadas . '</td>
                                            <td width="30px"> </tr>
                                            <td width="30px">X</tr>
                                            <td width="361px" rowspan=2>' . $profs . '</td>
                                            <td width="34px">' . $vagasBolsistas . '</tr>
                                            <td width="34px">' . $vagasNaoBolsistas . '</tr>
                                        </tr>
                                    </table>
                            ');
                        }
                    }
                }
                # else FOR ( $d == null )  END
            }
            # foreach($disciplinas as $disc)  END
            if ($contador >= 10) {
                $mpdf->AddPage();
                $mpdf->WriteHTML('<br><br><br><br>');
            }
            $mpdf->WriteHTML('
                <br>
                <p>OBS.: é imprescindível o preenchimento dos campos acima para a análise pela Comissão de Monitoria</p>
                <p>
                LEGENDA: &nbsp;QTO= quantidade de turmas oferecidas no semestre<br>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                QAT= quantidade de alunos por turma<br>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                LAB.= existência de laboratório na disciplina<br>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                B= bolsista<br>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                NB= não bolsista
                </p>

                <p style="font-family: times; font-size: 12px;">JUSTIFICATIVAS:<br>
                ' . $justi->justificativa . '
            ');
            $mpdf->Output();
            exit;
        } else {
            return $this->render('index');
        }
    }
예제 #6
0
파일: Monitoria.php 프로젝트: tammy00/paps
 public function afterFind()
 {
     switch ($this->bolsa) {
         case 0:
             $this->traducao_bolsa = 'Não';
             break;
         case 1:
             $this->traducao_bolsa = 'Sim';
             break;
     }
     switch ($this->status) {
         case 0:
             $this->traducao_status = 'Aguardando Avaliação';
             break;
         case 1:
             $this->traducao_status = 'Selecionado com bolsa';
             break;
         case 2:
             $this->traducao_status = 'Selecionado sem bolsa';
             break;
         case 3:
             $this->traducao_status = 'Não selecionado';
             break;
         case 4:
             $this->traducao_status = 'Indeferido - Nota < 7';
             break;
         case 5:
             $this->traducao_status = 'Indeferido - Coeficiente < 5';
             break;
         case 6:
             $this->traducao_status = 'Indeferido - Não cursou a disciplina';
             break;
     }
     $periodo = PeriodoInscricaoMonitoria::findOne(['id' => $this->IDperiodoinscr]);
     $this->IDperiodoinscr = $periodo->ano . '/' . $periodo->periodo;
     $disciplinaPeriodo = DisciplinaPeriodo::findOne($this->IDDisc);
     $disciplina = Disciplina::find()->where(['id' => $disciplinaPeriodo->idDisciplina])->one();
     $this->nomeDisciplina = $disciplina->nomeDisciplina;
     $curso = Curso::find()->where(['id' => $disciplinaPeriodo->idCurso])->one();
     $this->nomeCurso = $curso->nome;
 }
예제 #7
0
파일: index.php 프로젝트: tammy00/paps
/* @var $this yii\web\View */
/* @var $searchModel app\models\PeriodoInscricaoMonitoriaSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Períodos de Inscrição para Monitoria';
$this->params['breadcrumbs'][] = ['label' => 'Monitorias', 'url' => ['/monitoria/index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="periodo-inscricao-monitoria-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Novo Período de Inscrição', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'summary' => '', 'columns' => [['attribute' => 'ano', 'filter' => ArrayHelper::map(PeriodoInscricaoMonitoria::find()->distinct()->orderBy(['ano' => SORT_DESC])->asArray()->all(), 'ano', 'ano')], ['attribute' => 'periodo', 'filter' => ArrayHelper::map(PeriodoInscricaoMonitoria::find()->distinct()->orderBy(['periodo' => SORT_DESC])->asArray()->all(), 'periodo', 'periodo')], ['attribute' => 'dataInicio', 'format' => ['date', 'php:d/m/Y']], ['attribute' => 'dataFim', 'format' => ['date', 'php:d/m/Y']], ['class' => 'yii\\grid\\ActionColumn', 'header' => 'Ações', 'headerOptions' => ['style' => 'text-align:center; color:#337AB7'], 'contentOptions' => ['style' => 'text-align:center; vertical-align:middle']]]]);
?>

    <a href="?r=monitoria/index" class="btn btn-default">Voltar</a>

</div>