コード例 #1
0
 function Gerar()
 {
     if ($_POST) {
         foreach ($_POST as $campo => $val) {
             $this->{$campo} = $this->{$campo} ? $this->{$campo} : $val;
         }
     }
     $obrigatorio = TRUE;
     $desabilitado = TRUE;
     $get_escola = TRUE;
     $get_curso = TRUE;
     $get_escola_curso_serie = TRUE;
     $get_turma = TRUE;
     include 'include/pmieducar/educar_campo_lista.php';
     $this->campoQuebra();
     /**
      * Campos a serem preenchidos com os dados necessários para a inclusão de horários
      */
     // foreign keys
     $opcoes_disc = array('' => 'Selecione uma disciplina');
     // Componentes curriculares da série
     $componentesTurma = array();
     try {
         $componentesTurma = App_Model_IedFinder::getComponentesTurma($this->ref_ref_cod_serie, $this->ref_cod_escola, $this->ref_cod_turma);
     } catch (Exception $e) {
     }
     if (0 == count($componentesTurma)) {
         $opcoes_disc = array('NULL' => 'A série dessa escola não possui componentes cadastrados');
     } else {
         foreach ($componentesTurma as $componente) {
             $opcoes_disc[$componente->id] = $componente;
         }
     }
     $this->campoLista('ref_cod_disciplina', 'Componente curricular', $opcoes_disc, $this->ref_cod_disciplina, '', FALSE, '', '', FALSE, FALSE);
     $this->campoOculto('identificador', $this->identificador);
     $opcoesDias = array('' => 'Selecione um dia da semana', 1 => 'Domingo', 2 => 'Segunda-Feira', 3 => 'Terça-Feira', 4 => 'Quarta-Feira', 5 => 'Quinta-Feira', 6 => 'Sexta-Feira', 7 => 'Sábado');
     $this->campoOculto('dia_semana', $this->dia_semana);
     $this->campoLista('dia_semana_', 'Dia da Semana', $opcoesDias, $this->dia_semana, '', FALSE, '', '', TRUE, FALSE);
     $this->campoHora('hora_inicial', 'Hora Inicial', $this->hora_inicial, FALSE);
     $this->campoHora('hora_final', 'Hora Final', $this->hora_final, FALSE);
     $this->campoListaPesq('ref_cod_servidor', 'Servidor', array('' => 'Selecione um servidor'), $this->ref_cod_servidor, '', '', FALSE, '', '', NULL, NULL, '', TRUE, FALSE, FALSE);
     $this->campoRotulo('bt_incluir_horario', 'Hor&aacute;rio', "<a href='#' onclick=\"" . "if (document.getElementById('ref_cod_disciplina').value == '') {\n         alert('Você deve escolher a disciplina!');\n         return;\n       }\n       else if (document.getElementById('hora_inicial').value == '') {\n         alert('Você deve preencher o campo Hora Inicial!');\n         return;\n       }\n       else if (document.getElementById('hora_final').value == '') {\n         alert('Você deve preencher o campo Hora Final!');\n         return;\n       }\n       else if (document.getElementById('ref_cod_servidor').value == '') {\n         alert('Você deve selecionar um servidor no campo Servidor');\n         return;\n       }\n       else {\n         if (verificaQuadroHorario()) {\n           getElementById('incluir_horario').value = 'S';\n           getElementById('tipoacao').value = '';\n           {$this->__nome}.submit();\n         }\n       }\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>");
     $this->campoOculto('incluir_horario', '');
     /**
      * Inclui horários
      */
     if ($_POST['quadro_horario']) {
         $this->quadro_horario = unserialize(urldecode($_POST['quadro_horario']));
     }
     $qtd_horario = count($this->quadro_horario) == 0 ? 1 : count($this->quadro_horario) + 1;
     // primary keys
     if ($this->incluir_horario) {
         if (is_numeric($_POST['ref_cod_servidor']) && is_string($_POST['hora_inicial']) && is_string($_POST['hora_final']) && is_numeric($_POST['dia_semana']) && is_numeric($_POST['ref_cod_disciplina'])) {
             $this->quadro_horario[$qtd_horario]['ref_cod_quadro_horario_'] = $this->ref_cod_quadro_horario;
             $this->quadro_horario[$qtd_horario]['ref_ref_cod_serie_'] = $this->ref_ref_cod_serie;
             $this->quadro_horario[$qtd_horario]['ref_ref_cod_escola_'] = $this->ref_cod_escola;
             $this->quadro_horario[$qtd_horario]['ref_ref_cod_disciplina_'] = $_POST['ref_cod_disciplina'];
             $this->quadro_horario[$qtd_horario]['ref_cod_instituicao_servidor_'] = $this->ref_cod_instituicao;
             $this->quadro_horario[$qtd_horario]['ref_servidor_'] = $_POST['ref_cod_servidor'];
             $this->quadro_horario[$qtd_horario]['ref_servidor_substituto_'] = $_POST['ref_servidor_substituto'];
             $this->quadro_horario[$qtd_horario]['hora_inicial_'] = $_POST['hora_inicial'];
             $this->quadro_horario[$qtd_horario]['hora_final_'] = $_POST['hora_final'];
             $this->quadro_horario[$qtd_horario]['ativo_'] = 1;
             $this->quadro_horario[$qtd_horario]['dia_semana_'] = $_POST['dia_semana'];
             $this->quadro_horario[$qtd_horario]['qtd_horario_'] = $qtd_horario;
             $qtd_horario++;
             /**
              * salva os dados em uma tabela temporaria
              * para realizar consulta na listagem
              */
             $obj_quadro_horario = new clsPmieducarQuadroHorarioHorariosAux($this->ref_cod_quadro_horario, NULL, $this->ref_cod_disciplina, $this->ref_cod_escola, $this->ref_ref_cod_serie, $this->ref_cod_instituicao, $this->ref_cod_servidor, $this->dia_semana, $this->hora_inicial, $this->hora_final, $this->identificador);
             $obj_quadro_horario->cadastra();
             unset($this->ref_cod_servidor);
             unset($this->ref_cod_disciplina);
             unset($this->hora_inicial);
             unset($this->hora_final);
             echo "\n          <script>\n            window.onload = function() {\n              document.getElementById('ref_cod_servidor').value   = '';\n              document.getElementById('ref_cod_disciplina').value = '';\n              document.getElementById('hora_inicial').value       = '';\n              document.getElementById('hora_final').value         = '';\n            }\n          </script>";
         }
     }
     echo "<script>\n            quadro_horario = " . count($this->quadro_horario) . ";\n        </script>";
     $this->campoOculto('excluir_horario', '');
     $qtd_horario = 1;
     $this->lst_matriculas = urldecode($this->lst_matriculas);
     $this->min_mat = $this->min_ves = $this->min_not = 0;
     if ($this->quadro_horario) {
         foreach ($this->quadro_horario as $campo) {
             if ($this->excluir_horario == $campo['qtd_horario_']) {
                 $obj_horario = new clsPmieducarQuadroHorarioHorarios();
                 $lst_horario = $obj_horario->lista($campo['ref_cod_quadro_horario_'], $campo['ref_ref_cod_serie_'], $campo['ref_ref_cod_escola_'], $campo['ref_ref_cod_disciplina_'], NULL, NULL, NULL, $campo['ref_cod_instituicao_servidor_'], NULL, $campo['ref_servidor_'], $campo['hora_inicial_'], NULL, $campo['hora_final_'], NULL, NULL, NULL, NULL, NULL, 1, $campo['dia_semana_']);
                 if (is_array($lst_horario)) {
                     $campo['ativo_'] = 0;
                     if (isset($this->lst_matriculas)) {
                         $this->lst_matriculas .= '' . $campo['ref_servidor_'] . '';
                     } else {
                         $this->lst_matriculas .= ', ' . $campo['ref_servidor_'] . '';
                     }
                 } else {
                     $campo['ativo_'] = 2;
                     if (isset($this->lst_matriculas)) {
                         $this->lst_matriculas .= '' . $campo['ref_servidor_'] . '';
                     } else {
                         $this->lst_matriculas .= ', ' . $campo['ref_servidor_'] . '';
                     }
                 }
                 $this->excluir_horario = NULL;
                 $obj_horario = new clsPmieducarQuadroHorarioHorariosAux();
                 $lst_horario = $obj_horario->excluiRegistro($campo['ref_cod_quadro_horario_'], $campo['ref_ref_cod_serie_'], $campo['ref_ref_cod_escola_'], $campo['ref_ref_cod_disciplina_'], $campo['ref_cod_instituicao_servidor_'], $campo['ref_servidor_'], $this->identificador);
             } else {
                 switch ($campo['dia_semana_']) {
                     case 1:
                         $campo['nm_dia_semana_'] = 'Domingo';
                         break;
                     case 2:
                         $campo['nm_dia_semana_'] = 'Segunda-Feira';
                         break;
                     case 3:
                         $campo['nm_dia_semana_'] = 'Terça-Feira';
                         break;
                     case 4:
                         $campo['nm_dia_semana_'] = 'Quarta-Feira';
                         break;
                     case 5:
                         $campo['nm_dia_semana_'] = 'Quinta-Feira';
                         break;
                     case 6:
                         $campo['nm_dia_semana_'] = 'Sexta-Feira';
                         break;
                     case 7:
                         $campo['nm_dia_semana_'] = 'S&aacute;bado';
                         break;
                 }
             }
             if ($campo['ativo_'] == 1) {
                 $this->campoTextoInv($campo['qtd_horario_'] . '_nm_dia_semana', '', $campo['nm_dia_semana_'], 13, 255, FALSE, FALSE, TRUE);
                 $this->campoOculto($campo['qtd_horario_'] . '_dia_semana', $campo['dia_semana_']);
                 $this->campoTextoInv($campo['qtd_horario_'] . '_hora_inicial', '', $campo['hora_inicial_'], 5, 255, FALSE, FALSE, TRUE);
                 $this->campoTextoInv($campo['qtd_horario_'] . '_hora_final', '', $campo['hora_final_'], 5, 255, FALSE, FALSE, TRUE);
                 $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper();
                 $componente = $componenteMapper->find($campo['ref_ref_cod_disciplina_']);
                 $this->campoTextoInv($campo['qtd_horario_'] . '_ref_cod_disciplina', '', $componente->nome, 30, 255, FALSE, FALSE, TRUE);
                 $obj_pes = new clsPessoa_($campo['ref_servidor_']);
                 $det_pes = $obj_pes->detalhe();
                 if (is_numeric($campo['ref_servidor_substituto_'])) {
                     $this->campoTextoInv($campo['qtd_horario_'] . '_ref_cod_servidor', '', $det_pes['nome'], 30, 255, FALSE, FALSE, FALSE, '', '');
                 } else {
                     $this->campoTextoInv($campo['qtd_horario_'] . '_ref_cod_servidor', '', $det_pes['nome'], 30, 255, FALSE, FALSE, FALSE, '', "<a href='#' onclick=\"getElementById('excluir_horario').value = '{$campo["qtd_horario_"]}'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bola_xis.gif' title='Excluir' border=0></a>");
                 }
             }
             if ($campo['ativo_'] != 2) {
                 $horarios_incluidos[$qtd_horario]['ref_cod_quadro_horario_'] = $campo['ref_cod_quadro_horario_'];
                 $horarios_incluidos[$qtd_horario]['ref_ref_cod_serie_'] = $campo['ref_ref_cod_serie_'];
                 $horarios_incluidos[$qtd_horario]['ref_ref_cod_escola_'] = $campo['ref_ref_cod_escola_'];
                 $horarios_incluidos[$qtd_horario]['ref_ref_cod_disciplina_'] = $campo['ref_ref_cod_disciplina_'];
                 $horarios_incluidos[$qtd_horario]['sequencial_'] = $campo['sequencial_'];
                 $horarios_incluidos[$qtd_horario]['ref_cod_instituicao_servidor_'] = $campo['ref_cod_instituicao_servidor_'];
                 $horarios_incluidos[$qtd_horario]['ref_servidor_'] = $campo['ref_servidor_'];
                 $horarios_incluidos[$qtd_horario]['ref_servidor_substituto_'] = $campo['ref_servidor_substituto_'];
                 $horarios_incluidos[$qtd_horario]['hora_inicial_'] = $campo['hora_inicial_'];
                 $horarios_incluidos[$qtd_horario]['hora_final_'] = $campo['hora_final_'];
                 $horarios_incluidos[$qtd_horario]['ativo_'] = $campo['ativo_'];
                 $horarios_incluidos[$qtd_horario]['dia_semana_'] = $campo['dia_semana_'];
                 $horarios_incluidos[$qtd_horario]['qtd_horario_'] = $qtd_horario;
                 $qtd_horario++;
             }
         }
         unset($this->quadro_horario);
         $this->quadro_horario = $horarios_incluidos;
     }
     $this->campoOculto('ref_cod_turma', $this->ref_cod_turma);
     $this->campoOculto('quadro_horario', serialize($this->quadro_horario));
     $this->campoOculto('ref_cod_curso_', $this->ref_cod_curso);
     $this->campoOculto('lst_matriculas', urlencode($this->lst_matriculas));
     $this->campoOculto('min_mat', $this->min_mat);
     $this->campoOculto('min_ves', $this->min_ves);
     $this->campoOculto('min_not', $this->min_not);
     $this->campoQuebra();
 }
