function Gerar()
 {
     $lista = array();
     if ($this->nome_pessoa) {
         $lista[$this->cod_pessoa_fj] = $this->nome_pessoa;
     } else {
         $lista[""] = "Pesquise a pessoa clicando no botão ao lado";
     }
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(0);
     $parametros->adicionaCampoSelect("ref_ref_cod_pessoa_fj", "ref_cod_pessoa_fj", "nome");
     $this->campoListaPesq("ref_ref_cod_pessoa_fj", "Funcionario", $lista, $this->ref_ref_cod_pessoa_fj, "pesquisa_funcionario_lst.php", "", false, "", "", null, null, "", false, $parametros->serializaCampos());
 }
Exemplo n.º 2
0
 function Gerar()
 {
     $this->campoOculto("ref_pessoa", $this->ref_pessoa);
     if (is_numeric($this->ref_pessoa)) {
         $this->campoOculto("confere_senha", $this->confere_senha);
     }
     //--------------------------------------------------------------------
     if ($_POST) {
         foreach ($_POST as $campo => $val) {
             $this->{$campo} = $this->{$campo} ? $this->{$campo} : $val;
         }
     }
     //--------------------------------------------------------------------
     $this->ref_cod_setor_new = 0;
     if (!$this->ref_cod_setor_new && is_numeric($this->ref_pessoa)) {
         $objFuncionario = new clsPortalFuncionario($this->ref_pessoa);
         $detFunc = $objFuncionario->detalhe();
         $this->ref_cod_setor_new = $detFunc["ref_cod_setor_new"];
     }
     if ($this->ref_cod_setor_new) {
         $objSetor = new clsSetor();
         $parentes = $objSetor->getNiveis($this->ref_cod_setor_new);
         for ($i = 0; $i < 5; $i++) {
             if (isset($parentes[$i]) && $parentes[$i]) {
                 $nmvar = "setor_{$i}";
                 $this->{$nmvar} = $parentes[$i];
             }
         }
     }
     //--------------------------------------------------------------------
     if ($_GET["ref_pessoa"]) {
         $obj_funcionario = new clsPessoaFj($this->ref_pessoa);
         $det_funcionario = $obj_funcionario->detalhe();
         $this->nome = $det_funcionario["nome"];
         $this->campoRotulo("nome", "Nome", $this->nome);
     } else {
         $parametros = new clsParametrosPesquisas();
         $parametros->setSubmit(1);
         $parametros->setPessoa("F");
         $parametros->setPessoaNovo('S');
         $parametros->setPessoaEditar('N');
         $parametros->setPessoaTela("frame");
         $parametros->setPessoaCPF('N');
         $parametros->adicionaCampoTexto("nome", "nome");
         $parametros->adicionaCampoTexto("nome_busca", "nome");
         $parametros->adicionaCampoTexto("ref_pessoa", "idpes");
         $this->campoTextoPesquisa("nome_busca", "Nome", $this->nome, 30, 255, true, "pesquisa_pessoa_lst.php", false, false, "", "", $parametros->serializaCampos() . "&busca=S", true);
         $this->campoOculto("nome", $this->nome);
         $this->campoOculto("ref_pessoa", $this->ref_pessoa);
     }
     $this->campoTexto("matricula", "Matr&iacute;cula", $this->matricula, 12, 12, true);
     $this->campoSenha("_senha", "Senha", $this->_senha, true);
     $this->campoEmail("email", "E-mail usuário", $this->email, 50, 50, false, false, false, 'Utilizado para redefinir a senha, caso o usúario esqueça<br />Este campo pode ser gravado em branco, neste caso será solicitado um e-mail ao usuário, após entrar no sistema.');
     $obj_setor = new clsSetor();
     $lst_setor = $obj_setor->lista(null, null, null, null, null, null, null, null, null, 1, 0);
     $opcoes = array("" => "Selecione");
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $setor) {
             $opcoes[$setor["cod_setor"]] = $setor["sgl_setor"];
         }
     }
     $this->campoLista("setor_0", "Setor", $opcoes, $this->setor_0, "oproDocumentoNextLvl( this.value, '1' )", NULL, NULL, NULL, NULL, FALSE);
     $lst_setor = $obj_setor->lista($this->setor_0);
     $opcoes = array("" => "Selecione");
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $setor) {
             $opcoes[$setor["cod_setor"]] = $setor["sgl_setor"];
         }
     } else {
         $opcoes[""] = "---------";
     }
     $this->campoLista("setor_1", "Subsetor 1", $opcoes, $this->setor_1, "oproDocumentoNextLvl(this.value, '2')", false, "", "", $this->setor_0 == "" ? true : false, false);
     $opcoes = array("" => "Selecione");
     $lst_setor = $obj_setor->lista($this->setor_1);
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $setor) {
             $opcoes[$setor["cod_setor"]] = $setor["sgl_setor"];
         }
     } else {
         $opcoes[""] = "---------";
     }
     $this->campoLista("setor_2", "Subsetor 2", $opcoes, $this->setor_2, "oproDocumentoNextLvl(this.value, '3')", false, "", "", $this->setor_1 == "" ? true : false, false);
     $opcoes = array("" => "Selecione");
     $lst_setor = $obj_setor->lista($this->setor_2);
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $setor) {
             $opcoes[$setor["cod_setor"]] = $setor["sgl_setor"];
         }
     } else {
         $opcoes[""] = "---------";
     }
     $this->campoLista("setor_3", "Subsetor 3", $opcoes, $this->setor_3, "oproDocumentoNextLvl(this.value, '4')", false, "", "", $this->setor_2 == "" ? true : false, false);
     $opcoes = array("" => "Selecione");
     $lst_setor = $obj_setor->lista($this->setor_3);
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $setor) {
             $opcoes[$setor["cod_setor"]] = $setor["sgl_setor"];
         }
     } else {
         $opcoes[""] = "---------";
     }
     $this->campoLista("setor_4", "Subsetor 4", $opcoes, $this->setor_4, "oproDocumentoNextLvl(this.value, '5')", false, "", "", $this->setor_3 == "" ? true : false, false);
     $opcoes = array(0 => "Inativo", 1 => "Ativo");
     $this->campoLista("ativo", "Status", $opcoes, $this->ativo);
     $opcoes = array("" => "Selecione", 5 => "Comissionado", 4 => "Contratado", 3 => "Efetivo", 6 => "Estagi&aacute;rio");
     $this->campoLista("ref_cod_funcionario_vinculo", "V&iacute;nculo", $opcoes, $this->ref_cod_funcionario_vinculo);
     $opcoes = array("" => "Selecione", 5 => "5", 6 => "6", 7 => "7", 10 => "10", 14 => "14", 20 => "20", 21 => "21", 28 => "28", 30 => "30", 35 => "35", 60 => "60", 90 => "90", 120 => "120", 150 => "150", 180 => "180", 210 => "210", 240 => "240", 270 => "270", 300 => "300", 365 => "365");
     $this->campoLista("tempo_expira_conta", "Dias p/ expirar a conta", $opcoes, $this->tempo_expira_conta);
     $tempoExpiraSenha = $GLOBALS['coreExt']['Config']->app->user_accounts->default_password_expiration_period;
     if (is_numeric($tempoExpiraSenha)) {
         $this->campoOculto("tempo_expira_senha", $tempoExpiraSenha);
     } else {
         $opcoes = array('' => 'Selecione', 5 => '5', 30 => '30', 60 => '60', 90 => '90', 120 => '120', 180 => '180');
         $this->campoLista("tempo_expira_senha", "Dias p/ expirar a senha", $opcoes, $this->tempo_expira_senha);
     }
     $this->campoTexto("ramal", "Ramal", $this->ramal, 11, 30);
     $opcoes = array(null => "Não", 'S' => "Sim");
     $this->campoLista("super", "Super usu&aacute;rio", $opcoes, $this->super, '', false, '', '', false, false);
     $opcoes = array(null => "Não", 1 => "Sim");
     $this->campoLista("proibido", "Banido", $opcoes, $this->proibido, '', false, '', '', false, false);
     $opcoes = array(null => "Não", 1 => "Sim");
     $this->campoLista("matricula_permanente", "Matr&iacute;cula permanente", $opcoes, $this->matricula_permanente, '', false, '', '', false, false);
     //-----------------------------------------------------------------------------------------------
     $this->campoRotulo("rotulo_permissoes", "<b><i>Permiss&otilde;es</i></b>", "");
     $obj_menu = new clsPortalMenuMenu();
     $obj_menu->setOrderby("nm_menu ASC");
     $lst_menu = $obj_menu->lista();
     //busca todos os submenus liberado para o funcionario
     if (is_numeric($this->ref_pessoa)) {
         $obj_menu_funcionario = new clsPortalMenuFuncionario($this->ref_pessoa);
         $lst_menu_funcionario = $obj_menu_funcionario->lista(null, null, $this->ref_pessoa);
         if (is_array($lst_menu_funcionario) && count($lst_menu_funcionario)) {
             foreach ($lst_menu_funcionario as $id_submenu) {
                 $array_submenu[] = $id_submenu["ref_cod_menu_submenu"];
             }
         }
     }
     if (is_array($lst_menu) && count($lst_menu)) {
         foreach ($lst_menu as $key => $menu) {
             $array_valores = array();
             if ($menu["cod_menu_menu"] != 1) {
                 /*					if( $menu['nm_menu'] == "i-Frotas")
                 					{
                 						echo $menu["cod_menu_menu"];
                 					}*/
                 $obj_submenu = new clsPortalMenuSubmenu();
                 $obj_submenu->setOrderby("nm_submenu ASC");
                 $lst_submenu = $obj_submenu->lista($menu["cod_menu_menu"], 2);
                 $opcoes = array("" => "Selecione");
                 if (is_array($lst_submenu) && count($lst_submenu)) {
                     foreach ($lst_submenu as $submenu) {
                         $opcoes[$submenu["cod_menu_submenu"]] = $submenu["nm_submenu"];
                     }
                 }
                 if (is_numeric($this->ref_pessoa)) {
                     if (is_array($array_submenu) && count($array_submenu)) {
                         //faz a interseccao dos submenus do funcionario e os submenus do menu atual (do foreach)
                         $array_menu_submenu = array_intersect(array_flip($opcoes), $array_submenu);
                     }
                     $contador = 0;
                     if (is_array($array_menu_submenu) && count($array_menu_submenu)) {
                         //monta a matriz que conterao os valores da tabela (do BD)
                         foreach ($array_menu_submenu as $id_submenu) {
                             $obj_menu_funcionario = new clsPortalMenuFuncionario($this->ref_pessoa, null, null, $id_submenu);
                             $det_menu_funcionario = $obj_menu_funcionario->detalhe();
                             $array_valores[$contador][] = $det_menu_funcionario["ref_cod_menu_submenu"];
                             $array_valores[$contador][] = $det_menu_funcionario["cadastra"];
                             $array_valores[$contador++][] = $det_menu_funcionario["exclui"];
                         }
                     }
                 }
                 $this->campoTabelaInicio(str_replace(" ", "_", limpa_acentos(strtolower($menu["nm_menu"]))), $menu["nm_menu"], array("Submenu", "Cadastrar", "Excluir"), $array_valores, "500");
                 $this->campoLista(str_replace(" ", "_", limpa_acentos(strtolower($menu["nm_menu"]))) . "_", "", $opcoes, "", "", false, "", "", false, false);
                 $this->campoCheck("cad_" . str_replace(" ", "_", limpa_acentos(strtolower($menu["nm_menu"]))), "", "");
                 $this->campoCheck("exc_" . str_replace(" ", "_", limpa_acentos(strtolower($menu["nm_menu"]))), "", "");
                 $this->campoTabelaFim();
             }
         }
     }
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = 'Servidor - Listagem';
     // passa todos os valores obtidos no GET para atributos do objeto
     foreach ($_GET as $var => $val) {
         $this->{$var} = $val === '' ? NULL : $val;
     }
     $this->addCabecalhos(array('Nome do Servidor', 'Matrícula', 'Instituição'));
     $get_escola = TRUE;
     $obrigatorio = TRUE;
     $exibe_nm_escola = TRUE;
     include 'include/pmieducar/educar_campo_lista.php';
     $opcoes = array('' => 'Pesquise o funcionario clicando na lupa ao lado');
     if ($this->cod_servidor) {
         $objTemp = new clsFuncionario($this->cod_servidor);
         $detalhe = $objTemp->detalhe();
         $detalhe = $detalhe['idpes']->detalhe();
         $opcoes[$detalhe['idpes']] = $detalhe['nome'];
     }
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(0);
     $parametros->adicionaCampoSelect('cod_servidor', 'ref_cod_pessoa_fj', 'nome');
     $this->campoListaPesq('cod_servidor', 'Servidor', $opcoes, $this->cod_servidor, 'pesquisa_funcionario_lst.php', '', FALSE, '', '', NULL, NULL, '', FALSE, $parametros->serializaCampos() . '&com_matricula=false', TRUE);
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET['pagina_' . $this->nome] ? $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0;
     $obj_servidor = new clsPmieducarServidor();
     $obj_servidor->setOrderby('carga_horaria ASC');
     $obj_servidor->setLimite($this->limite, $this->offset);
     $lista = $obj_servidor->lista($this->cod_servidor, $this->ref_cod_deficiencia, $this->ref_idesco, $this->carga_horaria, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao, NULL, NULL, NULL, NULL, NULL, NULL, TRUE, NULL, NULL, NULL, NULL, !isset($_GET['busca']) ? $this->ref_cod_escola : NULL, NULL, NULL, NULL, NULL, !isset($_GET['busca']) ? 1 : NULL);
     $total = $obj_servidor->_total;
     // UrlHelper
     $url = CoreExt_View_Helper_UrlHelper::getInstance();
     // Monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             // Pega detalhes de foreign_keys
             if (class_exists('clsPmieducarInstituicao')) {
                 $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'];
             } else {
                 $registro['ref_cod_instituicao'] = 'Erro na geração';
             }
             if (class_exists('clsFuncionario')) {
                 $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'];
             } else {
                 $registro['cod_servidor'] = 'Erro na geracao';
             }
             $path = 'educar_servidor_det.php';
             $options = array('query' => array('cod_servidor' => $registro['cod_servidor'], 'ref_cod_instituicao' => $det_ref_cod_instituicao['cod_instituicao']));
             $this->addLinhas(array($url->l($registro['nome'], $path, $options), $url->l($registro['matricula'], $path, $options), $url->l($registro['ref_cod_instituicao'], $path, $options)));
         }
     }
     $this->addPaginador2('educar_servidor_lst.php', $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7)) {
         $this->acao = 'go("educar_servidor_cad.php")';
         $this->nome_acao = 'Novo';
     }
     $this->largura = '100%';
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_index.php" => "i-Educar - Escola", "" => "Listagem de servidores"));
     $this->enviaLocalizacao($localizacao->montar());
 }
