Пример #1
0
 /**
  * Finds the Inscreve model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $usuario_idusuario
  * @param integer $evento_idevento
  * @return Inscreve the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Evento::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Пример #2
0
 public function findEvento($idevento)
 {
     if ($evento = Evento::findOne($idevento)) {
         $evento['descricao'] = Evento::findOne($idevento)->descricao;
         $evento['idevento'] = $idevento;
         return $evento;
     } else {
         throw new NotFoundHttpException('Página não Encontrada');
     }
 }
Пример #3
0
 public function actionVoluntario()
 {
     $id_evento = Yii::$app->request->post('evento_idevento');
     $evento = Evento::findOne($id_evento);
     $searchModel = new InscreveSearch();
     $dataProvider3 = $searchModel->searchVoluntarios(Yii::$app->request->queryParams);
     return $this->render('voluntario', ['searchModel' => $searchModel, 'dataProvider3' => $dataProvider3, 'evento' => $evento]);
 }
Пример #4
0
 public function actionEliminar()
 {
     $msg = null;
     if ((int) isset($_REQUEST["id_evento"])) {
         $tabla = Evento::findOne($_REQUEST['id_evento']);
         if ($tabla->delete()) {
             $msg = "Eliminacion realizada con exito!";
             $this->redirect(["evento/buscar", 'msg' => $msg]);
         } else {
             $msg = "No se pudo realizar la eliminacion";
         }
     }
     $this->menu();
     return $this->render("buscar", ["msg" => $msg]);
 }
Пример #5
0
 public function pdfConteudo($pdf, $model, $ItemProgramacao, $j)
 {
     $pdf->WriteHTML('');
     //se tirar isso, desaparece o cabeçalho
     $pdf->SetFont("Helvetica", 'B', 14);
     //$pdf->MultiCell(0,6,"PODER EXECUTIVO",0, 'C');
     //$pdf->MultiCell(0,6,("MINISTÉRIO DA EDUCAÇÃO"),0, 'C');
     //$pdf->MultiCell(0,6,("UNIVERSIDADE FEDERAL DO AMAZONAS"),0, 'C');
     $pdf->Ln(15);
     //$pdf->MultiCell(0,6,("INSTITUTO DE COMPUTAÇÃO"),0, 'C');
     //$pdf->MultiCell(0,5,("-----------------"),0, 'C');
     $pdf->SetDrawColor(0, 0, 0);
     $pdf->Line(5, 42, 290, 42);
     //$pdf->Image('../web/img/logo-brasil.jpg', 10, 12, 32.32);
     //$pdf->Image('../web/img/ufam.jpg', 175, 12, 25.25);
     //TÍLULO DO RELATÓRIO
     $pdf->Ln(15);
     $pdf->SetFont('Arial', '', 18);
     $pdf->MultiCell(0, 6, "Lista de Participantes", 0, 'C');
     //FIM DO TITULO DO RELATÓRIO
     $pdf->Ln(5);
     $pdf->SetFont('Arial', '', 12);
     //$pdf->Line(5,55,290,55);
     if ($j != -1) {
         //so entra nesse if, se houver itens de programação
         $pdf->WriteHTML('<table width="100%" border = "1"> 
                 <tr>
                     <td>Sigla do Evento: ' . $ItemProgramacao[$j]->sigla . '
                     <br>
                     Programação: ' . $ItemProgramacao[$j]->titulo . '
                     </td>
                 </tr>
                 </table>
                 ');
         //$pdf->MultiCell(0,6,('Sigla: '.$ItemProgramacao[$j]->sigla),0, 'L');
         //$pdf->MultiCell(0,6,('Evento: '.$ItemProgramacao[$j]->descricao.'('.$ItemProgramacao[$j]->sigla.')'),0, 'L');
         //$pdf->MultiCell(0,6,('Programação: '.$ItemProgramacao[$j]->titulo),0, 'L');
     } else {
         if ($model[0]->descricao != NULL) {
             $pdf->WriteHTML('<table width="100%" border = "1"> 
                         <tr>
                             <td>
                             Evento: ' . $model[0]->descricao . '
                             </td>
                         </tr>
                         </table>
                     ');
             //$pdf->MultiCell(0,6,('Evento: '.$model[0]->descricao),0, 'L');
         } else {
             $evento_idevento = Yii::$app->request->get('evento_idevento');
             $dadosEvento = Evento::findOne($evento_idevento);
             $pdf->WriteHTML('<table width="100%" border = "1"> 
                         <tr>
                             <td>
                             Evento: ' . $dadosEvento->descricao . '
                             </td>
                         </tr>
                         </table>
                     ');
         }
     }
     //$pdf->Line(5,77,290,77);
     $pdf->Ln(5);
     $tag = $this->tag($dia_inicio, $mes_inicio, $ano_inicio, $dia_fim, $mes_fim, $ano_fim);
     //inicio da tabela
     $inicio = '
                 <table border="1" align = "center">
                     <tr>
                     <th> # </th>
                     <th width = "250px">Nome do Participante</th>
                     <th width = "500px">Assinatura</th>
                     </tr>
             ';
     $conteudo = "";
     $qtd_rows = count($model);
     //quantidade de rows
     if ($qtd_rows != 0) {
         //meio da tabela -> aqui haverá as repetições de cada linha
         for ($i = 0; $i < $qtd_rows; $i++) {
             $participante = $model[$i]->nome;
             $conteudo = $conteudo . '<tr>
                     <td width = "30px">' . ($i + 1) . '</td>
                     <td>' . $participante . '</td>
                     <td height = "40px" align = "center"></td>
                     </tr>
                 ';
         }
         //fim da tabela
         $pdf->WriteHTML($inicio . $conteudo . '</table>');
     } else {
         $pdf->SetFont('Arial', '', 22);
         $pdf->WriteHTML('<br>' . '<div align = "center"> Não foram encontrados registros de Participantes. </div>');
     }
     $pdf->Ln(15);
     $current = date('Y/m/d');
     $currentTime = strtotime($current);
     $mes = $this->converterMes($current);
     //DATA ATUAL
     $pdf->MultiCell(0, 4, 'Manaus, ' . date('d', $currentTime) . ' de ' . $mes . ' de ' . date('Y', $currentTime) . '.', 0, 'C');
     //FIM DA DATA ATUAL
     //$pdf->SetFont('Helvetica','I',8);
     $pdf->Line(5, 275, 290, 275);
     //$pdf->SetXY(10, 265);
     //$pdf->MultiCell(0,5,"",0, 'C');
     //$pdf->MultiCell(0,4,("Av. Rodrigo Otávio, 6.200 - Campus Universitário Senador Arthur Virgílio Filho - CEP 69077-000 - Manaus, AM, Brasil"),0, 'C');
     //$pdf->MultiCell(0,4,(" Tel. (092) 3305-1193/2808/2809         E-mail: secretaria@icomp.ufam.edu.br          http://www.icomp.ufam.edu.br"),0, 'C');
     return $pdf;
 }
Пример #6
0
 public function VerificaEncerramento($params)
 {
     $data_atual = strtotime(date('Y/m/d'));
     $data_fim = strtotime(Evento::findOne(['idevento' => $params['id']])->dataFim);
     if ($data_atual > $data_fim) {
         return 1;
     }
     return 0;
 }
Пример #7
0
 /**
  * Finds the Evento model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Evento the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Evento::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('Página Solicitada não Encontrada.');
     }
 }