コード例 #2
0
 function renderHTML()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->nivel_acesso($this->pessoa_logada) > 7) {
         $retorno .= '
     <table width="100%" height="40%" cellspacing="1" cellpadding="2" border="0" class="tablelistagem">
       <tbody>
         <tr>
           <td colspan="2" valig="center" height="50">
             <center class="formdktd">Usuário sem permissão para acessar esta página</center>
           </td>
         </tr>
       </tbody>
     </table>';
         return $retorno;
     }
     $retorno .= '
   <table width="100%" cellspacing="1" cellpadding="2" border="0" class="tablelistagem">
     <tbody>';
     if ($_POST) {
         $this->ref_cod_turma = $_POST['ref_cod_turma'] ? $_POST['ref_cod_turma'] : NULL;
         $this->ref_cod_serie = $_POST['ref_cod_serie'] ? $_POST['ref_cod_serie'] : NULL;
         $this->ref_cod_curso = $_POST['ref_cod_curso'] ? $_POST['ref_cod_curso'] : NULL;
         $this->ref_cod_escola = $_POST['ref_cod_escola'] ? $_POST['ref_cod_escola'] : NULL;
         $this->ref_cod_instituicao = $_POST['ref_cod_instituicao'] ? $_POST['ref_cod_instituicao'] : NULL;
         $this->busca = $_GET['busca'] ? $_GET['busca'] : NULL;
     } else {
         if ($_GET) {
             // Passa todos os valores obtidos no GET para atributos do objeto
             foreach ($_GET as $var => $val) {
                 $this->{$var} = $val === '' ? NULL : $val;
             }
         }
     }
     $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);
     if (!$this->ref_cod_escola) {
         $this->ref_cod_escola = $obj_permissoes->getEscola($this->pessoa_logada);
     }
     if (!is_numeric($this->ref_cod_instituicao)) {
         $this->ref_cod_instituicao = $obj_permissoes->getInstituicao($this->pessoa_logada);
     }
     // Componente curricular
     $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper();
     $obrigatorio = FALSE;
     $get_instituicao = TRUE;
     $get_escola = TRUE;
     $get_curso = TRUE;
     $get_serie = TRUE;
     $get_turma = TRUE;
     include 'educar_quadro_horarios_pesquisas.php';
     if ($this->busca == 'S') {
         if (is_numeric($this->ref_cod_turma)) {
             $obj_turma = new clsPmieducarTurma($this->ref_cod_turma);
             $det_turma = $obj_turma->detalhe();
             $obj_quadro = new clsPmieducarQuadroHorario(NULL, NULL, NULL, $this->ref_cod_turma, NULL, NULL, 1);
             $det_quadro = $obj_quadro->detalhe();
             if (is_array($det_quadro)) {
                 $quadro_horario = "<table class='calendar' cellspacing='0' cellpadding='0' border='0'><tr><td class='cal_esq' >&nbsp;</td><td background='imagens/i-educar/cal_bg.gif' width='100%' class='mes'>{$det_turma["nm_turma"]}</td><td align='right' class='cal_dir'>&nbsp;</td></tr><tr><td colspan='3' class='bordaM' style='border-bottom: 1px solid #8A959B;'  align='center'><table cellspacing='0' cellpadding='0'  border='0' ><tr class='header'><td style='border-right: 1px dotted #FFFFFF;width: 100px;'>DOM</td><td style='border-right: 1px dotted #FFFFFF;width: 100px;'>SEG</td><td style='border-right: 1px dotted #FFFFFF;width: 100px;'>TER</td><td style='border-right: 1px dotted #FFFFFF;width: 100px;'>QUA</td><td style='border-right: 1px dotted #FFFFFF;width: 100px;'>QUI</td><td style='border-right: 1px dotted #FFFFFF;width: 100px;'>SEX</td><td style='width: 100px;'>SAB</td></tr>";
                 $texto = '<tr>';
                 for ($c = 1; $c <= 7; $c++) {
                     $obj_horarios = new clsPmieducarQuadroHorarioHorarios();
                     $resultado = $obj_horarios->retornaHorario($this->ref_cod_instituicao, $this->ref_cod_escola, $this->ref_cod_serie, $this->ref_cod_turma, $c);
                     $texto .= "<td valign=top align='center' width='100' style='cursor: pointer; ' onclick='envia( this, {$this->ref_cod_turma}, {$this->ref_cod_serie}, {$this->ref_cod_curso}, {$this->ref_cod_escola}, {$this->ref_cod_instituicao}, {$det_quadro["cod_quadro_horario"]}, {$c} );'>";
                     if (is_array($resultado)) {
                         foreach ($resultado as $registro) {
                             // Componente curricular
                             $componente = $componenteMapper->find($registro['ref_cod_disciplina']);
                             // Servidor
                             $obj_servidor = new clsPmieducarServidor();
                             $det_servidor = array_shift($obj_servidor->lista($registro['ref_servidor'], NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,  NULL, NULL, NULL, NULL, NULL, TRUE));
                             $det_servidor['nome'] = array_shift(explode(' ', $det_servidor['nome']));
                             //$texto .= "<div  style='text-align: center;background-color: #F6F6F6;font-size: 11px; width: 100px; margin: 3px; border: 1px solid #CCCCCC; padding:5px; '>". substr($registro['hora_inicial'], 0, 5) . ' - ' . substr($registro['hora_final'], 0, 5) . " <br> {$componente->abreviatura} <br> {$det_servidor["nome"]}</div>";
                             $detalhes = sprintf("%s - %s<br />%s<br />%s", substr($registro['hora_inicial'], 0, 5), substr($registro['hora_final'], 0, 5), $componente->abreviatura, $det_servidor['nome']);
                             $texto .= sprintf('<div style="text-align: center; background-color: #F6F6F6; font-size: 11px; width: 100px; margin: 3px; border: 1px solid #CCCCCC; padding:5px;">%s</div>', $detalhes);
                         }
                     } else {
                         $texto .= "<div  style='text-align: center;background-color: #F6F6F6;font-size: 11px; width: 100px; margin: 3px; border: 1px solid #CCCCCC; padding:5px; height: 85%;'></div>";
                     }
                     $texto .= '</td>';
                 }
                 $texto .= '<tr><td colspan="7">&nbsp;</td></tr>';
                 $quadro_horario .= $texto;
                 $quadro_horario .= '</table></td></tr></table>';
                 $retorno .= "<tr><td colspan='2' ><center><b></b>{$quadro_horario}</center></td></tr>";
             } else {
                 $retorno .= "<tr><td colspan='2' ><b><center>N&atilde;o existe nenhum quadro de hor&aacute;rio cadastrado para esta turma.</center></b></td></tr>";
             }
         }
     }
     if ($obj_permissoes->permissao_cadastra(641, $this->pessoa_logada, 7)) {
         $retorno .= "<tr><td>&nbsp;</td></tr><tr>\n            <td align=\"center\" colspan=\"2\">";
         if (!$det_quadro) {
             $retorno .= "<input type=\"button\" value=\"Novo Quadro de Hor&aacute;rios\" onclick=\"window.location='educar_quadro_horario_cad.php?ref_cod_turma={$this->ref_cod_turma}&ref_cod_serie={$this->ref_cod_serie}&ref_cod_curso={$this->ref_cod_curso}&ref_cod_escola={$this->ref_cod_escola}&ref_cod_instituicao={$this->ref_cod_instituicao};'\" class=\"botaolistagem\"/>";
         } else {
             if ($obj_permissoes->permissao_excluir(641, $this->pessoa_logada, 7)) {
                 $retorno .= "<input type=\"button\" value=\"Excluir Quadro de Hor&aacute;rios\" onclick=\"window.location='educar_quadro_horario_cad.php?ref_cod_turma={$this->ref_cod_turma}&ref_cod_serie={$this->ref_cod_serie}&ref_cod_curso={$this->ref_cod_curso}&ref_cod_escola={$this->ref_cod_escola}&ref_cod_instituicao={$this->ref_cod_instituicao}&ref_cod_quadro_horario={$det_quadro["cod_quadro_horario"]}'\" class=\"botaolistagem\"/>";
             }
         }
         $retorno .= "</td>\n            </tr>";
     }
     $retorno .= '</tbody>
   </table>';
     return $retorno;
 }