Exemplo n.º 4
0
 function Gerar()
 {
     // Foreign keys
     $obrigatorio = TRUE;
     $get_instituicao = TRUE;
     include 'include/pmieducar/educar_campo_lista.php';
     $opcoes = array('' => 'Pesquise o funcionario clicando na lupa ao lado');
     if ($this->cod_servidor) {
         $objTemp = new clsFuncionario($this->cod_servidor);
         $detalhe = $objTemp->detalhe();
         $detalhe = $detalhe['idpes']->detalhe();
         $this->campoRotulo('nm_servidor', 'Servidor', $detalhe['nome']);
         $this->campoOculto('cod_servidor', $this->cod_servidor);
         $this->campoOculto('ref_cod_instituicao_original', $this->ref_cod_instituicao_original);
     } else {
         $parametros = new clsParametrosPesquisas();
         $parametros->setSubmit(0);
         $parametros->adicionaCampoSelect('cod_servidor', 'ref_cod_pessoa_fj', 'nome');
         $this->campoListaPesq('cod_servidor', 'Servidor', $opcoes, $this->cod_servidor, 'pesquisa_funcionario_lst.php', '', FALSE, '', '', NULL, NULL, '', FALSE, $parametros->serializaCampos(), TRUE);
     }
     $opcoes = array('' => 'Selecione');
     if (class_exists('clsCadastroDeficiencia')) {
         $objTemp = new clsCadastroDeficiencia();
         $lista = $objTemp->lista();
         if (is_array($lista) && count($lista)) {
             foreach ($lista as $registro) {
                 $opcoes[$registro['cod_deficiencia']] = $registro['nm_deficiencia'];
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsCadastroDeficiencia nao encontrada\n-->";
         $opcoes = array('' => 'Erro na geracao');
     }
     $script = "javascript:showExpansivelIframe(350, 100, 'educar_deficiencia_cad_pop.php');";
     $script = "<img id='img_deficiencia' style='display: \\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">";
     $this->campoLista('ref_cod_deficiencia', 'Deficiência', $opcoes, $this->ref_cod_deficiencia, '', FALSE, '', $script, FALSE, FALSE);
     $opcoes = array('' => 'Selecione');
     if (class_exists('clsCadastroEscolaridade')) {
         $objTemp = new clsCadastroEscolaridade();
         $lista = $objTemp->lista();
         if (is_array($lista) && count($lista)) {
             foreach ($lista as $registro) {
                 $opcoes[$registro['idesco']] = $registro['descricao'];
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsCadastroEscolaridade nao encontrada\n-->";
         $opcoes = array('' => 'Erro na geracao');
     }
     $script = "javascript:showExpansivelIframe(350, 100, 'educar_escolaridade_cad_pop.php');";
     $script = "<img id='img_deficiencia' style='display: \\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">";
     $this->campoLista('ref_idesco', 'Escolaridade', $opcoes, $this->ref_idesco, '', FALSE, '', $script, FALSE, FALSE);
     $opcoes = array('' => 'Selecione');
     if (class_exists('clsPmieducarFuncao')) {
         if (is_numeric($this->ref_cod_instituicao)) {
             $objTemp = new clsPmieducarFuncao();
             $objTemp->setOrderby("nm_funcao ASC");
             $lista = $objTemp->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao);
             if (is_array($lista) && count($lista)) {
                 foreach ($lista as $registro) {
                     $opcoes[$registro['cod_funcao'] . '-' . $registro['professor']] = $registro['nm_funcao'];
                 }
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsPmieducarFuncao nao encontrada\n-->";
         $opcoes = array('' => 'Erro na geracao');
     }
     $this->campoTabelaInicio('funcao', 'Funções Servidor', array("Função", "Componentes Curriculares", "Cursos"), $this->ref_cod_funcao);
     $funcao = 'popless()';
     $this->campoLista('ref_cod_funcao', 'Função', $opcoes, $this->ref_cod_funcao, 'funcaoChange(this)', '', '', '');
     $this->campoRotulo('disciplina', 'Componentes Curriculares', "<img src='imagens/lupa_antiga.png' border='0' style='cursor:pointer;' alt='Buscar Componente Curricular' title='Buscar Componente Curricular' onclick=\"{$funcao}\">");
     $funcao = 'popCurso()';
     $this->campoRotulo('curso', 'Curso', "<img src='imagens/lupa_antiga.png' border='0' style='cursor:pointer;' alt='Buscar Cursos' title='Buscar Cursos' onclick=\"{$funcao}\">");
     $this->campoTabelaFim();
     if (strtoupper($this->tipoacao) == 'EDITAR') {
         $this->campoTextoInv('total_horas_alocadas_', 'Total de Horas Alocadadas', $this->total_horas_alocadas, 9, 20);
         $hora = explode(':', $this->total_horas_alocadas);
         $this->total_horas_alocadas = $hora[0] + $hora[1] / 60;
         $this->campoOculto('total_horas_alocadas', $this->total_horas_alocadas);
         $this->acao_enviar = 'acao2()';
     }
     if ($this->carga_horaria) {
         $horas = (int) $this->carga_horaria;
         $minutos = round(($this->carga_horaria - (int) $this->carga_horaria) * 60);
         $hora_formatada = sprintf('%02d:%02d', $horas, $minutos);
     }
     $this->campoHora('carga_horaria', 'Carga Horária', $hora_formatada, TRUE, 'Número de horas deve ser maior que horas alocadas');
     // Dados do docente no Inep/Educacenso.
     if ($this->docente) {
         $docenteMapper = new Educacenso_Model_DocenteDataMapper();
         $docenteInep = NULL;
         try {
             $docenteInep = $docenteMapper->find(array('docente' => $this->cod_servidor));
         } catch (Exception $e) {
         }
         if (isset($docenteInep)) {
             $this->campoRotulo('_inep_cod_docente', 'Código do docente no Educacenso/Inep', $docenteInep->docenteInep);
             if (isset($docenteInep->nomeInep)) {
                 $this->campoRotulo('_inep_nome_docente', 'Nome do docente no Educacenso/Inep', $docenteInep->nomeInep);
             }
         }
     }
 }
Exemplo n.º 5
0
 function Gerar()
 {
     $obj_permissao = new clsPermissoes();
     $obj_permissao->permissao_cadastra(555, $this->pessoa_logada, 7, "educar_usuario_lst.php", true);
     // primary keys
     $this->campoOculto("cod_usuario", $this->cod_usuario);
     // foreign keys
     $opcoes = array("" => "Pesquise o funcion&aacute;rio clicando na lupa ao lado");
     if ($this->cod_usuario) {
         $objTemp = new clsFuncionario($this->cod_usuario);
         $detalhe = $objTemp->detalhe();
         $detalhe = $detalhe["idpes"]->detalhe();
         $opcoes["{$detalhe["idpes"]}"] = $detalhe["nome"];
     }
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(0);
     $parametros->adicionaCampoSelect("cod_usuario_", "ref_cod_pessoa_fj", "nome");
     $this->campoListaPesq("cod_usuario_", "Usu&aacute;rio", $opcoes, $this->cod_usuario, "pesquisa_funcionario_lst.php", "", false, "", "", null, null, "", false, $parametros->serializaCampos());
     $opcoes = array("" => "Selecione");
     if (class_exists("clsPmieducarTipoUsuario")) {
         $objTemp = new clsPmieducarTipoUsuario();
         $objTemp->setOrderby('nm_tipo ASC');
         $obj_libera_menu = new clsMenuFuncionario($this->pessoa_logada, false, false, 0);
         $obj_super_usuario = $obj_libera_menu->detalhe();
         // verifica se pessoa logada é super-usuario
         if ($obj_super_usuario) {
             $lista = $objTemp->lista(null, null, null, null, null, null, null, null, 1);
         } else {
             $lista = $objTemp->lista(null, null, null, null, null, null, null, null, 1, $obj_permissao->nivel_acesso($this->pessoa_logada));
         }
         if (is_array($lista) && count($lista)) {
             foreach ($lista as $registro) {
                 $opcoes["{$registro['cod_tipo_usuario']}"] = "{$registro['nm_tipo']}";
                 $opcoes_["{$registro['cod_tipo_usuario']}"] = "{$registro['nivel']}";
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsPmieducarTipoUsuario n&atilde;o encontrada\n-->";
         $opcoes = array("" => "Erro na geração");
     }
     $tamanho = sizeof($opcoes_);
     echo "<script>\nvar cod_tipo_usuario = new Array({$tamanho});\n";
     foreach ($opcoes_ as $key => $valor) {
         echo "cod_tipo_usuario[{$key}] = {$valor};\n";
     }
     echo "</script>";
     $this->campoLista("ref_cod_tipo_usuario", "Tipo Usu&aacute;rio", $opcoes, $this->ref_cod_tipo_usuario, "", null, null, null, null, true);
     $nivel = $obj_permissao->nivel_acesso($this->cod_usuario);
     $this->campoOculto("nivel_usuario_", $nivel);
     $get_biblioteca = false;
     $get_escola = true;
     $cad_usuario = true;
     include "include/pmieducar/educar_campo_lista.php";
     $this->acao_enviar = "valida()";
 }
Exemplo n.º 6
0
 function Gerar()
 {
     $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet', FALSE);
     if (!$this->busca_pessoa) {
         $this->campoOculto('cod_pessoa_fj', '');
         $parametros = new clsParametrosPesquisas();
         $parametros->setSubmit(1);
         $parametros->adicionaCampoTexto('busca_pessoa', 'id_federal');
         $parametros->adicionaCampoTexto('cod_pessoa_fj', 'idpes');
         $parametros->setPessoa('F');
         $parametros->setPessoaCampo('cod_pessoa_fj');
         $parametros->setPessoaNovo('S');
         $parametros->setPessoaTela('window');
         $html = sprintf('<img id="lupa" src="imagens/lupa.png" border="0" ' . "onclick=\"showExpansivel(500, 500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'pesquisa_pessoa_lst.php?campos=%s\\'></iframe>');\"" . '>', $parametros->serializaCampos());
         $this->campoCpf('busca_pessoa', 'CPF', $this->ref_cod_pessoa_fj, TRUE, $html, FALSE, TRUE);
     } else {
         $this->campoOculto('busca_pessoa', $this->busca_pessoa);
         $this->url_cancelar = $this->retorno == 'Editar' ? 'atendidos_det.php?cod_pessoa=' . $this->cod_pessoa_fj : 'atendidos_lst.php';
         $this->campoOculto('cod_pessoa_fj', $this->cod_pessoa_fj);
         $this->campoTexto('nm_pessoa', 'Nome', $this->nm_pessoa, '50', '255', TRUE);
         if ($this->id_federal) {
             $this->campoRotulo('id_federal', 'CPF', int2CPF($this->id_federal));
         } else {
             $this->campoCpf('id_federal', 'CPF', '', FALSE);
         }
         if ($this->data_nasc) {
             $this->data_nasc = dataFromPgToBr($this->data_nasc);
         }
         $this->campoData('data_nasc', 'Data de Nascimento', $this->data_nasc);
         $lista_sexos = array();
         $lista_sexos[''] = 'Escolha uma opção...';
         $lista_sexos['M'] = 'Masculino';
         $lista_sexos['F'] = 'Feminino';
         $this->campoLista('sexo', 'Sexo', $lista_sexos, $this->sexo);
         // Cor/raça.
         $opcoes_raca = array('' => 'Selecione');
         $obj_raca = new clsCadastroRaca();
         $lst_raca = $obj_raca->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, TRUE);
         if ($lst_raca) {
             foreach ($lst_raca as $raca) {
                 $opcoes_raca[$raca['cod_raca']] = $raca['nm_raca'];
             }
         }
         $this->campoLista('cor_raca', 'Raça', $opcoes_raca, $this->cod_raca, '', FALSE, '', '', '', FALSE);
         // Detalhes do Endereço
         $objTipoLog = new clsTipoLogradouro();
         $listaTipoLog = $objTipoLog->lista();
         $listaTLog = array('0' => 'Selecione');
         if ($listaTipoLog) {
             foreach ($listaTipoLog as $tipoLog) {
                 $listaTLog[$tipoLog['idtlog']] = $tipoLog['descricao'];
             }
         }
         $objUf = new clsUf();
         $listauf = $objUf->lista();
         $listaEstado = array('0' => 'Selecione');
         if ($listauf) {
             foreach ($listauf as $uf) {
                 $listaEstado[$uf['sigla_uf']] = $uf['sigla_uf'];
             }
         }
         $this->campoOculto('idbai', $this->idbai);
         $this->campoOculto('idlog', $this->idlog);
         $this->campoOculto('cep', $this->cep);
         $this->campoOculto('ref_sigla_uf', $this->sigla_uf);
         $this->campoOculto('ref_idtlog', $this->idtlog);
         $this->campoOculto('id_cidade', $this->cidade);
         $zona = App_Model_ZonaLocalizacao::getInstance();
         if ($this->idlog && $this->idbai && $this->cep && $this->cod_pessoa_fj) {
             $this->campoCep('cep_', 'CEP', $this->cep, true, '-', "&nbsp;<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'educar_pesquisa_cep_log_bairro.php?campo1=bairro&campo2=idbai&campo3=cep&campo4=logradouro&campo5=idlog&campo6=ref_sigla_uf&campo7=cidade&campo8=ref_idtlog&campo9=isEnderecoExterno&campo10=cep_&campo11=sigla_uf&campo12=idtlog&campo13=id_cidade\\'></iframe>');\">", TRUE);
             $this->campoLista('idtlog', 'Tipo Logradouro', $listaTLog, $this->idtlog, FALSE, FALSE, FALSE, FALSE, TRUE);
             $this->campoTextoInv('logradouro', 'Logradouro', $this->logradouro, '50', '255', FALSE);
             $this->campoTextoInv('cidade', 'Cidade', $this->cidade, '50', '255', FALSE);
             $this->campoTextoInv('bairro', 'Bairro', $this->bairro, '50', '255', FALSE);
             $this->campoTexto('complemento', 'Complemento', $this->complemento, '50', '255', FALSE);
             $this->campoTexto('numero', 'Número', $this->numero, '10', '10');
             $this->campoTexto('letra', 'Letra', $this->letra, '1', '1', FALSE);
             $this->campoTexto('apartamento', 'Número Apartamento', $this->apartamento, '6', '6', FALSE);
             $this->campoTexto('bloco', 'Bloco', $this->bloco, '20', '20', FALSE);
             $this->campoTexto('andar', 'Andar', $this->andar, '2', '2', FALSE);
             $this->campoLista('sigla_uf', 'Estado', $listaEstado, $this->sigla_uf, FALSE, FALSE, FALSE, FALSE, TRUE);
         } elseif ($this->cod_pessoa_fj && $this->cep) {
             $this->campoCep('cep_', 'CEP', $this->cep, true, '-', "&nbsp;<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'educar_pesquisa_cep_log_bairro.php?campo1=bairro&campo2=idbai&campo3=cep&campo4=logradouro&campo5=idlog&campo6=ref_sigla_uf&campo7=cidade&campo8=ref_idtlog&campo9=isEnderecoExterno&campo10=cep_&campo11=sigla_uf&campo12=idtlog&campo13=id_cidade\\'></iframe>');\">", $disabled);
             $this->campoLista('idtlog', 'Tipo Logradouro', $listaTLog, $this->idtlog);
             $this->campoTexto('logradouro', 'Logradouro', $this->logradouro, '50', '255', FALSE);
             $this->campoTexto('cidade', 'Cidade', $this->cidade, '50', '255', FALSE);
             $this->campoTexto('bairro', 'Bairro', $this->bairro, '50', '255', FALSE);
             $this->campoTexto('complemento', 'Complemento', $this->complemento, '50', '255', FALSE);
             $this->campoTexto('numero', 'Número', $this->numero, '10', '10');
             $this->campoTexto('letra', 'Letra', $this->letra, '1', '1', FALSE);
             $this->campoTexto('apartamento', 'Número Apartamento', $this->apartamento, '6', '6', FALSE);
             $this->campoTexto('bloco', 'Bloco', $this->bloco, '20', '20', FALSE);
             $this->campoTexto('andar', 'Andar', $this->andar, '2', '2', FALSE);
             $this->campoLista('sigla_uf', 'Estado', $listaEstado, $this->sigla_uf);
         } else {
             $this->campoCep('cep_', 'CEP', $this->cep, TRUE, '-', "&nbsp;<img id='lupa' src=\"imagens/lupa.png\" border=\"0\"\n          onclick=\"showExpansivel(500, 500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'educar_pesquisa_cep_log_bairro.php?campo1=bairro&campo2=idbai&campo3=cep&campo4=logradouro&campo5=idlog&campo6=ref_sigla_uf&campo7=cidade&campo8=ref_idtlog&campo9=isEnderecoExterno&campo10=cep_&campo11=sigla_uf&campo12=idtlog&campo13=id_cidade&campo14=zona_localizacao\\'></iframe>');\">", false);
             $this->campoLista('idtlog', 'Tipo Logradouro', $listaTLog, $this->idtlog, FALSE, FALSE, FALSE, FALSE, FALSE);
             $this->campoTexto('logradouro', 'Logradouro', $this->logradouro, '50', '255');
             $this->campoTexto('cidade', 'Cidade', $this->cidade, '50', '255');
             $this->campoTexto('bairro', 'Bairro', $this->bairro, '50', '255');
             $this->campoTexto('complemento', 'Complemento', $this->complemento, '50', '255', FALSE);
             $this->campoTexto('numero', 'Número', $this->numero, '10', '10');
             $this->campoTexto('letra', 'Letra', $this->letra, '1', '1', FALSE);
             $this->campoTexto('apartamento', 'Número Apartamento', $this->apartamento, '6', '6', FALSE);
             $this->campoTexto('bloco', 'Bloco', $this->bloco, '20', '20', FALSE);
             $this->campoTexto('andar', 'Andar', $this->andar, '2', '2', FALSE);
             $this->campoLista('sigla_uf', 'Estado', $listaEstado, $this->sigla_uf, FALSE, FALSE, FALSE, FALSE, FALSE);
         }
         $this->campoLista('zona_localizacao', 'Zona Localização', $zona->getEnums(), $this->zona_localizacao, FALSE, FALSE, FALSE, FALSE, $this->idbai ? TRUE : FALSE);
         $this->campoTexto('ddd_telefone_1', 'DDD Telefone 1', $this->ddd_telefone_1, '3', '2', FALSE);
         $this->campoTexto('telefone_1', 'Telefone 1', $this->telefone_1, '10', '15', FALSE);
         $this->campoTexto('ddd_telefone_2', 'DDD Telefone 2', $this->ddd_telefone_2, '3', '2', FALSE);
         $this->campoTexto('telefone_2', 'Telefone 2', $this->telefone_2, '10', '15', FALSE);
         $this->campoTexto('ddd_telefone_mov', 'DDD Celular', $this->ddd_telefone_mov, '3', '2', FALSE);
         $this->campoTexto('telefone_mov', 'Celular', $this->telefone_mov, '10', '15', FALSE);
         $this->campoTexto('ddd_telefone_fax', 'DDD Fax', $this->ddd_telefone_fax, '3', '2', FALSE);
         $this->campoTexto('telefone_fax', 'Fax', $this->telefone_fax, '10', '15', FALSE);
         $this->campoTexto('http', 'Site', $this->http, '50', '255', FALSE);
         $this->campoTexto('email', 'E-mail', $this->email, '50', '255', FALSE);
         if ($this->cod_pessoa_fj) {
             $this->campoRotulo('documentos', '<b><i>Documentos</i></b>', "<a href='#' onclick=\"openPage('adicionar_documentos_cad.php?id_pessoa={$this->cod_pessoa_fj}', '400', '400', 'yes', '10', '10'); \"><img src='imagens/nvp_bot_ad_doc.png' border='0'></a>");
             $this->campoCheck('alterado', 'Alterado', $this->alterado);
         }
     }
 }
Exemplo n.º 7
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Cliente - Listagem";
     foreach ($_GET as $var => $val) {
         // passa todos os valores obtidos no GET para atributos do objeto
         $this->{$var} = $val === "" ? null : $val;
     }
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $this->addCabecalhos(array("Cliente", "Tipo", "Status"));
     $opcoes = array("" => "Pesquise a pessoa clicando na lupa ao lado");
     if ($this->ref_idpes) {
         $objTemp = new clsPessoaFisica($this->ref_idpes);
         $detalhe = $objTemp->detalhe();
         $opcoes["{$detalhe["idpes"]}"] = $detalhe["nome"];
     }
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(0);
     $parametros->adicionaCampoSelect("ref_idpes", "idpes", "nome");
     $parametros->setCodSistema(1);
     $parametros->setPessoa('F');
     $parametros->setPessoaEditar('N');
     $parametros->setPessoaNovo('N');
     $this->campoListaPesq("ref_idpes", "Cliente", $opcoes, $this->ref_idpes, "pesquisa_pessoa_lst.php", "", false, "", "", null, null, "", false, $parametros->serializaCampos());
     $this->campoLista("status", "Status", array('' => "Selecione", 'R' => "Regular", 'S' => "Suspenso"), $this->status, "", false, "", "", false, false);
     $instituicao_obrigatorio = true;
     $escola_obrigatorio = false;
     $biblioteca_obrigatorio = true;
     $cliente_tipo_obrigatorio = true;
     $get_instituicao = true;
     $get_escola = true;
     $get_biblioteca = true;
     $get_cliente_tipo = true;
     include "include/pmieducar/educar_campo_lista.php";
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->limite - $this->limite : 0;
     $obj_cliente = new clsPmieducarCliente();
     $obj_cliente->setOrderby("nome ASC");
     $obj_cliente->setLimite($this->limite, $this->offset);
     if ($this->status != 'S') {
         $this->status = null;
     }
     $cod_biblioteca = $this->ref_cod_biblioteca;
     if (!is_numeric($this->ref_cod_biblioteca)) {
         $db = new clsBanco();
         $db->Consulta("SELECT ref_cod_biblioteca FROM pmieducar.biblioteca_usuario WHERE ref_cod_usuario = '{$this->pessoa_logada}' ");
         if ($db->numLinhas()) {
             $cod_biblioteca = array();
             while ($db->ProximoRegistro()) {
                 list($ref_cod) = $db->Tupla();
                 $cod_biblioteca[] = $ref_cod;
             }
         }
     }
     $lista = $obj_cliente->listaCompleta(null, null, null, $this->ref_idpes, null, null, null, null, null, null, 1, null, $this->status, $this->ref_cod_cliente_tipo, null, $cod_biblioteca);
     $total = $obj_cliente->_total;
     $obj_banco = new clsBanco();
     // monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             if (class_exists("clsBanco")) {
                 $sql_unico = "SELECT 1\n\t\t\t\t\t\t\t\t\tFROM pmieducar.cliente_suspensao\n\t\t\t\t\t\t\t\t   WHERE ref_cod_cliente = {$registro["cod_cliente"]}\n\t\t\t\t\t\t\t\t\t AND data_liberacao IS NULL\n\t\t\t\t\t\t\t\t\t AND EXTRACT ( DAY FROM ( NOW() - data_suspensao ) ) < dias";
                 $suspenso = $obj_banco->CampoUnico($sql_unico);
                 if (is_numeric($suspenso)) {
                     $registro["status"] = "Suspenso";
                 } else {
                     $registro["status"] = "Regular";
                 }
             } else {
                 $registro["ref_idpes"] = "Erro na geracao";
                 echo "<!--\nErro\nClasse nao existente: clsBanco\n-->";
             }
             //				echo "<pre>"; print_r($registro); die();
             $this->addLinhas(array("<a href=\"educar_cliente_det.php?cod_cliente={$registro["cod_cliente"]}&ref_cod_biblioteca={$registro["cod_biblioteca"]}\">{$registro["nome"]}</a>", "<a href=\"educar_cliente_det.php?cod_cliente={$registro["cod_cliente"]}&ref_cod_biblioteca={$registro["cod_biblioteca"]}\">{$registro["nm_tipo"]}</a>", "<a href=\"educar_cliente_det.php?cod_cliente={$registro["cod_cliente"]}&ref_cod_biblioteca={$registro["cod_biblioteca"]}\">{$registro["status"]}</a>"));
         }
     }
     $this->addPaginador2("educar_cliente_lst.php", $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(603, $this->pessoa_logada, 11)) {
         $this->acao = "go(\"educar_cliente_cad.php\")";
         $this->nome_acao = "Novo";
     }
     $this->largura = "100%";
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "i-Educar", "educar_biblooteca_index.php" => "Biblioteca", "" => "Lista de Clientes"));
     $this->enviaLocalizacao($localizacao->montar());
 }
Exemplo n.º 8
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $db = new clsBanco();
     $objPessoa = new clsPessoaFisica();
     $this->campoOculto("pessoaFj", $this->pessoaFj);
     $this->campoOculto("cod_agenda", $this->cod_agenda);
     $this->campoTexto("nm_agenda", "Nome da Agenda", $this->nm_agenda, 50, 50);
     $this->campoLista("publica", "Pública", array("N&atilde;o", "Sim"), $this->publica);
     $this->campoLista("envia_alerta", "Envia Alerta", array("N&atilde;o", "Sim"), $this->envia_alerta);
     $i = 0;
     if ($this->ref_ref_cod_pessoa_own) {
         list($nome) = $objPessoa->queryRapida($this->ref_ref_cod_pessoa_own, "nome");
         $this->campoTextoInv("editor{$i}", "Editores", $nome, 50, 255);
     }
     $lista = array("Pesquise a pessoa clicando no botao ao lado");
     if ($this->cod_agenda) {
         $db->Consulta("SELECT ref_ref_cod_pessoa_fj FROM agenda_responsavel WHERE ref_cod_agenda = '{$this->cod_agenda}'");
         while ($db->ProximoRegistro()) {
             $i++;
             list($idpes) = $db->Tupla();
             list($nome) = $objPessoa->queryRapida($idpes, "nome");
             $this->campoTextoInv("editor{$i}", "Editores", $nome, 50, 255, false, false, false, false, "<a href=\"agenda_admin_cad.php?cod_agenda={$this->cod_agenda}&edit_rem={$idpes}\">remover</a>");
         }
         //$this->campoListaPesq( "novo_editor", "Novo Editor", $lista, 0, "pesquisa_funcionario.php", false, false, false, "&nbsp; &nbsp; &nbsp; <a href=\"javascript:var idpes = document.getElementById('novo_editor').value; if( idpes != 0 ) { document.location.href='agenda_admin_cad.php?cod_agenda={$this->cod_agenda}&edit_add=' + idpes; } else { alert( 'Selecione a pessoa clicando na imagem da Lupa' ); }\">Adicionar</a>" );
         $parametros = new clsParametrosPesquisas();
         $parametros->setSubmit(1);
         $parametros->adicionaCampoSelect("novo_editor", "ref_cod_pessoa_fj", "nome");
         $this->campoListaPesq("novo_editor", "Novo Editor", $lista, 0, "pesquisa_funcionario_lst.php", "", false, "", "", null, null, "", false, $parametros->serializaCampos());
         //$this->campoLista( "edit_add", "Editores", $lista, "", "", false, "", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\'miolo\' id=\'miolo\' frameborder=\'0\' height=\'100%\' width=\'500\' marginheight=\'0\' marginwidth=\'0\' src=\'pesquisa_funcionario_lst.php?campos=$serializedcampos\'></iframe>' );\">", false, true );
         unset($campos);
     } else {
         //$this->campoListaPesq( "dono", "Dono da agenda", $lista, 0, "pesquisa_funcionario.php" );
         $parametros = new clsParametrosPesquisas();
         $parametros->setSubmit(0);
         $parametros->adicionaCampoSelect("dono", "ref_cod_pessoa_fj", "nome");
         $this->campoListaPesq("dono", "Dono da agenda", $lista, 0, "pesquisa_funcionario_lst.php", "", false, "", "", null, null, "", false, $parametros->serializaCampos());
         //$this->campoLista( "dono", "Dono da agenda", $lista, "", "", false, "", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\'miolo\' id=\'miolo\' frameborder=\'0\' height=\'100%\' width=\'500\' marginheight=\'0\' marginwidth=\'0\' src=\'pesquisa_funcionario_lst.php?campos=$serializedcampos\'></iframe>' );\">", false, true );
     }
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Pagamento Multa - Listagem";
     foreach ($_GET as $var => $val) {
         // passa todos os valores obtidos no GET para atributos do objeto
         $this->{$var} = $val === "" ? null : $val;
     }
     $lista_busca = array("Cliente", "Valor Multa (Biblioteca)", "Valor Multa (Total)", "Valor Pago");
     $obrigatorio = false;
     $get_instituicao = true;
     $get_escola = true;
     $get_biblioteca = true;
     $get_cliente_tipo = true;
     $get_cabecalho = "lista_busca";
     include "include/pmieducar/educar_campo_lista.php";
     $this->addCabecalhos($lista_busca);
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(0);
     $parametros->adicionaCampoSelect("ref_idpes", "idpes", "nome");
     $parametros->setPessoa('F');
     $parametros->setPessoaCPF('N');
     $parametros->setCodSistema(1);
     $this->campoListaPesq("ref_idpes", "Cliente", array('' => "Selecione"), $this->ref_idpes, "pesquisa_pessoa_lst.php", "", false, "", "", null, null, "", false, $parametros->serializaCampos());
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->limite - $this->limite : 0;
     $obj_exemplar_emprestimo = new clsPmieducarExemplarEmprestimo();
     $lst_exemplar_emprestimo = $obj_exemplar_emprestimo->listaDividaPagamentoCliente($this->ref_cod_cliente, $this->ref_idpes, $this->ref_cod_cliente_tipo, $this->pessoa_logada, $this->ref_cod_biblioteca, $this->ref_cod_escola, $this->ref_cod_instituicao);
     // monta a lista
     if (is_array($lst_exemplar_emprestimo) && count($lst_exemplar_emprestimo)) {
         foreach ($lst_exemplar_emprestimo as $registro) {
             $obj_cliente = new clsPmieducarCliente($registro["ref_cod_cliente"]);
             $det_cliente = $obj_cliente->detalhe();
             if ($det_cliente) {
                 $obj_pessoa = new clsPessoa_($det_cliente["ref_idpes"]);
                 $det_pessoa = $obj_pessoa->detalhe();
                 if ($det_tipo) {
                     $nm_tipo = $det_tipo["nm_tipo"];
                 }
             }
             if (!is_numeric($registro["valor_pago"])) {
                 $registro["valor_pago"] = 0;
             }
             $obj_ex_em = new clsPmieducarExemplarEmprestimo();
             $lst_ex_em = $obj_ex_em->listaTotalMulta($registro["ref_cod_cliente"]);
             $multa_total = 0;
             if ($lst_ex_em) {
                 foreach ($lst_ex_em as $divida_total) {
                     if ($divida_total["cod_cliente"] == $registro["ref_cod_cliente"]) {
                         $multa_total = $divida_total["valor_multa_total"];
                     }
                 }
             }
             $obj_bib = new clsPmieducarBiblioteca($registro["ref_cod_biblioteca"]);
             $det_bib = $obj_bib->detalhe();
             if ($det_bib) {
                 $obj_inst = new clsPmieducarInstituicao($det_bib["ref_cod_instituicao"]);
                 $det_inst = $obj_inst->detalhe();
                 $obj_esc = new clsPmieducarEscolaComplemento($det_bib["ref_cod_escola"]);
                 $det_esc = $obj_esc->detalhe();
                 if ($det_esc) {
                     $nome_escola = $det_esc["nm_escola"];
                 } else {
                     $obj_escola = new clsPmieducarEscola($det_bib["ref_cod_escola"]);
                     $det_escola = $obj_escola->detalhe();
                     if ($det_escola) {
                         $obj_pes = new clsPessoa_($det_escola["ref_idpes"]);
                         $det_pes = $obj_pes->detalhe();
                         if ($det_pes) {
                             $nome_escola = $det_pes["nome"];
                         }
                     }
                 }
             }
             $obj_tipo = new clsPmieducarCliente();
             $det_tipo = $obj_tipo->retornaTipoCliente($registro["ref_cod_cliente"], $registro["ref_cod_biblioteca"]);
             $lista_busca = array($lista_busca[] = "<a href=\"educar_pagamento_multa_det.php?cod_cliente={$registro["ref_cod_cliente"]}&cod_cliente_tipo={$det_tipo["cod_cliente_tipo"]}\">{$det_pessoa["nome"]}</a>", $lista_busca[] = "<a href=\"educar_pagamento_multa_det.php?cod_cliente={$registro["ref_cod_cliente"]}&cod_cliente_tipo={$det_tipo["cod_cliente_tipo"]}\">" . "R\$" . number_format($registro["valor_multa"], 2, ",", ".") . "</a>", $lista_busca[] = "<a href=\"educar_pagamento_multa_det.php?cod_cliente={$registro["ref_cod_cliente"]}&cod_cliente_tipo={$det_tipo["cod_cliente_tipo"]}\">" . "R\$" . number_format($multa_total, 2, ",", ".") . "</a>", $lista_busca[] = "<a href=\"educar_pagamento_multa_det.php?cod_cliente={$registro["ref_cod_cliente"]}&cod_cliente_tipo={$det_tipo["cod_cliente_tipo"]}\">" . "R\$" . number_format($registro["valor_pago"], 2, ",", ".") . "</a>");
             if ($qtd_bibliotecas > 1 && ($nivel_usuario == 4 || $nivel_usuario == 8)) {
                 $lista_busca[] = "<a href=\"educar_pagamento_multa_det.php?cod_cliente={$registro["ref_cod_cliente"]}&cod_cliente_tipo={$det_tipo["cod_cliente_tipo"]}\">{$det_bib["nm_biblioteca"]}</a>";
             } else {
                 if ($nivel_usuario == 1 || $nivel_usuario == 2 || $nivel_usuario == 4) {
                     $lista_busca[] = "<a href=\"educar_pagamento_multa_det.php?cod_cliente={$registro["ref_cod_cliente"]}&cod_cliente_tipo={$det_tipo["cod_cliente_tipo"]}\">{$det_bib["nm_biblioteca"]}</a>";
                 }
             }
             if ($nivel_usuario == 1 || $nivel_usuario == 2) {
                 $lista_busca[] = "<a href=\"educar_pagamento_multa_det.php?cod_cliente={$registro["ref_cod_cliente"]}&cod_cliente_tipo={$det_tipo["cod_cliente_tipo"]}\">{$nome_escola}</a>";
             }
             if ($nivel_usuario == 1) {
                 $lista_busca[] = "<a href=\"educar_pagamento_multa_det.php?cod_cliente={$registro["ref_cod_cliente"]}&cod_cliente_tipo={$det_tipo["cod_cliente_tipo"]}\">{$det_inst["nm_instituicao"]}</a>";
             }
             $this->addLinhas($lista_busca);
         }
     }
     $this->addPaginador2("educar_pagamento_multa_lst.php", $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     //		if( $obj_permissoes->permissao_cadastra( 622, $this->pessoa_logada, 11 ) )
     //		{
     //		$this->acao = "go(\"educar_pagamento_multa_cad.php\")";
     //		$this->nome_acao = "Novo";
     //		}
     $this->largura = "100%";
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_biblioteca_index.php" => "i-Educar - Biblioteca", "" => "Listagem de d&iacute;vidas"));
     $this->enviaLocalizacao($localizacao->montar());
 }
