function Gerar() { $this->campoOculto('cod_servidor', $this->cod_servidor); $this->campoOculto('ref_cod_instituicao', $this->ref_cod_instituicao); $obj_categoria = new clsPmieducarCategoriaNivel(); $lst_categoria = $obj_categoria->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1); $opcoes = array('' => 'Selecione uma categoria'); if ($lst_categoria) { foreach ($lst_categoria as $categoria) { $opcoes[$categoria['cod_categoria_nivel']] = $categoria['nm_categoria_nivel']; } } $this->campoLista('ref_cod_categoria', 'Categoria', $opcoes, $this->ref_cod_categoria); $opcoes = array('' => 'Selecione uma categoria'); if ($this->ref_cod_categoria) { $obj_nivel = new clsPmieducarNivel(); $lst_nivel = $obj_nivel->buscaSequenciaNivel($this->ref_cod_categoria); if ($lst_nivel) { foreach ($lst_nivel as $nivel) { $opcoes[$nivel['cod_nivel']] = $nivel['nm_nivel']; } } } $this->campoLista('ref_cod_nivel', 'Nível', $opcoes, $this->ref_cod_nivel, '', TRUE); $opcoes = array('' => 'Selecione um nível'); if ($this->ref_cod_nivel) { $obj_nivel = new clsPmieducarSubnivel(); $lst_nivel = $obj_nivel->buscaSequenciaSubniveis($this->ref_cod_nivel); if ($lst_nivel) { foreach ($lst_nivel as $subnivel) { $opcoes[$subnivel['cod_subnivel']] = $subnivel['nm_subnivel']; } } } $this->campoLista('ref_cod_subnivel', 'Subnível', $opcoes, $this->ref_cod_subnivel, '', FALSE, '', '', FALSE, TRUE); }
function Excluir() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); $obj_permissoes = new clsPermissoes(); $permite_excluir = $obj_permissoes->permissao_excluir(829, $this->pessoa_logada, 3, "", true); if (!$permite_excluir) { echo "<script>window.parent.fechaExpansivel( '{$_GET['div']}');</script>"; die; } $obj = new clsPmieducarSubnivel($this->cod_nivel, $this->pessoa_logada, $this->pessoa_logada); $excluiu = $obj->excluirTodos(); if ($excluiu) { $this->mensagem .= "Exclusão efetuada com sucesso.<br>"; header("location:educar_categoria_nivel_det.php?cod_categoria_nivel={$this->ref_cod_categoria_nivel}"); die; return true; } $this->mensagem = "Exclusão não realizada.<br>"; echo "<!--\nErro ao excluir clsPmieducarNivel\nvalores obrigatorios\nif( is_numeric( {$this->cod_nivel} ) && is_numeric( {$this->ref_usuario_exc} ) )\n-->"; return false; }
function Novo() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); $obj_permissoes = new clsPermissoes(); $obj_permissoes->permissao_cadastra(829, $this->pessoa_logada, 3, "educar_categoria_nivel_det.php?cod_categoria_nivel={$this->cod_nivel}", true); $obj = new clsPmieducarNivel($this->cod_nivel, $this->ref_cod_categoria_nivel, $this->pessoa_logada, $this->pessoa_logada, $this->ref_cod_nivel_anterior, $this->nm_nivel, $this->salario_base, $this->data_cadastro, $this->data_exclusao, $this->ativo); $obj->desativaTodos(); if ($this->nm_nivel) { $nivel_anterior = null; $niveis = array(); foreach ($this->nm_nivel as $id => $nm_nivel) { $obj_nivel = new clsPmieducarNivel($this->cod_nivel[$id], $this->ref_cod_categoria_nivel, $this->pessoa_logada, $this->pessoa_logada, $nivel_anterior, $nm_nivel, str_replace(',', '.', str_replace('.', '', $this->salario_base[$id])), null, null, 1); if ($obj_nivel->existe()) { $obj_nivel->edita(); $nivel_anterior = $this->cod_nivel[$id]; } else { $nivel_anterior = $obj_nivel->cadastra(); } $niveis[] = $nivel_anterior; } /** * desativa todos os subniveis dos niveis que nao se * encontram ativos */ if ($niveis) { $obj = new clsPmieducarSubnivel(null, $this->pessoa_logada, $this->pessoa_logada, null, $this->ref_cod_nivel); $obj->desativaTodos($niveis); } header("location:educar_categoria_nivel_det.php?cod_categoria_nivel={$this->ref_cod_categoria_nivel}"); die; return true; } $this->mensagem = "Cadastro não realizado.<br>"; echo "<!--\nErro ao cadastrar clsPmieducarNivel\nvalores obrigatorios\nis_numeric( {$this->ref_cod_categoria_nivel} ) && is_numeric( {$this->ref_usuario_cad} ) && is_numeric( {$this->ref_cod_nivel_anterior} ) && is_string( {$this->nm_nivel} )\n-->"; return false; }
* publicada pela Free Software Foundation, tanto a versão 2 da * * Licença como (a seu critério) qualquer versão mais nova. * * * * Este programa é distribuído na expectativa de ser útil, mas SEM * * QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI- * * ZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con- * * sulte a Licença Pública Geral GNU para obter mais detalhes. * * * * Você deve ter recebido uma cópia da Licença Pública Geral GNU * * junto com este programa. Se não, escreva para a Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * * 02111-1307, USA. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ header('Content-type: text/xml'); require_once "include/clsBanco.inc.php"; require_once "include/funcoes.inc.php"; require_once "include/pmieducar/geral.inc.php"; require_once 'Portabilis/Utils/DeprecatedXmlApi.php'; Portabilis_Utils_DeprecatedXmlApi::returnEmptyQueryUnlessUserIsLoggedIn(); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-15\"?>\n<query xmlns=\"sugestoes\">\n"; if (is_numeric($_GET["cod_nivel"])) { $obj_nivel = new clsPmieducarSubnivel(); $lst_nivel = $obj_nivel->buscaSequenciaSubniveis($_GET["cod_nivel"]); if ($lst_nivel) { foreach ($lst_nivel as $subnivel) { echo "\t<subnivel cod_subnivel=\"{$subnivel['cod_subnivel']}\">{$subnivel['nm_subnivel']}</subnivel>\n"; } } } echo "</query>";
/** * 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ício", "educar_index.php" => "i-Educar - Escola", "" => "Detalhe do servidor")); $this->enviaLocalizacao($localizacao->montar()); }