コード例 #3
0
 function renderHTML()
 {
     if ($_POST) {
         foreach ($_POST as $key => $value) {
             $this->{$key} = $value;
         }
     }
     if ($this->ref_ref_cod_serie) {
         $this->ref_cod_serie = $this->ref_ref_cod_serie;
     }
     if ($this->ref_cod_escola) {
         $obj_escola = new clsPmieducarEscola($this->ref_cod_escola);
         $det_escola = $obj_escola->detalhe();
         $this->nm_escola = $det_escola['nome'];
     }
     $obj_instituicao = new clsPmieducarInstituicao($this->ref_cod_instituicao);
     $det_instituicao = $obj_instituicao->detalhe();
     $this->nm_instituicao = $det_instituicao['nm_instituicao'];
     $fonte = 'arial';
     $corTexto = '#000000';
     $obj_curso = new clsPmieducarCurso();
     $obj_curso->setOrderby('nm_curso');
     $lst_curso = $obj_curso->lista($this->ref_cod_curso, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, $this->ref_cod_instituicao);
     if ($lst_curso) {
         foreach ($lst_curso as $curso) {
             $obj_serie = new clsPmieducarSerie();
             $obj_serie->setOrderby('nm_serie');
             $lst_serie = $obj_serie->lista($this->ref_cod_serie, NULL, NULL, $curso['cod_curso'], NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao, NULL, NULL, NULL, $this->ref_cod_escola);
             $quadro_horario = 0;
             if ($lst_serie) {
                 foreach ($lst_serie as $serie) {
                     $obj_turma = new clsPmieducarTurma();
                     $obj_turma->setOrderby('nm_turma');
                     $lst_turma = $obj_turma->lista($this->ref_cod_turma, NULL, NULL, $serie['cod_serie'], $this->ref_cod_escola, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $curso['cod_curso'], $this->ref_cod_instituicao);
                     if ($lst_turma) {
                         foreach ($lst_turma as $turma) {
                             $obj_quadro = new clsPmieducarQuadroHorario(NULL, NULL, NULL, $turma['cod_turma'], NULL, NULL, 1);
                             $det_quadro = $obj_quadro->detalhe();
                             if ($det_quadro) {
                                 if (!$this->pdf) {
                                     $this->pdf = new clsPDF('Quadro Horarios', 'Quadro Horarios', 'A4', '', FALSE, FALSE);
                                 }
                                 if ($quadro_horario % 3 == 0) {
                                     $this->page_y = 15;
                                     $this->pdf->OpenPage();
                                     $this->addCabecalho();
                                     $quadro_horario = 0;
                                 }
                                 $this->pdf->escreve_relativo($turma['nm_turma'] . ' -  ' . $serie['nm_serie'], 20, $this->page_y - 7, 550, 20, $fonte, 11, $corTexto, 'center');
                                 $this->page_y += 10;
                                 $this->pdf->quadrado_relativo(35, $this->page_y, 525, 20, 0.3, '#777777', '#777777');
                                 $inicio_x = 35;
                                 for ($dia_semana = 1; $dia_semana <= 7; $dia_semana++) {
                                     $this->pdf->linha_relativa($inicio_x, $this->page_y, 0, 20);
                                     $this->pdf->escreve_relativo($this->array_dias_semana[$dia_semana], $inicio_x, $this->page_y + 3, 75, 20, $fonte, 11, $corTexto, 'center');
                                     $inicio_x += 75;
                                 }
                                 $this->page_y += 20;
                                 $inicio_y = $this->page_y;
                                 $inicio_x = 35;
                                 $this->pdf->quadrado_relativo($inicio_x, $this->page_y, 525, 200, 0.3);
                                 for ($dia_semana = 1; $dia_semana <= 7; $dia_semana++) {
                                     $obj_horarios = new clsPmieducarQuadroHorarioHorarios();
                                     $resultado = $obj_horarios->retornaHorario($this->ref_cod_instituicao, $this->ref_cod_escola, $serie['cod_serie'], $turma['cod_turma'], $dia_semana);
                                     if (is_array($resultado)) {
                                         foreach ($resultado as $registro) {
                                             $this->pdf->quadrado_relativo($inicio_x, $this->page_y, 75, 50, 0.3);
                                             $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper();
                                             $componente = $componenteMapper->find($registro['ref_cod_disciplina']);
                                             $obj_servidor = new clsPmieducarServidor();
                                             $det_servidor = array_shift($obj_servidor->lista($registro['ref_servidor'], NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TRUE));
                                             $det_servidor['nome'] = array_shift(explode(' ', $det_servidor['nome']));
                                             $texto = sprintf("%s - %s\n%s\n%s", substr($registro['hora_inicial'], 0, 5), substr($registro["hora_final"], 0, 5), $componente->abreviatura, $det_servidor['nome']);
                                             $this->pdf->escreve_relativo($texto, $inicio_x, $this->page_y + 12, 75, 50, $fonte, 10, $corTexto, 'center');
                                             $this->page_y += 50;
                                         }
                                     }
                                     $inicio_x += 75;
                                     $this->page_y = $inicio_y;
                                 }
                                 $this->page_y += 220;
                             }
                             $quadro_horario++;
                         }
                     }
                 }
             }
         }
     }
     if ($this->pdf) {
         $this->pdf->CloseFile();
         $this->get_link = $this->pdf->GetLink();
     } else {
         echo '
     <script>
       alert("A(s) turma(s) não possui(em) quadro de horário(s).");
       window.parent.fechaExpansivel("div_dinamico_" + (window.parent.DOM_divs.length-1));
     </script>';
         return;
     }
     echo sprintf('
   <script>
     window.onload=function()
     {
       parent.EscondeDiv("LoadImprimir");
       window.location="download.php?filename=%s"
     }
   </script>', $this->get_link);
     echo sprintf('
   <html>
     <center>Se o download não iniciar automaticamente <br />
     <a target="blank" href="%s" style="font-size: 16px; color: #000000; text-decoration: underline;">clique aqui!</a><br /><br />
     <span style="font-size: 10px;">Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br />
       Clique na Imagem para Baixar o instalador<br /><br />
       <a href="http://www.adobe.com.br/products/acrobat/readstep2.html" target="new"><br><img src="imagens/acrobat.gif" width="88" height="31" border="0"></a>
     </span>
   </center>', $this->get_link);
 }
コード例 #4
0
 /**
  * Construtor.
  */
 function clsPmieducarServidorDisciplina($ref_cod_disciplina = NULL, $ref_ref_cod_instituicao = NULL, $ref_cod_servidor = NULL, $ref_cod_curso = NULL)
 {
     $db = new clsBanco();
     $this->_schema = 'pmieducar.';
     $this->_tabela = $this->_schema . 'servidor_disciplina';
     $this->_campos_lista = $this->_todos_campos = 'ref_cod_disciplina, ref_ref_cod_instituicao, ref_cod_servidor, ref_cod_curso';
     if (is_numeric($ref_cod_servidor) && is_numeric($ref_ref_cod_instituicao)) {
         $servidor = new clsPmieducarServidor($ref_cod_servidor, NULL, NULL, NULL, NULL, NULL, NULL, $ref_ref_cod_instituicao);
         if ($servidor->existe()) {
             $this->ref_cod_servidor = $ref_cod_servidor;
             $this->ref_ref_cod_instituicao = $ref_ref_cod_instituicao;
         }
     }
     if (is_numeric($ref_cod_disciplina)) {
         $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper();
         try {
             $componenteMapper->find($ref_cod_disciplina);
             $this->ref_cod_disciplina = $ref_cod_disciplina;
         } catch (Exception $e) {
         }
     }
     if (is_numeric($ref_cod_curso)) {
         $curso = new clsPmieducarCurso($ref_cod_curso);
         if ($curso->existe()) {
             $this->ref_cod_curso = $ref_cod_curso;
         }
     }
 }
コード例 #5
0
 function Inicializar()
 {
     $retorno = 'Novo';
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     $this->cod_servidor = $_GET['ref_cod_servidor'];
     $this->ref_cod_instituicao = $_GET['ref_cod_instituicao'];
     $obj_permissoes = new clsPermissoes();
     $obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7, 'educar_servidor_lst.php');
     if (is_numeric($this->cod_servidor) && is_numeric($this->ref_cod_instituicao)) {
         $obj = new clsPmieducarServidor($this->cod_servidor, NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_cod_instituicao);
         $registro = $obj->detalhe();
         if ($registro) {
             $retorno = 'Editar';
         }
     }
     @session_start();
     $this->cursos_disciplina = $_SESSION['cursos_disciplina'];
     @session_write_close();
     if (!$this->cursos_disciplina) {
         $obj_servidor_disciplina = new clsPmieducarServidorDisciplina();
         $lst_servidor_disciplina = $obj_servidor_disciplina->lista(NULL, $this->ref_cod_instituicao, $this->cod_servidor);
         if ($lst_servidor_disciplina) {
             foreach ($lst_servidor_disciplina as $disciplina) {
                 $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper();
                 $componente = $componenteMapper->find($disciplina['ref_cod_disciplina']);
                 $this->cursos_disciplina[$disciplina['ref_cod_curso']][$disciplina['ref_cod_disciplina']] = $disciplina['ref_cod_disciplina'];
             }
         }
     }
     if ($this->cursos_disciplina) {
         foreach ($this->cursos_disciplina as $curso => $disciplinas) {
             if ($disciplinas) {
                 foreach ($disciplinas as $disciplina) {
                     $this->ref_cod_curso[] = $curso;
                     $this->ref_cod_disciplina[] = $disciplina;
                 }
             }
         }
     }
     return $retorno;
 }
コード例 #6
0
 /**
  * Construtor.
  */
 function clsPmieducarEscolaSerieDisciplina($ref_ref_cod_serie = NULL, $ref_ref_cod_escola = NULL, $ref_cod_disciplina = NULL, $ativo = NULL, $carga_horaria = NULL)
 {
     $db = new clsBanco();
     $this->_schema = 'pmieducar.';
     $this->_tabela = $this->_schema . 'escola_serie_disciplina';
     $this->_campos_lista = $this->_todos_campos = 'ref_ref_cod_serie, ref_ref_cod_escola, ref_cod_disciplina, carga_horaria';
     if (is_numeric($ref_cod_disciplina)) {
         $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper();
         try {
             $componenteMapper->find($ref_cod_disciplina);
             $this->ref_cod_disciplina = $ref_cod_disciplina;
         } catch (Exception $e) {
         }
     }
     if (is_numeric($ref_ref_cod_escola) && is_numeric($ref_ref_cod_serie)) {
         if (class_exists("clsPmieducarEscolaSerie")) {
             $tmp_obj = new clsPmieducarEscolaSerie($ref_ref_cod_escola, $ref_ref_cod_serie);
             if (method_exists($tmp_obj, "existe")) {
                 if ($tmp_obj->existe()) {
                     $this->ref_ref_cod_escola = $ref_ref_cod_escola;
                     $this->ref_ref_cod_serie = $ref_ref_cod_serie;
                 }
             } else {
                 if (method_exists($tmp_obj, "detalhe")) {
                     if ($tmp_obj->detalhe()) {
                         $this->ref_ref_cod_escola = $ref_ref_cod_escola;
                         $this->ref_ref_cod_serie = $ref_ref_cod_serie;
                     }
                 }
             }
         } else {
             if ($db->CampoUnico("SELECT 1 FROM pmieducar.escola_serie WHERE ref_cod_escola = '{$ref_ref_cod_escola}' AND ref_cod_serie = '{$ref_ref_cod_serie}'")) {
                 $this->ref_ref_cod_escola = $ref_ref_cod_escola;
                 $this->ref_ref_cod_serie = $ref_ref_cod_serie;
             }
         }
     } else {
         $this->ref_ref_cod_serie = $ref_ref_cod_serie;
     }
     if (is_numeric($ativo)) {
         $this->ativo = $ativo;
     }
     if (is_numeric($carga_horaria)) {
         $this->carga_horaria = $carga_horaria;
     }
 }
コード例 #7
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     // Helper para url
     $urlHelper = CoreExt_View_Helper_UrlHelper::getInstance();
     $this->titulo = 'Dispensa Componente Curricular - Listagem';
     // passa todos os valores obtidos no GET para atributos do objeto
     foreach ($_GET as $var => $val) {
         $this->{$var} = $val === '' ? NULL : $val;
     }
     if (!$_GET['ref_cod_matricula']) {
         header('Location: educar_matricula_lst.php');
         die;
     }
     $this->ref_cod_matricula = $_GET['ref_cod_matricula'];
     $obj_matricula = new clsPmieducarMatricula();
     $lst_matricula = $obj_matricula->lista($this->ref_cod_matricula);
     if (is_array($lst_matricula)) {
         $det_matricula = array_shift($lst_matricula);
         $this->ref_cod_instituicao = $det_matricula['ref_cod_instituicao'];
         $this->ref_cod_escola = $det_matricula['ref_ref_cod_escola'];
         $this->ref_cod_serie = $det_matricula['ref_ref_cod_serie'];
         $obj_matricula_turma = new clsPmieducarMatriculaTurma();
         $lst_matricula_turma = $obj_matricula_turma->lista($this->ref_cod_matricula, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_serie, NULL, $this->ref_cod_escola);
         if (is_array($lst_matricula_turma)) {
             $det = array_shift($lst_matricula_turma);
             $this->ref_cod_turma = $det['ref_cod_turma'];
             $this->ref_sequencial = $det['sequencial'];
         }
     }
     $this->campoOculto('ref_cod_turma', $this->ref_cod_turma);
     $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet');
     $this->addCabecalhos(array('Disciplina', 'Tipo Dispensa', 'Data Dispensa'));
     // Filtros de Foreign Keys
     $opcoes = array('' => 'Selecione');
     $objTemp = new clsPmieducarTipoDispensa();
     if ($this->ref_cod_instituicao) {
         $lista = $objTemp->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao);
     } else {
         $lista = $objTemp->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     }
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             $opcoes[$registro['cod_tipo_dispensa']] = $registro['nm_tipo'];
         }
     }
     $this->campoLista('ref_cod_tipo_dispensa', 'Motivo', $opcoes, $this->ref_cod_tipo_dispensa, '', FALSE, '', '', FALSE, FALSE);
     $this->campoOculto('ref_cod_matricula', $this->ref_cod_matricula);
     // outros Filtros
     $opcoes = array('' => 'Selecione');
     // Escola série disciplina
     $componentes = App_Model_IedFinder::getComponentesTurma($this->ref_cod_serie, $this->ref_cod_escola, $this->ref_cod_turma);
     foreach ($componentes as $componente) {
         $opcoes[$componente->id] = $componente->nome;
     }
     $this->campoLista('ref_cod_disciplina', 'Disciplina', $opcoes, $this->ref_cod_disciplina, '', FALSE, '', '', FALSE, FALSE);
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0;
     $obj_dispensa_disciplina = new clsPmieducarDispensaDisciplina();
     $obj_dispensa_disciplina->setOrderby('data_cadastro ASC');
     $obj_dispensa_disciplina->setLimite($this->limite, $this->offset);
     $lista = $obj_dispensa_disciplina->lista($this->ref_cod_matricula, NULL, NULL, $this->ref_cod_disciplina, NULL, NULL, $this->ref_cod_tipo_dispensa, NULL, NULL, NULL, NULL, 1);
     $total = $obj_dispensa_disciplina->_total;
     // Mapper de componente curricular
     $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper();
     // monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             // muda os campos data
             $registro['data_cadastro_time'] = strtotime(substr($registro['data_cadastro'], 0, 16));
             $registro['data_cadastro_br'] = date('d/m/Y', $registro['data_cadastro_time']);
             // Tipo da dispensa
             $obj_ref_cod_tipo_dispensa = new clsPmieducarTipoDispensa($registro['ref_cod_tipo_dispensa']);
             $det_ref_cod_tipo_dispensa = $obj_ref_cod_tipo_dispensa->detalhe();
             $registro['ref_cod_tipo_dispensa'] = $det_ref_cod_tipo_dispensa['nm_tipo'];
             // Componente curricular
             $componente = $componenteMapper->find($registro['ref_cod_disciplina']);
             // Dados para a url
             $url = 'educar_dispensa_disciplina_det.php';
             $options = array('query' => array('ref_cod_matricula' => $registro['ref_cod_matricula'], 'ref_cod_serie' => $registro['ref_cod_serie'], 'ref_cod_escola' => $registro['ref_cod_escola'], 'ref_cod_disciplina' => $registro['ref_cod_disciplina']));
             $this->addLinhas(array($urlHelper->l($componente->nome, $url, $options), $urlHelper->l($registro['ref_cod_tipo_dispensa'], $url, $options), $urlHelper->l($registro['data_cadastro_br'], $url, $options)));
         }
     }
     $this->addPaginador2('educar_dispensa_disciplina_lst.php', $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(578, $this->pessoa_logada, 7)) {
         $this->array_botao_url[] = 'educar_dispensa_disciplina_cad.php?ref_cod_matricula=' . $this->ref_cod_matricula;
         $this->array_botao[] = 'Novo';
     }
     $this->array_botao_url[] = 'educar_matricula_det.php?cod_matricula=' . $this->ref_cod_matricula;
     $this->array_botao[] = 'Voltar';
     $this->largura = '100%';
 }