Exemplo n.º 10
0
 function Gerar()
 {
     @session_start();
     $id_pessoa = $_SESSION['id_pessoa'];
     $this->nome = "form1";
     $show = $_REQUEST['show'];
     $this->campoOculto("show", $show);
     if ($show == "todos") {
         $show = false;
     } else {
         $show = 1;
     }
     $this->chave_campo = $_GET['chave_campo'];
     if ($_GET["campos"]) {
         $parametros = new clsParametrosPesquisas();
         $parametros->deserializaCampos($_GET["campos"]);
         $_SESSION['campos'] = $parametros->geraArrayComAtributos();
         unset($_GET["campos"]);
     } else {
         $parametros = new clsParametrosPesquisas();
         $parametros->preencheAtributosComArray($_SESSION['campos']);
     }
     @session_write_close();
     $submit = false;
     foreach ($_GET as $key => $value) {
         $this->{$key} = $value;
     }
     if ($parametros->getPessoa() == 'F') {
         $this->addCabecalhos(array("CPF", "Nome"));
         // Filtros de Busca
         $this->campoTexto("campo_busca", "Pessoa", $this->campo_busca, 50, 255, false, false, false, "Código/Nome");
         $this->campoCpf("cpf", "CPF", $this->cpf ? int2CPF(idFederal2int($this->cpf)) : "");
         $chave_busca = @$_GET['campo_busca'];
         $cpf = @$_GET['cpf'];
         $busca = @$_GET['busca'];
         // Paginador
         $limite = 10;
         $iniciolimit = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $limite - $limite : 0;
         if (is_numeric($this->chave_campo)) {
             $chave = "[{$this->chave_campo}]";
         } else {
             $chave = "";
         }
         if ($busca == 'S') {
             if ($parametros->getPessoaNovo() == 'S') {
                 if ($parametros->getPessoaTela() == "window") {
                     $this->acao = "set_campo_pesquisa( \"" . $parametros->getPessoaCampo() . "\", \"0\", \"submit\" )";
                     $this->nome_acao = "Novo";
                 } elseif ($parametros->getPessoaTela() == "frame") {
                     $this->acao = "go( \"pesquisa_pessoa_cad.php?pessoa=F&cod=0&ref_cod_sistema=" . $parametros->getCodSistema() . "&pessoa_cpf=" . $parametros->getPessoaCPF() . "\" )";
                     $this->nome_acao = "Novo";
                 }
             }
             if (is_numeric($chave_busca)) {
                 $obj_pessoa = new clsPessoaFisica();
                 $lst_pessoa = $obj_pessoa->lista(null, $cpf ? idFederal2int($cpf) : null, $iniciolimit, $limite, false, $parametros->getCodSistema(), $chave_busca);
             } else {
                 $obj_pessoa = new clsPessoaFisica();
                 $lst_pessoa = $obj_pessoa->lista($chave_busca, $cpf ? idFederal2int($cpf) : null, $iniciolimit, $limite, false, $parametros->getCodSistema());
             }
         } else {
             $obj_pessoa = new clsPessoaFisica();
             $lst_pessoa = $obj_pessoa->lista(null, null, $iniciolimit, $limite, false, $parametros->getCodSistema());
         }
         if ($lst_pessoa) {
             foreach ($lst_pessoa as $pessoa) {
                 $funcao = " set_campo_pesquisa(";
                 $virgula = "";
                 $cont = 0;
                 $pessoa["cpf"] = is_numeric($pessoa["cpf"]) ? int2CPF($pessoa["cpf"]) : null;
                 foreach ($parametros->getCampoNome() as $campo) {
                     if ($parametros->getCampoTipo($cont) == "text") {
                         $funcao .= "{$virgula} '{$campo}{$chave}', '{$pessoa[$parametros->getCampoValor($cont)]}'";
                         $virgula = ",";
                     } elseif ($parametros->getCampoTipo($cont) == "select") {
                         $funcao .= "{$virgula} '{$campo}{$chave}', '{$pessoa[$parametros->getCampoIndice($cont)]}', '{$pessoa[$parametros->getCampoValor($cont)]}'";
                         $virgula = ",";
                     }
                     $cont++;
                 }
                 if ($parametros->getSubmit()) {
                     $funcao .= "{$virgula} 'submit' )";
                 } else {
                     $funcao .= " )";
                 }
                 if ($parametros->getPessoaEditar() == "S") {
                     if ($parametros->getPessoaTela() == "frame") {
                         $this->addLinhas(array("<a href='pesquisa_pessoa_cad.php?pessoa=F&cod={$pessoa["idpes"]}&ref_cod_sistema=" . $parametros->getCodSistema() . "'>{$pessoa["cpf"]}</a>", "<a href='pesquisa_pessoa_cad.php?pessoa=F&cod={$pessoa["idpes"]}&ref_cod_sistema=" . $parametros->getCodSistema() . "'>{$pessoa["nome"]}</a>"));
                     } else {
                         $this->addLinhas(array("<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["cpf"]}</a>", "<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["nome"]}</a>"));
                     }
                 } else {
                     $this->addLinhas(array("<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["cpf"]}</a>", "<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["nome"]}</a>"));
                 }
                 $total = $pessoa['total'];
             }
         } else {
             $this->addLinhas(array("Não existe nenhum resultado a ser apresentado."));
         }
     } elseif ($parametros->getPessoa() == 'J') {
         $this->addCabecalhos(array("CNPJ", "Nome"));
         // Filtros de Busca
         $this->campoTexto("campo_busca", "Pessoa", $this->campo_busca, 50, 255, false, false, false, "Código/Nome");
         if ($this->cnpj) {
             if (is_numeric($this->cnpj)) {
                 $this->cnpj = int2CNPJ($this->cnpj);
             }
         } else {
             $this->cnpj = "";
         }
         $this->campoCnpj("cnpj", "CNPJ", $this->cnpj);
         $chave_busca = @$_GET['campo_busca'];
         $cnpj = @$_GET['cnpj'];
         $busca = @$_GET['busca'];
         // Paginador
         $limite = 10;
         $iniciolimit = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $limite - $limite : 0;
         if ($busca == 'S') {
             if ($parametros->getPessoaNovo() == 'S') {
                 if ($parametros->getPessoaTela() == "window") {
                     $this->acao = "set_campo_pesquisa( \"" . $parametros->getPessoaCampo() . "\", \"0\", \"submit\" )";
                     $this->nome_acao = "Novo";
                 } elseif ($parametros->getPessoaTela() == "frame") {
                     $this->acao = "go( \"pesquisa_pessoa_cad.php?pessoa=J&cod=0\" )";
                     $this->nome_acao = "Novo";
                 }
             }
             if (is_numeric($chave_busca)) {
                 $obj_pessoa = new clsPessoaJuridica();
                 $lst_pessoa = $obj_pessoa->lista($cnpj ? idFederal2int($cnpj) : null, false, false, $iniciolimit, $limite, false, false, false, $chave_busca);
             } else {
                 $obj_pessoa = new clsPessoaJuridica();
                 $lst_pessoa = $obj_pessoa->lista($cnpj ? idFederal2int($cnpj) : null, $chave_busca, false, $iniciolimit, $limite);
             }
         } else {
             $obj_pessoa = new clsPessoaJuridica();
             $lst_pessoa = $obj_pessoa->lista(null, null, null, $iniciolimit, $limite);
         }
         if ($lst_pessoa) {
             foreach ($lst_pessoa as $pessoa) {
                 $funcao = " set_campo_pesquisa(";
                 $virgula = "";
                 $cont = 0;
                 $pessoa["cnpj"] = is_numeric($pessoa["cnpj"]) ? int2CNPJ($pessoa["cnpj"]) : null;
                 foreach ($parametros->getCampoNome() as $campo) {
                     if ($parametros->getCampoTipo($cont) == "text") {
                         $funcao .= "{$virgula} '{$campo}', '{$pessoa[$parametros->getCampoValor($cont)]}'";
                         $virgula = ",";
                     } elseif ($parametros->getCampoTipo($cont) == "select") {
                         $funcao .= "{$virgula} '{$campo}', '{$pessoa[$parametros->getCampoIndice($cont)]}', '{$pessoa[$parametros->getCampoValor($cont)]}'";
                         $virgula = ",";
                     }
                     $cont++;
                 }
                 if ($parametros->getSubmit()) {
                     $funcao .= "{$virgula} 'submit' )";
                 } else {
                     $funcao .= " )";
                 }
                 if ($campos["edita"]["permitir"] == "S") {
                     if ($parametros->getPessoaTela() == "frame") {
                         $this->addLinhas(array("<a href='pesquisa_pessoa_cad.php?pessoa=J&cod={$pessoa["idpes"]}'>{$pessoa["cnpj"]}</a>", "<a href='pesquisa_pessoa_cad.php?pessoa=J&cod={$pessoa["idpes"]}'>{$pessoa["nome"]}</a>"));
                     } else {
                         $this->addLinhas(array("<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["cnpj"]}</a>", "<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["nome"]}</a>"));
                     }
                 } else {
                     $this->addLinhas(array("<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["cnpj"]}</a>", "<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["nome"]}</a>"));
                 }
                 $total = $pessoa['total'];
             }
         } else {
             $this->addLinhas(array("Não existe nenhum resultado a ser apresentado."));
         }
     } elseif ($parametros->getPessoa() == 'FJ') {
         $this->addCabecalhos(array("CNPJ/CPF", "Nome"));
         // Filtros de Busca
         $this->campoTexto("campo_busca", "Pessoa", $this->campo_busca, 50, 255, false, false, false, "Código/Nome");
         $this->campoIdFederal("id_federal", "CNPJ/CPF", $this->id_federal ? int2IdFederal($this->id_federal) : "");
         $chave_busca = @$_GET['campo_busca'];
         $id_federal = @$_GET['id_federal'];
         $busca = @$_GET['busca'];
         // Paginador
         $limite = 10;
         $iniciolimit = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $limite - $limite : 0;
         if ($busca == 'S') {
             if ($parametros->getPessoaNovo() == 'S') {
                 if ($parametros->getPessoaTela() == "window") {
                     $this->acao = "set_campo_pesquisa( \"" . $parametros->getPessoaCampo() . "\", \"0\", \"submit\" )";
                     $this->nome_acao = "Novo";
                 } elseif ($parametros->getPessoaTela() == "frame") {
                     $this->acao = "go( \"pesquisa_pessoa_cad.php?pessoa=FJ&cod=0&ref_cod_sistema=" . $parametros->getCodSistema() . "&pessoa_cpf=" . $parametros->getPessoaCPF() . "\" )";
                     $this->nome_acao = "Novo";
                 }
             }
             if (is_numeric($chave_busca)) {
                 $obj_pessoa = new clsPessoaFj();
                 $lst_pessoa = $obj_pessoa->lista_rapida($chave_busca, null, idFederal2int($id_federal), $iniciolimit, $limite, null, "nome ASC", $parametros->getCodSistema());
             } else {
                 $obj_pessoa = new clsPessoaFj();
                 $lst_pessoa = $obj_pessoa->lista_rapida(null, $chave_busca, idFederal2int($id_federal), $iniciolimit, $limite, null, "nome ASC", $parametros->getCodSistema());
             }
         } else {
             $obj_pessoa = new clsPessoaFj();
             $lst_pessoa = $obj_pessoa->lista_rapida(null, null, null, $iniciolimit, $limite, null, "nome ASC", $parametros->getCodSistema());
         }
         if ($lst_pessoa) {
             foreach ($lst_pessoa as $pessoa) {
                 $funcao = " set_campo_pesquisa(";
                 $virgula = "";
                 $cont = 0;
                 foreach ($parametros->getCampoNome() as $campo) {
                     if ($parametros->getCampoTipo($cont) == "text") {
                         $funcao .= "{$virgula} '{$campo}', '{$pessoa[$parametros->getCampoValor($cont)]}'";
                         $virgula = ",";
                     } elseif ($parametros->getCampoTipo($cont) == "select") {
                         $funcao .= "{$virgula} '{$campo}', '{$pessoa[$parametros->getCampoIndice($cont)]}', '{$pessoa[$parametros->getCampoValor($cont)]}'";
                         $virgula = ",";
                     }
                     $cont++;
                 }
                 if ($parametros->getSubmit()) {
                     $funcao .= "{$virgula} 'submit' )";
                 } else {
                     $funcao .= " )";
                 }
                 $pessoa['cnpj'] = $pessoa['tipo'] == 'J' && $pessoa['cnpj'] ? int2CNPJ($pessoa['cnpj']) : null;
                 $pessoa['cpf'] = $pessoa['tipo'] == 'F' && $pessoa['cpf'] ? int2CPF($pessoa['cpf']) : null;
                 $obj_pes = new clsPessoa_($pessoa["idpes"]);
                 $det_pes = $obj_pes->detalhe();
                 if ($parametros->getPessoaEditar() == "S") {
                     if ($parametros->getPessoaTela() == "frame") {
                         if ($det_pes["tipo"] == "J") {
                             $this->addLinhas(array("<a href='pesquisa_pessoa_cad.php?pessoa={$det_pes["tipo"]}&cod={$pessoa["idpes"]}'>{$pessoa["cnpj"]}</a>", "<a href='pesquisa_pessoa_cad.php?pessoa={$det_pes["tipo"]}&cod={$pessoa["idpes"]}'>{$pessoa["nome"]}</a>"));
                         } elseif ($det_pes["tipo"] == "F") {
                             $this->addLinhas(array("<a href='pesquisa_pessoa_cad.php?pessoa={$det_pes["tipo"]}&cod={$pessoa["idpes"]}&ref_cod_sistema=" . $parametros->getCodSistema() . "'>{$pessoa["cpf"]}</a>", "<a href='pesquisa_pessoa_cad.php?pessoa={$det_pes["tipo"]}&cod={$pessoa["idpes"]}&ref_cod_sistema=" . $parametros->getCodSistema() . "'>{$pessoa["nome"]}</a>"));
                         }
                     } else {
                         if ($det_pes["tipo"] == "J") {
                             $this->addLinhas(array("<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["cnpj"]}</a>", "<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["nome"]}</a>"));
                         } else {
                             $this->addLinhas(array("<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["cpf"]}</a>", "<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["nome"]}</a>"));
                         }
                     }
                 } else {
                     if ($det_pes["tipo"] == "J") {
                         $this->addLinhas(array("<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["cnpj"]}</a>", "<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["nome"]}</a>"));
                     } else {
                         $this->addLinhas(array("<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["cpf"]}</a>", "<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["nome"]}</a>"));
                     }
                 }
                 $total = $pessoa['_total'];
             }
         } else {
             $this->addLinhas(array("Não existe nenhum resultado a ser apresentado."));
         }
     } else {
         if ($parametros->getPessoa() == 'FUNC') {
             $this->addCabecalhos(array("Matricula", "Nome"));
             // Filtros de Busca
             $this->campoTexto("campo_busca", "Pessoa", $this->campo_busca, 50, 255, false, false, false, "Código/Nome");
             $this->campoNumero("matricula", "Matricula", $this->matricula, 15, 255);
             //			$this->campoCpf( "cpf", "CPF", int2CPF($this->cpf) );
             $chave_busca = @$_GET['campo_busca'];
             $cpf = @$_GET['cpf'];
             $busca = @$_GET['busca'];
             // Paginador
             $limite = 10;
             $iniciolimit = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $limite - $limite : 0;
             if ($busca == 'S') {
                 if ($parametros->getPessoaNovo() == 'S') {
                     if ($parametros->getPessoaTela() == "window") {
                         $this->acao = "set_campo_pesquisa( \"" . $parametros->getPessoaCampo() . "\", \"0\", \"submit\" )";
                         $this->nome_acao = "Novo";
                     } elseif ($parametros->getPessoaTela() == "frame") {
                         $this->acao = "go( \"pesquisa_pessoa_cad.php?pessoa=F&cod=0&ref_cod_sistema=" . $parametros->getCodSistema() . "&pessoa_cpf=" . $parametros->getPessoaCPF() . "\" )";
                         $this->nome_acao = "Novo";
                     }
                 }
                 if (is_numeric($chave_busca)) {
                     $obj_funcionario = new clsFuncionario();
                     $lst_pessoa = $obj_funcionario->lista($this->matricula, false, $show, false, false, false, false, $iniciolimit, $limite, false, false, $this->campo_busca);
                     //					$obj_pessoa = new clsPessoaFisica();
                     //					$lst_pessoa = $obj_pessoa->lista( null, ( ( $cpf ) ? idFederal2int( $cpf ) : null ), $iniciolimit, $limite, false, $parametros->getCodSistema(), $chave_busca );
                 } else {
                     $obj_funcionario = new clsFuncionario();
                     $lst_pessoa = $obj_funcionario->lista($this->matricula, $this->campo_busca, $show, false, false, false, false, $iniciolimit, $limite);
                     //					$obj_pessoa = new clsPessoaFisica();
                     //					$lst_pessoa = $obj_pessoa->lista( $chave_busca, ( ( $cpf ) ? idFederal2int( $cpf ) : null ), $iniciolimit, $limite, false, $parametros->getCodSistema() );
                 }
             } else {
                 $obj_funcionario = new clsFuncionario();
                 $lst_pessoa = $obj_funcionario->lista(false, false, $show, false, false, false, false, $iniciolimit, $limite);
                 //				$obj_pessoa = new clsPessoaFisica();
                 //				$lst_pessoa = $obj_pessoa->lista( null, null, $iniciolimit, $limite, false, $parametros->getCodSistema() );
             }
             if ($lst_pessoa) {
                 foreach ($lst_pessoa as $pessoa) {
                     $funcao = " set_campo_pesquisa(";
                     $virgula = "";
                     $cont = 0;
                     $pessoa["cpf"] = is_numeric($pessoa["cpf"]) ? int2CPF($pessoa["cpf"]) : null;
                     foreach ($parametros->getCampoNome() as $campo) {
                         if ($parametros->getCampoTipo($cont) == "text") {
                             $funcao .= "{$virgula} '{$campo}', '{$pessoa[$parametros->getCampoValor($cont)]}'";
                             $virgula = ",";
                         } elseif ($parametros->getCampoTipo($cont) == "select") {
                             $funcao .= "{$virgula} '{$campo}', '{$pessoa[$parametros->getCampoIndice($cont)]}', '{$pessoa[$parametros->getCampoValor($cont)]}'";
                             $virgula = ",";
                         }
                         $cont++;
                     }
                     if ($parametros->getSubmit()) {
                         $funcao .= "{$virgula} 'submit' )";
                     } else {
                         $funcao .= " )";
                     }
                     if ($parametros->getPessoaEditar() == "S") {
                         if ($parametros->getPessoaTela() == "frame") {
                             $this->addLinhas(array("<a href='pesquisa_pessoa_cad.php?pessoa=F&cod={$pessoa["idpes"]}'>{$pessoa["matricula"]}</a>", "<a href='pesquisa_pessoa_cad.php?pessoa=F&cod={$pessoa["idpes"]}&ref_cod_sistema=" . $parametros->getCodSistema() . "'>{$pessoa["nome"]}</a>"));
                         } else {
                             $this->addLinhas(array("<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["matricula"]}</a>", "<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["nome"]}</a>"));
                         }
                     } else {
                         $this->addLinhas(array("<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["matricula"]}</a>", "<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$pessoa["nome"]}</a>"));
                     }
                     $total = $pessoa['_total'];
                 }
             } else {
                 $this->addLinhas(array("Não existe nenhum resultado a ser apresentado."));
             }
         }
     }
     // Paginador
     $this->addPaginador2("pesquisa_pessoa_lst.php", $total, $_GET, $this->nome, $limite);
     // Define Largura da Página
     $this->largura = "100%";
 }
Exemplo n.º 11
0
 function Gerar()
 {
     @session_start();
     $this->pessoaFj = $_SESSION['id_pessoa'];
     session_write_close();
     $this->campoOculto("pessoaFj", $this->pessoaFj);
     $this->campoOculto("cod_diaria", $this->cod_diaria);
     if ($this->num_diaria) {
         $this->campoOculto("num_diaria", $this->num_diaria);
     }
     // Campo listaPesq de Funcionario
     $lista = array();
     if ($this->ref_funcionario) {
         $objPessoa = new clsPessoaFJ($this->ref_funcionario);
         $detalhe = $objPessoa->detalhe();
         if ($detalhe) {
             $lista[$detalhe["idpes"]] = $detalhe["nome"];
             $lista[""] = "Pesquise outras pessoas clicando no botao ao lado";
         } else {
             $lista[""] = "Pesquise a pessoa clicando no botao ao lado";
         }
     } else {
         $lista[""] = "Pesquise a pessoa clicando no botao ao lado";
     }
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(0);
     $parametros->adicionaCampoSelect("ref_funcionario", "ref_cod_pessoa_fj", "nome");
     $this->campoListaPesq("ref_funcionario", "Funcion&aacute;rio", $lista, $this->ref_funcionario, "pesquisa_funcionario_lst.php", "", false, "", "", null, null, "", false, $parametros->serializaCampos());
     $grupo = array();
     $grupo[""] = "Selecione o grupo";
     $db = new clsBanco();
     $db->Consulta("SELECT cod_diaria_grupo, desc_grupo FROM pmidrh.diaria_grupo ORDER BY cod_diaria_grupo ASC");
     while ($db->ProximoRegistro()) {
         list($cod_grupo, $nome) = $db->Tupla();
         $grupo[$cod_grupo] = $nome;
     }
     $this->campoLista("ref_cod_diaria_grupo", "Grupo de di&aacute;ria", $grupo, $this->ref_cod_diaria_grupo, "diaria_carrega_valores();");
     $lst_setores = array("" => "Selecione");
     $obj_setor = new clsSetor();
     $lst_setor = $obj_setor->lista(null, null, null, null, null, null, null, null, null, null, 0);
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $linha) {
             $lst_setores[$linha["cod_setor"]] = $linha["nm_setor"];
         }
     }
     $this->campoLista("ref_cod_setor", "Secretaria", $lst_setores, $this->ref_cod_setor, "diaria_carrega_valores();");
     $this->campoTexto("conta_corrente", "Conta corrente", $this->conta_corrente, 10, 10);
     if (!$this->banco) {
         $this->banco = "001";
     }
     if (!$this->agencia) {
         $this->agencia = "03050";
     }
     $this->campoTexto("agencia", "Ag&ecirc;ncia", $this->agencia, 10, 10);
     $this->campoTexto("banco", "Banco", $this->banco, 10, 10);
     $this->campoTexto("dotacao_orcamentaria", "Dota&ccedil;&atilde;o Or&ccedil;ament&aacute;ria", $this->dotacao_orcamentaria, 50, 50);
     $this->campoMemo("objetivo", "Objetivo", $this->objetivo, 48, 2);
     if ($this->data_pedido) {
         $this->data_pedido = date("d/m/Y", strtotime(substr($this->data_pedido, 0, 16)));
     }
     $this->campoData("data_pedido", "Data para Empenho", $this->data_pedido, true);
     if ($this->data_partida) {
         $this->hora_partida = date("H:i", strtotime($this->data_partida));
         $this->data_partida = date("d/m/Y", strtotime($this->data_partida));
     }
     $this->campoData("data_partida", "Data de Partida", $this->data_partida, false, false, false, "onBlur=\"diaria_carrega_valores();\"");
     $this->campoHora("hora_partida", "Hora de Partida", $this->hora_partida, false, false, "onBlur=\"diaria_carrega_valores();\"");
     if ($this->data_chegada) {
         $this->hora_chegada = date("H:i", strtotime($this->data_chegada));
         $this->data_chegada = date("d/m/Y", strtotime($this->data_chegada));
     }
     $this->campoData("data_chegada", "Data de Chegada", $this->data_chegada, false, false, false, "onBlur=\"diaria_carrega_valores();\"");
     $this->campoHora("hora_chegada", "Hora de Chegada", $this->hora_chegada, false, false, "onBlur=\"diaria_carrega_valores();\"");
     if (!is_numeric($this->estadual)) {
         $this->estadual = 1;
     }
     $this->campoLista("estadual", "Estadual", array("N&atilde;o", "Sim"), $this->estadual, "diaria_carrega_valores();");
     $this->campoTexto("destino", "Destino", $this->destino, 50, 100);
     $this->campoTexto("vl100", "Valor 100%", number_format($this->vl100, 2, ',', '.'), 20, 20, false, false, true);
     $this->campoTextoInv("sug100", " &nbsp; &nbsp; Valor sugerido", "", 10, 10);
     $this->campoTexto("vl75", "Valor 75%", number_format($this->vl75, 2, ',', '.'), 20, 20, false, false, true);
     $this->campoTextoInv("sug75", " &nbsp; &nbsp; Valor sugerido", "", 10, 10);
     $this->campoTexto("vl50", "Valor 50%", number_format($this->vl50, 2, ',', '.'), 20, 20, false, false, true);
     $this->campoTextoInv("sug50", " &nbsp; &nbsp; Valor sugerido", "", 10, 10);
     $this->campoTexto("vl25", "Valor 25%", number_format($this->vl25, 2, ',', '.'), 20, 20, false, false, true);
     $this->campoTextoInv("sug25", " &nbsp; &nbsp; Valor sugerido", "", 10, 10);
     $this->campoRotulo("copia", "Copiar", "<a href=\"#bottom\" onclick=\"diaria_copia_valores();\">Clique aqui para copiar os valores sugeridos.</a>", false, "<script type=\"text/javascript\">diaria_carrega_valores();</script>");
 }
