/**
  * Construtor.
  *
  * @param int $int_ref_ref_cod_pessoa_fj
  * @param bool $cadastra
  * @param bool $exclui
  * @param int $int_ref_cod_menu_submenu
  */
 function clsMenuFuncionario($int_ref_ref_cod_pessoa_fj = FALSE, $cadastra = FALSE, $exclui = FALSE, $int_ref_cod_menu_submenu = FALSE)
 {
     $obj = new clsPessoaFj($int_ref_ref_cod_pessoa_fj);
     if ($obj->detalhe()) {
         $this->ref_ref_cod_pessoa_fj = $int_ref_ref_cod_pessoa_fj;
     }
     $this->cadastra = $cadastra;
     $this->exclui = $exclui;
     $this->ref_cod_menu_submenu = $int_ref_cod_menu_submenu;
     $this->tabela = "menu_funcionario";
 }
예제 #2
0
 function Gerar()
 {
     $this->titulo = "Detalhe de notícias";
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $id_noticia = @$_GET['id_noticia'];
     $db = new clsBanco();
     $db->Consulta("SELECT n.titulo, n.data_noticia, n.descricao, n.ref_ref_cod_pessoa_fj FROM not_portal n WHERE cod_not_portal={$id_noticia}");
     if ($db->ProximoRegistro()) {
         list($titulo, $data, $descricao, $cod_responsavel) = $db->Tupla();
         $objPessoa = new clsPessoaFj();
         list($responsavel) = $objPessoa->queryRapida($cod_responsavel, "nome");
         $data = explode(".", $data);
         $data = date("d/m/Y", strtotime(substr($data[0], 0, 19)));
         $this->addDetalhe(array("Responsável", $responsavel));
         $this->addDetalhe(array("Data", $data));
         $this->addDetalhe(array("Título", $titulo));
         $descricao = str_replace("\n\r", "<br>", $descricao);
         $descricao = str_replace("\n", "<br>", $descricao);
         $this->addDetalhe(array("Descri&ccedil;&atilde;o", $descricao));
         $db->Consulta("SELECT tipo,cod_vinc,caminho,nome_arquivo FROM not_vinc_portal n WHERE ref_cod_not_portal={$id_noticia}");
         while ($db->ProximoRegistro()) {
             list($tipo, $cod, $caminho, $nome_arquivo) = $db->Tupla();
             if ($tipo == "F") {
                 $dba = new clsBanco();
                 $dba->Consulta("SELECT titulo, caminho, altura, largura FROM foto_portal WHERE cod_foto_portal={$cod}");
                 $dba->ProximoRegistro();
                 list($titulo, $caminho, $altura, $largura) = $dba->Tupla();
                 $this->addDetalhe(array("Fotos Vinculadas", "<a href='#' onclick='javascript:openfoto(\"{$titulo}\",\"{$caminho}\",{$altura},{$largura})'><img src='fotos/small/{$caminho}' border='0'></a>"));
             }
             if ($tipo == "N") {
                 $dba = new clsBanco();
                 $dba->Consulta("SELECT titulo FROM not_portal WHERE cod_not_portal={$cod}");
                 $dba->ProximoRegistro();
                 list($titulo) = $dba->Tupla();
                 $this->addDetalhe(array("Noticias Vinculadas", "<img src='imagens/noticia.jpg' border=0>&nbsp;<a href='noticias_det.php?id_noticia={$cod}'><strong>{$titulo}</strong></a>"));
                 $dba->Consulta("SELECT v.cod_vinc, n.titulo FROM not_vinc_portal v, not_portal n WHERE v.ref_cod_not_portal={$cod} AND v.tipo='N' AND v.cod_vinc = n.cod_not_portal ");
                 while ($dba->ProximoRegistro()) {
                     list($cod, $titulo) = $dba->Tupla();
                     $this->addDetalhe(array("Noticias Vinculadas", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='imagens/noticia.jpg' border=0>&nbsp;<a href='noticias_det.php?id_noticia={$cod}'><strong>{$titulo}</strong></a>"));
                 }
             }
             if ($tipo == "A") {
                 $this->addDetalhe(array("Arquivos Vinculados", "<strong>{$nome_arquivo}</strong> &nbsp; <a href='{$caminho}'><img  width='20' height='20' src='imagens/noticia.jpg' border=0></a>"));
             }
         }
     }
     $this->url_novo = "noticias_cad.php";
     $this->url_editar = "noticias_cad.php?id_noticia={$id_noticia}";
     $this->url_cancelar = "noticias_lst.php";
     $this->largura = "100%";
 }
예제 #3
0
 function Gerar()
 {
     $this->titulo = "Empresas";
     $this->addCabecalhos(array("Razão Social", "Nome Fantasia"));
     $this->campoTexto("fantasia", "Nome Fantasia", $_GET['nm_pessoa'], "50", "255", true);
     $this->campoTexto("razao_social", "Razão Social", $_GET['razao_social'], "50", "255", true);
     $this->campoCnpj("id_federal", "CNPJ", $_GET['id_federal'], "50", "255", true);
     // Paginador
     $limite = 10;
     $iniciolimit = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $limite - $limite : 0;
     $par_nome = false;
     $par_razao = false;
     $par_cnpj = false;
     $opcoes = false;
     if ($_GET['fantasia']) {
         $par_fantasia = $_GET['fantasia'];
     }
     if ($_GET['razao_social']) {
         $par_razao = $_GET['razao_social'];
         $objPessoaFJ = new clsPessoaFj();
         $lista = $objPessoaFJ->lista($par_razao);
         if ($lista) {
             foreach ($lista as $pessoa) {
                 $opcoes[] = $pessoa['idpes'];
             }
         }
     }
     if ($_GET['id_federal']) {
         $par_cnpj = idFederal2Int($_GET['id_federal']);
     }
     $objPessoa = new clsPessoaJuridica();
     $empresas = $objPessoa->lista($par_cnpj, $par_fantasia, false, $iniciolimit, $limite, "fantasia asc", $opcoes);
     if ($empresas) {
         foreach ($empresas as $empresa) {
             $total = $empresa['total'];
             $cod_empresa = $empresa['idpes'];
             $razao_social = $empresa['nome'];
             $nome_fantasia = $empresa['fantasia'];
             $this->addLinhas(array("<a href='empresas_det.php?cod_empresa={$cod_empresa}'><img src='imagens/noticia.jpg' border=0>{$razao_social}</a>", "<a href='empresas_det.php?cod_empresa={$cod_empresa}'>{$nome_fantasia}</a>"));
         }
     }
     // Paginador
     $this->addPaginador2(" empresas_lst.php", $total, $_GET, $this->nome, $limite);
     $this->acao = "go(\"empresas_cad.php\")";
     $this->nome_acao = "Novo";
     $this->largura = "100%";
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "" => "Listagem de pessoas jur&iacute;dicas"));
     $this->enviaLocalizacao($localizacao->montar());
 }
예제 #4
0
 function Gerar()
 {
     $this->titulo = "Detalhe de Menu";
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $id_item = @$_GET['id_item'];
     $db = new clsBanco();
     $db->Consulta("SELECT cat.nm_menu, sub.cod_menu_submenu, sub.cod_sistema, sub.nm_submenu, sub.arquivo, sub.title FROM menu_submenu AS sub, menu_menu AS cat WHERE cod_menu_submenu={$id_item} AND cod_menu_menu = ref_cod_menu_menu");
     if ($db->ProximoRegistro()) {
         list($categoria, $id_item, $id_sistema, $nome, $arquivo, $alt) = $db->Tupla();
         $this->addDetalhe(array("Nome", $nome));
         $this->addDetalhe(array("Categoria", $categoria));
         $this->addDetalhe(array("Arquivo", $arquivo));
         $this->addDetalhe(array("Title", $alt));
         if ($id_sistema == '2') {
             $objPessoa = new clsPessoaFisica();
             $objPessoaFj = new clsPessoaFj();
             $dba = new clsBanco();
             //$dba->Consulta( "SELECT nm_pessoa FROM pessoa_fj WHERE cod_pessoa_fj in (SELECT ref_ref_cod_pessoa_fj FROM menu_funcionario WHERE ref_cod_menu_submenu in ({$id_item}, 0)) ORDER BY nm_pessoa" );
             $lista_id = array();
             $dba->Consulta("SELECT ref_ref_cod_pessoa_fj FROM menu_funcionario WHERE ref_cod_menu_submenu in ({$id_item}, 0)");
             while ($dba->ProximoRegistro()) {
                 list($cod) = $dba->Tupla();
                 $lista_id[] = $cod;
             }
             if (count($lista_id)) {
                 $pessoas = $objPessoaFj->lista(false, false, false, false, $lista_id);
             }
             /*
             while ($dba->ProximoRegistro())
             {
             	//list($nome_) = $dba->Tupla();
             	list($nome_) = $objPessoa->queryRapida($ref_ref_cod_pessoa, "nome");
             	$this->addDetalhe( array("Autorizados", "{$nome_}") );
             }
             */
             if (count($pessoas)) {
                 foreach ($pessoas as $pessoa) {
                     //print_r( $pessoa );
                     //list($nome_) = $objPessoa->queryRapida($pessoa["idpes"], "nome");
                     $this->addDetalhe(array("Autorizados", "{$pessoa["nome"]}"));
                 }
             }
         }
     }
     $this->url_novo = "menu_cad.php";
     $this->url_editar = "menu_cad.php?id_item={$id_item}";
     $this->url_cancelar = "menu_lst.php";
     $this->largura = "100%";
 }
 function Gerar()
 {
     $this->titulo = "Detalhe da licita&ccedil;&atilde;o finalizada";
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $id_licitacao = @$_GET['id_licitacao'];
     $db = new clsBanco();
     $db->Consulta("\n\t\t\tSELECT \n\t\t\t\tm.nm_modalidade, \n\t\t\t\tp.nm_pessoa, \n\t\t\t\tl.numero, \n\t\t\t\tl.objeto, \n\t\t\t\tl.data_hora, \n\t\t\t\tl.cod_compras_licitacoes, \n\t\t\t\te.ref_pregoeiro, \n\t\t\t\te.ref_equipe1, \n\t\t\t\te.ref_equipe2, \n\t\t\t\te.ref_equipe3, \n\t\t\t\te.ano_processo, \n\t\t\t\te.mes_processo, \n\t\t\t\te.seq_processo, \n\t\t\t\te.seq_portaria, \n\t\t\t\te.ano_portaria, \n\t\t\t\te.valor_referencia, \n\t\t\t\te.valor_real, \n\t\t\t\te.ref_cod_compras_final_pregao \n\t\t\tFROM \n\t\t\t\tcompras_licitacoes l, \n\t\t\t\tpessoa_fj p, \n\t\t\t\tcompras_modalidade m, \n\t\t\t\tcompras_pregao_execucao e\n\t\t\tWHERE \n\t\t\t\tp.cod_pessoa_fj=l.ref_ref_cod_pessoa_fj AND \n\t\t\t\tm.cod_compras_modalidade=l.ref_cod_compras_modalidade AND \n\t\t\t\tcod_compras_licitacoes={$id_licitacao} AND \n\t\t\t\tref_cod_compras_licitacoes = cod_compras_licitacoes\n\t\t");
     $db2 = new clsBanco();
     if ($db->ProximoRegistro()) {
         list($nm, $nome, $numero, $objeto, $data_c, $cod_licitacao, $ref_pregoeiro, $ref_equipe1, $ref_equipe2, $ref_equipe3, $ano_processo, $mes_processo, $seq_processo, $seq_portaria, $ano_portaria, $valor_referencia, $valor_real, $ref_final) = $db->Tupla();
         $hora = date('H:i', strtotime(substr($data_c, 0, 19)));
         $data_c = date('d/m/Y', strtotime(substr($data_c, 0, 19)));
         $this->addDetalhe(array("Modalidade", $nm . " " . $numero));
         $this->addDetalhe(array("Objeto", $objeto));
         $this->addDetalhe(array("Data", "{$data_c}"));
         $this->addDetalhe(array("Hora", $hora));
         $pessoa = new clsPessoaFj($ref_pregoeiro);
         $det = $pessoa->detalhe();
         $this->addDetalhe(array("Pregoeiro", $det["nm_pessoa"]));
         $pessoa = new clsPessoaFj($ref_equipe1);
         $det = $pessoa->detalhe();
         $this->addDetalhe(array("Equipe 1", $det["nm_pessoa"]));
         $pessoa = new clsPessoaFj($ref_equipe2);
         $det = $pessoa->detalhe();
         $this->addDetalhe(array("Equipe 2", $det["nm_pessoa"]));
         $pessoa = new clsPessoaFj($ref_equipe3);
         $det = $pessoa->detalhe();
         $this->addDetalhe(array("Equipe 3", $det["nm_pessoa"]));
         $this->addDetalhe(array("Ano do Processo", $ano_processo));
         $this->addDetalhe(array("Mes do Processo", $mes_processo));
         $this->addDetalhe(array("Sequencia Processo", $seq_processo));
         $this->addDetalhe(array("Sequencia Portaria", $seq_portaria));
         $this->addDetalhe(array("Ano da Portaria", $ano_portaria));
         $this->addDetalhe(array("Valor de Ref.", number_format($valor_referencia, 2, ",", ".")));
         $this->addDetalhe(array("Valor Real", number_format($valor_real, 2, ",", ".")));
         $this->addDetalhe(array("Diferença", number_format($valor_referencia - $valor_real, 2, ",", ".")));
         $this->addDetalhe(array("Diferença em %", number_format(100 - $valor_real / $valor_referencia * 100, 2, ",", ".")));
         $nmFinal = $db2->UnicoCampo("SELECT nm_final FROM compras_final_pregao WHERE cod_compras_final_pregao = '{$ref_final}'");
         $this->addDetalhe(array("Status Final", $nmFinal));
     }
     $this->url_editar = "licitacoes_funcionarios_cad.php?id_licitacao={$id_licitacao}";
     $this->url_cancelar = "licitacoes_finalizadas_lst.php";
     $this->largura = "100%";
 }