コード例 #8
0
 protected function getAreaConhecimento($componenteCurricularId = null)
 {
     if (is_null($componenteCurricularId)) {
         $componenteCurricularId = $this->getRequest()->componente_curricular_id;
     }
     if (!is_numeric($componenteCurricularId)) {
         throw new Exception('Não foi possível obter a área de conhecimento pois não foi recebido o id do componente curricular.');
     }
     require_once 'ComponenteCurricular/Model/ComponenteDataMapper.php';
     $mapper = new ComponenteCurricular_Model_ComponenteDataMapper();
     $where = array('id' => $componenteCurricularId);
     $area = $mapper->findAll(array('area_conhecimento'), $where);
     $areaConhecimento = new stdClass();
     $areaConhecimento->id = $area[0]->area_conhecimento->id;
     $areaConhecimento->nome = $area[0]->area_conhecimento->nome;
     $areaConhecimento->secao = $area[0]->area_conhecimento->secao;
     return $areaConhecimento;
 }
コード例 #9
0
 /**
  * Implementação do método Gerar()
  */
 function Gerar()
 {
     session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = 'Servidor - Detalhe';
     $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet');
     $this->cod_servidor = $_GET['cod_servidor'];
     $this->ref_cod_instituicao = $_GET['ref_cod_instituicao'];
     $tmp_obj = new clsPmieducarServidor($this->cod_servidor, NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_cod_instituicao);
     $registro = $tmp_obj->detalhe();
     if (!$registro) {
         header('Location: educar_servidor_lst.php');
         die;
     }
     // Deficiência
     $obj_ref_cod_deficiencia = new clsCadastroDeficiencia($registro['ref_cod_deficiencia']);
     $det_ref_cod_deficiencia = $obj_ref_cod_deficiencia->detalhe();
     $registro['ref_cod_deficiencia'] = $det_ref_cod_deficiencia['nm_deficiencia'];
     // Escolaridade
     $obj_ref_idesco = new clsCadastroEscolaridade($registro['ref_idesco']);
     $det_ref_idesco = $obj_ref_idesco->detalhe();
     $registro['ref_idesco'] = $det_ref_idesco['descricao'];
     // Função
     $obj_ref_cod_funcao = new clsPmieducarFuncao($registro['ref_cod_funcao'], NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_cod_instituicao);
     $det_ref_cod_funcao = $obj_ref_cod_funcao->detalhe();
     $registro['ref_cod_funcao'] = $det_ref_cod_funcao['nm_funcao'];
     // Nome
     $obj_cod_servidor = new clsFuncionario($registro['cod_servidor']);
     $det_cod_servidor = $obj_cod_servidor->detalhe();
     $registro['matricula'] = $det_cod_servidor['matricula'];
     $det_cod_servidor = $det_cod_servidor['idpes']->detalhe();
     $registro['nome'] = $det_cod_servidor['nome'];
     // Instituição
     $obj_ref_cod_instituicao = new clsPmieducarInstituicao($registro['ref_cod_instituicao']);
     $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
     $registro['ref_cod_instituicao'] = $det_ref_cod_instituicao['nm_instituicao'];
     // Alocação do servidor
     $obj = new clsPmieducarServidorAlocacao();
     $obj->setOrderby('periodo, carga_horaria');
     $lista = $obj->lista(NULL, $this->ref_cod_instituicao, NULL, NULL, NULL, $this->cod_servidor, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     if ($lista) {
         // Passa todos os valores do registro para atributos do objeto
         foreach ($lista as $campo => $val) {
             $temp = array();
             $temp['carga_horaria'] = $val['carga_horaria'];
             $temp['periodo'] = $val['periodo'];
             $obj_escola = new clsPmieducarEscola($val['ref_cod_escola']);
             $det_escola = $obj_escola->detalhe();
             $det_escola = $det_escola['nome'];
             $temp['ref_cod_escola'] = $det_escola;
             $this->alocacao_array[] = $temp;
         }
     }
     if ($registro['cod_servidor']) {
         $this->addDetalhe(array('Servidor', $registro['cod_servidor']));
     }
     if ($registro['matricula']) {
         $this->addDetalhe(array('Matrícula', $registro['matricula']));
     }
     if ($registro['nome']) {
         $this->addDetalhe(array('Nome', $registro['nome']));
     }
     if ($registro['ref_cod_instituicao']) {
         $this->addDetalhe(array("Instituição", $registro['ref_cod_instituicao']));
     }
     if ($registro['ref_cod_deficiencia']) {
         $this->addDetalhe(array('Deficiência', $registro['ref_cod_deficiencia']));
     }
     if ($registro['ref_idesco']) {
         $this->addDetalhe(array('Escolaridade', $registro['ref_idesco']));
     }
     if ($registro['ref_cod_subnivel']) {
         $obj_nivel = new clsPmieducarSubnivel($registro['ref_cod_subnivel']);
         $det_nivel = $obj_nivel->detalhe();
         $this->addDetalhe(array('Nível', $det_nivel['nm_subnivel']));
     }
     if ($registro['ref_cod_funcao']) {
         $this->addDetalhe(array('Função', $registro['ref_cod_funcao']));
     }
     $obj_funcao = new clsPmieducarServidorFuncao();
     $lst_funcao = $obj_funcao->lista($this->ref_cod_instituicao, $this->cod_servidor);
     // Inep.
     $docente = false;
     if ($lst_funcao) {
         $tabela .= "\n        <table cellspacing='0' cellpadding='0' border='0'>\n          <tr bgcolor='#A1B3BD' align='center'>\n            <td width='150'>Função</td>\n          </tr>";
         $class = 'formlttd';
         $tab_disc = NULL;
         $obj_disciplina_servidor = new clsPmieducarServidorDisciplina();
         $lst_disciplina_servidor = $obj_disciplina_servidor->lista(NULL, $this->ref_cod_instituicao, $this->cod_servidor);
         if ($lst_disciplina_servidor) {
             $tab_disc .= "<table cellspacing='0' cellpadding='0' width='200' border='0' style='border:1px dotted #000000'>";
             $class2 = $class2 == "formlttd" ? "formmdtd" : "formlttd";
             $tab_disc .= "\n          <tr>\n            <td bgcolor='#A1B3BD' align='center'>Componentes Curriculares</td>\n          </tr>";
             $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper();
             foreach ($lst_disciplina_servidor as $disciplina) {
                 $componente = $componenteMapper->find($disciplina['ref_cod_disciplina']);
                 $tab_disc .= "\n            <tr class='{$class2}' align='center'>\n              <td align='left'>{$componente->nome}</td>\n            </tr>";
                 $class2 = $class2 == "formlttd" ? "formmdtd" : "formlttd";
             }
             $tab_disc .= "</table>";
         }
         $obj_servidor_curso = new clsPmieducarServidorCursoMinistra();
         $lst_servidor_curso = $obj_servidor_curso->lista(NULL, $this->ref_cod_instituicao, $this->cod_servidor);
         if ($lst_servidor_curso) {
             $tab_curso .= "<table cellspacing='0' cellpadding='0' width='200' border='0' style='border:1px dotted #000000'>";
             $class2 = $class2 == "formlttd" ? "formmdtd" : "formlttd";
             $tab_curso .= "\n          <tr>\n            <td bgcolor='#A1B3BD' align='center'>Cursos Ministrados</td>\n          </tr>";
             foreach ($lst_servidor_curso as $curso) {
                 $obj_curso = new clsPmieducarCurso($curso['ref_cod_curso']);
                 $det_curso = $obj_curso->detalhe();
                 $tab_curso .= "\n            <tr class='{$class2}' align='center'>\n              <td align='left'>{$det_curso['nm_curso']}</td>\n            </tr>";
                 $class2 = $class2 == "formlttd" ? "formmdtd" : "formlttd";
             }
             $tab_curso .= "</table>";
         }
         foreach ($lst_funcao as $funcao) {
             $obj_funcao = new clsPmieducarFuncao($funcao['ref_cod_funcao']);
             $det_funcao = $obj_funcao->detalhe();
             $tabela .= "\n          <tr class='{$class}' align='left'>\n            <td><b>{$det_funcao['nm_funcao']}</b></td>\n          </tr>";
             $docente = (bool) $det_funcao['professor'];
             $class = $class == "formlttd" ? "formmdtd" : "formlttd";
         }
         if ($tab_curso) {
             $tabela .= "\n          <tr class='{$class}' align='center'>\n            <td style='padding:5px'>{$tab_curso}</td>\n          </tr>";
         }
         if ($tab_disc) {
             $tabela .= "\n          <tr class='{$class}' align='center'>\n            <td style='padding:5px'>{$tab_disc}</td>\n          </tr>";
         }
         $tabela .= "</table>";
         $this->addDetalhe(array('Função', "<a href='javascript:trocaDisplay(\"det_f\");' >Mostrar detalhe</a><div id='det_f' name='det_f' style='display:none;'>" . $tabela . "</div>"));
     }
     $tabela = NULL;
     /**
      * @todo  Criar função de transformação de hora decimal. Ver educar_servidor_cad.php em 276
      */
     if ($registro['carga_horaria']) {
         $cargaHoraria = $registro['carga_horaria'];
         $horas = (int) $cargaHoraria;
         $minutos = round(($cargaHoraria - $horas) * 60);
         $cargaHoraria = sprintf('%02d:%02d', $horas, $minutos);
         $this->addDetalhe(array('Carga Horária', $cargaHoraria));
     }
     $dias_da_semana = array('' => 'Selecione', 1 => 'Domingo', 2 => 'Segunda', 3 => 'Terça', 4 => 'Quarta', 5 => 'Quinta', 6 => 'Sexta', 7 => 'Sábado');
     if ($this->alocacao_array) {
         $tabela .= "\n        <table cellspacing='0' cellpadding='0' border='0'>\n          <tr bgcolor='#A1B3BD' align='center'>\n            <td width='150'>Carga Horária</td>\n            <td width='80'>Período</td>\n            <td width='150'>Escola</td>\n          </tr>";
         $class = "formlttd";
         foreach ($this->alocacao_array as $alocacao) {
             switch ($alocacao['periodo']) {
                 case 1:
                     $nm_periodo = "Matutino";
                     break;
                 case 2:
                     $nm_periodo = "Vespertino";
                     break;
                 case 3:
                     $nm_periodo = "Noturno";
                     break;
             }
             $tabela .= "\n          <tr class='{$class}' align='center'>\n            <td>{$alocacao['carga_horaria']}</td>\n            <td>{$nm_periodo}</td>\n            <td>{$alocacao['ref_cod_escola']}</td>\n          </tr>";
             $class = $class == 'formlttd' ? 'formmdtd' : 'formlttd';
         }
         $tabela .= "</table>";
         $this->addDetalhe(array('Horários de trabalho', "<a href='javascript:trocaDisplay(\"det_pree\");' >Mostrar detalhe</a><div id='det_pree' name='det_pree' style='display:none;'>" . $tabela . "</div>"));
     }
     // Horários do professor
     $horarios = $tmp_obj->getHorariosServidor($registro['cod_servidor'], $this->ref_cod_instituicao);
     if ($horarios) {
         $tabela = "\n        <table cellspacing='0' cellpadding='0' border='0'>\n          <tr bgcolor='#A1B3BD' align='center'>\n            <td width='150'>Escola</td>\n            <td width='100'>Curso</td>\n            <td width='70'>Série</td>\n            <td width='70'>Turma</td>\n            <td width='100'>Componente curricular</td>\n            <td width='70'>Dia da semana</td>\n            <td width='70'>Hora inicial</td>\n            <td width='70'>Hora final</td>\n          </tr>";
         foreach ($horarios as $horario) {
             $class = $class == 'formlttd' ? 'formmdtd' : 'formlttd';
             $tabela .= sprintf('
       <tr class="%s" align="center">
         <td>%s</td>
         <td>%s</td>
         <td>%s</td>
         <td>%s</td>
         <td>%s</td>
         <td>%s</td>
         <td>%s</td>
         <td>%s</td>
       </tr>', $class, $horario['nm_escola'], $horario['nm_curso'], $horario['nm_serie'], $horario['nm_turma'], $horario['nome'], $dias_da_semana[$horario['dia_semana']], $horario['hora_inicial'], $horario['hora_final']);
         }
         $tabela .= "</table>";
         $this->addDetalhe(array('Horários de aula', "<a href='javascript:trocaDisplay(\"horarios\");' >Mostrar detalhes</a>" . "<div id='horarios' name='det_pree' style='display:none;'>" . $tabela . "</div>"));
     }
     // Dados do docente no Educacenso/Inep.
     if ($docente) {
         $docenteMapper = new Educacenso_Model_DocenteDataMapper();
         $docenteInep = NULL;
         try {
             $docenteInep = $docenteMapper->find(array('docente' => $registro['cod_servidor']));
         } catch (Exception $e) {
         }
         if (isset($docenteInep)) {
             $this->addDetalhe(array('Código do docente no Educacenso/Inep', $docenteInep->docenteInep));
             if (isset($docenteInep->nomeInep)) {
                 $this->addDetalhe(array('Nome do docente no Educacenso/Inep', $docenteInep->nomeInep));
             }
         }
     }
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7)) {
         $this->url_novo = 'educar_servidor_cad.php';
         $this->url_editar = "educar_servidor_cad.php?cod_servidor={$registro["cod_servidor"]}&ref_cod_instituicao={$this->ref_cod_instituicao}";
         $get_padrao = "ref_cod_servidor={$registro["cod_servidor"]}&ref_cod_instituicao={$this->ref_cod_instituicao}";
         $this->array_botao = array();
         $this->array_botao_url_script = array();
         $this->array_botao[] = 'Avaliação de Desempenho';
         $this->array_botao_url_script[] = "go(\"educar_avaliacao_desempenho_lst.php?{$get_padrao}\");";
         $this->array_botao[] = 'Formação';
         $this->array_botao_url_script[] = "go(\"educar_servidor_formacao_lst.php?{$get_padrao}\");";
         $this->array_botao[] = 'Cursos superiores/Licenciaturas';
         $this->array_botao_url_script[] = sprintf("go(\"../module/Docente/index?servidor=%d&instituicao=%d\");", $registro['cod_servidor'], $this->ref_cod_instituicao);
         $this->array_botao[] = 'Faltas/Atrasos';
         $this->array_botao_url_script[] = "go(\"educar_falta_atraso_lst.php?{$get_padrao}\");";
         $this->array_botao[] = 'Alocar Servidor';
         $this->array_botao_url_script[] = "go(\"educar_servidor_alocacao_cad.php?{$get_padrao}\");";
         $this->array_botao[] = 'Alterar Nível';
         $this->array_botao_url_script[] = "popless();";
         $obj_servidor_alocacao = new clsPmieducarServidorAlocacao();
         $lista_alocacao = $obj_servidor_alocacao->lista(NULL, $this->ref_cod_instituicao, NULL, NULL, NULL, $this->cod_servidor, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
         if ($lista) {
             $this->array_botao[] = 'Substituir Horário Servidor';
             $this->array_botao_url_script[] = "go(\"educar_servidor_substituicao_cad.php?{$get_padrao}\");";
         }
         $obj_afastamento = new clsPmieducarServidorAfastamento();
         $afastamento = $obj_afastamento->afastado($this->cod_servidor, $this->ref_cod_instituicao);
         if (is_numeric($afastamento) && $afastamento == 0) {
             $this->array_botao[] = 'Afastar Servidor';
             $this->array_botao_url_script[] = "go(\"educar_servidor_afastamento_cad.php?{$get_padrao}\");";
         } elseif (is_numeric($afastamento)) {
             $this->array_botao[] = 'Retornar Servidor';
             $this->array_botao_url_script[] = "go(\"educar_servidor_afastamento_cad.php?{$get_padrao}&sequencial={$afastamento}\");";
         }
     }
     $this->url_cancelar = 'educar_servidor_lst.php';
     $this->largura = '100%';
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_index.php" => "i-Educar - Escola", "" => "Detalhe do servidor"));
     $this->enviaLocalizacao($localizacao->montar());
 }
コード例 #10
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = 'Dispensa Componente Curricular - Detalhe';
     $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet');
     $this->ref_cod_disciplina = $_GET['ref_cod_disciplina'];
     $this->ref_cod_matricula = $_GET['ref_cod_matricula'];
     $this->ref_cod_serie = $_GET['ref_cod_serie'];
     $this->ref_cod_disciplina = $_GET['ref_cod_disciplina'];
     $this->ref_cod_escola = $_GET['ref_cod_escola'];
     $tmp_obj = new clsPmieducarDispensaDisciplina($this->ref_cod_matricula, $this->ref_cod_serie, $this->ref_cod_escola, $this->ref_cod_disciplina);
     $registro = $tmp_obj->detalhe();
     if (!$registro) {
         header('Location: educar_dispensa_disciplina_lst.php?ref_cod_matricula=' . $this->ref_cod_matricula);
         die;
     }
     if (class_exists('clsPmieducarSerie')) {
         $obj_serie = new clsPmieducarSerie($this->ref_cod_serie);
         $det_serie = $obj_serie->detalhe();
         $registro['ref_ref_cod_serie'] = $det_serie['nm_serie'];
     } else {
         $registro['ref_ref_cod_serie'] = 'Erro na geracao';
         echo "<!--\nErro\nClasse nao existente: clsPmieducarSerie\n-->";
     }
     // Dados da matrícula
     $obj_ref_cod_matricula = new clsPmieducarMatricula();
     $detalhe_aluno = array_shift($obj_ref_cod_matricula->lista($this->ref_cod_matricula));
     $obj_aluno = new clsPmieducarAluno();
     $det_aluno = array_shift($obj_aluno->lista($detalhe_aluno['ref_cod_aluno'], NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1));
     $obj_escola = new clsPmieducarEscola($this->ref_cod_escola, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     $det_escola = $obj_escola->detalhe();
     $nm_aluno = $det_aluno['nome_aluno'];
     // Dados do curso
     $obj_ref_cod_curso = new clsPmieducarCurso($detalhe_aluno['ref_cod_curso']);
     $det_ref_cod_curso = $obj_ref_cod_curso->detalhe();
     $registro['ref_cod_curso'] = $det_ref_cod_curso['nm_curso'];
     // Tipo de dispensa
     $obj_ref_cod_tipo_dispensa = new clsPmieducarTipoDispensa($registro['ref_cod_tipo_dispensa']);
     $det_ref_cod_tipo_dispensa = $obj_ref_cod_tipo_dispensa->detalhe();
     $registro['ref_cod_tipo_dispensa'] = $det_ref_cod_tipo_dispensa['nm_tipo'];
     if ($registro['ref_cod_matricula']) {
         $this->addDetalhe(array('Matricula', $registro['ref_cod_matricula']));
     }
     if ($nm_aluno) {
         $this->addDetalhe(array('Aluno', $nm_aluno));
     }
     if ($registro['ref_cod_curso']) {
         $this->addDetalhe(array('Curso', $registro['ref_cod_curso']));
     }
     if ($registro['ref_ref_cod_serie']) {
         $this->addDetalhe(array('Série', $registro['ref_ref_cod_serie']));
     }
     if ($registro['ref_cod_disciplina']) {
         $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper();
         $componente = $componenteMapper->find($registro['ref_cod_disciplina']);
         $this->addDetalhe(array('Componente Curricular', $componente->nome));
     }
     if ($registro['ref_cod_tipo_dispensa']) {
         $this->addDetalhe(array('Tipo Dispensa', $registro['ref_cod_tipo_dispensa']));
     }
     if ($registro['observacao']) {
         $this->addDetalhe(array('Observação', $registro['observacao']));
     }
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(578, $this->pessoa_logada, 7)) {
         $this->url_novo = sprintf('educar_dispensa_disciplina_cad.php?ref_cod_matricula=%d', $this->ref_cod_matricula);
         $this->url_editar = sprintf('educar_dispensa_disciplina_cad.php?ref_cod_matricula=%d&ref_cod_disciplina=%d', $registro['ref_cod_matricula'], $registro['ref_cod_disciplina']);
     }
     $this->url_cancelar = 'educar_dispensa_disciplina_lst.php?ref_cod_matricula=' . $this->ref_cod_matricula;
     $this->largura = '100%';
 }