Exemplo n.º 12
0
 function Editar()
 {
     @session_start();
     $pessoaFj = $_SESSION['id_pessoa'];
     $parametros = new clsParametrosPesquisas();
     if ($this->cep_) {
         $this->cep = idFederal2int($this->cep_);
     }
     if ($_SESSION["campos"]) {
         $parametros->preencheAtributosComArray($_SESSION['campos']);
     }
     session_write_close();
     if ($_POST["pessoa"] == "F") {
         if ($this->id_federal) {
             $this->id_federal = idFederal2int($this->id_federal);
             $objCPF = new clsFisica(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, $this->id_federal);
             $detCPF = $objCPF->detalhe();
             if ($detCPF) {
                 if ($detCPF["idpes"] != $this->cod_pessoa_fj) {
                     $this->mensagem = "CPF j&aacute; cadastrado.";
                     $this->id_federal = false;
                     return false;
                 }
             }
         }
         $this->data_nasc = dataToBanco($this->data_nasc);
         $objPessoa = new clsPessoa_($this->cod_pessoa_fj, $this->nm_pessoa, false, $this->p_http, false, $pessoaFj, date("Y-m-d H:i:s", time()), $this->email);
         $objPessoa->edita();
         if ($this->id_federal) {
             $this->id_federal = idFederal2Int($this->id_federal);
             $objFisica = new clsFisica($this->cod_pessoa_fj, $this->data_nasc, $this->sexo, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, "NULL", $this->id_federal);
             $objFisica->edita();
         } else {
             $objFisica = new clsFisica($this->cod_pessoa_fj, $this->data_nasc, $this->sexo, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, $this->ref_cod_sistema, $this->id_federal);
             $objFisica->edita();
         }
         $objTelefone = new clsPessoaTelefone($this->cod_pessoa_fj, 1, $this->telefone_1, $this->ddd_telefone_1);
         if ($objTelefone->detalhe()) {
             $objTelefone->edita();
         } else {
             $objTelefone->cadastra();
         }
         $objTelefone = new clsPessoaTelefone($this->cod_pessoa_fj, 2, $this->telefone_2, $this->ddd_telefone_2);
         if ($objTelefone->detalhe()) {
             $objTelefone->edita();
         } else {
             $objTelefone->cadastra();
         }
         $objTelefone = new clsPessoaTelefone($this->cod_pessoa_fj, 3, $this->telefone_mov, $this->ddd_telefone_mov);
         if ($objTelefone->detalhe()) {
             $objTelefone->edita();
         } else {
             $objTelefone->cadastra();
         }
         $objTelefone = new clsPessoaTelefone($this->cod_pessoa_fj, 4, $this->telefone_fax, $this->ddd_telefone_fax);
         if ($objTelefone->detalhe()) {
             $objTelefone->edita();
         } else {
             $objTelefone->cadastra();
         }
         $objEndereco = new clsPessoaEndereco($this->cod_pessoa_fj);
         $detEndereco = $objEndereco->detalhe();
         $objEndereco2 = new clsPessoaEndereco($this->cod_pessoa_fj, $this->cep, $this->idlog, $this->idbai, $this->numero, $this->complemento, false, $this->letra, $this->bloco, $this->apartamento, $this->andar);
         if ($detEndereco && $this->cep && $this->idlog && $this->idbai) {
             $objEndereco2->edita();
         } elseif ($this->cep && $this->idlog && $this->idbai) {
             $objEndereco2->cadastra();
             $objEnderecoExterno = new clsEnderecoExterno($this->cod_pessoa_fj);
             if ($objEnderecoExterno->detalhe()) {
                 $objEnderecoExterno->exclui();
             }
         } elseif ($detEndereco) {
             $objEndereco2->exclui();
             $this->cep = $this->cep;
             $objEnderecoExterno = new clsEnderecoExterno($this->cod_pessoa_fj);
             $detEnderecoExterno = $objEnderecoExterno->detalhe();
             $objEnderecoExterno2 = new clsEnderecoExterno($this->cod_pessoa_fj, "1", $this->idtlog, $this->logradouro, $this->numero, $this->letra, $this->complemento, $this->bairro, $this->cep, $this->cidade, $this->sigla_uf, false, $this->bloco, $this->apartamento, $this->andar);
             if ($detEnderecoExterno) {
                 $objEnderecoExterno2->edita();
                 if ($detEndereco) {
                     $objEndereco->exclui();
                 }
             } else {
                 $objEnderecoExterno2->cadastra();
                 if ($detEndereco) {
                     $objEndereco->exclui();
                 }
             }
         } else {
             $this->cep = idFederal2int($this->cep);
             $objEnderecoExterno = new clsEnderecoExterno($this->cod_pessoa_fj);
             $objEnderecoExterno2 = new clsEnderecoExterno($this->cod_pessoa_fj, "1", $this->idtlog, $this->logradouro, $this->numero, $this->letra, $this->complemento, $this->bairro, $this->cep, $this->cidade, $this->sigla_uf, false, $this->bloco, $this->apartamento, $this->andar);
             if ($objEnderecoExterno->detalhe()) {
                 $objEnderecoExterno2->edita();
             } else {
                 $objEnderecoExterno2->cadastra();
                 if ($detEndereco) {
                     $objEndereco->exclui();
                 }
             }
         }
         if (is_numeric($this->cod_pessoa_fj)) {
             $obj_pessoa = new clsPessoaFj($this->cod_pessoa_fj);
             $pessoa = $obj_pessoa->lista_rapida($this->cod_pessoa_fj);
             $pessoa = $pessoa[0];
             $funcao = " set_campo_pesquisa(";
             $virgula = "";
             $cont = 0;
             foreach ($parametros->getCampoNome() as $campo) {
                 if ($parametros->getCampoTipo($cont) == "text") {
                     $funcao .= "{$virgula} '{$campo}', '{$pessoa[$parametros->getCampoValor($cont)]}'";
                     $virgula = ",";
                 } elseif ($parametros->getCampoTipo($cont) == "select") {
                     $funcao .= "{$virgula} '{$campo}', '{$pessoa[$parametros->getCampoIndice($cont)]}', '{$pessoa[$parametros->getCampoValor($cont)]}'";
                     $virgula = ",";
                 }
                 $cont++;
             }
             if ($parametros->getSubmit()) {
                 $funcao .= "{$virgula} 'submit' )";
             } else {
                 $funcao .= " )";
             }
             $this->executa_script = $funcao;
             /**
              * alteracao para executar script
              * em tabela dinamica
              * procon
              */
             if ($_GET['tab_dinamica'] == 'procon') {
                 $script = "function passaPraTraz(nome, id)\n\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t// reclamada\n\t\t\t\t\t\t\t\t\twindow.parent.document.getElementById('reclamada[{$_GET['tab_dinamica_id']}]').value = nome;\n\t\t\t\t\t\t\t\t\twindow.parent.document.getElementById('reclamada_id[{$_GET['tab_dinamica_id']}]').value = id;\n\n\t\t\t\t\t\t\t\t\twindow.parent.fechaExpansivel('div_dinamico_'+(parent.DOM_divs.length*1-1));\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpassaPraTraz('{$pessoa['nome']}',{$this->cod_pessoa_fj});";
                 $this->executa_script = $script;
             }
             return true;
         }
     } elseif ($_POST["pessoa"] == "J") {
         if ($this->id_federal) {
             $this->id_federal = idFederal2int($this->id_federal);
             $objCNPJ = new clsJuridica(false, $this->id_federal);
             $detCNPJ = $objCNPJ->detalhe();
             if ($detCNPJ) {
                 if ($detCNPJ["idpes"] != $this->cod_pessoa_fj) {
                     $this->mensagem = "CNPJ j&aacute; cadastrado.";
                     $this->id_federal = false;
                     return false;
                 }
             }
         }
         $this->id_federal = idFederal2int($this->id_federal);
         $this->insc_est = idFederal2int($this->insc_est);
         $objPessoa = new clsPessoa_($this->cod_pessoa_fj, $this->razao_social, $this->idpes_cad, $this->url, "J", false, false, $this->email);
         $objPessoa->edita();
         $objJuridica = new clsJuridica($this->cod_pessoa_fj, $this->id_federal, $this->fantasia, $this->insc_est, $this->capital_social);
         $objJuridica->edita();
         $objTelefone = new clsPessoaTelefone($this->cod_pessoa_fj, 1, $this->telefone_1, $this->ddd_telefone_1);
         if ($objTelefone->detalhe()) {
             $objTelefone->edita();
         } else {
             $objTelefone->cadastra();
         }
         $objTelefone = new clsPessoaTelefone($this->cod_pessoa_fj, 2, $this->telefone_2, $this->ddd_telefone_2);
         if ($objTelefone->detalhe()) {
             $objTelefone->edita();
         } else {
             $objTelefone->cadastra();
         }
         $objTelefone = new clsPessoaTelefone($this->cod_pessoa_fj, 3, $this->telefone_mov, $this->ddd_telefone_mov);
         if ($objTelefone->detalhe()) {
             $objTelefone->edita();
         } else {
             $objTelefone->cadastra();
         }
         $objTelefone = new clsPessoaTelefone($this->cod_pessoa_fj, 4, $this->telefone_fax, $this->ddd_telefone_fax);
         if ($objTelefone->detalhe()) {
             $objTelefone->edita();
         } else {
             $objTelefone->cadastra();
         }
         $objEndereco = new clsPessoaEndereco($this->cod_pessoa_fj);
         $detEndereco = $objEndereco->detalhe();
         $this->cep = $this->cep;
         $objEndereco2 = new clsPessoaEndereco($this->cod_pessoa_fj, $this->cep, $this->idlog, $this->idbai, $this->numero, $this->complemento, false, $this->letra, $this->bloco, $this->apartamento, $this->andar);
         if ($detEndereco && $this->cep && $this->idlog && $this->idbai) {
             $objEndereco2->edita();
         } elseif ($this->cep && $this->idlog && $this->idbai) {
             $objEndereco2->cadastra();
         } elseif ($detEndereco) {
             $objEndereco2->exclui();
             $this->cep = $this->cep;
             $objEnderecoExterno = new clsEnderecoExterno($this->cod_pessoa_fj);
             $detEnderecoExterno = $objEnderecoExterno->detalhe();
             $objEnderecoExterno2 = new clsEnderecoExterno($this->cod_pessoa_fj, "1", $this->idtlog, $this->logradouro, $this->numero, $this->letra, $this->complemento, $this->bairro, $this->cep, $this->cidade, $this->sigla_uf, false, $this->bloco, $this->apartamento, $this->andar);
             if ($detEnderecoExterno) {
                 $objEnderecoExterno2->edita();
                 if ($detEndereco) {
                     $objEndereco->exclui();
                 }
             } else {
                 $objEnderecoExterno2->cadastra();
                 if ($detEndereco) {
                     $objEndereco->exclui();
                 }
             }
         }
         if (is_numeric($this->cod_pessoa_fj)) {
             $obj_pessoa = new clsPessoaFj($this->cod_pessoa_fj);
             $pessoa = $obj_pessoa->lista_rapida($this->cod_pessoa_fj);
             $pessoa = $pessoa[0];
             $funcao = " set_campo_pesquisa(";
             $virgula = "";
             $cont = 0;
             foreach ($parametros->getCampoNome() as $campo) {
                 if ($parametros->getCampoTipo($cont) == "text") {
                     $funcao .= "{$virgula} '{$campo}', '{$pessoa[$parametros->getCampoValor($cont)]}'";
                     $virgula = ",";
                 } elseif ($parametros->getCampoTipo($cont) == "select") {
                     $funcao .= "{$virgula} '{$campo}', '{$pessoa[$parametros->getCampoIndice($cont)]}', '{$pessoa[$parametros->getCampoValor($cont)]}'";
                     $virgula = ",";
                 }
                 $cont++;
             }
             if ($parametros->getSubmit()) {
                 $funcao .= "{$virgula} 'submit' )";
             } else {
                 $funcao .= " )";
             }
             $this->executa_script = $funcao;
             /**
              * alteracao para executar script
              * em tabela dinamica
              * procon
              */
             if ($_GET['tab_dinamica'] == 'procon') {
                 $script = "function passaPraTraz(nome, id)\n\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t// reclamada\n\t\t\t\t\t\t\t\t\twindow.parent.document.getElementById('reclamada[{$_GET['tab_dinamica_id']}]').value = nome;\n\t\t\t\t\t\t\t\t\twindow.parent.document.getElementById('reclamada_id[{$_GET['tab_dinamica_id']}]').value = id;\n\n\t\t\t\t\t\t\t\t\twindow.parent.fechaExpansivel('div_dinamico_'+(parent.DOM_divs.length*1-1));\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpassaPraTraz('{$pessoa['nome']}',{$this->cod_pessoa_fj});";
                 $this->executa_script = $script;
             }
             return true;
         }
     }
     return false;
 }
 function Gerar()
 {
     @session_start();
     $id_pessoa = $_SESSION['id_pessoa'];
     $this->nome = "form1";
     if ($_GET["campos"]) {
         $parametros = new clsParametrosPesquisas();
         $parametros->deserializaCampos($_GET["campos"]);
         $_SESSION['campos'] = $parametros->geraArrayComAtributos();
         unset($_GET["campos"]);
     } else {
         $parametros = new clsParametrosPesquisas();
         $parametros->preencheAtributosComArray($_SESSION['campos']);
     }
     @session_write_close();
     $submit = false;
     $this->addCabecalhos(array("Matr&iacute;cula", "Funcion&aacute;rio"));
     // Filtros de Busca
     $this->campoTexto("campo_busca", "Funcionário", "", 50, 255, false, false, false, "Matrícula/Nome do Funcionário");
     $this->campoOculto("com_matricula", $_GET['com_matricula']);
     if ($_GET['campo_busca']) {
         $chave_busca = @$_GET['campo_busca'];
     }
     if ($_GET['busca']) {
         $busca = @$_GET['busca'];
     }
     // Paginador
     $limite = 10;
     $iniciolimit = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $limite - $limite : 0;
     $this->chave_campo = $_GET['chave_campo'];
     $this->campoOculto("chave_campo", $this->chave_campo);
     if (is_numeric($this->chave_campo)) {
         $chave = "[{$this->chave_campo}]";
     } else {
         $chave = "";
     }
     $this->importarCpf = $_GET['importa_cpf'];
     if ($_GET['com_matricula']) {
         $com_matricula = null;
     } else {
         $com_matricula = true;
     }
     if ($busca == 'S') {
         $obj_funcionario = new clsFuncionario();
         $lst_funcionario = $obj_funcionario->lista(false, $chave_busca, false, false, false, false, false, $iniciolimit, $limite, false, $com_matricula);
         if (!$lst_funcionario) {
             $lst_funcionario = $obj_funcionario->lista($chave_busca, false, false, false, false, false, false, $iniciolimit, $limite, false, $com_matricula);
         }
     } else {
         $obj_funcionario = new clsFuncionario();
         $lst_funcionario = $obj_funcionario->lista(false, false, false, false, false, false, false, $iniciolimit, $limite, false, $com_matricula);
     }
     if ($lst_funcionario) {
         foreach ($lst_funcionario as $funcionario) {
             $funcao = " set_campo_pesquisa(";
             $virgula = "";
             $cont = 0;
             foreach ($parametros->getCampoNome() as $campo) {
                 if ($parametros->getCampoTipo($cont) == "text") {
                     if ($parametros->getCampoValor($cont) == "cpf") {
                         if ($this->importarCpf || $busca) {
                             $objPessoa = new clsPessoaFisica($funcionario["ref_cod_pessoa_fj"]);
                             $objPessoa_det = $objPessoa->detalhe();
                             $funcionario[$parametros->getCampoValor($cont)] = $objPessoa_det["cpf"];
                         }
                         $funcionario[$parametros->getCampoValor($cont)] = int2CPF($funcionario[$parametros->getCampoValor($cont)]);
                     }
                     $funcao .= "{$virgula} '{$campo}{$chave}', '{$funcionario[$parametros->getCampoValor($cont)]}'";
                     $virgula = ",";
                 } elseif ($parametros->getCampoTipo($cont) == "select") {
                     if ($parametros->getCampoValor($cont) == "cpf") {
                         if ($this->importarCpf || $busca) {
                             $objPessoa = new clsPessoaFisica($funcionario["ref_cod_pessoa_fj"]);
                             $objPessoa_det = $objPessoa->detalhe();
                             $funcionario[$parametros->getCampoValor($cont)] = $objPessoa_det["cpf"];
                         }
                         $funcionario[$parametros->getCampoValor($cont)] = int2CPF($funcionario[$parametros->getCampoValor($cont)]);
                     }
                     $funcao .= "{$virgula} '{$campo}{$chave}', '{$funcionario[$parametros->getCampoIndice($cont)]}', '{$funcionario[$parametros->getCampoValor($cont)]}'";
                     $virgula = ",";
                 }
                 $cont++;
             }
             if ($parametros->getSubmit()) {
                 $funcao .= "{$virgula} 'submit' )";
             } else {
                 $funcao .= " )";
             }
             $this->addLinhas(array("<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$funcionario["matricula"]}</a>", "<a href='javascript:void( 0 );' onclick=\"javascript:{$funcao}\">{$funcionario["nome"]}</a>"));
             $total = $funcionario['_total'];
         }
     }
     // Paginador
     $this->addPaginador2("pesquisa_funcionario_lst.php", $total, $_GET, $this->nome, $limite);
     // Define Largura da Página
     $this->largura = "100%";
 }
Exemplo n.º 14
0
 function Gerar()
 {
     // primary keys
     $this->campoOculto("cod_cliente", $this->cod_cliente);
     $this->campoOculto("requisita_senha", "0");
     $opcoes = array("" => "Pesquise a pessoa clicando na lupa ao lado");
     if ($this->ref_idpes) {
         $objTemp = new clsPessoaFisica($this->ref_idpes);
         $detalhe = $objTemp->detalhe();
         $opcoes["{$detalhe["idpes"]}"] = $detalhe["nome"];
     }
     // Caso o cliente não exista, exibe um campo de pesquisa, senão, mostra um rótulo
     if (!$this->cod_cliente) {
         $parametros = new clsParametrosPesquisas();
         $parametros->setSubmit(0);
         $parametros->adicionaCampoSelect('ref_idpes', 'idpes', 'nome');
         $parametros->setPessoa('F');
         $parametros->setPessoaCPF('N');
         $parametros->setCodSistema(1);
         $parametros->setPessoaNovo('S');
         $parametros->setPessoaTela('frame');
         $this->campoListaPesq('ref_idpes', 'Cliente', $opcoes, $this->ref_idpes, 'pesquisa_pessoa_lst.php', '', FALSE, '', '', NULL, NULL, '', FALSE, $parametros->serializaCampos());
     } else {
         $this->campoOculto('ref_idpes', $this->ref_idpes);
         $this->campoRotulo('nm_cliente', 'Cliente', $detalhe['nome']);
     }
     // text
     $this->campoNumero("login", "Login", $this->login_, 9, 9, false);
     $this->campoSenha("senha", "Senha", $this->senha_, false);
     $get_escola = 1;
     $get_biblioteca = 1;
     $instituicao_obrigatorio = true;
     $escola_obrigatorio = false;
     $biblioteca_obrigatorio = true;
     include "include/pmieducar/educar_campo_lista.php";
     //$instituicao_obrigatorio  = true;
     //$escola_obrigatorio		  = false;
     //$biblioteca_obrigatorio	  = true;
     $cliente_tipo_obrigatorio = true;
     $get_instituicao = true;
     $get_escola = true;
     //$get_biblioteca  		  = true;
     $get_cliente_tipo = true;
     if ($this->cod_cliente && $this->ref_cod_biblioteca) {
         $db = new clsBanco();
         // Cria campo oculto com o ID da biblioteca atual ao qual usuário está cadastrado
         $this->ref_cod_biblioteca_atual = $this->ref_cod_biblioteca;
         $this->campoOculto("ref_cod_biblioteca_atual", $this->ref_cod_biblioteca_atual);
         $this->ref_cod_instituicao = $db->CampoUnico("SELECT ref_cod_instituicao  FROM pmieducar.biblioteca, pmieducar.cliente_tipo_cliente ctc, pmieducar.cliente_tipo ct WHERE ref_cod_cliente = '{$this->cod_cliente}' AND ref_cod_cliente_tipo = cod_cliente_tipo AND ct.ref_cod_biblioteca = cod_biblioteca AND ctc.ref_cod_biblioteca = {$this->ref_cod_biblioteca}");
         $this->ref_cod_escola = $db->CampoUnico("SELECT ref_cod_escola  FROM pmieducar.biblioteca, pmieducar.cliente_tipo_cliente ctc, pmieducar.cliente_tipo ct WHERE ref_cod_cliente = '{$this->cod_cliente}' AND ref_cod_cliente_tipo = cod_cliente_tipo AND ct.ref_cod_biblioteca = cod_biblioteca AND ctc.ref_cod_biblioteca = {$this->ref_cod_biblioteca}");
         $this->ref_cod_biblioteca = $db->CampoUnico("SELECT cod_biblioteca  FROM pmieducar.biblioteca, pmieducar.cliente_tipo_cliente ctc, pmieducar.cliente_tipo ct WHERE ref_cod_cliente = '{$this->cod_cliente}' AND ref_cod_cliente_tipo = cod_cliente_tipo AND ct.ref_cod_biblioteca = cod_biblioteca AND ctc.ref_cod_biblioteca = {$this->ref_cod_biblioteca}");
         $this->ref_cod_cliente_tipo = $db->CampoUnico("SELECT ref_cod_cliente_tipo FROM pmieducar.cliente_tipo_cliente WHERE ref_cod_cliente = '{$this->cod_cliente}'");
         // AND ref_cod_cliente_tipo IN (SELECT cod_cliente_tipo FROM pmieducar.cliente_tipo WHERE ref_cod_biblioteca = )");//IN (SELECT ref_cod_biblioteca FROM pmieducar.biblioteca_usuario WHERE ref_cod_usuario = '$this->pessoa_logada'))");
     }
     include "include/pmieducar/educar_campo_lista.php";
 }