예제 #6
0
 function Inicializar()
 {
     $retorno = "";
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     $obj_permissoes = new clsPermissoes();
     $obj_permissoes->permissao_cadastra(561, $this->pessoa_logada, 3, "educar_escola_lst.php");
     $this->cod_escola = $_GET["cod_escola"];
     $this->sem_cnpj = false;
     // verifica se eh cadastro ou edicao de uma escola sem CNPJ
     //		if (is_numeric( $_POST["sem_cnpj"] ) && !$this->ref_idpes)
     //		{
     //			$this->passo = 3;
     ////			$retorno = "Novo";
     //		}
     //		else if ($_POST['cnpj'])
     //		{
     //			$retorno = "Editar";
     //		}// verifica se eh um novo cadastro
     //		elseif ($_POST['cnpj'] == "" && empty($_POST))
     //		{
     //			$this->passo = 1;
     //		}// verifica se eh uma cadastro ou edicao de uma escola com CNPJ
     //		else
     //		{
     //			$this->passo = 2;
     //		}
     // cadastro Novo sem CNPJ
     if (is_numeric($_POST["sem_cnpj"]) && !$this->cod_escola) {
         //			$this->passo = 3;
         // vai para Novo, + o cadastro sera sem CNPJ
         //			die("Sem CNPJ");
         $this->sem_cnpj = true;
         $retorno = "Novo";
     } else {
         if ($_POST["cnpj"]) {
             $this->com_cnpj = true;
             //			echo "<pre>";print_r($_POST["cnpj"]);
             //			echo idFederal2int($_POST["cnpj"]);
             $obj_juridica = new clsPessoaJuridica();
             $lst_juridica = $obj_juridica->lista(idFederal2int($_POST["cnpj"]));
             // caso exista o CNPJ na BD
             if (is_array($lst_juridica)) {
                 //				die("juridica");
                 $retorno = "Editar";
                 $det_juridica = array_shift($lst_juridica);
                 $this->ref_idpes = $det_juridica["idpes"];
                 $obj = new clsPmieducarEscola();
                 $lst_escola = $obj->lista(null, null, null, null, null, null, $this->ref_idpes, null, null, null, 1);
                 if (is_array($lst_escola)) {
                     $registro = array_shift($lst_escola);
                     $this->cod_escola = $registro["cod_escola"];
                 }
                 //				echo "idpes: ".$this->ref_idpes;
             } else {
                 //				die("novo");
                 $retorno = "Novo";
             }
         }
     }
     // cadastro Editar
     if (is_numeric($this->cod_escola) && !$_POST["passou"]) {
         $obj = new clsPmieducarEscola($this->cod_escola);
         $registro = $obj->detalhe();
         if ($registro["ref_idpes"]) {
             $this->com_cnpj = true;
         } else {
             $this->sem_cnpj = true;
         }
         if ($registro) {
             foreach ($registro as $campo => $val) {
                 // passa todos os valores obtidos no registro para atributos do objeto
                 $this->{$campo} = $val;
             }
             $objEndereco = new clsPessoaEndereco($this->ref_idpes);
             $detEndereco = $objEndereco->detalhe();
             if ($detEndereco) {
                 $this->isEnderecoExterno = 0;
             } else {
                 $this->isEnderecoExterno = 1;
             }
             $this->fantasia = $registro['nome'];
             $objJuridica = new clsPessoaJuridica($this->ref_idpes);
             $det = $objJuridica->detalhe();
             $this->cnpj = int2CNPJ($det["cnpj"]);
             $this->fexcluir = $obj_permissoes->permissao_excluir(561, $this->pessoa_logada, 3);
             $retorno = "Editar";
             if ($registro["tipo_cadastro"] == 1) {
                 $objJuridica = new clsPessoaJuridica(false, idFederal2int($this->cnpj));
                 $det = $objJuridica->detalhe();
                 $objPessoa = new clsPessoaFj($det["idpes"]);
                 list($this->endereco, $this->cep, $this->ref_bairro, $this->p_ddd_telefone_1, $this->p_telefone_1, $this->p_ddd_telefone_2, $this->p_telefone_2, $this->p_ddd_telefone_mov, $this->p_telefone_mov, $this->p_ddd_telefone_fax, $this->p_telefone_fax, $this->p_email, $this->p_http, $this->tipo_pessoa, $this->cidade, $this->bairro, $this->logradouro, $this->idlog, $this->idbai, $this->idtlog, $this->sigla_uf, $this->complemento, $this->numero, $this->andar) = $objPessoa->queryRapida($det["idpes"], "endereco", "cep", "bairro", "ddd_1", "fone_1", "ddd_2", "fone_2", "ddd_mov", "fone_mov", "ddd_fax", "fone_fax", "email", "url", "tipo", "cidade", "bairro", "logradouro", "idlog", "idbai", "idtlog", "sigla_uf", "complemento", "numero", "andar");
             } else {
                 $objEscolaComplemento = new clsPmieducarEscolaComplemento($this->cod_escola);
                 $detComplemento = $objEscolaComplemento->detalhe();
                 foreach ($detComplemento as $campo => $val) {
                     $this->{$campo} = $val;
                 }
                 $this->cep_ = $this->cep;
                 $this->p_email = $this->email;
                 $this->cidade = $this->municipio;
                 $this->p_ddd_telefone_1 = $this->ddd_telefone;
                 $this->p_telefone_1 = $this->telefone;
                 $this->p_ddd_telefone_fax = $this->ddd_fax;
                 $this->p_telefone_fax = $this->fax;
             }
         }
     } elseif ($_POST['cnpj'] && !$_POST["passou"]) {
         //			echo idFederal2int( $_POST['cnpj'] );
         $objJuridica = new clsPessoaJuridica(false, idFederal2int($_POST['cnpj']));
         $det = $objJuridica->detalhe();
         $objPessoa = new clsPessoaFj($det["idpes"]);
         list($this->endereco, $this->cep, $this->ref_bairro, $this->p_ddd_telefone_1, $this->p_telefone_1, $this->p_ddd_telefone_2, $this->p_telefone_2, $this->p_ddd_telefone_mov, $this->p_telefone_mov, $this->p_ddd_telefone_fax, $this->p_telefone_fax, $this->p_email, $this->p_http, $this->tipo_pessoa, $this->cidade, $this->bairro, $this->logradouro, $this->idlog, $this->idbai, $this->idtlog, $this->sigla_uf, $this->complemento, $this->numero, $this->andar) = $objPessoa->queryRapida($det["idpes"], "endereco", "cep", "bairro", "ddd_1", "fone_1", "ddd_2", "fone_2", "ddd_mov", "fone_mov", "ddd_fax", "fone_fax", "email", "url", "tipo", "cidade", "bairro", "logradouro", "idlog", "idbai", "idtlog", "sigla_uf", "complemento", "numero", "andar");
     }
     $this->url_cancelar = $retorno == "Editar" ? "educar_escola_det.php?cod_escola={$registro["cod_escola"]}" : "educar_escola_lst.php";
     $this->nome_url_cancelar = "Cancelar";
     return $retorno;
 }
예제 #7
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();
     $id_visualiza = $_SESSION['id_pessoa'];
     @session_write_close();
     $this->nome = "Form4";
     $this->titulo = "Tópicos Finalizados";
     $this->addBanner();
     $cod_membro = $_GET['cod_membro'];
     $cod_grupo = $_GET['cod_grupo'];
     $this->addCabecalhos(array("Tópico", "Responsável"));
     // Paginador
     $limite = 10;
     $iniciolimit = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $limite - $limite : 0;
     $obj = new clsReuniao();
     /*  Pega lista de Reunioes Finalizadas, Verifica e mostra os Topicos Finalizados 
     			que nao foram finalizados nessa reuniao 
     		*/
     $lista = $obj->lista(false, $cod_grupo, false, false, false, false, false, false, true);
     if ($lista) {
         foreach ($lista as $reuniao) {
             $obj = new clsTopicoReuniao();
             $lista = $obj->lista(false, false, false, false, false, false, false, $reuniao['cod_reuniao']);
             if ($lista) {
                 foreach ($lista as $topicos) {
                     if ($topicos['finalizado']) {
                         $topico_comprometidos[] = $topicos['ref_cod_topico'];
                     }
                 }
             }
         }
     }
     /*  Pega lista de Reunioes não Finalizadas, Verifica que estão nessa reuniao e marca como 
     			comprometido
     		*/
     $obj = new clsReuniao();
     $lista = $obj->lista(false, $cod_grupo, false, false, false, false, false, true);
     if ($lista) {
         foreach ($lista as $reuniao) {
             $obj = new clsTopicoReuniao();
             $lista = $obj->lista(false, false, false, false, false, false, false, $reuniao['cod_reuniao']);
             if ($lista) {
                 foreach ($lista as $topicos) {
                     $topico_comprometidos[] = $topicos['ref_cod_topico'];
                 }
             }
         }
     }
     if ($topico_comprometidos) {
         $topico_finalizados = "";
         foreach ($topico_comprometidos as $topicos) {
             $obj = new clsTopicoReuniao($topicos);
             $detalhe = $obj->detalhe();
             if ($detalhe['finalizado']) {
                 $topico_finalizados[] = $topicos;
             }
         }
     }
     if ($topico_finalizados) {
         $obj = new clsTopico();
         $lista = $obj->lista(false, false, false, false, false, false, false, 1, $iniciolimit, $limite, "cod_topico DESC", false, $topico_finalizados);
         if ($lista) {
             foreach ($lista as $topicos) {
                 $total = $topicos['total'];
                 $obj = new clsTopicoReuniao($topicos['cod_topico']);
                 $detalhe = $obj->detalhe();
                 if (strlen($topicos['assunto']) > 60) {
                     $descricao = substr($topicos['assunto'], 0, 60) . "...";
                 } else {
                     $descricao = $topicos['assunto'];
                 }
                 // Pega o Nome do responsável pelo Tópico
                 $obj = new clsPessoaFj($topicos['ref_idpes_cad']);
                 $detalhe = $obj->detalhe();
                 $nome = $detalhe['nome'];
                 $this->addLinhas(array("{$descricao}", $nome));
             }
             //pdf
             $this->array_botao = array("Imprimir (Jato)", "Imprimir (Laser)");
             $this->array_botao_url = array("otopic_meus_grupos_imprime_topicos_finalizados.php?cod_membro={$cod_membro}&cod_grupo={$cod_grupo}&imprimir=jato", "otopic_meus_grupos_imprime_topicos_finalizados.php?cod_membro={$cod_membro}&cod_grupo={$cod_grupo}&imprimir=laser");
         }
     }
     $this->largura = "100%";
     $this->addPaginador2("otopic_meus_grupos_det2.php", $total, $_GET, $this->nome, $limite);
 }
 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;
 }