コード例 #11
0
ファイル: IedFinder.php プロジェクト: secteofilandia/ieducar
 /**
  * Recupera instâncias persistidas de ComponenteCurricular_Model_Componente,
  * retornando-as com a carga horária padrão caso o componente identificado
  * em $componentes possua uma carga horária (atributo cargaHoraria) nula.
  *
  * @param  array  $componentes  (array(stdClass->id, stdClass->cargaHoraria))
  * @param  int    $anoEscolar   O ano escolar/série para recuperar a carga
  *   horária padrão do componente curricular.
  * @param  ComponenteCurricular_Model_ComponenteDataMapper $mapper (Opcional)
  *   O mapper para recuperar a instância persistida com a carga horária padrão.
  * @return array
  */
 protected static function _hydrateComponentes(array $componentes, $anoEscolar, ComponenteCurricular_Model_ComponenteDataMapper $mapper = NULL)
 {
     if (is_null($mapper)) {
         require_once 'ComponenteCurricular/Model/ComponenteDataMapper.php';
         $mapper = new ComponenteCurricular_Model_ComponenteDataMapper();
     }
     $ret = array();
     foreach ($componentes as $componentePlaceholder) {
         $id = $componentePlaceholder->id;
         $carga = $componentePlaceholder->cargaHoraria;
         $componente = $mapper->findComponenteCurricularAnoEscolar($id, $anoEscolar);
         if (!is_null($carga)) {
             $componente->cargaHoraria = $carga;
         }
         $ret[$id] = $componente;
     }
     return $ret;
 }