Exemplo n.º 15
0
 function Gerar()
 {
     $obj_permissoes = new clsPermissoes();
     //		echo "<pre>";print_r($_POST);die;
     if (!$this->sem_cnpj && !$this->com_cnpj) {
         $parametros = new clsParametrosPesquisas();
         $parametros->setSubmit(1);
         $parametros->setPessoa('J');
         $parametros->setPessoaCampo('sem_cnpj');
         $parametros->setPessoaNovo("S");
         $parametros->setPessoaCPF("N");
         $parametros->setPessoaTela('window');
         $this->campoOculto("sem_cnpj", "");
         $parametros->setCodSistema(13);
         $parametros->adicionaCampoTexto("cnpj", "cnpj");
         $this->campoCnpjPesq("cnpj", "CNPJ", $this->cnpj, "pesquisa_pessoa_lst.php", $parametros->serializaCampos(), true);
         //			$this->acao_enviar = "obj = document.getElementById(\"cnpj\");if(obj.value != \"\" ) {document.getElementById(\"formcadastro\").submit(); } else { acao(); }";
         $this->acao_enviar = false;
         $this->url_cancelar = false;
         $this->array_botao = array("Continuar", "Cancelar");
         $this->array_botao_url_script = array("obj = document.getElementById('cnpj');if(obj.value != '' ) { acao(); } else { acao(); }", "go('educar_escola_lst.php');");
     } else {
         if ($_POST) {
             foreach ($_POST as $campo => $val) {
                 if ($campo != 'tipoacao' && $campo != 'sem_cnpj') {
                     $this->{$campo} = $this->{$campo} ? $this->{$campo} : $val;
                 }
             }
         }
         if ($this->sem_cnpj) {
             $this->campoOculto("sem_cnpj", $this->sem_cnpj);
             // cadastro novo sem CNPJ
             $this->p_ddd_telefone_1 = $this->p_ddd_telefone_1 == null ? "" : $this->p_ddd_telefone_1;
             $this->p_ddd_telefone_fax = $this->p_ddd_telefone_fax == null ? "" : $this->p_ddd_telefone_fax;
             if ($this->ref_idpes) {
                 $objTemp = new clsPessoaJuridica($this->ref_idpes);
                 $detalhe = $objTemp->detalhe();
             }
             //				$this->campoOculto( "passo", 4 );
             //				$this->campoOculto( "sem_cnpj", 0 );
             $this->campoOculto("cod_escola", $this->cod_escola);
             // text
             $this->campoTexto("fantasia", "Escola", $this->fantasia, 30, 255, true);
             $this->campoTexto("sigla", "Sigla", $this->sigla, 30, 255, true);
             // foreign keys
             $nivel = $obj_permissoes->nivel_acesso($this->pessoa_logada);
             if ($nivel == 1) {
                 $cabecalhos[] = "Instituicao";
                 $objInstituicao = new clsPmieducarInstituicao();
                 $opcoes = array("" => "Selecione");
                 $objInstituicao->setOrderby("nm_instituicao ASC");
                 $lista = $objInstituicao->lista();
                 if (is_array($lista)) {
                     foreach ($lista as $linha) {
                         $opcoes[$linha["cod_instituicao"]] = $linha["nm_instituicao"];
                     }
                 }
                 $this->campoLista("ref_cod_instituicao", "Institui&ccedil;&atilde;o", $opcoes, $this->ref_cod_instituicao);
             } else {
                 $this->ref_cod_instituicao = $obj_permissoes->getInstituicao($this->pessoa_logada);
                 if ($this->ref_cod_instituicao) {
                     $this->campoOculto("ref_cod_instituicao", $this->ref_cod_instituicao);
                 } else {
                     die("Usu�rio n�o � do nivel poli-institucional e n�o possui uma institui��o");
                 }
             }
             $opcoes = array("" => "Selecione");
             if (class_exists("clsPmieducarEscolaRedeEnsino")) {
                 /*$todas_redes_ensino = "rede_ensino = new Array();\n";
                 		$objTemp = new clsPmieducarEscolaRedeEnsino();
                 		$lista = $objTemp->lista();
                 		if ( is_array( $lista ) && count( $lista ) )
                 		{
                 			foreach ( $lista as $registro )
                 			{
                 				$todas_redes_ensino .= "rede_ensino[rede_ensino.length] = new Array( {$registro["cod_escola_rede_ensino"]}, '{$registro['nm_rede']}', {$registro["ref_cod_instituicao"]} );\n";
                 			}
                 		}
                 		echo "<script>{$todas_redes_ensino}</script>";*/
                 // EDITAR
                 $script = "javascript:showExpansivelIframe(520, 120, 'educar_escola_rede_ensino_cad_pop.php');";
                 if ($this->ref_cod_instituicao) {
                     $objTemp = new clsPmieducarEscolaRedeEnsino();
                     $lista = $objTemp->lista(null, null, null, null, null, null, null, null, 1, $this->ref_cod_instituicao);
                     if (is_array($lista) && count($lista)) {
                         foreach ($lista as $registro) {
                             $opcoes["{$registro['cod_escola_rede_ensino']}"] = "{$registro['nm_rede']}";
                         }
                     }
                     $script = "<img id='img_rede_ensino' style='display: \\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">";
                 } else {
                     $script = "<img id='img_rede_ensino' style='display: none;'  src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">";
                 }
             } else {
                 echo "<!--\nErro\nClasse clsPmieducarEscolaRedeEnsino nao encontrada\n-->";
                 $opcoes = array("" => "Erro na geracao");
             }
             $this->campoLista("ref_cod_escola_rede_ensino", "Rede Ensino", $opcoes, $this->ref_cod_escola_rede_ensino, "", false, "", $script);
             $opcoes = array("" => "Selecione");
             if (class_exists("clsPmieducarEscolaLocalizacao")) {
                 /*$todas_escolas_localizacao = "escola_localizacao = new Array();\n";
                 		$objTemp = new clsPmieducarEscolaLocalizacao();
                 		$lista = $objTemp->lista();
                 		if ( is_array( $lista ) && count( $lista ) )
                 		{
                 			foreach ( $lista as $registro )
                 			{
                 				$todas_escolas_localizacao .= "escola_localizacao[escola_localizacao.length] = new Array( {$registro["cod_escola_localizacao"]}, '{$registro['nm_localizacao']}', {$registro["ref_cod_instituicao"]} );\n";
                 			}
                 		}
                 		echo "<script>{$todas_escolas_localizacao}</script>";*/
                 // EDITAR
                 $script = "javascript:showExpansivelIframe(520, 120, 'educar_escola_localizacao_cad_pop.php');";
                 if ($this->ref_cod_instituicao) {
                     $objTemp = new clsPmieducarEscolaLocalizacao();
                     $lista = $objTemp->lista(null, null, null, null, null, null, null, null, 1, $this->ref_cod_instituicao);
                     if (is_array($lista) && count($lista)) {
                         foreach ($lista as $registro) {
                             $opcoes["{$registro['cod_escola_localizacao']}"] = "{$registro['nm_localizacao']}";
                         }
                     }
                     $script = "<img id='img_localizacao' style='display: \\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">";
                 } else {
                     $script = "<img id='img_localizacao' style='display: none;'  src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">";
                 }
             } else {
                 echo "<!--\nErro\nClasse clsPmieducarEscolaLocalizacao nao encontrada\n-->";
                 $opcoes = array("" => "Erro na geracao");
             }
             $this->campoLista("ref_cod_escola_localizacao", "Escola Localiza&ccedil;&atilde;o", $opcoes, $this->ref_cod_escola_localizacao, "", false, "", $script);
             if (is_numeric($this->cep)) {
                 $this->cep = int2CEP($this->cep);
             }
             //				$this->campoCep( "cep","CEP", $this->cep,true,"-",false,false );
             $this->campoCep("cep", "CEP", $this->cep, true, "-", false, false);
             $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", true);
             $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "20", true);
             $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", true);
             $this->campoTexto("complemento", "Complemento", $this->complemento, "22", "20", false);
             $this->campoNumero("numero", "Número", $this->numero, "6", "6", true);
             $this->campoTexto("p_ddd_telefone_1", "DDD Telefone 1", $this->p_ddd_telefone_1, "2", "2", false);
             $this->campoTexto("p_telefone_1", "Telefone 1", $this->p_telefone_1, "10", "15", false);
             $this->campoTexto("p_ddd_telefone_fax", "DDD Fax", $this->p_ddd_telefone_fax, "2", "2", false);
             $this->campoTexto("p_telefone_fax", "Fax", $this->p_telefone_fax, "10", "15", false);
             $this->campoTexto("p_email", "E-mail", $this->p_email, "50", "255", false);
         }
         if ($this->com_cnpj) {
             $this->campoOculto("com_cnpj", $this->com_cnpj);
             //				die("com CNPJ");
             //				echo "<br>cep: ".$this->cep;
             //				echo "<br>cep_: ".$this->cep_;
             if (!$this->cod_escola) {
                 $this->cnpj = urldecode($_POST['cnpj']);
                 $this->cnpj = idFederal2int($this->cnpj);
                 //					echo int2IdFederal($this->cnpj);
                 $this->cnpj = int2IdFederal($this->cnpj);
             }
             //				echo "sakdmk: ".$this->cnpj;die;
             // cadastro novo com CNPJ
             //echo "hehehe".idFederal2int($this->cnpj);echo "kiki".int2IdFederal($this->cnpj);die;
             $objJuridica = new clsPessoaJuridica(false, idFederal2int($this->cnpj));
             $det = $objJuridica->detalhe();
             $this->ref_idpes = $det["idpes"];
             //				if( $this->ref_idpes )
             //				{
             //					$this->p_ddd_telefone_1 = ( $this->p_ddd_telefone_1 == null ) ? "": is_numeric( $this->p_ddd_telefone_1 );
             //					$this->p_ddd_telefone_2 = ( $this->p_ddd_telefone_2 == null ) ? "": is_numeric( $this->p_ddd_telefone_2 );
             //					$this->p_ddd_telefone_3 = ( $this->p_ddd_telefone_3 == null ) ? "": is_numeric( $this->p_ddd_telefone_3 );
             //					$obj_pessoa = new clsPessoa_( $this->ref_idpes );
             //					$det_pessoa = $obj_pessoa->detalhe();
             //$this->fantasia = $det_pessoa["nome"];
             //					$this->nm_escola = $det["nome"];
             if (!$this->fantasia) {
                 $this->fantasia = $det["fantasia"];
             }
             if ($this->passou) {
                 $this->cnpj = is_numeric($this->cnpj) ? $this->cnpj : idFederal2int($this->cnpj);
                 $this->cnpj = int2IdFederal($this->cnpj);
             }
             //
             $this->campoRotulo("cnpj_", "CNPJ", $this->cnpj);
             $this->campoOculto("cnpj", idFederal2int($this->cnpj));
             $this->campoOculto("ref_idpes", $this->ref_idpes);
             //					$this->campoOculto( "passo", 3 );
             $this->campoOculto("cod_escola", $this->cod_escola);
             // text
             $this->campoTexto("fantasia", "Escola", $this->fantasia, 30, 255, true);
             $this->campoTexto("sigla", "Sigla", $this->sigla, 30, 255, true);
             // foreign keys
             $nivel = $obj_permissoes->nivel_acesso($this->pessoa_logada);
             if ($nivel == 1) {
                 $cabecalhos[] = "Instituicao";
                 $objInstituicao = new clsPmieducarInstituicao();
                 $opcoes = array("" => "Selecione");
                 $objInstituicao->setOrderby("nm_instituicao ASC");
                 $lista = $objInstituicao->lista();
                 if (is_array($lista)) {
                     foreach ($lista as $linha) {
                         $opcoes[$linha["cod_instituicao"]] = $linha["nm_instituicao"];
                     }
                 }
                 $this->campoLista("ref_cod_instituicao", "Instituicao", $opcoes, $this->ref_cod_instituicao);
             } else {
                 $this->ref_cod_instituicao = $obj_permissoes->getInstituicao($this->pessoa_logada);
                 if ($this->ref_cod_instituicao) {
                     $this->campoOculto("ref_cod_instituicao", $this->ref_cod_instituicao);
                 } else {
                     die("Usu�rio n�o � do nivel poli-institucional e n�o possui uma institui��o");
                 }
             }
             $opcoes = array("" => "Selecione");
             if (class_exists("clsPmieducarEscolaRedeEnsino")) {
                 /*$todas_redes_ensino = "rede_ensino = new Array();\n";
                 		$objTemp = new clsPmieducarEscolaRedeEnsino();
                 		$lista = $objTemp->lista( null,null,null,null,null,null,null,null,1 );
                 		if ( is_array( $lista ) && count( $lista ) )
                 		{
                 			foreach ( $lista as $registro )
                 			{
                 				$todas_redes_ensino .= "rede_ensino[rede_ensino.length] = new Array( {$registro["cod_escola_rede_ensino"]}, '{$registro['nm_rede']}', {$registro["ref_cod_instituicao"]} );\n";
                 			}
                 		}
                 		echo "<script>{$todas_redes_ensino}</script>";*/
                 // EDITAR
                 $script = "javascript:showExpansivelIframe(520, 120, 'educar_escola_rede_ensino_cad_pop.php');";
                 if ($this->ref_cod_instituicao) {
                     $objTemp = new clsPmieducarEscolaRedeEnsino();
                     $lista = $objTemp->lista(null, null, null, null, null, null, null, null, 1, $this->ref_cod_instituicao);
                     if (is_array($lista) && count($lista)) {
                         foreach ($lista as $registro) {
                             $opcoes["{$registro['cod_escola_rede_ensino']}"] = "{$registro['nm_rede']}";
                         }
                     }
                     $script = "<img id='img_rede_ensino' style='display:\\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">";
                 } else {
                     $script = "<img id='img_rede_ensino' style='display: none;'  src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">";
                 }
             } else {
                 echo "<!--\nErro\nClasse clsPmieducarEscolaRedeEnsino nao encontrada\n-->";
                 $opcoes = array("" => "Erro na geracao");
             }
             $this->campoLista("ref_cod_escola_rede_ensino", "Rede Ensino", $opcoes, $this->ref_cod_escola_rede_ensino, "", false, "", $script);
             $opcoes = array("" => "Selecione");
             if (class_exists("clsPmieducarEscolaLocalizacao")) {
                 /*$todas_escolas_localizacao = "escola_localizacao = new Array();\n";
                 		$objTemp = new clsPmieducarEscolaLocalizacao();
                 		$lista = $objTemp->lista( null,null,null,null,null,null,null,null,1 );
                 		if ( is_array( $lista ) && count( $lista ) )
                 		{
                 			foreach ( $lista as $registro )
                 			{
                 				$todas_escolas_localizacao .= "escola_localizacao[escola_localizacao.length] = new Array( {$registro["cod_escola_localizacao"]}, '{$registro['nm_localizacao']}', {$registro["ref_cod_instituicao"]} );\n";
                 			}
                 		}
                 		echo "<script>{$todas_escolas_localizacao}</script>";*/
                 // EDITAR
                 $script = "javascript:showExpansivelIframe(520, 120, 'educar_escola_localizacao_cad_pop.php');";
                 if ($this->ref_cod_instituicao) {
                     $objTemp = new clsPmieducarEscolaLocalizacao();
                     $lista = $objTemp->lista(null, null, null, null, null, null, null, null, 1, $this->ref_cod_instituicao);
                     if (is_array($lista) && count($lista)) {
                         foreach ($lista as $registro) {
                             $opcoes["{$registro['cod_escola_localizacao']}"] = "{$registro['nm_localizacao']}";
                         }
                     }
                     $script = "<img id='img_localizacao' style='display:\\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">";
                 } else {
                     $script = "<img id='img_localizacao' style='display: none;' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">";
                 }
             } else {
                 echo "<!--\nErro\nClasse clsPmieducarEscolaLocalizacao nao encontrada\n-->";
                 $opcoes = array("" => "Erro na geracao");
             }
             $this->campoLista("ref_cod_escola_localizacao", "Escola Localiza&ccedil;&atilde;o", $opcoes, $this->ref_cod_escola_localizacao, "", false, "", $script);
             // Detalhes do Endereco
             $objUf = new clsUf();
             $listauf = $objUf->lista();
             $listaEstado = array("" => "Selecione");
             if ($listauf) {
                 foreach ($listauf as $uf) {
                     $listaEstado[$uf['sigla_uf']] = $uf['sigla_uf'];
                 }
             }
             $objTipoLog = new clsTipoLogradouro();
             $listaTipoLog = $objTipoLog->lista();
             $listaTLog = array("" => "Selecione");
             if ($listaTipoLog) {
                 foreach ($listaTipoLog as $tipoLog) {
                     $listaTLog[urldecode($tipoLog['idtlog'])] = $tipoLog['descricao'];
                 }
             }
             $this->campoOculto("isEnderecoExterno", $this->isEnderecoExterno);
             //	echo "$this->cep ,$this->sigla_uf ";
             $this->campoOculto("cep_", $this->cep_);
             $this->campoOculto("sigla_uf_", $this->sigla_uf_);
             $this->campoOculto("cidade_", $this->cidade_);
             $this->campoOculto("bairro_", $this->bairro_);
             $this->campoOculto("idbai", $this->idbai);
             $this->campoOculto("logradouro_", $this->logradouro_);
             $this->campoOculto("idlog", $this->idlog);
             $this->campoOculto("idtlog_", $this->idtlog_);
             $disabled = $this->isEnderecoExterno ? false : true;
             if ($this->idlog && $this->idbai && $this->cep && $this->ref_idpes) {
                 $this->campoOculto("cep_", $this->cep);
                 $this->cep_ = int2CEP($this->cep);
                 //$this->campoLista( "ref_cod_escola_localizacao", "Escola Localizac&atilde;o", $opcoes, $this->ref_cod_escola_localizacao );
                 //						$this->campoCep("cep_","CEP", int2CEP($this->cep),true,"-","&nbsp;<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f('pesquisa_cep3.php', 'enderecos')\" style=\"cursor: hand;\">",true);
                 //						$this->campoCep( "cep_", "CEP", int2CEP( $this->cep ), true, "-", "&nbsp;<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f( 'pesquisa_cep_lst.php', 'enderecos' )\" style=\"cursor: hand;\">", false );
                 //$this->campoCep( "cep", "CEP", int2CEP( $this->cep ), true, "-", "&nbsp;<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_popless('pesquisa_cep_lst.php', 'enderecos')\" style=\"cursor: hand;\">", true );
                 $this->campoCep("cep", "CEP", $this->cep_, true, "-", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'educar_pesquisa_cep_log_bairro.php?campo1=bairro&campo2=idbai&campo3=cep_&campo4=logradouro&campo5=idlog&campo6=sigla_uf_&campo7=cidade&campo8=idtlog_&campo9=isEnderecoExterno&campo10=cep&campo11=sigla_uf&campo12=idtlog&campo13=cidade_\\'></iframe>');\">", $disabled);
                 $this->campoLista("sigla_uf", "Estado", $listaEstado, $this->sigla_uf, false, false, false, false, true, true);
                 $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", true, false, false, "", "", "", "onKeyUp", true);
                 $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "255", true, false, false, "", "", "", "onKeyUp", true);
                 $this->campoLista("idtlog", "Tipo Logradouro", $listaTLog, $this->idtlog, false, false, false, false, true, true);
                 $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", true, false, false, "", "", "", "onKeyUp", true);
                 $this->campoTexto("complemento", "Complemento", $this->complemento, "22", "20", false, false);
                 $this->campoNumero("numero", "Número", $this->numero, "6", "6", false);
                 $this->campoNumero("andar", "Andar", $this->andar, "2", "2", false);
             } elseif ($this->ref_idpes && $this->cep) {
                 $this->cep = is_numeric($this->cep) ? int2CEP($this->cep) : $this->cep;
                 //						$this->campoCep("cep_","CEP", int2CEP($this->cep),true,"-","&nbsp;<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f('pesquisa_cep3.php', 'enderecos')\" style=\"cursor: hand;\">",false);
                 //						$this->campoCep( "cep_", "CEP", int2CEP( $this->cep ), true, "-", "&nbsp;<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f( 'pesquisa_cep_lst.php', 'enderecos' )\" style=\"cursor: hand;\">", false );
                 //$this->campoCep( "cep", "CEP", int2CEP( $this->cep ), true, "-", "&nbsp;<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_popless('pesquisa_cep_lst.php', 'enderecos')\" style=\"cursor: hand;\">", false );
                 $this->campoCep("cep", "CEP", $this->cep, true, "-", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'educar_pesquisa_cep_log_bairro.php?campo1=bairro&campo2=idbai&campo3=cep_&campo4=logradouro&campo5=idlog&campo6=sigla_uf_&campo7=cidade&campo8=idtlog_&campo9=isEnderecoExterno&campo10=cep&campo11=sigla_uf&campo12=idtlog&campo13=cidade_\\'></iframe>');\">");
                 $this->campoLista("sigla_uf", "Estado", $listaEstado, $this->sigla_uf, "", false, "", "", false, true);
                 $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", true, false, false, "", "", "", "onKeyUp", false);
                 $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "255", true, false, false, "", "", "", "onKeyUp", false);
                 $this->campoLista("idtlog", "Tipo Logradouro", $listaTLog, $this->idtlog, "", false, "", "", false, true);
                 $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", true, false, false, "", "", "", "onKeyUp", false);
                 $this->campoTexto("complemento", "Complemento", $this->complemento, "22", "20", false, false, false, "", "", "", "onKeyUp", false);
                 $this->campoNumero("numero", "Número", $this->numero, 6, 6, false, "", "");
                 $this->campoNumero("andar", "Andar", $this->andar, "2", "2", false);
             } else {
                 if (!$this->isEnderecoExterno) {
                     $obj_bairro = new clsBairro($this->idbai);
                     $this->cep_ = int2CEP($this->cep_);
                     $obj_bairro_det = $obj_bairro->detalhe();
                     if ($obj_bairro_det) {
                         $this->bairro = $obj_bairro_det["nome"];
                     }
                     $obj_log = new clsLogradouro($this->idlog);
                     $obj_log_det = $obj_log->detalhe();
                     if ($obj_log_det) {
                         $this->logradouro = $obj_log_det["nome"];
                         $this->idtlog = $obj_log_det["idtlog"]->idtlog;
                         $obj_mun = new clsMunicipio($obj_log_det["idmun"]);
                         $det_mun = $obj_mun->detalhe();
                         if ($det_mun) {
                             $this->cidade = strtoupper(ucfirst(strtolower($det_mun["nome"])));
                         }
                         $this->sigla_uf = $this->sigla_uf_ = $det_mun['sigla_uf']->sigla_uf;
                     }
                 } else {
                     $this->cep_ = $this->cep;
                 }
                 /*$obj_bairro = new clsBairro($obj_endereco_det["ref_idbai"]);
                 					$obj_bairro_det = $obj_bairro->detalhe();
                 
                 					if($obj_bairro_det){
                 
                 						$this->bairro = $obj_bairro_det["nome"];
                 					}*/
                 //						$this->campoCep("cep_","CEP", int2CEP($this->cep),true,"-","&nbsp;<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f('pesquisa_cep3.php', 'enderecos')\" style=\"cursor: hand;\">",true);
                 //						$this->campoCep( "cep_", "CEP", int2CEP( $this->cep ), true, "-", "&nbsp;<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f( 'pesquisa_cep_lst.php', 'enderecos' )\" style=\"cursor: hand;\">", false );
                 //						$this->campoCep( "cep_", "CEP", int2CEP( $this->cep ), true, "-", "&nbsp;<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_popless('pesquisa_cep_lst.php', 'enderecos')\" style=\"cursor: hand;\">", false );
                 $this->campoCep("cep", "CEP", $this->cep_, true, "-", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'educar_pesquisa_cep_log_bairro.php?campo1=bairro&campo2=idbai&campo3=cep_&campo4=logradouro&campo5=idlog&campo6=sigla_uf_&campo7=cidade&campo8=idtlog_&campo9=isEnderecoExterno&campo10=cep&campo11=sigla_uf&campo12=idtlog&campo13=cidade_\\'></iframe>');\">", $disabled);
                 //	$this->campoCep("cep_", "CEP", $this->cep_, true, "-", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\'miolo\' id=\'miolo\' frameborder=\'0\' height=\'100%\' width=\'500\' marginheight=\'0\' marginwidth=\'0\' src=\'educar_pesquisa_cep_log_bairro.php?campo1=nm_bairro&campo2=id_bairro&campo3=id_cep&campo4=nm_logradouro&campo5=id_logradouro&campo6=ref_sigla_uf&campo7=cidade&campo8=ref_idtlog_&campo9=isEnderecoExterno&campo10=cep_&campo11=ref_sigla_uf_&campo12=ref_idtlog&campo13=id_cidade\'></iframe>');\">", $disabled);
                 $this->campoLista("sigla_uf", "Estado", $listaEstado, $this->sigla_uf, false, false, false, false, $disabled, true);
                 $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", true, false, false, "", "", "", "", $disabled, true);
                 $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "20", true, false, false, "", "", "", "", $disabled, true);
                 $this->campoLista("idtlog", "Tipo Logradouro", $listaTLog, $this->idtlog, false, false, false, false, $disabled, true);
                 $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", true, false, false, "", "", "", "", $disabled, true);
                 $this->campoTexto("complemento", "Complemento", $this->complemento, "22", "20", false, false, false);
                 $this->campoNumero("numero", "N&uacute;mero", $this->numero, "6", "6", false);
                 $this->campoNumero("andar", "Andar", $this->andar, "2", "2", false);
             }
             $this->campoNumero("p_ddd_telefone_1", "DDD Telefone 1", $this->p_ddd_telefone_1, 2, 2, false);
             $this->campoNumero("p_telefone_1", "Telefone 1", $this->p_telefone_1, 10, 15, false);
             $this->campoNumero("p_ddd_telefone_2", "DDD Telefone 2", $this->p_ddd_telefone_2, 2, 2, false);
             $this->campoNumero("p_telefone_2", "Telefone", $this->p_telefone_2, 10, 15, false);
             $this->campoNumero("p_ddd_telefone_fax", "DDD Fax", $this->p_ddd_telefone_fax, 2, 2, false);
             $this->campoNumero("p_telefone_fax", "Fax", $this->p_telefone_fax, 10, 15, false);
             $this->campoTexto("p_http", "Site", $this->p_http, "50", "255", false);
             $this->campoTexto("p_email", "E-mail", $this->p_email, "50", "255", false);
             //				}
             //				else
             //				{
             //					$this->mensagem = "nop";
             //				}
             $this->passou = true;
             $this->campoOculto("passou", $this->passou);
         }
         //			else if ( $this->passo == 3 )
         //			{
         //
         //
         //
         //			}
         if ($_POST["escola_curso"]) {
             $this->escola_curso = unserialize(urldecode($_POST["escola_curso"]));
         }
         if (is_numeric($this->cod_escola) && !$_POST) {
             $obj = new clsPmieducarEscolaCurso($this->cod_escola);
             $registros = $obj->lista($this->cod_escola);
             if ($registros) {
                 foreach ($registros as $campo) {
                     $this->escola_curso[$campo["ref_cod_curso"]] = $campo["ref_cod_curso"];
                 }
             }
         }
         if ($_POST["ref_cod_curso"]) {
             $this->escola_curso[$_POST["ref_cod_curso"]] = $_POST["ref_cod_curso"];
             unset($this->ref_cod_curso);
         }
         $this->campoQuebra();
         $this->campoOculto("excluir_curso", "");
         unset($aux);
         if ($this->escola_curso) {
             //				echo "<pre>";print_r($this->escola_curso);
             foreach ($this->escola_curso as $curso) {
                 if ($this->excluir_curso == $curso) {
                     unset($this->escola_curso[$curso]);
                     // = null;
                     $this->excluir_curso = null;
                 } else {
                     $obj_curso = new clsPmieducarCurso($curso);
                     $obj_curso_det = $obj_curso->detalhe();
                     $nm_curso = $obj_curso_det["nm_curso"];
                     $this->campoTextoInv("ref_cod_curso_{$curso}", "", $nm_curso, 30, 255, false, false, false, "", "<a href='#' onclick=\"getElementById('excluir_curso').value = '{$curso}'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bola_xis.gif' title='Excluir' border=0></a>");
                     $aux[$curso] = $curso;
                 }
             }
             unset($this->escola_curso);
             $this->escola_curso = $aux;
         }
         $this->campoOculto("escola_curso", serialize($this->escola_curso));
         $opcoes = array("" => "Selecione");
         if (class_exists("clsPmieducarCurso")) {
             /*$todos_cursos = "curso = new Array();\n";
             		$objTemp = new clsPmieducarCurso();
             		$objTemp->setOrderby("nm_curso");
             		$lista = $objTemp->lista( null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1 );
             		if ( is_array( $lista ) && count( $lista ) )
             		{
             			foreach ( $lista as $registro )
             			{
             				$todos_cursos .= "curso[curso.length] = new Array({$registro["cod_curso"]},'{$registro["nm_curso"]}', {$registro["ref_cod_instituicao"]});\n";
             			}
             		}
             		echo "<script>{$todos_cursos}</script>";*/
             // EDITAR
             if ($this->cod_escola || $this->ref_cod_instituicao) {
                 $objTemp = new clsPmieducarCurso();
                 $objTemp->setOrderby("nm_curso");
                 $lista = $objTemp->lista(null, 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 (is_array($lista) && count($lista)) {
                     foreach ($lista as $registro) {
                         $opcoes["{$registro['cod_curso']}"] = "{$registro['nm_curso']}";
                     }
                 }
             }
         } else {
             echo "<!--\nErro\nClasse clsPmieducarCurso n&atilde;o encontrada\n-->";
             $opcoes = array("" => "Erro na gera&ccedil;&atilde;o");
         }
         if ($aux) {
             $this->campoLista("ref_cod_curso", "Curso", $opcoes, $this->ref_cod_curso, "", false, "", "<a href='#' onclick=\"getElementById('incluir_curso').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>", false, false);
         } else {
             $this->campoLista("ref_cod_curso", "Curso", $opcoes, $this->ref_cod_curso, "", false, "", "<a href='#' onclick=\"getElementById('incluir_curso').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>");
         }
         $this->campoOculto("incluir_curso", "");
         $this->campoQuebra();
     }
 }
