Exemplo n.º 1
0
 public function actionEventopdf()
 {
     $datainicial = $_GET['datainicial'];
     $datafinal = $_GET['datafinal'];
     //$tag = $this->tag($dia_inicio,$mes_inicio,$ano_inicio,$dia_fim,$mes_fim,$ano_fim);
     $relatorio = new Evento();
     $model = $relatorio->getInscritosEventos($datainicial, $datafinal);
     //obtendo model dos coordenadores de eventos
     $qtd_rows = count($model);
     //quantidade de rows
     $current = date('Y/m/d');
     $currentTime = strtotime($current);
     $mes = $this->converterMes($current);
     $data = 'Manaus, ' . date('d', $currentTime) . ' de ' . $mes . ' de ' . date('Y', $currentTime) . '.';
     return $this->render('evento', ['model' => $model, 'data' => $data]);
 }
Exemplo n.º 2
0
 /**
  * Busca os Eventos passados, com incrições abertas ou inscrições que podem ser abertas do usuário autenticado criando uma instância data provider.
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function searchEventosResponsavel($params)
 {
     $status = $params['status'];
     $inscricoes = $params['inscricoes'];
     if ($status == 'passado') {
         $query = Evento::find()->select(['*'])->where("dataFim < '" . date('Y-m-d') . "'")->joinWith("inscreve")->andWhere(['responsavel' => Yii::$app->user->identity->idusuario])->innerJoin('tipo', 'evento.tipo_idtipo = tipo.idtipo');
     } else {
         if ($inscricoes == 'fechada') {
             $query = Evento::find()->select(['*'])->where("dataFim >= '" . date('Y-m-d') . "'")->andWhere("allow = '0'")->joinWith("inscreve")->andWhere(['responsavel' => Yii::$app->user->identity->idusuario])->innerJoin('tipo', 'evento.tipo_idtipo = tipo.idtipo');
         } else {
             if ($inscricoes == 'naoiniciada') {
                 $query = Evento::find()->select(['*'])->where("dataFim >= '" . date('Y-m-d') . "'")->andWhere("allow is null")->joinWith("inscreve")->andWhere(['responsavel' => Yii::$app->user->identity->idusuario])->innerJoin('tipo', 'evento.tipo_idtipo = tipo.idtipo');
             } else {
                 $query = Evento::find()->select(['*'])->where("dataFim >= '" . date('Y-m-d') . "'")->andWhere("allow = '1'")->joinWith("inscreve")->andWhere(['responsavel' => Yii::$app->user->identity->idusuario])->innerJoin('tipo', 'evento.tipo_idtipo = tipo.idtipo');
             }
         }
     }
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['attributes' => ['sigla', 'descricao', 'Vagas', 'Total De Inscritos', 'tipo.titulo', 'qtd_evento']]]);
     //$this->load($params);
     if (!$this->validate()) {
         return $dataProvider;
     }
     $dataProvider->sort->attributes['tipo'] = ['asc' => ['titulo' => SORT_ASC], 'desc' => ['titulo' => SORT_DESC]];
     $dataProvider->sort->attributes['local'] = ['asc' => ['descricao' => SORT_ASC], 'desc' => ['descricao' => SORT_DESC]];
     $query->andFilterWhere(['idevento' => $this->idevento, 'horaIni' => $this->horaIni, 'horaFim' => $this->horaFim, 'vagas' => $this->vagas, 'cargaHoraria' => $this->cargaHoraria, 'allow' => $this->allow, 'responsavel' => $this->responsavel]);
     $query->andFilterWhere(['like', 'sigla', $this->sigla])->andFilterWhere(['like', 'descricao', $this->descricao])->andFilterWhere(['like', 'dataIni', $this->dataIni])->andFilterWhere(['like', 'dataFim', $this->dataFim])->andFilterWhere(['like', 'imagem', $this->imagem])->andFilterWhere(['like', 'detalhe', $this->detalhe])->andFilterWhere(['like', 'tipo.titulo', $this->tipo])->andFilterWhere(['like', 'local.descricao', $this->descricao]);
     return $dataProvider;
 }
Exemplo n.º 3
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $idMidia = collect(Midia::where('id_registro_tabela', $id)->where('id_tipo_midia', $this->tipo_midia)->first())->first();
     if (!empty($idMidia)) {
         $dados['imagens'] = Midia::find($idMidia)->multimidia()->where('id_midia', $idMidia)->get();
     } else {
         $dados['imagens'] = '';
     }
     $dados['destacada'] = Midia::where('id_registro_tabela', $id)->where('id_tipo_midia', $this->tipo_midia)->first();
     $dados['evento'] = Evento::findOrFail($id);
     return view('site/eventos-page', $dados);
 }
 public function search(Request $request)
 {
     $eventos = Evento::where('nombre_evento', 'like', '%' . $request->nombre . '%')->get();
     return \View::make('Evento/list_evento', compact('eventos'));
 }
Exemplo n.º 5
0
 public function getEvento()
 {
     return $this->hasOne(Evento::className(), ['idEvento' => 'evento_idevento']);
 }
Exemplo n.º 6
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]);
 }
Exemplo n.º 7
0
Arquivo: Evento.php Projeto: schw/SGE3
 public function getInscritosEventosPacotes($iditemProgramacao)
 {
     $model = Evento::find()->select(['nome'])->innerJoin('inscreve', 'inscreve.evento_idevento = evento.idevento')->innerJoin('itemProgramacao_has_pacote', 'itemProgramacao_has_pacote.pacote_idpacote = inscreve.pacote_idpacote')->innerJoin('user', 'user.idusuario = inscreve.usuario_idusuario')->where('itemProgramacao_has_pacote.itemProgramacao_idItemProgramacao =' . $iditemProgramacao)->orderBy('nome')->all();
     return $model;
 }
Exemplo n.º 8
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]);
 }
Exemplo n.º 9
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.');
     }
 }
Exemplo n.º 10
0
Arquivo: Tipo.php Projeto: schw/SGE3
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEventos()
 {
     return $this->hasMany(Evento::className(), ['tipo_idtipo' => 'idtipo']);
 }
Exemplo n.º 11
0
Arquivo: User.php Projeto: schw/SGE3
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEventoIdeventos()
 {
     return $this->hasMany(Evento::className(), ['idevento' => 'evento_idevento'])->viaTable('inscreve', ['usuario_idusuario' => 'idusuario']);
 }
Exemplo n.º 12
0
 public function getEvento()
 {
     return $this->hasMany(Evento::className(), ['palestrante_idPalestrante' => 'idPalestrante']);
 }
Exemplo n.º 13
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEventoIdeventos()
 {
     return $this->hasMany(Evento::className(), ['idevento' => 'evento_idevento'])->viaTable('evento_has_voluntario', ['voluntario_idvoluntario' => 'idvoluntario']);
 }
Exemplo n.º 14
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;
 }
Exemplo n.º 15
0
Arquivo: Local.php Projeto: schw/SGE3
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEventos()
 {
     return $this->hasMany(Evento::className(), ['local_idlocal' => 'idlocal']);
 }
Exemplo n.º 16
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.');
     }
 }
Exemplo n.º 17
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');
     }
 }
Exemplo n.º 18
0
 public function updateStatus($status, $id)
 {
     try {
         $dado = Evento::findOrFail($id);
         $dado->status = $status;
         $dado->save();
         session()->flash('flash_message', 'Status alterado com sucesso!');
     } catch (\Exception $e) {
         LogR::exception($dado, $e);
         session()->flash('flash_message', 'Ops!! Ocorreu algum problema!. ' . $e->getMessage());
     }
     return Redirect::back();
 }
Exemplo n.º 19
0
 public function actionEliminar()
 {
     $msg = null;
     $id;
     if (!isset($_REQUEST['confirmar']) && isset($_REQUEST['id'])) {
         $id = $_REQUEST['id'];
         $tabla = Evento::find()->where(['id_categoria' => $id]);
         if ($tabla->count() != 0) {
             $msg = "existen eventos registrados con esta categoria";
         }
         $tabla = Deportista_cat::find()->where(['id_categoria' => $id]);
         if ($tabla->count() != 0) {
             $msg .= "<br>" . "existen Deportistas registrados con esta categoria";
         }
         $tabla = Comision::find()->where(['id_categoria' => $id]);
         if ($tabla->count() != 0) {
             $msg .= "<br>" . "existen Comisiones registrados con esta categoria";
         }
         if ($msg != null) {
             return $this->render("confirmar", ['msg' => $msg, 'id' => $id]);
         } else {
             if (Categoria::deleteAll($id)) {
                 $msg = "Categoria eliminado con exito";
             } else {
                 $msg = "ocurrio un error";
             }
         }
     } else {
         if (isset($_REQUEST['confirmar'])) {
             if (Categoria::deleteAll($_REQUEST['id'])) {
                 $msg = "Categoria eliminado con exito";
             } else {
                 $msg = "ocurrio un error";
             }
         }
     }
     return $this->render("eliminar", ['msg' => $msg]);
 }
Exemplo n.º 20
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;
 }