예제 #10
0
 function detalhe()
 {
     if ($this->idpes) {
         $tupla = parent::detalhe();
         $objFisica = new clsFisica($this->idpes);
         $detalhe_fisica = $objFisica->detalhe();
         if ($detalhe_fisica) {
             $this->data_nasc = $detalhe_fisica['data_nasc'];
             $this->sexo = $detalhe_fisica['sexo'];
             $this->idpes_mae = $detalhe_fisica['idpes_mae'];
             $this->idpes_pai = $detalhe_fisica['idpes_pai'];
             $this->idpes_responsavel = $detalhe_fisica['idpes_responsavel'];
             $this->idesco = $detalhe_fisica['idesco'];
             $this->ideciv = $detalhe_fisica['ideciv'];
             $this->idpes_con = $detalhe_fisica['idpes_con'];
             $this->data_uniao = $detalhe_fisica['data_uniao'];
             $this->data_obito = $detalhe_fisica['data_obito'];
             $this->nacionalidade = $detalhe_fisica['nacionalidade'];
             $this->idpais_estrangeiro = $detalhe_fisica['idpais_estrangeiro'];
             $this->data_chagada_brasil = $detalhe_fisica['data_chagada_brasil'];
             $this->idmun_nascimento = $detalhe_fisica['idmun_nascimento'];
             $this->ultima_empresa = $detalhe_fisica['ultima_empresa'];
             $this->idocup = $detalhe_fisica['idocup'];
             $this->nome_mae = $detalhe_fisica['nome_mae'];
             $this->nome_pai = $detalhe_fisica['nome_pai'];
             $this->nome_conjuge = $detalhe_fisica['nome_conjuge'];
             $this->nome_responsavel = $detalhe_fisica['nome_responsavel'];
             $this->justificativa_provisorio = $detalhe_fisica['justificativa_provisorio'];
             $this->cpf = $detalhe_fisica['cpf'];
             $this->ref_cod_religiao = $detalhe_fisica['ref_cod_religiao'];
             $this->sus = $detalhe_fisica['sus'];
             $this->nis_pis_pasep = $detalhe_fisica['nis_pis_pasep'];
             $tupla['idpes'] = $this->idpes;
             $tupla[] =& $tupla['idpes'];
             $tupla['cpf'] = $this->cpf;
             $tupla[] =& $tupla['cpf'];
             $tupla['ref_cod_religiao'] = $this->ref_cod_religiao;
             $tupla[] =& $tupla['ref_cod_religiao'];
             $tupla['data_nasc'] = $this->data_nasc;
             $tupla[] =& $tupla['data_nasc'];
             $tupla['sexo'] = $this->sexo;
             $tupla[] =& $tupla['sexo'];
             $tupla['idpes_mae'] = $this->idpes_mae;
             $tupla[] =& $tupla['idpes_mae'];
             $tupla['idpes_pai'] = $this->idpes_pai;
             $tupla[] =& $tupla['idpes_pai'];
             $tupla['idpes_responsavel'] = $this->idpes_responsavel;
             $tupla[] =& $tupla['idpes_responsavel'];
             $tupla['idesco'] = $this->idesco;
             $tupla[] =& $tupla['idesco'];
             $tupla['ideciv'] = $this->ideciv;
             $tupla[] =& $tupla['ideciv'];
             $tupla['idpes_con'] = $this->idpes_con;
             $tupla[] =& $tupla['idpes_con'];
             $tupla['data_uniao'] = $this->data_uniao;
             $tupla[] =& $tupla['data_uniao'];
             $tupla['data_obito'] = $this->data_obito;
             $tupla[] =& $tupla['data_obito'];
             $tupla['nacionalidade'] = $this->nacionalidade;
             $tupla[] =& $tupla['nacionalidade'];
             $tupla['idpais_estrangeiro'] = $this->idpais_estrangeiro;
             $tupla[] =& $tupla['idpais_estrangeiro'];
             $tupla['data_chagada_brasil'] = $this->data_chagada_brasil;
             $tupla[] =& $tupla['data_chagada_brasil'];
             $tupla['idmun_nascimento'] = $this->idmun_nascimento;
             $tupla[] =& $tupla['idmun_nascimento'];
             $tupla['ultima_empresa'] = $this->ultima_empresa;
             $tupla[] =& $tupla['ultima_empresa'];
             $tupla['idocup'] = $this->idocup;
             $tupla[] =& $tupla['idocup'];
             $tupla['nome_mae'] = $this->nome_mae;
             $tupla[] =& $tupla['nome_mae'];
             $tupla['nome_pai'] = $this->nome_pai;
             $tupla[] =& $tupla['nome_pai'];
             $tupla['nome_conjuge'] = $this->nome_conjuge;
             $tupla[] =& $tupla['nome_conjuge'];
             $tupla['nome_responsavel'] = $this->nome_responsavel;
             $tupla[] =& $tupla['nome_responsavel'];
             $tupla['justificativa_provisorio'] = $this->justificativa_provisorio;
             $tupla[] =& $tupla['justificativa_provisorio'];
             return $tupla;
         }
     } elseif ($this->cpf) {
         $tupla = parent::detalhe();
         $objFisica = new clsFisica();
         $lista = $objFisica->lista(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, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, $this->cpf);
         $this->idpes = $lista[0]['idpes'];
         if ($this->idpes) {
             $objFisica = new clsFisica($this->idpes);
             $detalhe_fisica = $objFisica->detalhe();
             if ($detalhe_fisica) {
                 $this->data_nasc = $detalhe_fisica['data_nasc'];
                 $this->sexo = $detalhe_fisica['sexo'];
                 $this->idpes_mae = $detalhe_fisica['idpes_mae'];
                 $this->idpes_pai = $detalhe_fisica['idpes_pai'];
                 $this->idpes_responsavel = $detalhe_fisica['idpes_responsavel'];
                 $this->idesco = $detalhe_fisica['idesco'];
                 $this->ideciv = $detalhe_fisica['ideciv'];
                 $this->idpes_con = $detalhe_fisica['idpes_con'];
                 $this->data_uniao = $detalhe_fisica['data_uniao'];
                 $this->data_obito = $detalhe_fisica['data_obito'];
                 $this->nacionalidade = $detalhe_fisica['nacionalidade'];
                 $this->idpais_estrangeiro = $detalhe_fisica['idpais_estrangeiro'];
                 $this->data_chagada_brasil = $detalhe_fisica['data_chagada_brasil'];
                 $this->idmun_nascimento = $detalhe_fisica['idmun_nascimento'];
                 $this->ultima_empresa = $detalhe_fisica['ultima_empresa'];
                 $this->idocup = $detalhe_fisica['idocup'];
                 $this->nome_mae = $detalhe_fisica['nome_mae'];
                 $this->nome_pai = $detalhe_fisica['nome_pai'];
                 $this->nome_conjuge = $detalhe_fisica['nome_conjuge'];
                 $this->nome_responsavel = $detalhe_fisica['nome_responsavel'];
                 $this->justificativa_provisorio = $detalhe_fisica['justificativa_provisorio'];
                 $this->cpf = $detalhe_fisica['cpf'];
                 $tupla['idpes'] = $this->idpes;
                 $tupla[] =& $tupla['idpes'];
                 $tupla['cpf'] = $this->cpf;
                 $tupla[] =& $tupla['cpf'];
                 $tupla['data_nasc'] = $this->data_nasc;
                 $tupla[] =& $tupla['data_nasc'];
                 $tupla['sexo'] = $this->sexo;
                 $tupla[] =& $tupla['sexo'];
                 $tupla['idpes_mae'] = $this->idpes_mae;
                 $tupla[] =& $tupla['idpes_mae'];
                 $tupla['idpes_pai'] = $this->idpes_pai;
                 $tupla[] =& $tupla['idpes_pai'];
                 $tupla['idpes_responsavel'] = $this->idpes_responsavel;
                 $tupla[] =& $tupla['idpes_responsavel'];
                 $tupla['idesco'] = $this->idesco;
                 $tupla[] =& $tupla['idesco'];
                 $tupla['ideciv'] = $this->ideciv;
                 $tupla[] =& $tupla['ideciv'];
                 $tupla['idpes_con'] = $this->idpes_con;
                 $tupla[] =& $tupla['idpes_con'];
                 $tupla['data_uniao'] = $this->data_uniao;
                 $tupla[] =& $tupla['data_uniao'];
                 $tupla['data_obito'] = $this->data_obito;
                 $tupla[] =& $tupla['data_obito'];
                 $tupla['nacionalidade'] = $this->nacionalidade;
                 $tupla[] =& $tupla['nacionalidade'];
                 $tupla['idpais_estrangeiro'] = $this->idpais_estrangeiro;
                 $tupla[] =& $tupla['idpais_estrangeiro'];
                 $tupla['data_chagada_brasil'] = $this->data_chagada_brasil;
                 $tupla[] =& $tupla['data_chagada_brasil'];
                 $tupla['idmun_nascimento'] = $this->idmun_nascimento;
                 $tupla[] =& $tupla['idmun_nascimento'];
                 $tupla['ultima_empresa'] = $this->ultima_empresa;
                 $tupla[] =& $tupla['ultima_empresa'];
                 $tupla['idocup'] = $this->idocup;
                 $tupla[] =& $tupla['idocup'];
                 $tupla['nome_mae'] = $this->nome_mae;
                 $tupla[] =& $tupla['nome_mae'];
                 $tupla['nome_pai'] = $this->nome_pai;
                 $tupla[] =& $tupla['nome_pai'];
                 $tupla['nome_conjuge'] = $this->nome_conjuge;
                 $tupla[] =& $tupla['nome_conjuge'];
                 $tupla['nome_responsavel'] = $this->nome_responsavel;
                 $tupla[] =& $tupla['nome_responsavel'];
                 $tupla['justificativa_provisorio'] = $this->justificativa_provisorio;
                 $tupla[] =& $tupla['justificativa_provisorio'];
                 return $tupla;
             }
         }
     }
     return FALSE;
 }
예제 #11
0
 function Gerar()
 {
     // CAMPOS DA NOTÍCIA A INSERIR
     $objPessoa = new clsPessoaFj();
     list($nome_) = $objPessoa->queryRapida($this->id_pessoa, "nome");
     $db = new clsBanco();
     /*
     $db->Consulta( "SELECT nm_pessoa FROM pessoa_fj WHERE cod_pessoa_fj = {$this->id_pessoa}" );
     $db->ProximoRegistro();
     list($nome_) = $db->Tupla();
     */
     $this->campoOculto("id_noticia_altera", $this->id_noticia_altera);
     $this->campoRotulo("pessoa", "Respons&aacute;vel", $nome_);
     $this->campoTexto("titulo", "Titulo", $this->titulo, "50", "100", true);
     $this->campoOculto("data_noticia", $this->data_noticia);
     $this->campoTextoInv("data_noticia_", "Data", $this->data_noticia, "15", "15", true);
     $this->campoMemo("descricao", "Descri&ccedil;&atilde;o", $this->descricao, "50", "8", true);
     //TIPO DA NOTÍCIA
     $this->campoOculto("id_tipo_deletar", $this->id_tipo_deletar);
     $this->campoOculto("qtd_tipos", $this->qtd_tipos);
     if (is_array($this->todos_tipos)) {
         foreach ($this->todos_tipos as $id => $tipo) {
             $db->Consulta("SELECT nm_tipo FROM not_tipo WHERE cod_not_tipo = {$tipo}");
             if ($db->ProximoRegistro()) {
                 list($nm_tipo) = $db->Tupla();
             }
             $this->campoTextoInv("id_tipo_{$id}", "Tipo", $nm_tipo, "15", "15", true, false, false, "", "<a href='#' onclick=\"javascript:excluirSumit({$tipo},'id_tipo_deletar') \">Clique aqui para Excluir</a>");
         }
     }
     $this->campoOculto("todos_tipos", serialize($this->todos_tipos));
     $db->Consulta("SELECT * FROM not_tipo ORDER BY nm_tipo ASC");
     $opcoes = array("Selecione");
     while ($db->ProximoRegistro()) {
         list($cod, $nome) = $db->Tupla();
         $opcoes[$cod] = $nome;
     }
     $this->campoLista("id_tipo", "Vincular com Tipo", $opcoes, 0, "insereSubmit()");
     //FOTOS VINCULADAS
     $this->campoOculto("id_foto_deletar", $this->id_foto_deletar);
     $this->campoOculto("qtd_fotos", $this->qtd_fotos);
     if (is_array($this->todas_fotos)) {
         foreach ($this->todas_fotos as $id => $foto) {
             $this->campoTextoInv("id_foto_{$id}", "Fotos", $foto, "15", "15", true, false, false, "", "<a href='#' onclick=\"javascript:excluirSumit({$foto},'id_foto_deletar') \">Clique aqui para Excluir</a>");
         }
     }
     $this->campoOculto("todas_fotos", serialize($this->todas_fotos));
     $this->campoOculto("id_foto", $this->id_foto);
     $this->campoProcurarAdicionar("id_foto_", "Vincular com foto", $this->id_foto, 10, 5, "showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'add_fotos.php?campo=id_foto\\'></iframe>');", "Procurar", "insereSubmit()", "");
     //"openurl('add_fotos.php?campo=id_foto')"
     //NOTICIAS VINCULADAS
     $this->campoOculto("id_noticia_deletar", $this->id_noticia_deletar);
     $this->campoOculto("qtd_noticias", $this->qtd_noticias);
     if (is_array($this->todas_noticias)) {
         foreach ($this->todas_noticias as $id => $noticia) {
             $this->campoTextoInv("id_noticias_{$id}", "Noticias", $noticia, "15", "15", true, false, false, "", "<a href='#' onclick=\"javascript:excluirSumit({$noticia},'id_noticia_deletar') \">Clique aqui para Excluir</a>");
         }
     }
     $this->campoOculto("todas_noticias", serialize($this->todas_noticias));
     $this->campoOculto("id_noticia", $this->id_noticia);
     $this->campoProcurarAdicionar("id_noticia_", "Vincular com noticia", $this->id_noticia, 10, 5, "showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'add_noticias.php?campo=id_noticia\\'></iframe>');", "Procurar", "insereSubmit()", "");
     //openurl('add_noticias.php?campo=id_noticia')
     //ARQUIVOS VINCULADOS
     $this->campoOculto("arquivo_deletar", $this->arquivo_deletar);
     $this->campoOculto("qtd_arquivos", $this->qtd_arquivos);
     if (is_array($this->todos_arquivos)) {
         foreach ($this->todos_arquivos as $id => $arquivo) {
             $this->campoTextoInv("nome_arquivo_{$id}", "Nome Arquivo", $arquivo[1], "15", "15", true, false, false, "", "<a href='#' onclick=\"javascript:excluirSumit({$id},'arquivo_deletar') \">Clique aqui para Excluir</a>");
         }
     }
     $this->campoOculto("todos_arquivos", serialize($this->todos_arquivos));
     $this->campoArquivo("caminho_arquivo", "Vincular Arquivo", $this->caminho_arquivo, "22", "<a  href='#' onclick=\"javascript:insereSubmit()\">Salvar Arquivo</a>");
     $this->campoTexto("nome_arquivo", "Nome do Arquivo", $this->nome_arquivo, "22", "250", false);
 }
         $cert_civil_data = date("d/m/Y", strtotime(substr($detalheDocumento['data_emissao_cert_civil'], 0, 19)));
     }
     $cert_civil_uf = $detalheDocumento['sigla_uf_cert_civil'];
     $cartorio = $detalheDocumento['cartorio_cert_civil'];
     $tit_eleitor = $detalheDocumento['num_tit_eleitor'];
     $zona = $detalheDocumento['zona_tit_eleitor'];
     $secao = $detalheDocumento['secao_tit_eleitor'];
 }
 if ($tipo_responsavel == 'p') {
     $ref_idpes_responsavel = $det_fisica['idpes_pai'];
 } elseif ($tipo_responsavel == 'm') {
     $ref_idpes_responsavel = $det_fisica['idpes_mae'];
 } else {
     $ref_idpes_responsavel = $det_fisica["idpes_responsavel"];
 }
 $obj_pessoa = new clsPessoaFj($ref_idpes_responsavel);
 $det_pessoa = $obj_pessoa->detalhe();
 $nome_resp = $det_pessoa["nome"];
 $email_resp = $det_pessoa["email"];
 if ($det_pessoa["ddd_1"] && $det_pessoa["fone_1"]) {
     $telefone_resp = "{$det_pessoa["ddd_1"]} {$det_pessoa["fone_1"]}";
 } else {
     if ($det_pessoa["ddd_2"] && $det_pessoa["fone_2"]) {
         $telefone_resp = "{$det_pessoa["ddd_2"]} {$det_pessoa["fone_2"]}";
     }
 }
 if ($det_pessoa["ddd_mov"] && $det_pessoa["fone_mov"]) {
     $celular_resp = "{$det_pessoa["ddd_mov"]} {$det_pessoa["fone_mov"]}";
 }
 $obj_fisica = new clsFisica($ref_idpes_responsavel);
 $det_fisica = $obj_fisica->detalhe();
 function Gerar()
 {
     @session_start();
     $id_visualiza = $_SESSION['id_pessoa'];
     @session_write_close();
     $this->nome = "Form4";
     $this->titulo = "Tópicos Finalizados";
     $this->addBanner();
     $cod_membro = $_GET['cod_membro'];
     $cod_grupo = $_GET['cod_grupo'];
     $imprimir = $_GET['imprimir'];
     $this->addCabecalhos(array("Imprimir"));
     $obj = new clsReuniao();
     /*  Pega lista de Reunioes Finalizadas, Verifica e mostra os Topicos Finalizados 
     			que nao foram finalizados nessa reuniao 
     		*/
     $lista = $obj->lista(false, $cod_grupo, false, false, false, false, false, false, true);
     if ($lista) {
         foreach ($lista as $reuniao) {
             $obj = new clsTopicoReuniao();
             $lista = $obj->lista(false, false, false, false, false, false, false, $reuniao['cod_reuniao']);
             if ($lista) {
                 foreach ($lista as $topicos) {
                     if ($topicos['finalizado']) {
                         $topico_comprometidos[] = $topicos['ref_cod_topico'];
                     }
                 }
             }
         }
     }
     /*  Pega lista de Reunioes não Finalizadas, Verifica que estão nessa reuniao e marca como 
     			comprometido
     		*/
     $obj = new clsReuniao();
     $lista = $obj->lista(false, $cod_grupo, false, false, false, false, false, true);
     if ($lista) {
         foreach ($lista as $reuniao) {
             $obj = new clsTopicoReuniao();
             $lista = $obj->lista(false, false, false, false, false, false, false, $reuniao['cod_reuniao']);
             if ($lista) {
                 foreach ($lista as $topicos) {
                     $topico_comprometidos[] = $topicos['ref_cod_topico'];
                 }
             }
         }
     }
     if ($topico_comprometidos) {
         $topico_finalizados = "";
         foreach ($topico_comprometidos as $topicos) {
             $obj = new clsTopicoReuniao($topicos);
             $detalhe = $obj->detalhe();
             if ($detalhe['finalizado']) {
                 $topico_finalizados[] = $topicos;
             }
         }
     }
     if ($topico_finalizados) {
         $obj = new clsTopico();
         $lista = $obj->lista(false, false, false, false, false, false, false, 1, $iniciolimit, $limite, "cod_topico DESC", false, $topico_finalizados);
         if ($lista) {
             //pdf
             $objRelatorio = new relatorios("Tópicos Finalizados", 80, false, false, "A4", "Prefeitura de Itajaí\nCentro Tecnologico de Informação e Modernização Administrativa.\nRua Alberto Werner, 100 - Vila Operária\nCEP. 88304-053 - Itajaí - SC", "#FFFFFF", "#000000", "#FFFFFF", "#FFFFFF");
             if ($imprimir == "jato") {
                 foreach ($lista as $topicos) {
                     $total = $topicos['total'];
                     $obj = new clsTopicoReuniao($topicos['cod_topico']);
                     $detalhe = $obj->detalhe();
                     if (strlen($topicos['assunto']) > 60) {
                         $descricao = substr($topicos['assunto'], 0, 60) . "...";
                     } else {
                         $descricao = $topicos['assunto'];
                     }
                     // Pega o Nome do responsável pelo Tópico
                     $obj = new clsPessoaFj($topicos['ref_idpes_cad']);
                     $detalhe = $obj->detalhe();
                     $nome = $detalhe['nome'];
                     //pdf
                     $objRelatorio->novalinha(array("Descrição: " . quebra_linhas_pdf($descricao, 70)), 0, 13 * count(explode("\n", quebra_linhas_pdf($descricao, 70))), false, false, 109, false, "#FFFFFF");
                     $objRelatorio->novalinha(array("Responsável: " . $nome), 15, 13, false, false, 109, false, "#FFFFFF");
                 }
             } else {
                 foreach ($lista as $topicos) {
                     $total = $topicos['total'];
                     $obj = new clsTopicoReuniao($topicos['cod_topico']);
                     $detalhe = $obj->detalhe();
                     if (strlen($topicos['assunto']) > 60) {
                         $descricao = substr($topicos['assunto'], 0, 60) . "...";
                     } else {
                         $descricao = $topicos['assunto'];
                     }
                     // Pega o Nome do responsável pelo Tópico
                     $obj = new clsPessoaFj($topicos['ref_idpes_cad']);
                     $detalhe = $obj->detalhe();
                     $nome = $detalhe['nome'];
                     //pdf
                     $objRelatorio->novalinha(array("Descrição: " . quebra_linhas_pdf($descricao, 70)), 0, 13 * count(explode("\n", quebra_linhas_pdf($descricao, 70))), false, false, 109);
                     $objRelatorio->novalinha(array("Responsável: " . $nome), 15, 13, false, false, 109);
                 }
             }
             //pdf
             $link = $objRelatorio->fechaPdf();
             $this->addLinhas(array("<a href='{$link}'>Clique aqui para abrir o arquivo</a>"));
             $this->array_botao = array("Cancelar");
             $this->array_botao_url = array("otopic_meus_grupos_det2.php?cod_grupo={$cod_grupo}");
         }
     }
     $this->largura = "100%";
 }