Exemplo n.º 16
0
 function Gerar()
 {
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet", false);
     if (!$this->busca_pessoa) {
         $parametros = new clsParametrosPesquisas();
         $parametros->setSubmit(1);
         $parametros->setPessoa('F');
         $parametros->setPessoaCampo("cod_pessoa_fj");
         $parametros->setPessoaNovo('S');
         $parametros->setPessoaTela("window");
         $parametros->setCodSistema(8);
         $parametros->adicionaCampoTexto("busca_pessoa", "cpf");
         $this->campoCpf("busca_pessoa", "CPF", $this->busca_pessoa, true, "<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_popless( 'pesquisa_pessoa_lst.php?campos=" . $parametros->serializaCampos() . "', 'busca_pessoa' )\">");
         $this->campoOculto("cod_grupo", $this->cod_grupo);
         $this->campoOculto("cod_pessoa_fj", "");
     } else {
         $this->nome_url_cancelar = "Cancelar";
         $this->url_cancelar = "otopic_meus_grupos_det.php?cod_grupo={$this->cod_grupo}";
         $this->campoOculto("cod_grupo", $this->cod_grupo);
         $this->campoOculto("cod_pessoa_fj", $this->cod_pessoa_fj);
         $this->campoTexto("nm_pessoa", "Nome", $this->nm_pessoa, "50", "255", true);
         if ($this->id_federal) {
             $this->campoCpf("id_federal", "CPF", int2CPF($this->id_federal), "50", "", true);
         }
         $lista_sexos = array();
         $lista_sexos[""] = "Escolha uma op&ccedil;&atilde;o...";
         $lista_sexos["M"] = "Masculino";
         $lista_sexos["F"] = "Feminino";
         $this->campoLista("sexo", "Sexo", $lista_sexos, $this->sexo);
         // Detalhes do Endereço
         $objTipoLog = new clsTipoLogradouro();
         $listaTipoLog = $objTipoLog->lista();
         $listaTLog = array("0" => "Selecione");
         if ($listaTipoLog) {
             foreach ($listaTipoLog as $tipoLog) {
                 $listaTLog[$tipoLog['idtlog']] = $tipoLog['descricao'];
             }
         }
         $objUf = new clsUf();
         $listauf = $objUf->lista();
         $listaEstado = array("0" => "Selecione");
         if ($listauf) {
             foreach ($listauf as $uf) {
                 $listaEstado[$uf['sigla_uf']] = $uf['sigla_uf'];
             }
         }
         $this->campoOculto("idbai", $this->idbai);
         $this->campoOculto("idlog", $this->idlog);
         $this->campoOculto("cep", $this->cep);
         if ($this->idlog && $this->idbai && $this->cep && $this->cod_pessoa_fj) {
             $this->campoCep("cep_", "CEP", $this->cep, false, "-", "&nbsp;<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f('pesquisa_cep.php', 'enderecos')\" style=\"cursor: hand;\">", true);
             $this->campoLista("idtlog", "Tipo Logradouro", $listaTLog, $this->idtlog, false, false, false, false, true);
             $this->campoTextoInv("logradouro", "Logradouro", $this->logradouro, "50", "255", false);
             $this->campoTextoInv("cidade", "Cidade", $this->cidade, "50", "255", false);
             $this->campoTextoInv("bairro", "Bairro", $this->bairro, "50", "255", false);
             $this->campoTexto("complemento", "Complemento", $this->complemento, "50", "255", false);
             $this->campoTexto("numero", "Número", $this->numero, "10", "10", false);
             $this->campoTexto("letra", "Letra", $this->letra, "1", "1", false);
             $this->campoTexto("apartamento", "Número Apartametno", $this->apartamento, "6", "6", false);
             $this->campoTexto("bloco", "Bloco", $this->bloco, "20", "20", false);
             $this->campoTexto("andar", "Andar", $this->andar, "2", "2", false);
             $this->campoLista("sigla_uf", "Estado", $listaEstado, $this->sigla_uf, false, false, false, false, true);
         } elseif ($this->cod_pessoa_fj) {
             $this->campoCep("cep_", "CEP", $this->cep, false, "-", "&nbsp;<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f('pesquisa_cep.php', 'enderecos')\" style=\"cursor: hand;\">", false);
             $this->campoLista("idtlog", "Tipo Logradouro", $listaTLog, $this->idtlog);
             $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", false);
             $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", false);
             $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "255", false);
             $this->campoTexto("complemento", "Complemento", $this->complemento, "50", "255", false);
             $this->campoTexto("numero", "Número", $this->numero, "10", "10", false);
             $this->campoTexto("letra", "Letra", $this->letra, "1", "1", false);
             $this->campoTexto("apartamento", "Número Apartametno", $this->apartamento, "6", "6", false);
             $this->campoTexto("bloco", "Bloco", $this->bloco, "20", "20", false);
             $this->campoTexto("andar", "Andar", $this->andar, "2", "2", false);
             $this->campoLista("sigla_uf", "Estado", $listaEstado, $this->sigla_uf);
         } else {
             $this->campoCep("cep_", "CEP", $this->cep, false, "-", "&nbsp;<img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f('pesquisa_cep.php', 'enderecos')\" style=\"cursor: hand;\">", true);
             $this->campoLista("idtlog", "Tipo Logradouro", $listaTLog, $this->idtlog, false, false, false, false, true);
             $this->campoTextoInv("logradouro", "Logradouro", $this->logradouro, "50", "255", true);
             $this->campoTextoInv("cidade", "Cidade", $this->cidade, "50", "255", true);
             $this->campoTextoInv("bairro", "Bairro", $this->bairro, "50", "255", true);
             $this->campoTextoInv("complemento", "Complemento", $this->complemento, "50", "255", false);
             $this->campoTextoInv("numero", "Número", $this->numero, "10", "10", false);
             $this->campoTextoInv("letra", "Letra", $this->letra, "1", "1", false);
             $this->campoTexto("apartamento", "Número Apartametno", $this->apartamento, "6", "6", false);
             $this->campoTexto("bloco", "Bloco", $this->bloco, "20", "20", false);
             $this->campoTexto("andar", "Andar", $this->andar, "2", "2", false);
             $this->campoLista("sigla_uf", "Estado", $listaEstado, $this->sigla_uf, false, false, false, false, true);
         }
         $this->campoTexto("ddd_telefone_1", "DDD Telefone 1", $this->ddd_telefone_1, "3", "2", false);
         $this->campoTexto("telefone_1", "Telefone 1", $this->telefone_1, "10", "15", false);
         $this->campoTexto("ddd_telefone_2", "DDD Telefone 2", $this->ddd_telefone_2, "3", "2", false);
         $this->campoTexto("telefone_2", "Telefone", $this->telefone_2, "10", "15", false);
         $this->campoTexto("ddd_telefone_mov", "DDD Celular", $this->ddd_telefone_mov, "3", "2", false);
         $this->campoTexto("telefone_mov", "Celular", $this->telefone_mov, "10", "15", false);
         $this->campoTexto("ddd_telefone_fax", "DDD Fax", $this->ddd_telefone_fax, "3", "2", false);
         $this->campoTexto("telefone_fax", "Fax", $this->telefone_fax, "10", "15", false);
         $this->campoTexto("http", "Site", $this->http, "50", "255", false);
         $this->campoTexto("email", "E-mail", $this->email, "50", "255", false);
         /***********************
         			Documentos
         			***********************/
         if ($this->cod_pessoa_fj) {
             $this->campoRotulo("documentos", "<b><i>Documentos</i></b>", "<a href='#' onclick=\" openPage('adicionar_documentos_cad.php?id_pessoa={$this->cod_pessoa_fj}','400','400','yes', '10','10'); \"><img src='imagens/nvp_bot_ad_doc.png' border='0'></a>");
         }
     }
 }
Exemplo n.º 17
0
 function Gerar()
 {
     // primary keys
     $this->campoOculto("cod_cliente", $this->cod_cliente);
     $this->campoOculto("requisita_senha", "0");
     $opcoes = array("" => "Pesquise a pessoa clicando na lupa ao lado");
     if ($this->ref_idpes) {
         $objTemp = new clsPessoaFisica($this->ref_idpes);
         $detalhe = $objTemp->detalhe();
         $opcoes["{$detalhe["idpes"]}"] = $detalhe["nome"];
     }
     // Caso o cliente não exista, exibe um campo de pesquisa, senão, mostra um rótulo
     if (!$this->cod_cliente) {
         $parametros = new clsParametrosPesquisas();
         $parametros->setSubmit(0);
         $parametros->adicionaCampoSelect('ref_idpes', 'idpes', 'nome');
         $parametros->setPessoa('F');
         $parametros->setPessoaCPF('N');
         $parametros->setCodSistema(null);
         $parametros->setPessoaNovo('S');
         $parametros->setPessoaTela('frame');
         $this->campoListaPesq('ref_idpes', 'Cliente', $opcoes, $this->ref_idpes, 'pesquisa_pessoa_lst.php', '', FALSE, '', '', NULL, NULL, '', FALSE, $parametros->serializaCampos());
     } else {
         $this->campoOculto('ref_idpes', $this->ref_idpes);
         $this->campoRotulo('nm_cliente', 'Cliente', $detalhe['nome']);
     }
     // text
     $this->campoNumero("login", "Login", $this->login_, 9, 9, false);
     $this->campoSenha("senha", "Senha", $this->senha_, false);
     if ($this->cod_cliente && $this->ref_cod_biblioteca) {
         $db = new clsBanco();
         // Cria campo oculto com o ID da biblioteca atual ao qual usuário está cadastrado
         $this->ref_cod_biblioteca_atual = $this->ref_cod_biblioteca;
         $this->campoOculto("ref_cod_biblioteca_atual", $this->ref_cod_biblioteca_atual);
         //$this->ref_cod_biblioteca   = $db->CampoUnico("SELECT cod_biblioteca  FROM pmieducar.biblioteca, pmieducar.cliente_tipo_cliente ctc, pmieducar.cliente_tipo ct WHERE ref_cod_cliente = '$this->cod_cliente' AND ref_cod_cliente_tipo = cod_cliente_tipo AND ct.ref_cod_biblioteca = cod_biblioteca AND ctc.ref_cod_biblioteca = {$this->ref_cod_biblioteca}");
         // obtem o codigo do tipo de cliente, apartir da tabela cliente_tipo_cliente
         $this->ref_cod_cliente_tipo = $db->CampoUnico("SELECT ref_cod_cliente_tipo FROM pmieducar.cliente_tipo_cliente WHERE ref_cod_cliente = '{$this->cod_cliente}'");
     }
     $this->inputsHelper()->dynamic(array('instituicao', 'escola', 'biblioteca', 'bibliotecaTipoCliente'));
 }
Exemplo n.º 18
0
 function Gerar()
 {
     $this->fexcluir = FALSE;
     $this->campoTabInicio('educar_cad', '', TRUE);
     $this->campoOculto('retorno', $this->retorno);
     $this->campoOculto('bloqueado', 1);
     if (is_int((int) $this->cpf) && !empty($this->cpf)) {
         $cpf = int2CPF($this->cpf);
     } else {
         $cpf = $this->cpf;
     }
     if (!$this->cod_aluno) {
         $this->campoAdicionaTab('CPF', $this->tab_habilitado);
         $opcoes = array('' => 'Pesquise a pessoa clicando na lupa ao lado');
         $this->campoCpf('cpf_', 'CPF', $cpf, FALSE, '<img border="0" onclick="pesquisa_valores_popless(\'educar_pesquisa_aluno_lst2.php?campo1=ref_idpes&campo3=cpf&campo4=cpf_\', \'nome\')" src="imagens/lupa.png">');
     }
     $this->campoOculto('ref_idpes', $this->ref_idpes);
     $this->campoAdicionaTab('Dados Pessoais', $this->tab_habilitado);
     if ($this->cod_aluno) {
         $obj_matricula = new clsPmieducarMatricula();
         $lst_matricula = $obj_matricula->lista(NULL, NULL, NULL, NULL, NULL, NULL, $this->cod_aluno);
     }
     if (!empty($this->ref_idpes)) {
         $obj_aluno = new clsPmieducarAluno();
         $lista_aluno = $obj_aluno->lista(NULL, NULL, NULL, NULL, NULL, $this->ref_idpes, NULL, NULL, NULL, NULL);
         if ($lista_aluno) {
             $det_aluno = array_shift($lista_aluno);
         }
     }
     if ($det_aluno['cod_aluno']) {
         $this->cod_aluno = $det_aluno['cod_aluno'];
         $this->ref_cod_aluno_beneficio = $det_aluno['ref_cod_aluno_beneficio'];
         $this->ref_cod_religiao = $det_aluno['ref_cod_religiao'];
         $this->caminho_foto = $det_aluno['caminho_foto'];
     }
     $this->campoOculto('cod_aluno', $this->cod_aluno);
     $this->campoOculto('ref_idpes', $this->ref_idpes);
     if ($this->ref_idpes != 'NULL') {
         if ($this->ref_idpes) {
             $obj_pessoa = new clsPessoaFj($this->ref_idpes);
             $det_pessoa = $obj_pessoa->detalhe();
             $obj_fisica = new clsFisica($this->ref_idpes);
             $det_fisica = $obj_fisica->detalhe();
             $obj_fisica_raca = new clsCadastroFisicaRaca($this->ref_idpes);
             $det_fisica_raca = $obj_fisica_raca->detalhe();
             $this->ref_cod_raca = $det_fisica_raca['ref_cod_raca'];
             $this->nome = $det_pessoa['nome'];
             $this->email = $det_pessoa['email'];
             $this->ideciv = $det_fisica['ideciv']->ideciv;
             $this->data_nascimento = dataToBrasil($det_fisica['data_nasc']);
             $this->cpf = $det_fisica['cpf'];
             $obj_documento = new clsDocumento($this->ref_idpes);
             $obj_documento_det = $obj_documento->detalhe();
             $this->ddd_fone_1 = $det_pessoa['ddd_1'];
             $this->fone_1 = $det_pessoa['fone_1'];
             $this->ddd_fone_2 = $det_pessoa['ddd_2'];
             $this->fone_2 = $det_pessoa['fone_2'];
             $this->ddd_fax = $det_pessoa['ddd_fax'];
             $this->fone_fax = $det_pessoa['fone_fax'];
             $this->ddd_mov = $det_pessoa['ddd_mov'];
             $this->fone_mov = $det_pessoa['fone_mov'];
             $this->email = $det_pessoa['email'];
             $this->url = $det_pessoa['url'];
             $this->sexo = $det_fisica['sexo'];
             $this->nacionalidade = $det_fisica['nacionalidade'];
             $this->idmun_nascimento = $det_fisica['idmun_nascimento']->idmun;
             $detalhe_pais_origem = $det_fisica['idpais_estrangeiro']->detalhe();
             $this->pais_origem = $detalhe_pais_origem['idpais'];
             $this->ref_idpes_responsavel = $det_fisica['idpes_responsavel'];
             $this->idpes_pai = $det_fisica['idpes_pai'];
             $this->idpes_mae = $det_fisica['idpes_mae'];
             $obj_aluno = new clsPmieducarAluno(NULL, NULL, NULL, NULL, NULL, $this->ref_idpes);
             $detalhe_aluno = $obj_aluno->detalhe();
             if ($detalhe_aluno) {
                 $this->nm_pai = $detalhe_aluno['nm_pai'];
                 $this->nm_mae = $detalhe_aluno['nm_mae'];
             }
             $obj_endereco = new clsPessoaEndereco($this->ref_idpes);
             if ($obj_endereco_det = $obj_endereco->detalhe()) {
                 $this->isEnderecoExterno = 0;
                 $this->id_cep = $obj_endereco_det['cep']->cep;
                 $this->id_bairro = $obj_endereco_det['idbai']->idbai;
                 $this->id_logradouro = $obj_endereco_det['idlog']->idlog;
                 $this->numero = $obj_endereco_det['numero'];
                 $this->letra = $obj_endereco_det['letra'];
                 $this->complemento = $obj_endereco_det['complemento'];
                 $this->andar = $obj_endereco_det['andar'];
                 $this->apartamento = $obj_endereco_det['apartamento'];
                 $this->bloco = $obj_endereco_det['bloco'];
                 $this->ref_idtlog = $obj_endereco_det['idtlog'];
                 $this->nm_bairro = $obj_endereco_det['bairro'];
                 $this->nm_logradouro = $obj_endereco_det['logradouro'];
                 $this->cep_ = int2CEP($this->id_cep);
             } else {
                 $obj_endereco = new clsEnderecoExterno($this->ref_idpes);
                 if ($obj_endereco_det = $obj_endereco->detalhe()) {
                     $this->isEnderecoExterno = 1;
                     $this->id_cep = $obj_endereco_det['cep'];
                     $this->cidade = $obj_endereco_det['cidade'];
                     $this->nm_bairro = $obj_endereco_det['bairro'];
                     $this->nm_logradouro = $obj_endereco_det['logradouro'];
                     $this->id_bairro = NULL;
                     $this->id_logradouro = NULL;
                     $this->numero = $obj_endereco_det['numero'];
                     $this->letra = $obj_endereco_det['letra'];
                     $this->complemento = $obj_endereco_det['complemento'];
                     $this->andar = $obj_endereco_det['andar'];
                     $this->apartamento = $obj_endereco_det['apartamento'];
                     $this->bloco = $obj_endereco_det['bloco'];
                     $this->ref_idtlog = $this->idtlog = $obj_endereco_det['idtlog']->idtlog;
                     $this->ref_sigla_uf = $this->ref_sigla_uf_ = $obj_endereco_det['sigla_uf']->sigla_uf;
                     $this->cep_ = int2CEP($this->id_cep);
                 }
             }
             $this->zona_localizacao = $obj_endereco_det['zona_localizacao'];
         }
     }
     if ($this->isEnderecoExterno == 0) {
         $obj_bairro = new clsBairro($this->id_bairro);
         $this->cep_ = int2CEP($this->id_cep);
         $obj_bairro_det = $obj_bairro->detalhe();
         if ($obj_bairro_det) {
             $this->nm_bairro = $obj_bairro_det["nome"];
         }
         $obj_log = new clsLogradouro($this->id_logradouro);
         $obj_log_det = $obj_log->detalhe();
         if ($obj_log_det) {
             $this->nm_logradouro = $obj_log_det["nome"];
             $this->ref_idtlog = $obj_log_det["idtlog"]->idtlog;
             $obj_mun = new clsMunicipio($obj_log_det["idmun"]);
             $det_mun = $obj_mun->detalhe();
             if ($det_mun) {
                 $this->cidade = ucfirst(strtolower($det_mun["nome"]));
             }
             $this->ref_sigla_uf = $this->ref_sigla_uf_ = $det_mun['sigla_uf']->sigla_uf;
         }
         $obj_bairro = new clsBairro($obj_endereco_det["ref_idbai"]);
         $obj_bairro_det = $obj_bairro->detalhe();
         if ($obj_bairro_det) {
             $this->nm_bairro = $obj_bairro_det["nome"];
         }
     }
     $this->campoTexto('nome', 'Nome', $this->nome, 30, 100, TRUE);
     if ($this->cpf && $this->ref_idpes) {
         if (!$this->cpf) {
             $this->campoRotulo('cpf_2', 'CPF', $this->cpf);
         } else {
             $this->campoRotulo('cpf_2', 'CPF', int2CPF($this->cpf));
         }
     } else {
         if (!$this->cpf) {
             $this->campoCpf('cpf_2', 'CPF', $this->cpf);
             $this->campoOculto('sem_cpf', 1);
         } else {
             $this->campoCpf('cpf_2', 'CPF', int2CPF($this->cpf), FALSE);
         }
     }
     $this->campoData('data_nascimento', 'Data de Nascimento', $this->data_nascimento, TRUE);
     $lista = array('' => 'Selecione', 'F' => 'Feminino', 'M' => 'Masculino');
     $this->campoLista('sexo', 'Sexo', $lista, $this->sexo);
     $obj_estado_civil = new clsEstadoCivil();
     $obj_estado_civil_lista = $obj_estado_civil->lista();
     $lista_estado_civil = array('' => 'Selecione');
     if ($obj_estado_civil_lista) {
         foreach ($obj_estado_civil_lista as $estado_civil) {
             $lista_estado_civil[$estado_civil['ideciv']] = $estado_civil['descricao'];
         }
     }
     $this->campoLista('ideciv', 'Estado Civil', $lista_estado_civil, $this->ideciv);
     $obj_religiao = new clsPmieducarReligiao();
     $obj_religia_lista = $obj_religiao->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     $lista_religiao = array('NULL' => 'Selecione');
     if ($obj_religia_lista) {
         foreach ($obj_religia_lista as $religiao) {
             $lista_religiao[$religiao["cod_religiao"]] = $religiao["nm_religiao"];
         }
     }
     $this->campoLista('ref_cod_religiao', 'Religi&atilde;o', $lista_religiao, $this->ref_cod_religiao, '', FALSE, '', '', '', FALSE);
     $opcoes_raca = array('' => 'Selecione');
     $obj_raca = new clsCadastroRaca();
     $lst_raca = $obj_raca->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, TRUE);
     if ($lst_raca) {
         foreach ($lst_raca as $raca) {
             $opcoes_raca[$raca['cod_raca']] = $raca['nm_raca'];
         }
     }
     $this->campoLista('ref_cod_raca', 'Ra&ccedil;a', $opcoes_raca, $this->ref_cod_raca, '', FALSE, '', '', '', FALSE);
     $this->campoQuebra2('#224488');
     if ($this->idpes_pai) {
         $obj_pessoa_pai = new clsPessoaFj($this->idpes_pai);
         $det_pessoa_pai = $obj_pessoa_pai->detalhe();
         if ($det_pessoa_pai) {
             $this->nm_pai = $det_pessoa_pai['nome'];
             // cpf
             $obj_cpf = new clsFisica($this->idpes_pai);
             $det_cpf = $obj_cpf->detalhe();
             if ($det_cpf['cpf']) {
                 $this->cpf_pai = int2CPF($det_cpf['cpf']);
             }
         }
     }
     if ($this->idpes_mae) {
         $obj_pessoa_mae = new clsPessoaFj($this->idpes_mae);
         $det_pessoa_mae = $obj_pessoa_mae->detalhe();
         if ($det_pessoa_mae) {
             $this->nm_mae = $det_pessoa_mae['nome'];
             //cpf
             $obj_cpf = new clsFisica($this->idpes_mae);
             $det_cpf = $obj_cpf->detalhe();
             if ($det_cpf['cpf']) {
                 $this->cpf_mae = int2CPF($det_cpf['cpf']);
             }
         }
     }
     $this->campoTexto('nm_pai', 'Nome do Pai', $this->nm_pai, 30, 255, FALSE);
     $this->campoCpf('cpf_pai', 'CPF pai', $this->cpf_pai, FALSE, $this->cpf_pai ? '' : ' &nbsp; &nbsp; (preencher sempre que possível)');
     $this->campoTexto('nm_mae', 'Nome da M&atilde;e', $this->nm_mae, 30, 255, FALSE);
     $this->campoCpf('cpf_mae', 'CPF mãe', $this->cpf_mae, FALSE, $this->cpf_mae ? '' : ' &nbsp; &nbsp; (preencher sempre que possível)');
     $lista = array('' => 'Responsável');
     if ($this->ref_idpes_responsavel != 'NULL') {
         $obj_pessoa_resp = new clsPessoaFj($this->ref_idpes_responsavel);
         $det_pessoa_resp = $obj_pessoa_resp->detalhe();
         if ($det_pessoa_resp) {
             $lista[$det_pessoa_resp['idpes']] = $det_pessoa_resp['nome'];
         }
     }
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(0);
     $parametros->adicionaCampoSelect('ref_idpes_responsavel', 'idpes', 'nome');
     $parametros->setPessoa('F');
     $parametros->setPessoaNovo('S');
     $parametros->setPessoaCPF('N');
     $parametros->setPessoaTela('frame');
     $parametros->setCodSistema(1);
     $this->campoListaPesq('ref_idpes_responsavel', 'Responsavel', $lista, $this->ref_idpes_responsavel, 'pesquisa_pessoa_lst.php', '', FALSE, '', '', NULL, NULL, '', FALSE, $parametros->serializaCampos(), FALSE);
     $this->campoQuebra2('#224488');
     if ($this->tipo_responsavel) {
         if ($this->nm_pai) {
             $this->tipo_responsavel = 'p';
         } elseif ($this->nm_mae) {
             $this->tipo_responsavel = 'm';
         } elseif ($this->ref_idpes_responsavel) {
             $this->tipo_responsavel = 'r';
         }
     }
     $opcoes = array('p' => 'Pai', 'm' => 'M&atilde;e', 'r' => 'Respons&aacute;vel');
     $this->campoRadio('tipo_responsavel', 'Respons&aacute;vel', $opcoes, $this->tipo_responsavel);
     $this->campoQuebra2('#224488');
     $disabled = $this->isEnderecoExterno ? FALSE : TRUE;
     $this->campoOculto('isEnderecoExterno', $this->isEnderecoExterno);
     $urlPesquisaCep = 'educar_pesquisa_cep_log_bairro.php?' . 'campo1=nm_bairro&campo2=id_bairro&campo3=id_cep&campo4=nm_logradouro&' . 'campo5=id_logradouro&campo6=ref_sigla_uf&campo7=cidade&' . 'campo8=ref_idtlog_&campo9=isEnderecoExterno&campo10=cep_&' . 'campo11=ref_sigla_uf_&campo12=ref_idtlog&campo13=id_cidade&' . 'campo14=zona_localizacao';
     $urlPesquisaCep = sprintf("<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'%s\\'></iframe>');\">", $urlPesquisaCep);
     $this->campoCep('cep_', 'CEP', $this->cep_, TRUE, '-', $urlPesquisaCep, $disabled);
     $this->campoTexto('cidade', 'Cidade', $this->cidade, 30, 255, TRUE, FALSE, TRUE, '', '', '', '', $disabled);
     $obj_uf = new clsUf(FALSE, FALSE, 1);
     $lst_uf = $obj_uf->lista(FALSE, FALSE, FALSE, FALSE, FALSE, 'sigla_uf');
     $array_uf = array('' => 'Selecione um estado');
     foreach ($lst_uf as $uf) {
         $array_uf[$uf['sigla_uf']] = $uf['nome'];
     }
     $this->campoLista('ref_sigla_uf_', ' &nbsp; Estado', $array_uf, $this->ref_sigla_uf, '', FALSE, '', '', $disabled);
     $this->campoTexto('nm_bairro', 'Bairro', $this->nm_bairro, 30, 255, TRUE, FALSE, FALSE, '', '', '', '', $disabled);
     $tipo_logradouro_array = array('' => 'Tipo de Logradouro');
     $obj_tipo_logradouro = new clsTipoLogradouro();
     $obj_tipo_logradouro_lista = $obj_tipo_logradouro->lista();
     if ($obj_tipo_logradouro_lista) {
         foreach ($obj_tipo_logradouro_lista as $key => $tipo_log) {
             $tipo_logradouro_array[$tipo_log["idtlog"]] = $tipo_log["descricao"];
         }
     }
     $this->campoLista('ref_idtlog', 'Logradouro', $tipo_logradouro_array, $this->ref_idtlog, '', TRUE, '', '', $this->isEnderecoExterno ? FALSE : TRUE, TRUE);
     $this->campoTexto('nm_logradouro', 'Logradouro', $this->nm_logradouro, 30, 255, TRUE, FALSE, FALSE, '', '', '', '', $disabled);
     $zl = App_Model_ZonaLocalizacao::getInstance();
     $this->campoLista('zona_localizacao', 'Zona Localização', $zl->getEnums(), $this->zona_localizacao, FALSE, FALSE, FALSE, FALSE, $disabled);
     $this->campoNumero('numero', 'N&uacute;mero', $this->numero, 4, 6, FALSE, '', '', FALSE, FALSE, TRUE);
     $this->campoTexto('letra', ' &nbsp; Letra', $this->letra, 4, 1, FALSE);
     $this->campoTexto('complemento', 'Complemento', $this->complemento, 30, 50, FALSE);
     $this->campoTexto('bloco', 'Bloco', $this->bloco, 30, 50, FALSE);
     $this->campoNumero('andar', 'Andar', $this->andar, 4, 2, FALSE, '', '', FALSE, FALSE, TRUE);
     $this->campoNumero('apartamento', ' &nbsp; Apartamento', $this->apartamento, 4, 6, FALSE);
     $this->campoLista('nacionalidade', 'Nacionalidade', $lista_nacionalidade, $this->nacionalidade, 'tmpObj = document.getElementById("pais_origem"); if(this.value != 1) { tmpObj.disabled = false; } else { tmpObj.selectedIndex = 27; tmpObj.disabled = true; }', TRUE, '', '', '', FALSE);
     $lista_mun_nasc = array('NULL' => 'Selecione a cidade');
     $obj_mun_nasc = new clsMunicipio($this->idmun_nascimento);
     $det_mun_nasc = $obj_mun_nasc->detalhe();
     if ($det_mun_nasc["nome"]) {
         $lista_mun_nasc[$det_mun_nasc["idmun"]] = $det_mun_nasc["nome"];
     }
     $this->campoListaPesq('idmun_nascimento', 'Naturalidade', $lista_mun_nasc, $this->idmun_nascimento, 'educar_pesquisa_municipio_lst.php?campo1=idmun_nascimento', '', FALSE, '', '', NULL, NULL, '', TRUE);
     $this->nacionalidade = $this->nacionalidade ? $this->nacionalidade : 1;
     $lista_nacionalidade = array('NULL' => 'Selecione', '1' => 'Brasileiro', '2' => 'Naturalizado Brasileiro', '3' => 'Estrangeiro');
     $this->campoLista('nacionalidade', 'Nacionalidade', $lista_nacionalidade, $this->nacionalidade, 'tmpObj = document.getElementById("pais_origem"); if(this.value != 1) { tmpObj.disabled = false; } else { tmpObj.selectedIndex = 27; tmpObj.disabled = true; }', TRUE, '', '', '', FALSE);
     $lista_pais_origem = array('NULL' => 'País de origem');
     $obj_pais = new clsPais();
     $obj_pais_lista = $obj_pais->lista(NULL, NULL, NULL, '', '', 'nome asc');
     if ($obj_pais_lista) {
         foreach ($obj_pais_lista as $key => $pais) {
             $lista_pais_origem[$pais['idpais']] = $pais['nome'];
         }
     }
     // se a nacionalidade for "BRASILEIRO" seleciona o brasil e deixa inativo
     $this->pais_origem = $this->nacionalidade == 1 ? 1 : $this->pais_origem;
     $this->campoLista('pais_origem', ' &nbsp; País de Origem', $lista_pais_origem, $this->pais_origem, '', '', '', '', $this->nacionalidade == 1, FALSE);
     $this->campoQuebra2('#224488');
     // Transporte escolar
     $transporteMapper = new Transporte_Model_AlunoDataMapper();
     $transporte = NULL;
     try {
         $transporte = $transporteMapper->find(array($this->cod_aluno));
     } catch (Exception $e) {
     }
     $bit = App_Model_SimNao::getInstance();
     $this->campoLista('transporte_aluno', 'Transporte', $bit->getEnums(), !is_null($transporte) ? 1 : 0, 'transporteResponsavel();');
     $responsavel = Transporte_Model_Responsavel::getInstance();
     $this->campoLista('transporte_responsavel', 'Responsável', $responsavel->getEnums(), !is_null($transporte) ? $transporte->get('responsavel') : 0);
     $this->campoQuebra2('#224488');
     $obj_beneficio = new clsPmieducarAlunoBeneficio();
     $obj_beneficio_lista = $obj_beneficio->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     $lista_beneficio = array('NULL' => 'Selecione');
     if ($obj_beneficio_lista) {
         foreach ($obj_beneficio_lista as $beneficio) {
             $lista_beneficio[$beneficio['cod_aluno_beneficio']] = $beneficio['nm_beneficio'];
         }
     }
     $this->campoLista('ref_cod_aluno_beneficio', 'Benef&iacute;cio', $lista_beneficio, $this->ref_cod_aluno_beneficio, '', FALSE, '', '', FALSE, FALSE);
     $lista_analfabeto = array(1 => 'N&atilde;o', 0 => 'Sim');
     $this->campoLista('analfabeto', 'Alfabetizado', $lista_analfabeto, $this->analfabeto, '', FALSE, '', '', FALSE, FALSE);
     $this->campoNumero('ddd_fone_1', 'Telefone', $this->ddd_fone_1, 1, 3, FALSE, '', '', FALSE, FALSE, TRUE);
     $this->campoNumero('fone_1', 'Telefone', $this->fone_1, 11, 11);
     $this->campoNumero('ddd_mov', 'Celular', $this->ddd_mov, 1, 3, FALSE, '', '', FALSE, FALSE, TRUE);
     $this->campoNumero('fone_mov', 'Celular', $this->fone_mov, 11, 11);
     $this->campoEmail('email', 'Email', $this->email, 30, 255, FALSE);
     if (!empty($this->caminho_foto)) {
         $this->campoRotulo('foto_antiga_', 'Arquivo', sprintf('
       <img src="arquivos/educar/aluno/small/%s" border="0">
         <a href="javascript:void(0);" onclick="document.getElementById(\'foto_excluida\').value=1; setVisibility(\'tr_foto_antiga_\', false); setVisibility(\'tr_foto\', true);"><img src="imagens/nvp_bola_xis.gif" border="0"></a>', $this->caminho_foto));
     }
     $this->campoOculto('foto_excluida', 0);
     $this->campoArquivo('foto', 'Foto', '', '20', '', FALSE);
     $this->campoOculto('id_bairro', $this->id_bairro);
     $this->campoOculto('id_cep', $this->id_cep);
     $this->campoOculto('id_logradouro', $this->id_logradouro);
     $this->campoOculto('id_cidade', $this->id_cidade);
     $this->campoOculto('ref_idtlog_', $this->ref_idtlog);
     $this->campoOculto('ref_sigla_uf', $this->ref_sigla_uf);
     $this->campoTexto('nome', 'Nome', $this->nome, 30, 100, TRUE);
     if ($this->cpf && $this->ref_idpes) {
         if (!$this->cpf) {
             $this->campoRotulo('cpf_2', 'CPF', $this->cpf);
         } else {
             $this->campoRotulo('cpf_2', 'CPF', int2CPF($this->cpf));
         }
     } else {
         if (!$this->cpf) {
             $this->campoOculto('sem_cpf', 1);
         }
     }
     $this->campoData('data_nascimento', 'Data de Nascimento', $this->data_nascimento, TRUE);
     $lista = array('' => 'Selecione', 'F' => 'Feminino', 'M' => 'Masculino');
     $this->campoLista('sexo', 'Sexo', $lista, $this->sexo);
     $obj_estado_civil = new clsEstadoCivil();
     $obj_estado_civil_lista = $obj_estado_civil->lista();
     $lista_estado_civil = array('' => 'Selecione');
     if ($obj_estado_civil_lista) {
         foreach ($obj_estado_civil_lista as $estado_civil) {
             $lista_estado_civil[$estado_civil['ideciv']] = $estado_civil['descricao'];
         }
     }
     $this->campoLista('ideciv', 'Estado Civil', $lista_estado_civil, $this->ideciv);
     $obj_religiao = new clsPmieducarReligiao();
     $obj_religia_lista = $obj_religiao->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     $lista_religiao = array('NULL' => 'Selecione');
     if ($obj_religia_lista) {
         foreach ($obj_religia_lista as $religiao) {
             $lista_religiao[$religiao['cod_religiao']] = $religiao['nm_religiao'];
         }
     }
     $this->campoLista('ref_cod_religiao', 'Religi&atilde;o', $lista_religiao, $this->ref_cod_religiao, '', FALSE, '', '', '', FALSE);
     $opcoes_raca = array('' => 'Selecione');
     $obj_raca = new clsCadastroRaca();
     $lst_raca = $obj_raca->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, TRUE);
     if ($lst_raca) {
         foreach ($lst_raca as $raca) {
             $opcoes_raca[$raca['cod_raca']] = $raca['nm_raca'];
         }
     }
     $this->campoLista('ref_cod_raca', 'Ra&ccedil;a', $opcoes_raca, $this->ref_cod_raca, '', FALSE, '', '', '', FALSE);
     $this->campoQuebra2('#224488');
     if ($this->idpes_pai) {
         $obj_pessoa_pai = new clsPessoaFj($this->idpes_pai);
         $det_pessoa_pai = $obj_pessoa_pai->detalhe();
         if ($det_pessoa_pai) {
             $this->nm_pai = $det_pessoa_pai['nome'];
             // cpf
             $obj_cpf = new clsFisica($this->idpes_pai);
             $det_cpf = $obj_cpf->detalhe();
             if ($det_cpf['cpf']) {
                 $this->cpf_pai = int2CPF($det_cpf['cpf']);
             }
         }
     }
     if ($this->idpes_mae) {
         $obj_pessoa_mae = new clsPessoaFj($this->idpes_mae);
         $det_pessoa_mae = $obj_pessoa_mae->detalhe();
         if ($det_pessoa_mae) {
             $this->nm_mae = $det_pessoa_mae['nome'];
             // cpf
             $obj_cpf = new clsFisica($this->idpes_mae);
             $det_cpf = $obj_cpf->detalhe();
             if ($det_cpf['cpf']) {
                 $this->cpf_mae = int2CPF($det_cpf['cpf']);
             }
         }
     }
     $this->campoTexto('nm_pai', 'Nome do Pai', $this->nm_pai, 30, 255, FALSE);
     $this->campoCpf('cpf_pai', 'CPF pai', $this->cpf_pai, FALSE, $this->cpf_pai ? '' : ' &nbsp; &nbsp; (preencher sempre que possível)');
     $this->campoTexto('nm_mae', 'Nome da M&atilde;e', $this->nm_mae, 30, 255, FALSE);
     $this->campoCpf('cpf_mae', 'CPF mãe', $this->cpf_mae, FALSE, $this->cpf_mae ? '' : ' &nbsp; &nbsp; (preencher sempre que possível)');
     $lista = array('' => 'Responsável');
     if ($this->ref_idpes_responsavel != 'NULL') {
         $obj_pessoa_resp = new clsPessoaFj($this->ref_idpes_responsavel);
         $det_pessoa_resp = $obj_pessoa_resp->detalhe();
         if ($det_pessoa_resp) {
             $lista[$det_pessoa_resp['idpes']] = $det_pessoa_resp['nome'];
         }
     }
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(0);
     $parametros->adicionaCampoSelect('ref_idpes_responsavel', 'idpes', 'nome');
     $parametros->setPessoa('F');
     $parametros->setPessoaNovo('S');
     $parametros->setPessoaCPF('N');
     $parametros->setPessoaTela('frame');
     $parametros->setCodSistema(1);
     $this->campoListaPesq('ref_idpes_responsavel', 'Responsavel', $lista, $this->ref_idpes_responsavel, 'pesquisa_pessoa_lst.php', '', FALSE, '', '', NULL, NULL, '', FALSE, $parametros->serializaCampos(), FALSE);
     $this->campoQuebra2('#224488');
     if (!$this->tipo_responsavel) {
         if ($this->nm_pai) {
             $this->tipo_responsavel = 'p';
         } elseif ($this->nm_mae) {
             $this->tipo_responsavel = 'm';
         } elseif ($this->ref_idpes_responsavel) {
             $this->tipo_responsavel = 'r';
         }
     }
     $opcoes = array('' => 'Sem Responsável', 'p' => 'Pai', 'm' => 'M&atilde;e', 'r' => 'Respons&aacute;vel');
     $this->campoRadio('tipo_responsavel', 'Respons&aacute;vel', $opcoes, $this->tipo_responsavel);
     $this->campoQuebra2('#224488');
     $disabled = $this->isEnderecoExterno ? FALSE : TRUE;
     $this->campoOculto('isEnderecoExterno', $this->isEnderecoExterno);
     $this->campoCep('cep_', 'CEP', $this->cep_, TRUE, '-', $urlPesquisaCep, $disabled);
     $this->campoTexto('cidade', 'Cidade', $this->cidade, 30, 255, TRUE, FALSE, TRUE, '', '', '', '', $disabled);
     $obj_uf = new clsUf(FALSE, FALSE, 1);
     $lst_uf = $obj_uf->lista(FALSE, FALSE, FALSE, FALSE, FALSE, 'sigla_uf');
     $array_uf = array('' => 'Selecione um estado');
     foreach ($lst_uf as $uf) {
         $array_uf[$uf['sigla_uf']] = $uf['nome'];
     }
     $this->campoLista('ref_sigla_uf_', ' &nbsp; Estado', $array_uf, $this->ref_sigla_uf, '', FALSE, '', '', $disabled);
     $this->campoTexto('nm_bairro', 'Bairro', $this->nm_bairro, 30, 255, TRUE, FALSE, FALSE, '', '', '', '', $disabled);
     $tipo_logradouro_array = array('' => 'Tipo de Logradouro');
     $obj_tipo_logradouro = new clsTipoLogradouro();
     $obj_tipo_logradouro_lista = $obj_tipo_logradouro->lista();
     if ($obj_tipo_logradouro_lista) {
         foreach ($obj_tipo_logradouro_lista as $key => $tipo_log) {
             $tipo_logradouro_array[$tipo_log['idtlog']] = $tipo_log['descricao'];
         }
     }
     $this->campoLista('ref_idtlog', 'Logradouro', $tipo_logradouro_array, $this->ref_idtlog, '', TRUE, '', '', $this->isEnderecoExterno ? FALSE : TRUE, TRUE);
     $this->campoTexto('nm_logradouro', 'Logradouro', $this->nm_logradouro, 30, 255, TRUE, FALSE, FALSE, '', '', '', '', $disabled);
     $this->campoNumero('numero', 'N&uacute;mero', $this->numero, 4, 6, FALSE, '', '', FALSE, FALSE, TRUE);
     $this->campoTexto('letra', ' &nbsp; Letra', $this->letra, 4, 1, FALSE);
     $this->campoTexto('complemento', 'Complemento', $this->complemento, 30, 50, FALSE);
     $this->campoTexto('bloco', 'Bloco', $this->bloco, 30, 50, FALSE);
     $this->campoNumero('andar', 'Andar', $this->andar, 4, 2, FALSE, '', '', FALSE, FALSE, TRUE);
     $this->campoNumero('apartamento', ' &nbsp; Apartamento', $this->apartamento, 4, 6, FALSE);
     $lista_mun_nasc = array('NULL' => 'Selecione a cidade');
     $obj_mun_nasc = new clsMunicipio($this->idmun_nascimento);
     $det_mun_nasc = $obj_mun_nasc->detalhe();
     if ($det_mun_nasc['nome']) {
         $lista_mun_nasc[$det_mun_nasc['idmun']] = $det_mun_nasc['nome'];
     }
     $this->campoListaPesq('idmun_nascimento', 'Naturalidade', $lista_mun_nasc, $this->idmun_nascimento, 'educar_pesquisa_municipio_lst.php?campo1=idmun_nascimento', '', FALSE, '', '', NULL, NULL, '', TRUE);
     $this->nacionalidade = $this->nacionalidade ? $this->nacionalidade : 1;
     $lista_nacionalidade = array('NULL' => 'Selecione', '1' => 'Brasileiro', '2' => 'Naturalizado Brasileiro', '3' => 'Estrangeiro');
     $this->campoLista('nacionalidade', 'Nacionalidade', $lista_nacionalidade, $this->nacionalidade, "tmpObj = document.getElementById('pais_origem'); if (this.value!=1) { tmpObj.disabled = false; } else { tmpObj.selectedIndex = 27; tmpObj.disabled = true; }", TRUE, '', '', '', FALSE);
     $lista_pais_origem = array('NULL' => 'País de origem');
     $obj_pais = new clsPais();
     $obj_pais_lista = $obj_pais->lista(null, null, null, '', '', 'nome asc');
     if ($obj_pais_lista) {
         foreach ($obj_pais_lista as $key => $pais) {
             $lista_pais_origem[$pais['idpais']] = $pais['nome'];
         }
     }
     // se a nacionalidade for "BRASILEIRO" seleciona o brasil e deixa inativo
     $this->pais_origem = $this->nacionalidade == 1 ? 1 : $this->pais_origem;
     $this->campoLista('pais_origem', ' &nbsp; País de Origem', $lista_pais_origem, $this->pais_origem, '', '', '', '', $this->nacionalidade == 1, FALSE);
     $this->campoQuebra2('#224488');
     $obj_beneficio = new clsPmieducarAlunoBeneficio();
     $obj_beneficio_lista = $obj_beneficio->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     $lista_beneficio = array('NULL' => "Selecione");
     if ($obj_beneficio_lista) {
         foreach ($obj_beneficio_lista as $beneficio) {
             $lista_beneficio[$beneficio['cod_aluno_beneficio']] = $beneficio['nm_beneficio'];
         }
     }
     $this->campoLista('ref_cod_aluno_beneficio', 'Benef&iacute;cio', $lista_beneficio, $this->ref_cod_aluno_beneficio, '', FALSE, '', '', FALSE, FALSE);
     $lista_analfabeto = array(1 => 'N&atilde;o', 0 => 'Sim');
     $this->campoLista('analfabeto', 'Alfabetizado', $lista_analfabeto, $this->analfabeto, '', FALSE, '', '', FALSE, FALSE);
     $this->campoNumero('ddd_fone_1', 'Telefone', $this->ddd_fone_1, 1, 3, FALSE, '', '', FALSE, FALSE, TRUE);
     $this->campoNumero('fone_1', 'Telefone', $this->fone_1, 11, 11);
     $this->campoNumero('ddd_mov', 'Celular', $this->ddd_mov, 1, 3, FALSE, '', '', FALSE, FALSE, TRUE);
     $this->campoNumero('fone_mov', 'Celular', $this->fone_mov, 11, 11);
     $this->campoEmail('email', 'Email', $this->email, 30, 255, FALSE);
     if (!empty($this->caminho_foto)) {
         $this->campoRotulo('foto_antiga_', 'Arquivo', sprintf('<img src="arquivos/educar/aluno/small/%s" border="0"> <a href="javascript:void(0);" onclick="document.getElementById(\'foto_excluida\').value=1; setVisibility(\'tr_foto_antiga_\', false); setVisibility(\'tr_foto\',true);"> <img src="imagens/nvp_bola_xis.gif" border="0"></a>', $this->caminho_foto));
     }
     $this->campoArquivo('foto', 'Foto', '', '20', '', FALSE);
     $this->campoOculto('id_bairro', $this->id_bairro);
     $this->campoOculto('id_cep', $this->id_cep);
     $this->campoOculto('id_logradouro', $this->id_logradouro);
     $this->campoOculto('id_cidade', $this->id_cidade);
     $this->campoOculto('ref_idtlog_', $this->ref_idtlog);
     $this->campoOculto('ref_sigla_uf', $this->ref_sigla_uf);
     $this->campoOculto('cpf', $this->cpf);
     $this->campoAdicionaTab('Deficiência', $this->tab_habilitado);
     if ($this->ref_idpes) {
         $obj_deficiencia_pessoa = new clsCadastroFisicaDeficiencia();
         $obj_deficiencia_pessoa_lista = $obj_deficiencia_pessoa->lista($this->ref_idpes);
     }
     if ($this->inc != 2 && !$this->exc) {
         if ($obj_deficiencia_pessoa_lista) {
             $deficiencia_pessoa = array();
             foreach ($obj_deficiencia_pessoa_lista as $deficiencia) {
                 $obj_def = new clsCadastroDeficiencia($deficiencia['ref_cod_deficiencia']);
                 $det_def = $obj_def->detalhe();
                 $deficiencia_pessoa[$deficiencia['ref_cod_deficiencia']] = $det_def['nm_deficiencia'];
             }
             $deficiencia_aluno = array();
             $deficiencia_aluno = $deficiencia_pessoa;
         }
     }
     $obj_deficiencias = new clsCadastroDeficiencia();
     $lista_deficiencias = $obj_deficiencias->lista();
     $lista = array('' => 'Selecione');
     if ($lista_deficiencias) {
         foreach ($lista_deficiencias as $deficiencia) {
             $lista[$deficiencia['cod_deficiencia']] = $deficiencia['nm_deficiencia'];
         }
     }
     $oculto = $tabela = '';
     if ($deficiencia_aluno) {
         foreach ($deficiencia_aluno as $indice => $valor) {
             $cor_fundo = $cor_fundo == '#D1DADF' ? '#E4E9ED' : '#D1DADF';
             $tabela .= "<tr id=\"tr_{$indice}\" bgcolor=\"{$cor_fundo}\" style=\"padding-right: 10px;\">";
             $tabela .= "<td>{$valor}</td>";
             $tabela .= "<td align=\"right\" style=\"padding-right: 10px;\">";
             $tabela .= "<img border=\"0\" onclick=\"excluirLinhaDeficiencia({$indice})\"\n                      style=\"cursor: pointer;\" src=\"imagens/banco_imagens/excluirrr.gif\"\n                      title=\"Excluir\">";
             $tabela .= "</td></tr>";
             $oculto .= "<input type=\"hidden\" id=\"oc_defic[{$indice}]\" name=\"oc_defic[{$indice}]\" value=\"{$indice}\">";
         }
     }
     $this->campoLista('ref_cod_pessoa_deficiencia', 'Defici&ecirc;ncia', $lista, $this->ref_cod_pessoa_deficiencia, '', FALSE, '', '', FALSE, $obrigatorio);
     $this->campoRotulo('incluir2', 'Incluir defici&ecirc;ncia', "<a href='#' onclick=\"adicionaDeficiencia();\"><img src='imagens/banco_imagens/entrada2.gif' title='Incluir' border=0></a>");
     $this->campoRotulo("tab_defic", "Deficiências", "<table id='tabela_deficiencia' cellspacing='0' cellpadding='2'><tbody>{$tabela}</tbody></table><div id='ocultos_defic'>{$oculto}</div>");
     $this->campoOculto('inc', '');
     $this->campoOculto('exc', '');
     $this->campoAdicionaTab('Outros Dados', $this->tab_habilitado);
     if ($this->ref_idpes) {
         $ObjDocumento = new clsDocumento($this->ref_idpes);
         $detalheDocumento = $ObjDocumento->detalhe();
         $this->rg = $detalheDocumento['rg'];
         if ($detalheDocumento['data_exp_rg']) {
             $this->data_exp_rg = date('d/m/Y', strtotime(substr($detalheDocumento['data_exp_rg'], 0, 19)));
         }
         $this->sigla_uf_exp_rg = $detalheDocumento['sigla_uf_exp_rg'];
         $this->tipo_cert_civil = $detalheDocumento['tipo_cert_civil'];
         $this->num_termo = $detalheDocumento['num_termo'];
         $this->num_livro = $detalheDocumento['num_livro'];
         $this->num_folha = $detalheDocumento['num_folha'];
         if ($detalheDocumento['data_emissao_cert_civil']) {
             $this->data_emissao_cert_civil = date('d/m/Y', strtotime(substr($detalheDocumento['data_emissao_cert_civil'], 0, 19)));
         }
         $this->sigla_uf_cert_civil = $detalheDocumento['sigla_uf_cert_civil'];
         $this->cartorio_cert_civil = $detalheDocumento['cartorio_cert_civil'];
         $this->num_cart_trabalho = $detalheDocumento['num_cart_trabalho'];
         $this->serie_cart_trabalho = $detalheDocumento['serie_cart_trabalho'];
         if ($detalheDocumento['data_emissao_cart_trabalho']) {
             $this->data_emissao_cart_trabalho = date("d/m/Y", strtotime(substr($detalheDocumento['data_emissao_cart_trabalho'], 0, 19)));
         }
         $this->sigla_uf_cart_trabalho = $detalheDocumento['sigla_uf_cart_trabalho'];
         $this->num_tit_eleitor = $detalheDocumento['num_tit_eleitor'];
         $this->zona_tit_eleitor = $detalheDocumento['zona_tit_eleitor'];
         $this->secao_tit_eleitor = $detalheDocumento['secao_tit_eleitor'];
         $this->idorg_exp_rg = $detalheDocumento['idorg_exp_rg'];
     }
     $objUf = new clsUf();
     $listauf = $objUf->lista();
     $listaEstado = array('0' => 'Selecione');
     if ($listauf) {
         foreach ($listauf as $uf) {
             $listaEstado[$uf['sigla_uf']] = $uf['sigla_uf'];
         }
     }
     $objOrgaoEmissorRg = new clsOrgaoEmissorRg();
     $listaOrgaoEmissorRg = $objOrgaoEmissorRg->lista();
     $listaOrgao = array('0' => 'Selecione');
     if ($listaOrgaoEmissorRg) {
         foreach ($listaOrgaoEmissorRg as $orgaoemissor) {
             $listaOrgao[$orgaoemissor['idorg_rg']] = $orgaoemissor['sigla'];
         }
     }
     $this->campoOculto('idpes', $this->idpes);
     $this->campoTexto('rg', 'Rg', $this->rg, '10', '10', FALSE);
     $this->campoData('data_exp_rg', 'Data Expedição RG', $this->data_exp_rg, FALSE);
     $this->campoLista('idorg_exp_rg', 'Órgão Expedição RG', $listaOrgao, $this->idorg_exp_rg, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
     $this->campoLista('sigla_uf_exp_rg', 'Estado Expedidor', $listaEstado, $this->sigla_uf_exp_rg, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
     $lista_tipo_cert_civil = array();
     $lista_tipo_cert_civil['0'] = 'Selecione';
     $lista_tipo_cert_civil[91] = 'Nascimento';
     $lista_tipo_cert_civil[92] = 'Casamento';
     $this->campoLista('tipo_cert_civil', 'Tipo Certificado Civil', $lista_tipo_cert_civil, $this->tipo_cert_civil, NULL, NULL, NULL, NULL, NULL, FALSE);
     $this->campoTexto('num_termo', 'Termo', $this->num_termo, '8', '8', FALSE);
     $this->campoTexto('num_livro', 'Livro', $this->num_livro, '8', '8', FALSE);
     $this->campoTexto('num_folha', 'Folha', $this->num_folha, '4', '4', FALSE);
     $this->campoData('data_emissao_cert_civil', 'Emissão Certidão Civil', $this->data_emissao_cert_civil, FALSE);
     $this->campoLista('sigla_uf_cert_civil', 'Sigla Certidão Civil', $listaEstado, $this->sigla_uf_cert_civil, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
     $this->campoMemo('cartorio_cert_civil', 'Cartório', $this->cartorio_cert_civil, '35', '4', FALSE, FALSE);
     $this->campoTexto('num_tit_eleitor', 'Título de Eleitor', $this->num_tit_eleitor, '13', '13', FALSE);
     $this->campoTexto('zona_tit_eleitor', 'Zona', $this->zona_tit_eleitor, '4', '4', FALSE);
     $this->campoTexto('secao_tit_eleitor', 'Seção', $this->secao_tit_eleitor, '10', '10', FALSE);
     // Adiciona uma aba com dados do Inep/Educacenso caso aluno tenha código Inep.
     if (isset($this->cod_aluno)) {
         $alunoMapper = new Educacenso_Model_AlunoDataMapper();
         $alunoInep = NULL;
         try {
             $alunoInep = $alunoMapper->find(array('aluno' => $this->cod_aluno));
         } catch (Exception $e) {
         }
         if ($alunoInep) {
             $this->campoAdicionaTab('Educacenso/Inep', $this->tab_habilitado);
             $this->campoRotulo('_inep_cod_aluno', 'Código do aluno no Educacenso/Inep', $alunoInep->alunoInep);
             if (isset($alunoInep->nomeInep)) {
                 $this->campoRotulo('_inep_nome_aluno', 'Nome do aluno no Educacenso/Inep', $alunoInep->nomeInep);
             }
         }
     }
     $this->campoTabFim();
 }
Exemplo n.º 19
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Usu&aacute;rio - Listagem";
     foreach ($_GET as $var => $val) {
         // passa todos os valores obtidos no GET para atributos do objeto
         $this->{$var} = $val === "" ? null : $val;
     }
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $this->addCabecalhos(array("Usu&aacute;rio", "Tipo Usu&aacute;rio", "N&iacute;vel de Acesso"));
     $objPermissao = new clsPermissoes();
     // Filtros de Foreign Keys
     $opcoes = array("" => "Pesquise o funcion&aacute;rio clicando na lupa ao lado");
     if ($this->cod_usuario) {
         $objTemp = new clsFuncionario($this->cod_usuario);
         $detalhe = $objTemp->detalhe();
         $detalhe = $detalhe["idpes"]->detalhe();
         $opcoes["{$detalhe["idpes"]}"] = $detalhe["nome"];
     }
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(0);
     $parametros->adicionaCampoSelect("cod_usuario", "ref_cod_pessoa_fj", "nome");
     $this->campoListaPesq("cod_usuario", "Usu&aacute;rio", $opcoes, $this->cod_usuario, "pesquisa_funcionario_lst.php", "", false, "", "", null, null, "", false, $parametros->serializaCampos());
     $opcoes = array("" => "Selecione");
     if (class_exists("clsPmieducarTipoUsuario")) {
         $objTemp = new clsPmieducarTipoUsuario();
         $objTemp->setOrderby('nm_tipo ASC');
         $lista = $objTemp->lista();
         if (is_array($lista) && count($lista)) {
             foreach ($lista as $registro) {
                 $opcoes["{$registro['cod_tipo_usuario']}"] = "{$registro['nm_tipo']}";
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsPmieducarTipoUsuario n&atilde;o encontrada\n-->";
         $opcoes = array("" => "Erro na gera&ccedil;&atilde;o");
     }
     $this->campoLista("ref_cod_tipo_usuario", "Tipo Usu&aacute;rio", $opcoes, $this->ref_cod_tipo_usuario, null, null, null, null, null, false);
     // filtro de nivel de acesso
     $obj_tipo_usuario = new clsPmieducarTipoUsuario($this->pessoa_logada);
     $tipo_usuario = $obj_tipo_usuario->detalhe();
     $obj_super_usuario = new clsMenuFuncionario($this->pessoa_logada, false, false, 0);
     $super_usuario_det = $obj_super_usuario->detalhe();
     if ($super_usuario_det) {
         $opcoes = array("" => "Selecione", "1" => "Poli-Institucional", "2" => "Institucional", "4" => "Escolar", "8" => "Biblioteca");
     } elseif ($tipo_usuario["nivel"] == 1) {
         $opcoes = array("" => "Selecione", "2" => "Institucional", "4" => "Escolar", "8" => "Biblioteca");
     } elseif ($tipo_usuario["nivel"] == 2) {
         $opcoes = array("" => "Selecione", "4" => "Escolar", "8" => "Biblioteca");
     } elseif ($tipo_usuario["nivel"] == 4) {
         $opcoes = array("" => "Selecione", "8" => "Biblioteca");
     }
     $this->campoLista("ref_cod_nivel_usuario", "N&iacute;vel de Acesso", $opcoes, $this->ref_cod_nivel_usuario, null, null, null, null, null, false);
     if ($super_usuario_det) {
         $get_escola = true;
         include "include/pmieducar/educar_campo_lista.php";
     }
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->limite - $this->limite : 0;
     $obj_usuario = new clsPmieducarUsuario();
     $obj_usuario->setOrderby("nivel ASC");
     $obj_usuario->setLimite($this->limite, $this->offset);
     $lista = $obj_usuario->lista($this->cod_usuario, $this->ref_cod_escola, $this->ref_cod_instituicao, null, null, $this->ref_cod_tipo_usuario, null, null, null, null, 1, $this->ref_cod_nivel_usuario);
     $total = $obj_usuario->_total;
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             // pega detalhes de foreign_keys
             if (class_exists("clsPessoa_")) {
                 $obj_cod_usuario = new clsPessoa_($registro["cod_usuario"]);
                 $obj_usuario_det = $obj_cod_usuario->detalhe();
                 $nome_usuario = $obj_usuario_det['nome'];
             } else {
                 $nome_usuario = "Erro na gera&ccedil;&atilde;o";
                 echo "<!--\nErro\nClasse n&atilde;o existente: clsPessoa_\n-->";
             }
             if (class_exists("clsPmieducarTipoUsuario")) {
                 $obj_tipo_usuario = new clsPmieducarTipoUsuario($registro["ref_cod_tipo_usuario"]);
                 $obj_tipo_usuario_det = $obj_tipo_usuario->detalhe();
                 $nm_tipo_usuario = $obj_tipo_usuario_det["nm_tipo"];
                 $registro["ref_cod_nivel_usuario"] = $obj_tipo_usuario_det["nivel"];
                 if ($registro["ref_cod_nivel_usuario"] == 1) {
                     $nivel = "Poli-Institucional";
                 } elseif ($registro["ref_cod_nivel_usuario"] == 2) {
                     $nivel = "Institucional";
                 } elseif ($registro["ref_cod_nivel_usuario"] == 4) {
                     $nivel = "Escolar";
                 } elseif ($registro["ref_cod_nivel_usuario"] == 8) {
                     $nivel = "Biblioteca";
                 }
             } else {
                 $registro["ref_cod_tipo_usuario"] = "Erro na gera&ccedil;&atilde;o";
                 echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarTipoUsuario\n-->";
             }
             $this->addLinhas(array("<a href=\"educar_usuario_det.php?cod_usuario={$registro["cod_usuario"]}\">{$nome_usuario}</a>", "<a href=\"educar_usuario_det.php?cod_usuario={$registro["cod_usuario"]}\">{$nm_tipo_usuario}</a>", "<a href=\"educar_usuario_det.php?cod_usuario={$registro["cod_usuario"]}\">{$nivel}</a>"));
         }
     }
     $this->addPaginador2("educar_usuario_lst.php", $total, $_GET, $this->nome, $this->limite);
     $objPermissao = new clsPermissoes();
     if ($objPermissao->permissao_cadastra(555, $this->pessoa_logada, 7, null, true)) {
         $this->acao = "go(\"educar_usuario_cad.php\")";
         $this->nome_acao = "Novo";
     }
     $this->largura = "100%";
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Cliente - Listagem";
     foreach ($_GET as $var => $val) {
         // passa todos os valores obtidos no GET para atributos do objeto
         $this->{$var} = $val === "" ? null : $val;
     }
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $lista_busca = array("Cliente", "Tipo do Cliente");
     // Filtros de Foreign Keys
     $get_instituicao = true;
     $get_escola = true;
     $get_biblioteca = true;
     $get_cliente_tipo = true;
     $get_cabecalho = "lista_busca";
     include "include/pmieducar/educar_campo_lista.php";
     $this->addCabecalhos($lista_busca);
     $opcoes = array("" => "Pesquise a pessoa clicando na lupa ao lado");
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(0);
     $parametros->adicionaCampoSelect("ref_idpes", "idpes", "nome");
     $parametros->setCodSistema(1);
     $parametros->setPessoa('F');
     $parametros->setPessoaEditar('N');
     $parametros->setPessoaNovo('N');
     $this->campoListaPesq("ref_idpes", "Cliente", $opcoes, $this->ref_idpes, "pesquisa_pessoa_lst.php", "", false, "", "", null, null, "", false, $parametros->serializaCampos());
     //$this->campoLista( "status", "Status", array( '' => "Selecione", 'R' => "Regular", 'S' => "Suspenso" ), $this->status, "", false, "", "", false, false );
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->limite - $this->limite : 0;
     $obj_cliente = new clsPmieducarCliente();
     $obj_cliente->setOrderby("nome ASC");
     $obj_cliente->setLimite($this->limite, $this->offset);
     if ($this->status != 'S') {
         $this->status = null;
     }
     $lista = $obj_cliente->listaCompleta(null, null, null, $this->ref_idpes, null, null, null, null, null, null, 1, null, null, $this->ref_cod_cliente_tipo, $this->ref_cod_escola, $this->ref_cod_biblioteca, $this->ref_cod_instituicao);
     $total = $obj_cliente->_total;
     $obj_banco = new clsBanco();
     // monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             // pega detalhes de foreign_keys
             if (class_exists("clsPmieducarBiblioteca")) {
                 $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca($registro["cod_biblioteca"]);
                 $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe();
                 $registro["cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"];
             }
             if ($registro["cod_instituicao"]) {
                 $obj_ref_cod_instituicao = new clsPmieducarInstituicao($registro["cod_instituicao"]);
                 $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
                 $registro["cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
             }
             if ($registro["cod_escola"]) {
                 $obj_ref_cod_escola = new clsPmieducarEscola();
                 $det_ref_cod_escola = array_shift($obj_ref_cod_escola->lista($registro["cod_escola"]));
                 $registro["cod_escola"] = $det_ref_cod_escola["nome"];
             }
             $lista_busca = array("<a href=\"educar_definir_cliente_tipo_det.php?cod_cliente={$registro["cod_cliente"]}&cod_cliente_tipo={$registro["cod_cliente_tipo"]}\">{$registro["nome"]}</a>", "<a href=\"educar_definir_cliente_tipo_det.php?cod_cliente={$registro["cod_cliente"]}&cod_cliente_tipo={$registro["cod_cliente_tipo"]}\">{$registro["nm_tipo"]}</a>");
             if ($qtd_bibliotecas > 1 && ($nivel_usuario == 4 || $nivel_usuario == 8)) {
                 $lista_busca[] = "<a href=\"educar_definir_cliente_tipo_det.php?cod_cliente={$registro["cod_cliente"]}&cod_cliente_tipo={$registro["cod_cliente_tipo"]}\">{$registro["cod_biblioteca"]}</a>";
             } else {
                 if ($nivel_usuario == 1 || $nivel_usuario == 2 || $nivel_usuario == 4) {
                     $lista_busca[] = "<a href=\"educar_definir_cliente_tipo_det.php?cod_cliente={$registro["cod_cliente"]}&cod_cliente_tipo={$registro["cod_cliente_tipo"]}\">{$registro["cod_biblioteca"]}</a>";
                 }
             }
             if ($nivel_usuario == 1 || $nivel_usuario == 2) {
                 $lista_busca[] = "<a href=\"educar_definir_cliente_tipo_det.php?cod_cliente={$registro["cod_cliente"]}&cod_cliente_tipo={$registro["cod_cliente_tipo"]}\">{$registro["cod_escola"]}</a>";
             }
             if ($nivel_usuario == 1) {
                 $lista_busca[] = "<a href=\"educar_definir_cliente_tipo_det.php?cod_cliente={$registro["cod_cliente"]}&cod_cliente_tipo={$registro["cod_cliente_tipo"]}\">{$registro["cod_instituicao"]}</a>";
             }
             $this->addLinhas($lista_busca);
         }
     }
     $this->addPaginador2("educar_definir_cliente_tipo_lst.php", $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(623, $this->pessoa_logada, 11)) {
         $this->acao = "go(\"educar_definir_cliente_tipo_cad.php\")";
         $this->nome_acao = "Novo";
     }
     $this->largura = "100%";
 }
Exemplo n.º 21
0
 function Gerar()
 {
     //Moderadores vinculados
     $this->campoOculto("id_moderador_deletar", $this->id_moderador_deletar);
     $this->campoOculto("qtd_moderadores", $this->qtd_moderadores);
     $this->campoOculto("nm_grupo", $this->nm_grupo);
     $this->campoOculto("cod_grupos", $this->cod_grupos);
     $this->campoOculto("todos_moderadores", serialize($this->todos_moderadores));
     $this->campoOculto("id_moderador", $this->id_moderador);
     $this->campoTexto("nm_grupo", "Nome do Grupo", $this->nm_grupo, "50", "100", true);
     if (is_array($this->todos_moderadores)) {
         foreach ($this->todos_moderadores as $id => $moderador) {
             $objPessoa = new clsPessoaFj($moderador);
             $detPessoa = $objPessoa->detalhe();
             $nome = $detPessoa['nome'];
             $this->campoTextoInv("id_moderador_{$id}", "Moderador(es)", $nome, "30", "30", true, false, false, "", "<a href='#' onclick=\"javascript:excluirSumit({$moderador},'id_moderador_deletar') \">Clique aqui para Excluir</a>");
         }
     }
     //$this->campoProcurarAdicionar("id_moderador_", "Incluir Moderador", "", 10, 5, "openurl('pesquisa_funcionario_otopic.php?campo=id_moderador')", "Procurar","insereSubmit()","");
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(1);
     $parametros->adicionaCampoSelect("id_moderador", "ref_cod_pessoa_fj", "nome");
     $this->campoListaPesq("id_moderador", "Incluir Moderador", array("Para procurar, clique na lupa ao lado"), $this->ref_cod_pessoa_fj, "pesquisa_funcionario_lst.php", "", false, "", "", null, null, "", false, $parametros->serializaCampos());
     //$this->campoLista( "id_moderador", "Incluir Moderador", array("Para procurar, clique na lupa ao lado"), $this->ref_cod_pessoa_fj, "", false, "", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\'miolo\' id=\'miolo\' frameborder=\'0\' height=\'100%\' width=\'500\' marginheight=\'0\' marginwidth=\'0\' src=\'pesquisa_funcionario_lst.php?campos=$serializedcampos\'></iframe>' );\">", false, true );
     $this->url_cancelar = $retorno == "Editar" ? "otopic_grupos_det.php?cod_grupo={$this->cod_grupos}" : "otopic_grupos_lst.php";
     $this->nome_url_cancelar = "Cancelar";
 }
Exemplo n.º 22
0
 function Gerar()
 {
     $this->campoOculto("cod_setor", $_GET["cod_setor"]);
     $this->campoOculto("cod_pessoa", $this->cod_pessoa);
     $nivelAtual = 0;
     $objSetor = new clsSetor();
     $strSetorAtual = "";
     if (isset($_GET["setor_atual"]) && $_GET["setor_atual"]) {
         $codPai = null;
         $strSetorAtual = "setor_atual={$_GET["setor_atual"]}&";
         $niveis = $objSetor->getNiveis($_GET["setor_atual"]);
         $nivelAtual = count($niveis);
         for ($i = 0; $i < count($niveis); $i++) {
             $listaSetores = $objSetor->lista($codPai, null, null, null, null, null, null, null, null, null, $i);
             $nomeVar = "setor_{$i}";
             $setores = array("" => "Selecione");
             foreach ($listaSetores as $setor) {
                 $setores[$setor["cod_setor"]] = $setor["nm_setor"];
             }
             $this->campoLista($nomeVar, "Setor nivel " . ($i + 1), $setores, $niveis[$i], "if( this.value ) { document.location.href='oprot_setor_cad.php?cod_setor={$this->cod_setor}&setor_atual=' + this.value } else { document.location.href='oprot_setor_cad.php?cod_setor={$this->cod_setor}&setor_atual={$codPai}' }");
             $codPai = $niveis[$i];
         }
     }
     if (isset($_GET["selecionar"])) {
         $codPai = isset($_GET["setor_atual"]) ? $_GET["setor_atual"] : null;
         $listaSetores = $objSetor->lista($codPai, null, null, null, null, null, null, null, null, null, $nivelAtual);
         if (is_array($listaSetores) && count($listaSetores)) {
             $setores = array("" => "Selecione");
             foreach ($listaSetores as $setor) {
                 $setores[$setor["cod_setor"]] = $setor["nm_setor"];
             }
             $nomeVar = "setor_{$nivelAtual}";
             $this->campoLista($nomeVar, "Setor nivel " . ($i + 1), $setores, false, "if( this.value ) { document.location.href='oprot_setor_cad.php?cod_setor={$this->cod_setor}&setor_atual=' + this.value }");
         } else {
             $this->campoRotulo("aviso", "Alerta", "<a href=\"oprot_setor_cad.php?cod_setor={$this->cod_setor}&{$strSetorAtual}\">Nenhum setor neste nivel</a>");
         }
     } else {
         if ($nivelAtual < 5) {
             if ($nivelAtual < 4) {
                 $this->campoRotulo("adicionar", "Selecionar", "<a href=\"oprot_setor_cad.php?cod_setor={$this->cod_setor}&{$strSetorAtual}selecionar=1\">Selecionar um setor já cadastrado</a>");
             }
             $this->campoTexto("nm_setor", "Nome do Setor", $this->nm_setor, 30, 255, true);
             $this->campoTexto("sgl_setor", "Sigla do Setor", $this->sgl_setor, 15, 15, true);
             $this->campoCheck("no_paco", "No Paço", 0);
             $this->campoMemo("end", "Endereço", "", 55, 5);
             $lista = array();
             $lista = array(0 => "Selecione", "s" => "Secretaria", "a" => "Altarquia", "f" => "Fundação");
             $this->campoLista("tipo", "Tipo", $lista, $this->tipo);
             $lista = array();
             $lista[0] = "Selecione";
             $parametros = new clsParametrosPesquisas();
             $parametros->setSubmit(0);
             $parametros->adicionaCampoSelect("secretario", "idpes", "nome");
             $sec = array("Para procurar, clique na lupa ao lado");
             if ($this->secretario) {
                 $cls_pessoa = new clsPessoa_($this->secretario);
                 $detalhe_pessoa = $cls_pessoa->detalhe();
                 $sec = array("Para procurar, clique na lupa ao lado", $this->secretario => $detalhe_pessoa['nome']);
             }
             $this->campoListaPesq("secretario", "Secretário", $sec, $this->secretario, "pesquisa_funcionario_lst.php", "", false, "", "", null, null, "", false, $parametros->serializaCampos());
             //$this->campoListaPesq("secretario", "Secretario Responsável", $lista, $this->secretario, "pesquisa_pessoa.php");
             if ($this->cod_setor) {
                 $obj = new clsSetor($this->cod_setor);
                 $det = $obj->detalhe();
                 $status = $det["ativo"] == 1 ? 1 : 0;
                 $ativo = $this->ativo ? $this->ativo : $status;
                 $this->campoCheck("ativo", "Ativo", $ativo);
             }
         }
     }
 }