예제 #14
0
 function Gerar()
 {
     $this->titulo = "Detalhe do Setor";
     $this->cod_setor = @$_GET['cod_setor'];
     $obj_setor = new clsSetor($this->cod_setor);
     $detalhe = $obj_setor->detalhe();
     if (!$detalhe) {
         $this->addDetalhe(array("Erro", "Setor Inexistente"));
     } else {
         $objSetor = new clsSetor($detalhe["cod_setor"]);
         $parentes = $objSetor->getNiveis($detalhe["cod_setor"]);
         $strParentes = "";
         $gruda = "";
         for ($i = 0; $i < count($parentes); $i++) {
             $objSetor = new clsSetor($parentes[$i]);
             $detalheSetor = $objSetor->detalhe();
             $strParentes = " {$detalheSetor["nm_setor"]} - {$detalheSetor["sgl_setor"]}";
             //$gruda = " &gt; ";
             $gruda .= "&nbsp&nbsp&nbsp ";
             if ($i == 0) {
                 $this->addDetalhe(array("Setor", $strParentes));
             } else {
                 $this->addDetalhe(array("Setor", "{$gruda}<img src=\"imagens/nvp_setal.gif\">{$strParentes}"));
             }
         }
         $ref_cod_pessoa_cad = $detalhe["ref_cod_pessoa_cad"];
         $obj_pessoa_fj = new clsPessoaFj($ref_cod_pessoa_cad);
         $det = $obj_pessoa_fj->detalhe();
         $this->addDetalhe(array("Responsável pelo cadastro", $det["nome"]));
         $ativo = $detalhe["ativo"] == 1 ? "Sim" : "Não";
         $this->addDetalhe(array("Ativo", $ativo));
         $no_paco = $detalhe["no_paco"] ? "Sim" : "Não";
         $this->addDetalhe(array("No Paço", $no_paco));
         if ($detalhe["endereco"]) {
             $this->addDetalhe(array("Endereço", $detalhe["endereco"]));
         }
         if ($detalhe["tipo"]) {
             switch ($detalhe["tipo"]) {
                 case "s":
                     $this->addDetalhe(array("Tipo", "Secretaria"));
                     break;
                 case "a":
                     $this->addDetalhe(array("Tipo", "Altarquia"));
                     break;
                 case "f":
                     $this->addDetalhe(array("Tipo", "Fundação"));
                     break;
             }
         }
         if ($detalhe["refIdpesResp"]) {
             $obj_pessoa = new clsPessoa($detalhe["refIdpesResp"]);
             $det_pessoa = $obj_pessoa->detalhe();
             $this->addDetalhe(array("Secretario", $det_pessoa["nome"]));
         }
     }
     if (!is_null($detalhe["ref_cod_setor"])) {
         $this->url_editar = "oprot_setor_cad.php?cod_setor={$this->cod_setor}&setor_atual={$detalhe['ref_cod_setor']}";
     } else {
         $this->url_editar = "oprot_setor_cad.php?cod_setor={$this->cod_setor}";
     }
     $this->url_novo = "oprot_setor_cad.php";
     $this->url_cancelar = "oprot_setor_lst.php";
     $this->largura = "100%";
 }
예제 #15
0
 public function Editar()
 {
     session_start();
     $pessoaFj = $_SESSION['id_pessoa'];
     session_write_close();
     $objPessoa = new clsPessoa_($pessoaFj, FALSE, FALSE, $this->p_http, FALSE, $pessoaFj, date("Y-m-d H:i:s", time()), $this->p_email);
     $objPessoa->edita();
     $objFisica = new clsFisica($pessoaFj, FALSE, $this->p_sexo);
     $objFisica->edita();
     $objTelefone = new clsPessoaTelefone($pessoaFj);
     $objTelefone->excluiTodos();
     $objTelefone = new clsPessoaTelefone($pessoaFj, 1, str_replace("-", "", $this->p_telefone_1), $this->p_ddd_telefone_1);
     $objTelefone->cadastra();
     $objTelefone = new clsPessoaTelefone($pessoaFj, 2, str_replace("-", "", $this->p_telefone_2), $this->p_ddd_telefone_2);
     $objTelefone->cadastra();
     $objTelefone = new clsPessoaTelefone($pessoaFj, 3, str_replace("-", "", $this->p_telefone_mov), $this->p_ddd_telefone_mov);
     $objTelefone->cadastra();
     $objTelefone = new clsPessoaTelefone($pessoaFj, 4, str_replace("-", "", $this->p_telefone_fax), $this->p_ddd_telefone_fax);
     $objTelefone->cadastra();
     if ($this->cep && $this->idbai && $this->idlog) {
         $objEndereco = new clsPessoaEndereco($pessoaFj);
         $objEndereco2 = new clsPessoaEndereco($pessoaFj, $this->cep, $this->idlog, $this->idbai, $this->numero, $this->complemento, FALSE, $this->letra, $this->bloco, $this->apartamento, $this->andar);
         if ($objEndereco->detalhe()) {
             $objEndereco2->edita();
         } else {
             $objEndereco2->cadastra();
         }
         $objPessoa = new clsPessoaFj();
         list($this->cidade, $this->bairro, $this->logradouro, $this->cep, $this->idtlog, $this->sigla_uf, $this->bloco, $this->apartamento, $this->andar) = $objPessoa->queryRapida($pessoaFj, "cidade", "bairro", "logradouro", "cep", "idtlog", "sigla_uf", "bloco", "apartamento", "andar");
     } else {
         $this->cep_ = idFederal2int($this->cep_);
         $objEnderecoExterno = new clsEnderecoExterno($pessoaFj);
         $objEnderecoExterno2 = new clsEnderecoExterno($pessoaFj, "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();
         }
     }
     // Verifica o maior setor selecionado
     for ($i = 0; $i < 5; $i++) {
         $varNm = "setor_{$i}";
         if ($this->{$varNm}) {
             $setor = $this->{$varNm};
         }
     }
     if ($setor) {
         $sql = " ref_cod_setor_new = '{$setor}', ";
     }
     if ($this->f_senha != $this->confere_senha) {
         $sql_funcionario = "UPDATE funcionario SET senha=md5('{$this->f_senha}'), data_troca_senha = NOW(), ref_cod_funcionario_vinculo='{$this->ref_cod_funcionario_vinculo}', {$sql} ramal='{$this->f_ramal}', ref_ref_cod_pessoa_fj='{$pessoaFj}', tempo_expira_senha = 30 WHERE ref_cod_pessoa_fj={$this->p_cod_pessoa_fj}";
     } else {
         if (empty($_SESSION['convidado'])) {
             $sql_funcionario = "UPDATE funcionario SET {$sql} ramal='{$this->f_ramal}', ref_cod_funcionario_vinculo='{$this->ref_cod_funcionario_vinculo}', ref_ref_cod_pessoa_fj='{$pessoaFj}' WHERE ref_cod_pessoa_fj={$this->p_cod_pessoa_fj}";
         } else {
             $sql_funcionario = "UPDATE funcionario SET {$sql} ramal='{$this->f_ramal}', ref_ref_cod_pessoa_fj='{$pessoaFj}' WHERE ref_cod_pessoa_fj={$this->p_cod_pessoa_fj}";
         }
     }
     $db = new clsBanco();
     $db->Consulta($sql_funcionario);
     if (empty($_SESSION['convidado'])) {
         if (!$_POST["reloading"]) {
         }
     } else {
         if ($_SESSION['motivo_visita'] == 'atualizar_cadastro_e_email') {
             echo "<script>document.location='solicita_email.php';</script>";
         } else {
             echo "<script>document.location='insmess_cad.php';</script>";
         }
     }
     header('Location: index.php');
     return TRUE;
 }
예제 #16
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();
 }
예제 #17
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = 'Aluno - Detalhe';
     $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet');
     $this->cod_aluno = $_GET['cod_aluno'];
     $tmp_obj = new clsPmieducarAluno($this->cod_aluno);
     $registro = $tmp_obj->detalhe();
     if (!$registro) {
         header('Location: educar_aluno_lst.php');
         die;
     } else {
         foreach ($registro as $key => $value) {
             $this->{$key} = $value;
         }
     }
     if ($this->ref_idpes) {
         $obj_pessoa_fj = new clsPessoaFj($this->ref_idpes);
         $det_pessoa_fj = $obj_pessoa_fj->detalhe();
         $obj_fisica = new clsFisica($this->ref_idpes);
         $det_fisica = $obj_fisica->detalhe();
         $obj_fisica_raca = new clsCadastroFisicaRaca();
         $lst_fisica_raca = $obj_fisica_raca->lista($this->ref_idpes);
         if ($lst_fisica_raca) {
             $det_fisica_raca = array_shift($lst_fisica_raca);
             $obj_raca = new clsCadastroRaca($det_fisica_raca['ref_cod_raca']);
             $det_raca = $obj_raca->detalhe();
         }
         $registro['nome_aluno'] = $det_pessoa_fj['nome'];
         $registro['cpf'] = int2IdFederal($det_fisica['cpf']);
         $registro['data_nasc'] = dataToBrasil($det_fisica['data_nasc']);
         $registro['sexo'] = $det_fisica['sexo'] == 'F' ? 'Feminino' : 'Masculino';
         $obj_estado_civil = new clsEstadoCivil();
         $obj_estado_civil_lista = $obj_estado_civil->lista();
         $lista_estado_civil = array();
         if ($obj_estado_civil_lista) {
             foreach ($obj_estado_civil_lista as $estado_civil) {
                 $lista_estado_civil[$estado_civil['ideciv']] = $estado_civil['descricao'];
             }
         }
         $registro['ideciv'] = $lista_estado_civil[$det_fisica['ideciv']->ideciv];
         $registro['email'] = $det_pessoa_fj['email'];
         $registro['url'] = $det_pessoa_fj['url'];
         $registro['nacionalidade'] = $det_fisica['nacionalidade'];
         $registro['naturalidade'] = $det_fisica['idmun_nascimento']->detalhe();
         $registro['naturalidade'] = $registro['naturalidade']['nome'];
         $registro['pais_origem'] = $det_fisica['idpais_estrangeiro']->detalhe();
         $registro['pais_origem'] = $registro['pais_origem']['nome'];
         $registro['ref_idpes_responsavel'] = $det_fisica['idpes_responsavel'];
         $this->idpes_pai = $det_fisica['idpes_pai'];
         $this->idpes_mae = $det_fisica['idpes_mae'];
         $this->nm_pai = $detalhe_aluno['nm_pai'];
         $this->nm_mae = $detalhe_aluno['nm_mae'];
         if ($this->idpes_pai) {
             $obj_pessoa_pai = new clsPessoaFj($this->idpes_pai);
             $det_pessoa_pai = $obj_pessoa_pai->detalhe();
             if ($det_pessoa_pai) {
                 $registro['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) {
                 $registro['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']);
                 }
             }
         }
         $registro['ddd_fone_1'] = $det_pessoa_fj['ddd_1'];
         $registro['fone_1'] = $det_pessoa_fj['fone_1'];
         $registro['ddd_fone_2'] = $det_pessoa_fj['ddd_2'];
         $registro['fone_2'] = $det_pessoa_fj['fone_2'];
         $registro['ddd_fax'] = $det_pessoa_fj['ddd_fax'];
         $registro['fone_fax'] = $det_pessoa_fj['fone_fax'];
         $registro['ddd_mov'] = $det_pessoa_fj['ddd_mov'];
         $registro['fone_mov'] = $det_pessoa_fj['fone_mov'];
         $obj_deficiencia_pessoa = new clsCadastroFisicaDeficiencia();
         $obj_deficiencia_pessoa_lista = $obj_deficiencia_pessoa->lista($this->ref_idpes);
         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'];
             }
         }
         $ObjDocumento = new clsDocumento($this->ref_idpes);
         $detalheDocumento = $ObjDocumento->detalhe();
         $registro['rg'] = $detalheDocumento['rg'];
         if ($detalheDocumento['data_exp_rg']) {
             $registro['data_exp_rg'] = date('d/m/Y', strtotime(substr($detalheDocumento['data_exp_rg'], 0, 19)));
         }
         $registro['sigla_uf_exp_rg'] = $detalheDocumento['sigla_uf_exp_rg'];
         $registro['tipo_cert_civil'] = $detalheDocumento['tipo_cert_civil'];
         $registro['num_termo'] = $detalheDocumento['num_termo'];
         $registro['num_livro'] = $detalheDocumento['num_livro'];
         $registro['num_folha'] = $detalheDocumento['num_folha'];
         if ($detalheDocumento['data_emissao_cert_civil']) {
             $registro['data_emissao_cert_civil'] = date('d/m/Y', strtotime(substr($detalheDocumento['data_emissao_cert_civil'], 0, 19)));
         }
         $registro['sigla_uf_cert_civil'] = $detalheDocumento['sigla_uf_cert_civil'];
         $registro['cartorio_cert_civil'] = $detalheDocumento['cartorio_cert_civil'];
         $registro['num_cart_trabalho'] = $detalheDocumento['num_cart_trabalho'];
         $registro['serie_cart_trabalho'] = $detalheDocumento['serie_cart_trabalho'];
         if ($detalheDocumento['data_emissao_cart_trabalho']) {
             $registro['data_emissao_cart_trabalho'] = date('d/m/Y', strtotime(substr($detalheDocumento['data_emissao_cart_trabalho'], 0, 19)));
         }
         $registro['sigla_uf_cart_trabalho'] = $detalheDocumento['sigla_uf_cart_trabalho'];
         $registro['num_tit_eleitor'] = $detalheDocumento['num_titulo_eleitor'];
         $registro['zona_tit_eleitor'] = $detalheDocumento['zona_titulo_eleitor'];
         $registro['secao_tit_eleitor'] = $detalheDocumento['secao_titulo_eleitor'];
         $registro['idorg_exp_rg'] = $detalheDocumento['ref_idorg_rg'];
         $obj_endereco = new clsPessoaEndereco($this->ref_idpes);
         if ($obj_endereco_det = $obj_endereco->detalhe()) {
             $registro['id_cep'] = $obj_endereco_det['cep']->cep;
             $registro['id_bairro'] = $obj_endereco_det['idbai']->idbai;
             $registro['id_logradouro'] = $obj_endereco_det['idlog']->idlog;
             $registro['numero'] = $obj_endereco_det['numero'];
             $registro['letra'] = $obj_endereco_det['letra'];
             $registro['complemento'] = $obj_endereco_det['complemento'];
             $registro['andar'] = $obj_endereco_det['andar'];
             $registro['apartamento'] = $obj_endereco_det['apartamento'];
             $registro['bloco'] = $obj_endereco_det['bloco'];
             $registro['nm_logradouro'] = $obj_endereco_det['logradouro'];
             $registro['cep_'] = int2CEP($registro['id_cep']);
             $obj_bairro = new clsBairro($registro['id_bairro']);
             $obj_bairro_det = $obj_bairro->detalhe();
             if ($obj_bairro_det) {
                 $registro['nm_bairro'] = $obj_bairro_det['nome'];
             }
             $obj_log = new clsLogradouro($registro['id_logradouro']);
             $obj_log_det = $obj_log->detalhe();
             if ($obj_log_det) {
                 $registro['nm_logradouro'] = $obj_log_det['nome'];
                 $registro['idtlog'] = $obj_log_det['idtlog']->detalhe();
                 $registro['idtlog'] = $registro['idtlog']['descricao'];
                 $obj_mun = new clsMunicipio($obj_log_det['idmun']);
                 $det_mun = $obj_mun->detalhe();
                 if ($det_mun) {
                     $registro['cidade'] = ucfirst(strtolower($det_mun['nome']));
                 }
             }
             $obj_bairro = new clsBairro($registro["id_bairro"]);
             $obj_bairro_det = $obj_bairro->detalhe();
             if ($obj_bairro_det) {
                 $registro['nm_bairro'] = $obj_bairro_det['nome'];
             }
         } else {
             $obj_endereco = new clsEnderecoExterno($this->ref_idpes);
             if ($obj_endereco_det = $obj_endereco->detalhe()) {
                 $registro['id_cep'] = $obj_endereco_det['cep'];
                 $registro['cidade'] = $obj_endereco_det['cidade'];
                 $registro['nm_bairro'] = $obj_endereco_det['bairro'];
                 $registro['nm_logradouro'] = $obj_endereco_det['logradouro'];
                 $registro['numero'] = $obj_endereco_det['numero'];
                 $registro['letra'] = $obj_endereco_det['letra'];
                 $registro['complemento'] = $obj_endereco_det['complemento'];
                 $registro['andar'] = $obj_endereco_det['andar'];
                 $registro['apartamento'] = $obj_endereco_det['apartamento'];
                 $registro['bloco'] = $obj_endereco_det['bloco'];
                 $registro['idtlog'] = $obj_endereco_det['idtlog']->detalhe();
                 $registro['idtlog'] = $registro['idtlog']['descricao'];
                 $det_uf = $obj_endereco_det['sigla_uf']->detalhe();
                 $registro['ref_sigla_uf'] = $det_uf['nome'];
                 $registro['cep_'] = int2CEP($registro['id_cep']);
             }
         }
     }
     // Adiciona a informação de zona de localização junto ao bairro do
     // endereço.
     $zona = App_Model_ZonaLocalizacao::getInstance();
     $registro['nm_bairro'] = sprintf('%s (Zona %s)', $registro['nm_bairro'], $zona->getValue($obj_endereco_det['zona_localizacao']));
     if ($registro['cod_aluno']) {
         $this->addDetalhe(array('Código Aluno', $registro['cod_aluno']));
     }
     if ($registro['nome_aluno']) {
         $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno']));
     }
     if (idFederal2int($registro['cpf'])) {
         $this->addDetalhe(array('CPF', $registro['cpf']));
     }
     if ($registro['data_nasc']) {
         $this->addDetalhe(array('Data de Nascimento', $registro['data_nasc']));
     }
     /**
      * Analfabeto.
      */
     $this->addDetalhe(array('Analfabeto', $registro['analfabeto'] == 0 ? 'Não' : 'Sim'));
     if ($registro['sexo']) {
         $this->addDetalhe(array('Sexo', $registro['sexo']));
     }
     if ($registro['ideciv']) {
         $this->addDetalhe(array('Estado Civil', $registro['ideciv']));
     }
     if ($registro['id_cep']) {
         $this->addDetalhe(array('CEP', $registro['cep_']));
     }
     if ($registro['ref_sigla_uf']) {
         $this->addDetalhe(array('UF', $registro['ref_sigla_uf']));
     }
     if ($registro['cidade']) {
         $this->addDetalhe(array('Cidade', $registro['cidade']));
     }
     if ($registro['nm_bairro']) {
         $this->addDetalhe(array('Bairro', $registro['nm_bairro']));
     }
     if ($registro['nm_logradouro']) {
         $logradouro = '';
         if ($registro['idtlog']) {
             $logradouro .= $registro['idtlog'] . ' ';
         }
         $logradouro .= $registro['nm_logradouro'];
         $this->addDetalhe(array('Logradouro', $logradouro));
     }
     if ($registro['numero']) {
         $this->addDetalhe(array('Número', $registro['numero']));
     }
     if ($registro['letra']) {
         $this->addDetalhe(array('Letra', $registro['letra']));
     }
     if ($registro['complemento']) {
         $this->addDetalhe(array('Complemento', $registro['complemento']));
     }
     if ($registro['bloco']) {
         $this->addDetalhe(array('Bloco', $registro['bloco']));
     }
     if ($registro['andar']) {
         $this->addDetalhe(array('Andar', $registro['andar']));
     }
     if ($registro['apartamento']) {
         $this->addDetalhe(array('Apartamento', $registro['apartamento']));
     }
     if ($registro['naturalidade']) {
         $this->addDetalhe(array('Naturalidade', $registro['naturalidade']));
     }
     if ($registro['nacionalidade']) {
         $lista_nacionalidade = array('NULL' => 'Selecione', 1 => 'Brasileiro', 2 => 'Naturalizado Brasileiro', 3 => 'Estrangeiro');
         $registro['nacionalidade'] = $lista_nacionalidade[$registro['nacionalidade']];
         $this->addDetalhe(array('Nacionalidade', $registro['nacionalidade']));
     }
     if ($registro['pais_origem']) {
         $this->addDetalhe(array('País de Origem', $registro['pais_origem']));
     }
     $responsavel = $tmp_obj->getResponsavelAluno();
     if ($responsavel) {
         $this->addDetalhe(array('Responsável Aluno', $responsavel['nome_responsavel']));
     }
     if ($registro['ref_idpes_responsavel']) {
         $obj_pessoa_resp = new clsPessoaFj($registro['ref_idpes_responsavel']);
         $det_pessoa_resp = $obj_pessoa_resp->detalhe();
         if ($det_pessoa_resp) {
             $registro['ref_idpes_responsavel'] = $det_pessoa_resp['nome'];
         }
         $this->addDetalhe(array('Responsável', $registro['ref_idpes_responsavel']));
     }
     if ($registro['nm_pai']) {
         $this->addDetalhe(array('Pai', $registro['nm_pai']));
     }
     if ($registro["nm_mae"]) {
         $this->addDetalhe(array('Mãe', $registro['nm_mae']));
     }
     if ($registro['fone_1']) {
         if ($registro['ddd_fone_1']) {
             $registro['ddd_fone_1'] = sprintf('(%s)&nbsp;', $registro['ddd_fone_1']);
         }
         $this->addDetalhe(array('Telefone 1', $registro['ddd_fone_1'] . $registro['fone_1']));
     }
     if ($registro['fone_2']) {
         if ($registro['ddd_fone_2']) {
             $registro['ddd_fone_2'] = sprintf('(%s)&nbsp;', $registro['ddd_fone_2']);
         }
         $this->addDetalhe(array('Telefone 2', $registro['ddd_fone_2'] . $registro['fone_2']));
     }
     if ($registro['fone_mov']) {
         if ($registro['ddd_mov']) {
             $registro['ddd_mov'] = sprintf('(%s)&nbsp;', $registro['ddd_mov']);
         }
         $this->addDetalhe(array('Celular', $registro['ddd_mov'] . $registro['fone_mov']));
     }
     if ($registro['fone_fax']) {
         if ($registro['ddd_fax']) {
             $registro['ddd_fax'] = sprintf('(%s)&nbsp;', $registro['ddd_fax']);
         }
         $this->addDetalhe(array('Fax', $registro['ddd_fax'] . $registro['fone_fax']));
     }
     if ($registro['email']) {
         $this->addDetalhe(array('E-mail', $registro['email']));
     }
     if ($registro['url']) {
         $this->addDetalhe(array('Página Pessoal', $registro['url']));
     }
     if ($registro['ref_cod_aluno_beneficio']) {
         $obj_beneficio = new clsPmieducarAlunoBeneficio($registro['ref_cod_aluno_beneficio']);
         $obj_beneficio_det = $obj_beneficio->detalhe();
         $this->addDetalhe(array('Benefício', $obj_beneficio_det['nm_beneficio']));
     }
     if ($registro['ref_cod_religiao']) {
         $obj_religiao = new clsPmieducarReligiao($registro['ref_cod_religiao']);
         $obj_religiao_det = $obj_religiao->detalhe();
         $this->addDetalhe(array('Religião', $obj_religiao_det['nm_religiao']));
     }
     if ($det_raca['nm_raca']) {
         $this->addDetalhe(array('Raça', $det_raca['nm_raca']));
     }
     if ($deficiencia_pessoa) {
         $tabela = '<table border="0" width="300" cellpadding="3"><tr bgcolor="#A1B3BD" align="center"><td>Deficiências</td></tr>';
         $cor = '#D1DADF';
         foreach ($deficiencia_pessoa as $indice => $valor) {
             $cor = $cor == '#D1DADF' ? '#E4E9ED' : '#D1DADF';
             $tabela .= sprintf('<tr bgcolor="%s" align="center"><td>%s</td></tr>', $cor, $valor);
         }
         $tabela .= '</table>';
         $this->addDetalhe(array('Deficiências', $tabela));
     }
     if ($registro['rg']) {
         $this->addDetalhe(array('RG', $registro['rg']));
     }
     if ($registro['data_exp_rg']) {
         $this->addDetalhe(array('Data de Expedição RG', $registro['data_exp_rg']));
     }
     if ($registro['idorg_exp_rg']) {
         $this->addDetalhe(array('Órgão Expedição RG', $registro['idorg_exp_rg']));
     }
     if ($registro['sigla_uf_exp_rg']) {
         $this->addDetalhe(array('Estado Expedidor', $registro['sigla_uf_exp_rg']));
     }
     /**
      * @todo CoreExt_Enum?
      */
     if ($registro['tipo_cert_civil']) {
         $lista_tipo_cert_civil = array();
         $lista_tipo_cert_civil["0"] = 'Selecione';
         $lista_tipo_cert_civil[91] = 'Nascimento';
         $lista_tipo_cert_civil[92] = 'Casamento';
         $this->addDetalhe(array('Tipo Certificado Civil', $registro['tipo_cert_civil']));
     }
     if ($registro['num_termo']) {
         $this->addDetalhe(array('Termo', $registro['num_termo']));
     }
     if ($registro['num_livro']) {
         $this->addDetalhe(array('Livro', $registro['num_livro']));
     }
     if ($registro['num_folha']) {
         $this->addDetalhe(array('Folha', $registro['num_folha']));
     }
     if ($registro['data_emissao_cert_civil']) {
         $this->addDetalhe(array('Emissão Certidão Civil', $registro['data_emissao_cert_civil']));
     }
     if ($registro['sigla_uf_cert_civil']) {
         $this->addDetalhe(array('Sigla Certidão Civil', $registro['sigla_uf_cert_civil']));
     }
     if ($registro['cartorio_cert_civil']) {
         $this->addDetalhe(array('Cartório', $registro['cartorio_cert_civil']));
     }
     if ($registro['num_tit_eleitor']) {
         $this->addDetalhe(array('Título de Eleitor', $registro['num_tit_eleitor']));
     }
     if ($registro['zona_tit_eleitor']) {
         $this->addDetalhe(array('Zona', $registro['zona_tit_eleitor']));
     }
     if ($registro['secao_tit_eleitor']) {
         $this->addDetalhe(array('Seção', $registro['secao_tit_eleitor']));
     }
     if ($registro['caminho_foto']) {
         $this->addDetalhe(array('Foto', sprintf('<img src="arquivos/educar/aluno/small/%s" border="0">', $registro['caminho_foto'])));
     }
     // Transporte escolar.
     $transporteMapper = new Transporte_Model_AlunoDataMapper();
     $transporteAluno = NULL;
     try {
         $transporteAluno = $transporteMapper->find(array('aluno' => $this->cod_aluno));
     } catch (Exception $e) {
     }
     $this->addDetalhe(array('Transporte escolar', isset($transporteAluno) ? 'Sim' : 'Não'));
     if ($transporteAluno) {
         $this->addDetalhe(array('Responsável transporte', $transporteAluno->responsavel));
     }
     // 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->addDetalhe(array('Código do aluno no Educacenso/Inep', $alunoInep->alunoInep));
             if (isset($alunoInep->nomeInep)) {
                 $this->addDetalhe(array('Nome do aluno no Educacenso/Inep', $alunoInep->nomeInep));
             }
         }
     }
     $this->addDetalhe(array('Matrícula', $this->montaTabelaMatricula()));
     // Verificação de permissão para cadastro.
     $obj_permissao = new clsPermissoes();
     if ($obj_permissao->permissao_cadastra(578, $this->pessoa_logada, 7)) {
         $this->url_novo = 'educar_aluno_cad.php';
         $this->url_editar = 'educar_aluno_cad.php?cod_aluno=' . $registro['cod_aluno'];
         $this->array_botao = array('Matrícula', 'Atualizar Histórico', 'Ficha do Aluno');
         $this->array_botao_url_script = array(sprintf('go("educar_matricula_lst.php?ref_cod_aluno=%d");', $registro['cod_aluno']), sprintf('go("educar_historico_escolar_lst.php?ref_cod_aluno=%d");', $registro['cod_aluno']), sprintf('showExpansivelImprimir(400, 200, "educar_relatorio_aluno_dados.php?ref_cod_aluno=%d", [], "Relatório i-Educar")', $registro['cod_aluno']));
     }
     $this->url_cancelar = 'educar_aluno_lst.php';
     $this->largura = '100%';
 }
예제 #18
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     // Verificação de permissão para cadastro.
     $this->obj_permissao = new clsPermissoes();
     $this->nivel_usuario = $this->obj_permissao->nivel_acesso($this->pessoa_logada);
     $this->titulo = 'Aluno - Detalhe';
     $this->cod_aluno = $_GET['cod_aluno'];
     $tmp_obj = new clsPmieducarAluno($this->cod_aluno);
     $registro = $tmp_obj->detalhe();
     if (!$registro) {
         header('Location: educar_aluno_lst.php');
         die;
     } else {
         foreach ($registro as $key => $value) {
             $this->{$key} = $value;
         }
     }
     if ($this->ref_idpes) {
         $obj_pessoa_fj = new clsPessoaFj($this->ref_idpes);
         $det_pessoa_fj = $obj_pessoa_fj->detalhe();
         $obj_fisica = new clsFisica($this->ref_idpes);
         $det_fisica = $obj_fisica->detalhe();
         $obj_fisica_raca = new clsCadastroFisicaRaca();
         $lst_fisica_raca = $obj_fisica_raca->lista($this->ref_idpes);
         if ($lst_fisica_raca) {
             $det_fisica_raca = array_shift($lst_fisica_raca);
             $obj_raca = new clsCadastroRaca($det_fisica_raca['ref_cod_raca']);
             $det_raca = $obj_raca->detalhe();
         }
         $objFoto = new clsCadastroFisicaFoto($this->ref_idpes);
         $detalheFoto = $objFoto->detalhe();
         if ($detalheFoto) {
             $caminhoFoto = $detalheFoto['caminho'];
         }
         $registro['nome_aluno'] = strtoupper($det_pessoa_fj['nome']);
         $registro['cpf'] = int2IdFederal($det_fisica['cpf']);
         $registro['data_nasc'] = dataToBrasil($det_fisica['data_nasc']);
         $registro['sexo'] = $det_fisica['sexo'] == 'F' ? 'Feminino' : 'Masculino';
         $obj_estado_civil = new clsEstadoCivil();
         $obj_estado_civil_lista = $obj_estado_civil->lista();
         $lista_estado_civil = array();
         if ($obj_estado_civil_lista) {
             foreach ($obj_estado_civil_lista as $estado_civil) {
                 $lista_estado_civil[$estado_civil['ideciv']] = $estado_civil['descricao'];
             }
         }
         $registro['ideciv'] = $lista_estado_civil[$det_fisica['ideciv']->ideciv];
         $registro['email'] = $det_pessoa_fj['email'];
         $registro['url'] = $det_pessoa_fj['url'];
         $registro['nacionalidade'] = $det_fisica['nacionalidade'];
         $registro['naturalidade'] = $det_fisica['idmun_nascimento']->detalhe();
         $registro['naturalidade'] = $registro['naturalidade']['nome'];
         $registro['pais_origem'] = $det_fisica['idpais_estrangeiro']->detalhe();
         $registro['pais_origem'] = $registro['pais_origem']['nome'];
         $registro['ref_idpes_responsavel'] = $det_fisica['idpes_responsavel'];
         $this->idpes_pai = $det_fisica['idpes_pai'];
         $this->idpes_mae = $det_fisica['idpes_mae'];
         $this->sus = $det_fisica['sus'];
         $this->nm_pai = $registro['nm_pai'];
         $this->nm_mae = $registro['nm_mae'];
         if ($this->idpes_pai) {
             $obj_pessoa_pai = new clsPessoaFj($this->idpes_pai);
             $det_pessoa_pai = $obj_pessoa_pai->detalhe();
             if ($det_pessoa_pai) {
                 $registro['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) {
                 $registro['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']);
                 }
             }
         }
         $registro['ddd_fone_1'] = $det_pessoa_fj['ddd_1'];
         $registro['fone_1'] = $det_pessoa_fj['fone_1'];
         $registro['ddd_fone_2'] = $det_pessoa_fj['ddd_2'];
         $registro['fone_2'] = $det_pessoa_fj['fone_2'];
         $registro['ddd_fax'] = $det_pessoa_fj['ddd_fax'];
         $registro['fone_fax'] = $det_pessoa_fj['fone_fax'];
         $registro['ddd_mov'] = $det_pessoa_fj['ddd_mov'];
         $registro['fone_mov'] = $det_pessoa_fj['fone_mov'];
         $obj_deficiencia_pessoa = new clsCadastroFisicaDeficiencia();
         $obj_deficiencia_pessoa_lista = $obj_deficiencia_pessoa->lista($this->ref_idpes);
         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'];
             }
         }
         $ObjDocumento = new clsDocumento($this->ref_idpes);
         $detalheDocumento = $ObjDocumento->detalhe();
         $registro['rg'] = $detalheDocumento['rg'];
         if ($detalheDocumento['data_exp_rg']) {
             $registro['data_exp_rg'] = date('d/m/Y', strtotime(substr($detalheDocumento['data_exp_rg'], 0, 19)));
         }
         $registro['sigla_uf_exp_rg'] = $detalheDocumento['sigla_uf_exp_rg'];
         $registro['tipo_cert_civil'] = $detalheDocumento['tipo_cert_civil'];
         $registro['num_termo'] = $detalheDocumento['num_termo'];
         $registro['num_livro'] = $detalheDocumento['num_livro'];
         $registro['num_folha'] = $detalheDocumento['num_folha'];
         if ($detalheDocumento['data_emissao_cert_civil']) {
             $registro['data_emissao_cert_civil'] = date('d/m/Y', strtotime(substr($detalheDocumento['data_emissao_cert_civil'], 0, 19)));
         }
         $registro['sigla_uf_cert_civil'] = $detalheDocumento['sigla_uf_cert_civil'];
         $registro['cartorio_cert_civil'] = $detalheDocumento['cartorio_cert_civil'];
         $registro['num_cart_trabalho'] = $detalheDocumento['num_cart_trabalho'];
         $registro['serie_cart_trabalho'] = $detalheDocumento['serie_cart_trabalho'];
         if ($detalheDocumento['data_emissao_cart_trabalho']) {
             $registro['data_emissao_cart_trabalho'] = date('d/m/Y', strtotime(substr($detalheDocumento['data_emissao_cart_trabalho'], 0, 19)));
         }
         $registro['sigla_uf_cart_trabalho'] = $detalheDocumento['sigla_uf_cart_trabalho'];
         $registro['num_tit_eleitor'] = $detalheDocumento['num_titulo_eleitor'];
         $registro['zona_tit_eleitor'] = $detalheDocumento['zona_titulo_eleitor'];
         $registro['secao_tit_eleitor'] = $detalheDocumento['secao_titulo_eleitor'];
         $registro['idorg_exp_rg'] = $detalheDocumento['ref_idorg_rg'];
         $obj_endereco = new clsPessoaEndereco($this->ref_idpes);
         if ($obj_endereco_det = $obj_endereco->detalhe()) {
             $registro['id_cep'] = $obj_endereco_det['cep']->cep;
             $registro['id_bairro'] = $obj_endereco_det['idbai']->idbai;
             $registro['id_logradouro'] = $obj_endereco_det['idlog']->idlog;
             $registro['numero'] = $obj_endereco_det['numero'];
             $registro['letra'] = $obj_endereco_det['letra'];
             $registro['complemento'] = $obj_endereco_det['complemento'];
             $registro['andar'] = $obj_endereco_det['andar'];
             $registro['apartamento'] = $obj_endereco_det['apartamento'];
             $registro['bloco'] = $obj_endereco_det['bloco'];
             $registro['nm_logradouro'] = $obj_endereco_det['logradouro'];
             $registro['cep_'] = int2CEP($registro['id_cep']);
             $obj_bairro = new clsBairro($registro['id_bairro']);
             $obj_bairro_det = $obj_bairro->detalhe();
             if ($obj_bairro_det) {
                 $registro['nm_bairro'] = $obj_bairro_det['nome'];
             }
             $obj_log = new clsLogradouro($registro['id_logradouro']);
             $obj_log_det = $obj_log->detalhe();
             if ($obj_log_det) {
                 $registro['nm_logradouro'] = $obj_log_det['nome'];
                 $registro['idtlog'] = $obj_log_det['idtlog']->detalhe();
                 $registro['idtlog'] = $registro['idtlog']['descricao'];
                 $obj_mun = new clsMunicipio($obj_log_det['idmun']);
                 $det_mun = $obj_mun->detalhe();
                 if ($det_mun) {
                     $registro['cidade'] = ucfirst(strtolower($det_mun['nome']));
                 }
             }
             $obj_bairro = new clsBairro($registro["id_bairro"]);
             $obj_bairro_det = $obj_bairro->detalhe();
             if ($obj_bairro_det) {
                 $registro['nm_bairro'] = $obj_bairro_det['nome'];
             }
         } else {
             $obj_endereco = new clsEnderecoExterno($this->ref_idpes);
             if ($obj_endereco_det = $obj_endereco->detalhe()) {
                 $registro['id_cep'] = $obj_endereco_det['cep'];
                 $registro['cidade'] = $obj_endereco_det['cidade'];
                 $registro['nm_bairro'] = $obj_endereco_det['bairro'];
                 $registro['nm_logradouro'] = $obj_endereco_det['logradouro'];
                 $registro['numero'] = $obj_endereco_det['numero'];
                 $registro['letra'] = $obj_endereco_det['letra'];
                 $registro['complemento'] = $obj_endereco_det['complemento'];
                 $registro['andar'] = $obj_endereco_det['andar'];
                 $registro['apartamento'] = $obj_endereco_det['apartamento'];
                 $registro['bloco'] = $obj_endereco_det['bloco'];
                 $registro['idtlog'] = $obj_endereco_det['idtlog']->detalhe();
                 $registro['idtlog'] = $registro['idtlog']['descricao'];
                 $det_uf = $obj_endereco_det['sigla_uf']->detalhe();
                 $registro['ref_sigla_uf'] = $det_uf['nome'];
                 $registro['cep_'] = int2CEP($registro['id_cep']);
             }
         }
     }
     // Adiciona a informação de zona de localização junto ao bairro do
     // endereço.
     $zona = App_Model_ZonaLocalizacao::getInstance();
     $registro['nm_bairro'] = sprintf('%s (Zona %s)', $registro['nm_bairro'], $zona->getValue($obj_endereco_det['zona_localizacao']));
     if ($registro['cod_aluno']) {
         $this->addDetalhe(array('Código Aluno', $registro['cod_aluno']));
     }
     // código inep
     $alunoMapper = new Educacenso_Model_AlunoDataMapper();
     $alunoInep = NULL;
     try {
         $alunoInep = $alunoMapper->find(array('aluno' => $this->cod_aluno));
         $this->addDetalhe(array('Código inep', $alunoInep->alunoInep));
     } catch (Exception $e) {
     }
     // código estado
     $this->addDetalhe(array('Código estado', $registro['aluno_estado_id']));
     if ($registro['caminho_foto']) {
         $this->addDetalhe(array('Foto', sprintf('<img src="arquivos/educar/aluno/small/%s" border="0">', $registro['caminho_foto'])));
     }
     if ($registro['nome_aluno']) {
         if ($caminhoFoto != null and $caminhoFoto != '') {
             $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno'] . '<p><img height="117" src="' . $caminhoFoto . '"/></p>'));
         } else {
             $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno']));
         }
     }
     if (idFederal2int($registro['cpf'])) {
         $this->addDetalhe(array('CPF', $registro['cpf']));
     }
     if ($registro['data_nasc']) {
         $this->addDetalhe(array('Data de Nascimento', $registro['data_nasc']));
     }
     /**
      * Analfabeto.
      */
     $this->addDetalhe(array('Analfabeto', $registro['analfabeto'] == 0 ? 'Não' : 'Sim'));
     if ($registro['sexo']) {
         $this->addDetalhe(array('Sexo', $registro['sexo']));
     }
     if ($registro['ideciv']) {
         $this->addDetalhe(array('Estado Civil', $registro['ideciv']));
     }
     if ($registro['id_cep']) {
         $this->addDetalhe(array('CEP', $registro['cep_']));
     }
     if ($registro['ref_sigla_uf']) {
         $this->addDetalhe(array('UF', $registro['ref_sigla_uf']));
     }
     if ($registro['cidade']) {
         $this->addDetalhe(array('Cidade', $registro['cidade']));
     }
     if ($registro['nm_bairro']) {
         $this->addDetalhe(array('Bairro', $registro['nm_bairro']));
     }
     if ($registro['nm_logradouro']) {
         $logradouro = '';
         if ($registro['idtlog']) {
             $logradouro .= $registro['idtlog'] . ' ';
         }
         $logradouro .= $registro['nm_logradouro'];
         $this->addDetalhe(array('Logradouro', $logradouro));
     }
     if ($registro['numero']) {
         $this->addDetalhe(array('Número', $registro['numero']));
     }
     if ($registro['letra']) {
         $this->addDetalhe(array('Letra', $registro['letra']));
     }
     if ($registro['complemento']) {
         $this->addDetalhe(array('Complemento', $registro['complemento']));
     }
     if ($registro['bloco']) {
         $this->addDetalhe(array('Bloco', $registro['bloco']));
     }
     if ($registro['andar']) {
         $this->addDetalhe(array('Andar', $registro['andar']));
     }
     if ($registro['apartamento']) {
         $this->addDetalhe(array('Apartamento', $registro['apartamento']));
     }
     if ($registro['naturalidade']) {
         $this->addDetalhe(array('Naturalidade', $registro['naturalidade']));
     }
     if ($registro['nacionalidade']) {
         $lista_nacionalidade = array('NULL' => 'Selecione', 1 => 'Brasileiro', 2 => 'Naturalizado Brasileiro', 3 => 'Estrangeiro');
         $registro['nacionalidade'] = $lista_nacionalidade[$registro['nacionalidade']];
         $this->addDetalhe(array('Nacionalidade', $registro['nacionalidade']));
     }
     if ($registro['pais_origem']) {
         $this->addDetalhe(array('País de Origem', $registro['pais_origem']));
     }
     $responsavel = $tmp_obj->getResponsavelAluno();
     if ($responsavel) {
         $this->addDetalhe(array('Responsável Aluno', $responsavel['nome_responsavel']));
     }
     if ($registro['ref_idpes_responsavel']) {
         $obj_pessoa_resp = new clsPessoaFj($registro['ref_idpes_responsavel']);
         $det_pessoa_resp = $obj_pessoa_resp->detalhe();
         if ($det_pessoa_resp) {
             $registro['ref_idpes_responsavel'] = $det_pessoa_resp['nome'];
         }
         $this->addDetalhe(array('Responsável', $registro['ref_idpes_responsavel']));
     }
     if ($registro['nm_pai']) {
         $this->addDetalhe(array('Pai', $registro['nm_pai']));
     }
     if ($registro["nm_mae"]) {
         $this->addDetalhe(array('Mãe', $registro['nm_mae']));
     }
     if ($registro['fone_1']) {
         if ($registro['ddd_fone_1']) {
             $registro['ddd_fone_1'] = sprintf('(%s)&nbsp;', $registro['ddd_fone_1']);
         }
         $this->addDetalhe(array('Telefone 1', $registro['ddd_fone_1'] . $registro['fone_1']));
     }
     if ($registro['fone_2']) {
         if ($registro['ddd_fone_2']) {
             $registro['ddd_fone_2'] = sprintf('(%s)&nbsp;', $registro['ddd_fone_2']);
         }
         $this->addDetalhe(array('Telefone 2', $registro['ddd_fone_2'] . $registro['fone_2']));
     }
     if ($registro['fone_mov']) {
         if ($registro['ddd_mov']) {
             $registro['ddd_mov'] = sprintf('(%s)&nbsp;', $registro['ddd_mov']);
         }
         $this->addDetalhe(array('Celular', $registro['ddd_mov'] . $registro['fone_mov']));
     }
     if ($registro['fone_fax']) {
         if ($registro['ddd_fax']) {
             $registro['ddd_fax'] = sprintf('(%s)&nbsp;', $registro['ddd_fax']);
         }
         $this->addDetalhe(array('Fax', $registro['ddd_fax'] . $registro['fone_fax']));
     }
     if ($registro['email']) {
         $this->addDetalhe(array('E-mail', $registro['email']));
     }
     if ($registro['url']) {
         $this->addDetalhe(array('Página Pessoal', $registro['url']));
     }
     if ($registro['ref_cod_aluno_beneficio']) {
         $obj_beneficio = new clsPmieducarAlunoBeneficio($registro['ref_cod_aluno_beneficio']);
         $obj_beneficio_det = $obj_beneficio->detalhe();
         $this->addDetalhe(array('Benefício', $obj_beneficio_det['nm_beneficio']));
     }
     if ($registro['ref_cod_religiao']) {
         $obj_religiao = new clsPmieducarReligiao($registro['ref_cod_religiao']);
         $obj_religiao_det = $obj_religiao->detalhe();
         $this->addDetalhe(array('Religião', $obj_religiao_det['nm_religiao']));
     }
     if ($det_raca['nm_raca']) {
         $this->addDetalhe(array('Raça', $det_raca['nm_raca']));
     }
     if ($deficiencia_pessoa) {
         $tabela = '<table border="0" width="300" cellpadding="3"><tr bgcolor="#A1B3BD" align="center"><td>Deficiências</td></tr>';
         $cor = '#D1DADF';
         foreach ($deficiencia_pessoa as $indice => $valor) {
             $cor = $cor == '#D1DADF' ? '#E4E9ED' : '#D1DADF';
             $tabela .= sprintf('<tr bgcolor="%s" align="center"><td>%s</td></tr>', $cor, $valor);
         }
         $tabela .= '</table>';
         $this->addDetalhe(array('Deficiências', $tabela));
     }
     if ($registro['rg']) {
         $this->addDetalhe(array('RG', $registro['rg']));
     }
     if ($registro['data_exp_rg']) {
         $this->addDetalhe(array('Data de Expedição RG', $registro['data_exp_rg']));
     }
     if ($registro['idorg_exp_rg']) {
         $this->addDetalhe(array('Órgão Expedição RG', $registro['idorg_exp_rg']));
     }
     if ($registro['sigla_uf_exp_rg']) {
         $this->addDetalhe(array('Estado Expedidor', $registro['sigla_uf_exp_rg']));
     }
     /**
      * @todo CoreExt_Enum?
      */
     if ($registro['tipo_cert_civil']) {
         $lista_tipo_cert_civil = array();
         $lista_tipo_cert_civil["0"] = 'Selecione';
         $lista_tipo_cert_civil[91] = 'Nascimento';
         $lista_tipo_cert_civil[92] = 'Casamento';
         $this->addDetalhe(array('Tipo Certificado Civil', $registro['tipo_cert_civil']));
     }
     if ($registro['num_termo']) {
         $this->addDetalhe(array('Termo', $registro['num_termo']));
     }
     if ($registro['num_livro']) {
         $this->addDetalhe(array('Livro', $registro['num_livro']));
     }
     if ($registro['num_folha']) {
         $this->addDetalhe(array('Folha', $registro['num_folha']));
     }
     if ($registro['data_emissao_cert_civil']) {
         $this->addDetalhe(array('Emissão Certidão Civil', $registro['data_emissao_cert_civil']));
     }
     if ($registro['sigla_uf_cert_civil']) {
         $this->addDetalhe(array('Sigla Certidão Civil', $registro['sigla_uf_cert_civil']));
     }
     if ($registro['cartorio_cert_civil']) {
         $this->addDetalhe(array('Cartório', $registro['cartorio_cert_civil']));
     }
     if ($registro['num_tit_eleitor']) {
         $this->addDetalhe(array('Título de Eleitor', $registro['num_tit_eleitor']));
     }
     if ($registro['zona_tit_eleitor']) {
         $this->addDetalhe(array('Zona', $registro['zona_tit_eleitor']));
     }
     if ($registro['secao_tit_eleitor']) {
         $this->addDetalhe(array('Seção', $registro['secao_tit_eleitor']));
     }
     // Transporte escolar.
     $transporteMapper = new Transporte_Model_AlunoDataMapper();
     $transporteAluno = NULL;
     try {
         $transporteAluno = $transporteMapper->find(array('aluno' => $this->cod_aluno));
     } catch (Exception $e) {
     }
     $this->addDetalhe(array('Transporte escolar', isset($transporteAluno) && $transporteAluno->responsavel != 'Não utiliza' ? 'Sim' : 'Não'));
     if ($transporteAluno && $transporteAluno->responsavel != 'Não utiliza') {
         $this->addDetalhe(array('Responsável transporte', $transporteAluno->responsavel));
     }
     if ($this->obj_permissao->permissao_cadastra(578, $this->pessoa_logada, 7)) {
         $this->url_novo = '/module/Cadastro/aluno';
         $this->url_editar = '/module/Cadastro/aluno?id=' . $registro['cod_aluno'];
         $this->array_botao = array('Nova matrícula', 'Atualizar Histórico');
         $this->array_botao_url_script = array(sprintf('go("educar_matricula_cad.php?ref_cod_aluno=%d");', $registro['cod_aluno']), sprintf('go("educar_historico_escolar_lst.php?ref_cod_aluno=%d");', $registro['cod_aluno']));
     }
     $objFichaMedica = new clsModulesFichaMedicaAluno($this->cod_aluno);
     $reg = $objFichaMedica->detalhe();
     if ($reg) {
         $this->addDetalhe(array('<span id="fmedica"></span>Altura/metro', $reg['altura']));
         if (trim($reg['peso']) != '') {
             $this->addDetalhe(array('Peso/kg', $reg['peso']));
         }
         if (trim($reg['grupo_sanguineo']) != '') {
             $this->addDetalhe(array('Grupo sanguíneo', $reg['grupo_sanguineo']));
         }
         if (trim($reg['fator_rh']) != '') {
             $this->addDetalhe(array('Fator RH', $reg['fator_rh']));
         }
         if (trim($this->sus) != '') {
             $this->addDetalhe(array('Número do cartão do SUS', $this->sus));
         }
         $this->addDetalhe(array('Possui alergia a algum medicamento', $reg['alergia_medicamento'] == 'S' ? 'Sim' : 'Não'));
         if (trim($reg['desc_alergia_medicamento']) != '') {
             $this->addDetalhe(array('Quais', $reg['desc_alergia_medicamento']));
         }
         $this->addDetalhe(array('Possui alergia a algum alimento', $reg['alergia_alimento'] == 'S' ? 'Sim' : 'Não'));
         if (trim($reg['desc_alergia_alimento']) != '') {
             $this->addDetalhe(array('Quais', $reg['desc_alergia_alimento']));
         }
         $this->addDetalhe(array('Possui alguma doenca congênita', $reg['doenca_congenita'] == 'S' ? 'Sim' : 'Não'));
         if (trim($reg['desc_doenca_congenita']) != '') {
             $this->addDetalhe(array('Quais', $reg['desc_doenca_congenita']));
         }
         $this->addDetalhe(array('É fumante', $reg['fumante'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Já contraiu caxumba', $reg['doenca_caxumba'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Já contraiu sarampo', $reg['doenca_sarampo'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Já contraiu rubeola', $reg['doenca_rubeola'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Já contraiu catapora', $reg['doenca_catapora'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Já contraiu escarlatina', $reg['doenca_escarlatina'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Já contraiu coqueluche', $reg['doenca_coqueluche'] == 'S' ? 'Sim' : 'Não'));
         if (trim($reg['doenca_outras']) != '') {
             $this->addDetalhe(array('Outras doenças que o aluno já contraiu', $reg['doenca_outras']));
         }
         $this->addDetalhe(array('Epilético', $reg['epiletico'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Está em tratamento', $reg['epiletico_tratamento'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Hemofílico', $reg['hemofilico'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Hipertenso', $reg['hipertenso'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Asmático', $reg['asmatico'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Diabético', $reg['diabetico'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Depende de insulina', $reg['insulina'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('Faz tratamento médico', $reg['tratamento_medico'] == 'S' ? 'Sim' : 'Não'));
         if (trim($reg['desc_tratamento_medico']) != '') {
             $this->addDetalhe(array('Qual', $reg['desc_tratamento_medico']));
         }
         $this->addDetalhe(array('Ingere medicação específica', $reg['medicacao_especifica'] == 'S' ? 'Sim' : 'Não'));
         if (trim($reg['desc_medicacao_especifica']) != '') {
             $this->addDetalhe(array('Qual', $reg['desc_medicacao_especifica']));
         }
         $this->addDetalhe(array('Acompanhamento médico ou psicológico', $reg['acomp_medico_psicologico'] == 'S' ? 'Sim' : 'Não'));
         if (trim($reg['desc_acomp_medico_psicologico']) != '') {
             $this->addDetalhe(array('Motivo', $reg['desc_acomp_medico_psicologico']));
         }
         $this->addDetalhe(array('Restrição para atividades físicas', $reg['restricao_atividade_fisica'] == 'S' ? 'Sim' : 'Não'));
         if (trim($reg['desc_restricao_atividade_fisica']) != '') {
             $this->addDetalhe(array('Qual', $reg['desc_restricao_atividade_fisica']));
         }
         $this->addDetalhe(array('Teve alguma fratura ou trauma', $reg['fratura_trauma'] == 'S' ? 'Sim' : 'Não'));
         if (trim($reg['desc_fratura_trauma']) != '') {
             $this->addDetalhe(array('Qual', $reg['desc_fratura_trauma']));
         }
         $this->addDetalhe(array('Tem plano de saúde', $reg['plano_saude'] == 'S' ? 'Sim' : 'Não'));
         if (trim($reg['desc_plano_saude']) != '') {
             $this->addDetalhe(array('Qual', $reg['desc_plano_saude']));
         }
         $this->addDetalhe(array('<span id="tr_tit_dados_hospital">Em caso de emergência, levar para hospital ou clínica</span>'));
         $this->addDetalhe(array('Nome', $reg['hospital_clinica']));
         $this->addDetalhe(array('Endereço', $reg['hospital_clinica_endereco']));
         $this->addDetalhe(array('Telefone', $reg['hospital_clinica_telefone']));
         $this->addDetalhe(array('<span id="tr_tit_dados_responsavel">Em caso de emergência, se não for possível contatar os responsáveis, comunicar</span>'));
         $this->addDetalhe(array('Nome', $reg['responsavel']));
         $this->addDetalhe(array('Parentesco', $reg['responsavel_parentesco']));
         $this->addDetalhe(array('Telefone', $reg['responsavel_parentesco_telefone']));
         $this->addDetalhe(array('Celular', $reg['responsavel_parentesco_celular']));
     }
     $objUniforme = new clsModulesUniformeAluno($this->cod_aluno);
     $reg = $objUniforme->detalhe();
     if ($reg) {
         $this->addDetalhe(array('<span id="funiforme"></span>Recebeu uniforme escolar', $reg['recebeu_uniforme'] == 'S' ? 'Sim' : 'Não'));
         $this->addDetalhe(array('<span class="tit_uniforme">Camiseta</span>'));
         $this->addDetalhe(array('Quantidade', $reg['quantidade_camiseta']));
         $this->addDetalhe(array('Tamanho', $reg['tamanho_camiseta']));
         $this->addDetalhe(array('<span class="tit_uniforme">Blusa/Jaqueta</span>'));
         $this->addDetalhe(array('Quantidade', $reg['quantidade_blusa_jaqueta']));
         $this->addDetalhe(array('Tamanho', $reg['tamanho_blusa_jaqueta']));
         $this->addDetalhe(array('<span class="tit_uniforme">Bermuda</span>'));
         $this->addDetalhe(array('Quantidade', $reg['quantidade_bermuda']));
         $this->addDetalhe(array('Tamanho', $reg['tamanho_bermuda']));
         $this->addDetalhe(array('<span class="tit_uniforme">Calça</span>'));
         $this->addDetalhe(array('Quantidade', $reg['quantidade_calca']));
         $this->addDetalhe(array('Tamanho', $reg['tamanho_calca']));
         $this->addDetalhe(array('<span class="tit_uniforme">Saia</span>'));
         $this->addDetalhe(array('Quantidade', $reg['quantidade_saia']));
         $this->addDetalhe(array('Tamanho', $reg['tamanho_saia']));
         $this->addDetalhe(array('<span class="tit_uniforme">Calçado</span>'));
         $this->addDetalhe(array('Quantidade', $reg['quantidade_calcado']));
         $this->addDetalhe(array('Tamanho', $reg['tamanho_calcado']));
         $this->addDetalhe(array('<span class="tit_uniforme">Meia</span>'));
         $this->addDetalhe(array('Quantidade', $reg['quantidade_meia']));
         $this->addDetalhe(array('Tamanho', $reg['tamanho_meia']));
     }
     $objMoradia = new clsModulesMoradiaAluno($this->cod_aluno);
     $reg = $objMoradia->detalhe();
     if ($reg) {
         $moradia = '';
         switch ($reg['moradia']) {
             case 'A':
                 $moradia = 'Apartamento';
                 break;
             case 'C':
                 $moradia = 'Casa';
                 switch ($reg['material']) {
                     case 'A':
                         $moradia .= ' de alvenaria';
                         break;
                     case 'M':
                         $moradia .= ' de madeira';
                         break;
                     case 'I':
                         $moradia .= ' mista';
                         break;
                 }
                 break;
             case 'O':
                 $moradia = 'Outra: ' . $reg['casa_outra'];
                 break;
             default:
                 $moradia = 'Não informado';
         }
         $this->addDetalhe(array('<span id="fmoradia"></span>Moradia', $moradia));
         $situacao;
         switch ($reg['moradia_situacao']) {
             case 1:
                 $situacao = 'Alugado';
                 break;
             case 2:
                 $situacao = 'Próprio';
                 break;
             case 3:
                 $situacao = 'Cedido';
                 break;
             case 4:
                 $situacao = 'Financiado';
                 break;
             case 5:
                 $situacao = 'Outra';
                 break;
         }
         $this->addDetalhe(array('Situação', $situacao));
         $this->addDetalhe(array('Quantidade de quartos', $reg['quartos']));
         $this->addDetalhe(array('Quantidade de salas', $reg['sala']));
         $this->addDetalhe(array('Quantidade de copas', $reg['copa']));
         $this->addDetalhe(array('Quantidade de banheiros', $reg['banheiro']));
         $this->addDetalhe(array('Quantidade de garagens', $reg['garagem']));
         $this->addDetalhe(array('Possui empregada doméstica', $reg['empregada_domestica']));
         $this->addDetalhe(array('Possui automóvel', $reg['automovel']));
         $this->addDetalhe(array('Possui motocicleta', $reg['motocicleta']));
         $this->addDetalhe(array('Possui computador', $reg['computador']));
         $this->addDetalhe(array('Possui geladeira', $reg['geladeira']));
         $this->addDetalhe(array('Possui fogão', $reg['fogao']));
         $this->addDetalhe(array('Possui máquina de lavar', $reg['maquina_lavar']));
         $this->addDetalhe(array('Possui microondas', $reg['microondas']));
         $this->addDetalhe(array('Possui vídeo/dvd', $reg['video_dvd']));
         $this->addDetalhe(array('Possui televisão', $reg['televisao']));
         $this->addDetalhe(array('Possui celular', $reg['celular']));
         $this->addDetalhe(array('Possui telefone', $reg['telefone']));
         $this->addDetalhe(array('Quantidade de pessoas', $reg['quant_pessoas']));
         $this->addDetalhe(array('Renda familiar', 'R$ ' . $reg['renda']));
         $this->addDetalhe(array('Possui água encanada', $reg['agua_encanada']));
         $this->addDetalhe(array('Possui poço', $reg['poco']));
         $this->addDetalhe(array('Possui energia elétrica', $reg['energia']));
         $this->addDetalhe(array('Possui tratamento de esgoto', $reg['esgoto']));
         $this->addDetalhe(array('Possui fossa', $reg['fossa']));
         $this->addDetalhe(array('Possui coleta de lixo', $reg['lixo']));
     }
     $this->url_cancelar = 'educar_aluno_lst.php';
     $this->largura = '100%';
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_index.php" => "i-Educar - Escola", "" => "Detalhe do aluno"));
     $this->enviaLocalizacao($localizacao->montar());
     $this->addDetalhe("<input type='hidden' id='escola_id' name='aluno_id' value='{$registro['ref_cod_escola']}' />");
     $this->addDetalhe("<input type='hidden' id='aluno_id' name='aluno_id' value='{$registro['cod_aluno']}' />");
     // js
     Portabilis_View_Helper_Application::loadJQueryLib($this);
     $scripts = array('/modules/Portabilis/Assets/Javascripts/Utils.js', '/modules/Portabilis/Assets/Javascripts/ClientApi.js', '/modules/Cadastro/Assets/Javascripts/AlunoShow.js');
     Portabilis_View_Helper_Application::loadJavascript($this, $scripts);
     $styles = array('/modules/Cadastro/Assets/Stylesheets/Aluno.css');
     Portabilis_View_Helper_Application::loadStylesheet($this, $styles);
 }
예제 #19
0
 if ($idpes_pai) {
     $obj_pessoa_pai = new clsPessoaFj($idpes_pai);
     $det_pessoa_pai = $obj_pessoa_pai->detalhe();
     if ($det_pessoa_pai) {
         $nm_pai = $det_pessoa_pai['nome'];
         $xml .= sprintf('<nm_pai>%s</nm_pai>', $nm_pai) . PHP_EOL;
         $obj_cpf = new clsFisica($idpes_pai);
         $det_cpf = $obj_cpf->detalhe();
         if ($det_cpf['cpf']) {
             $cpf_pai = int2CPF($det_cpf['cpf']);
             $xml .= sprintf('<cpf_pai>%s</cpf_pai>', $cpf_pai) . PHP_EOL;
         }
     }
 }
 if ($idpes_mae) {
     $obj_pessoa_mae = new clsPessoaFj($idpes_mae);
     $det_pessoa_mae = $obj_pessoa_mae->detalhe();
     if ($det_pessoa_mae) {
         $nm_mae = $det_pessoa_mae['nome'];
         $xml .= sprintf('<nm_mae>%s</nm_mae>', $nm_mae) . PHP_EOL;
         // CPF
         $obj_cpf = new clsFisica($idpes_mae);
         $det_cpf = $obj_cpf->detalhe();
         if ($det_cpf['cpf']) {
             $cpf_mae = int2CPF($det_cpf['cpf']);
             $xml .= sprintf('<cpf_mae>%s</cpf_mae>', $cpf_mae) . PHP_EOL;
         }
     }
 }
 if (!$tipo_responsavel) {
     if ($nm_pai) {
 function detalhe()
 {
     if ($this->idpes) {
         $tupla = parent::detalhe();
         $objJuridica = new clsJuridica($this->idpes);
         $detalhe = $objJuridica->detalhe();
         if ($detalhe) {
             $this->fantasia = $detalhe['fantasia'];
             $this->cnpj = $detalhe['cnpj'];
             $this->insc_estadual = $detalhe['insc_estadual'];
             $this->capital_social = $detalhe['capital_social'];
             $tupla['insc_estadual'] = $this->insc_estadual;
             $tupla[] =& $tupla['insc_estadual'];
             $tupla['capital_social'] = $this->capital_social;
             $tupla[] =& $tupla['capital_social'];
             $tupla['cnpj'] = $this->cnpj;
             $tupla[] =& $tupla['cnpj'];
             $tupla['fantasia'] = $this->fantasia;
             $tupla[] =& $tupla['fantasia'];
         }
         return $tupla;
     } elseif ($this->cnpj) {
         $objJuridica = new clsJuridica(false, $this->cnpj);
         $detalhe = $objJuridica->detalhe();
         if ($detalhe) {
             $this->fantasia = $detalhe['fantasia'];
             $this->cnpj = $detalhe['cnpj'];
             $this->insc_estadual = $detalhe['insc_estadual'];
             $this->capital_social = $detalhe['capital_social'];
             $this->idpes = $detalhe['idpes'];
             $tupla = parent::detalhe();
             $tupla['insc_estadual'] = $this->insc_estadual;
             $tupla[] =& $tupla['insc_estadual'];
             $tupla['capital_social'] = $this->capital_social;
             $tupla[] =& $tupla['capital_social'];
             $tupla['cnpj'] = $this->cnpj;
             $tupla[] =& $tupla['cnpj'];
             $tupla['fantasia'] = $this->fantasia;
             $tupla[] =& $tupla['fantasia'];
         }
         return $tupla;
     }
     return false;
 }
예제 #21
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%";
 }
예제 #22
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";
 }
예제 #23
0
 function Gerar()
 {
     $this->campoOculto("cod_cad", $this->cod_cad);
     $this->campoOculto("cod_jornal", $this->cod_jornal);
     $db = new clsBanco();
     //$db->Consulta( "SELECT nm_pessoa FROM pessoa_fj WHERE cod_pessoa_fj = {$this->cod_cad}" );
     $objPessoa = new clsPessoaFj();
     list($nome_) = $objPessoa->queryRapida($this->cod_cad, "nome");
     $this->campoRotulo("pessoa", "Respons&aacute;vel", $nome_);
     $this->campoTexto("ano", "Ano", $this->ano, "8", "4", true);
     $this->campoTexto("edicao", "Edi&ccedil;&atilde;o", $this->edicao, "8", "4", false, false, false, "", "deixar em branco caso seja edi&ccedil;&atilde;o extra");
     $this->campoData("data_inicial", "Data Inicial", $this->data_inicial, true);
     $this->campoData("data_final", "Data Final", $this->data_final, false, "deixar em branco caso seja de apenas um dia.");
     // Jornais
     $this->campoOculto("arquivo_deletar", $this->arquivo_deletar);
     if (is_array($this->todos_arquivos)) {
         foreach ($this->todos_arquivos as $id => $arquivo) {
             $this->campoTextoInv("nome_arquivo_{$id}", "Nome Arquivo", $arquivo[1], "30", "30", true, false, false, "", "<a href='#' onclick=\"javascript:excluirSumit({$id},'arquivo_deletar') \">Clique aqui para Excluir</a>");
         }
     }
     $this->campoOculto("todos_arquivos", serialize($this->todos_arquivos));
     $this->campoArquivo("caminho_arquivo", "Vincular Arquivo", $this->caminho_arquivo, "22", "<a  href='#' onclick=\"javascript:insereSubmit()\">Salvar Arquivo</a>");
 }