Commit 0f50bf7da0092e23f9e55e0e59255d97fdca3cf9

Authored by Eriksen Costa
1 parent aeec990f
Exists in master

Refactoring para coding standards

Showing 1 changed file with 162 additions and 118 deletions   Show diff stats
ieducar/intranet/atendidos_det.php
1 1 <?php
2   -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3   - * *
4   - * @author Prefeitura Municipal de Itajaí *
5   - * @updated 29/03/2007 *
6   - * Pacote: i-PLB Software Público Livre e Brasileiro *
7   - * *
8   - * Copyright (C) 2006 PMI - Prefeitura Municipal de Itajaí *
9   - * ctima@itajai.sc.gov.br *
10   - * *
11   - * Este programa é software livre, você pode redistribuí-lo e/ou *
12   - * modificá-lo sob os termos da Licença Pública Geral GNU, conforme *
13   - * publicada pela Free Software Foundation, tanto a versão 2 da *
14   - * Licença como (a seu critério) qualquer versão mais nova. *
15   - * *
16   - * Este programa é distribuído na expectativa de ser útil, mas SEM *
17   - * QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI- *
18   - * ZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con- *
19   - * sulte a Licença Pública Geral GNU para obter mais detalhes. *
20   - * *
21   - * Você deve ter recebido uma cópia da Licença Pública Geral GNU *
22   - * junto com este programa. Se não, escreva para a Free Software *
23   - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA *
24   - * 02111-1307, USA. *
25   - * *
26   - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
27   -$desvio_diretorio = "";
28   -require_once ("include/clsBase.inc.php");
29   -require_once ("include/clsDetalhe.inc.php");
30   -require_once ("include/clsBanco.inc.php");
31 2  
  3 +/**
  4 + * i-Educar - Sistema de gestão escolar
  5 + *
  6 + * Copyright (C) 2006 Prefeitura Municipal de Itajaí
  7 + * <ctima@itajai.sc.gov.br>
  8 + *
  9 + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo
  10 + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free
  11 + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério)
  12 + * qualquer versão posterior.
  13 + *
  14 + * Este programa é distribuí­do na expectativa de que seja útil, porém, SEM
  15 + * NENHUMA GARANTIA; nem mesmo a garantia implí­cita de COMERCIABILIDADE OU
  16 + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral
  17 + * do GNU para mais detalhes.
  18 + *
  19 + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto
  20 + * com este programa; se não, escreva para a Free Software Foundation, Inc., no
  21 + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
  22 + *
  23 + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br>
  24 + * @category i-Educar
  25 + * @license http://creativecommons.org/licenses/GPL/2.0/legalcode.pt CC GNU GPL
  26 + * @package Ied_Cadastro
  27 + * @since Arquivo disponível desde a versão 1.0.0
  28 + * @version $Id$
  29 + */
  30 +
  31 +require_once 'include/clsBase.inc.php';
  32 +require_once 'include/clsDetalhe.inc.php';
  33 +require_once 'include/clsBanco.inc.php';
  34 +
  35 +/**
  36 + * clsIndex class.
  37 + *
  38 + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br>
  39 + * @category i-Educar
  40 + * @license @@license@@
  41 + * @package iEd_Cadastro
  42 + * @since Classe disponível desde a versão 1.0.0
  43 + * @version @@package_version@@
  44 + */
32 45 class clsIndex extends clsBase
33 46 {
34   -
35   - function Formular()
36   - {
37   - $this->SetTitulo( "{$this->_instituicao} Pessoa" );
38   - $this->processoAp = "43";
39   - }
  47 + function Formular()
  48 + {
  49 + $this->SetTitulo($this->_instituicao . ' Pessoa');
  50 + $this->processoAp = 43;
  51 + }
40 52 }
41 53  
  54 +/**
  55 + * indice class.
  56 + *
  57 + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br>
  58 + * @category i-Educar
  59 + * @license @@license@@
  60 + * @package iEd_Cadastro
  61 + * @since Classe disponível desde a versão 1.0.0
  62 + * @version @@package_version@@
  63 + */
42 64 class indice extends clsDetalhe
43 65 {
44   - function Gerar()
45   - {
46   - $this->titulo = "Detalhe da Pessoa";
47   - $this->addBanner( "imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet" );
48   -
49   - $cod_pessoa = @$_GET['cod_pessoa'];
50   -
51   - $objPessoa = new clsPessoaFisica($cod_pessoa);
52   - $db = new clsBanco();
53   - $detalhe = $objPessoa->queryRapida($cod_pessoa, "idpes", "complemento","nome", "cpf", "data_nasc", "logradouro", "idtlog", "numero", "apartamento","cidade","sigla_uf", "cep", "ddd_1", "fone_1", "ddd_2", "fone_2", "ddd_mov", "fone_mov", "ddd_fax", "fone_fax", "email", "url", "tipo", "sexo");
54   - $this->addDetalhe( array("Nome", $detalhe['nome']) );
55   - $this->addDetalhe( array("CPF", int2cpf( $detalhe['cpf'] ) ) );
56   - if($detalhe['data_nasc'])
57   - {
58   - $this->addDetalhe( array("Data de Nascimento", dataFromPgToBr($detalhe['data_nasc'])) );
59   - }
60   - if($detalhe['logradouro'])
61   - {
62   - if($detalhe['numero'])
63   - {
64   - $end = " nº {$detalhe['numero']}";
65   - }
66   - if($detalhe['apartamento'])
67   - {
68   - $end .= " apto {$detalhe['apartamento']}";
69   - }
70   - $this->addDetalhe( array("Endere&ccedil;o", strtolower($detalhe['idtlog']).": {$detalhe['logradouro']} $end") );
71   - }
72   - if($detalhe['complemento'])
73   - {
74   - $this->addDetalhe( array("Complemento", $detalhe['complemento'] ) );
75   - }
76   - if($detalhe['cidade'])
77   - {
78   - $this->addDetalhe( array("Cidade", strtolower($detalhe['cidade']) ) );
79   - }
80   - if($detalhe['sigla_uf'])
81   - {
82   - $this->addDetalhe( array("Estado", strtolower($detalhe['sigla_uf']) ) );
83   - }
84   -
85   - if($detalhe['cep'])
86   - {
87   - $this->addDetalhe( array("CEP", int2cep( $detalhe['cep'] ) ) );
88   - }
89   -
90   - if($detalhe['fone_1'])
91   - {
92   - $this->addDetalhe( array("Telefone 1", "({$detalhe['ddd_1'] }) {$detalhe['fone_1'] }") );
93   - }
94   - if($detalhe['fone_2'])
95   - {
96   - $this->addDetalhe( array("Telefone 2", "({$detalhe['ddd_2'] }) {$detalhe['fone_2'] }") );
97   - }
98   - if($detalhe['fone_mov'])
99   - {
100   - $this->addDetalhe( array("Celular", "({$detalhe['ddd_mov'] }) {$detalhe['fone_mov'] }") );
101   - }
102   - if($detalhe['fone_fax'])
103   - {
104   - $this->addDetalhe( array("Fax", "({$detalhe['ddd_fax'] }) {$detalhe['fone_fax'] }") );
105   - }
106   -
107   - if($detalhe['url'])
108   - {
109   - $this->addDetalhe( array("Site", $detalhe['url']) );
110   - }
111   - if($detalhe['email'])
112   - {
113   - $this->addDetalhe( array("E-mail", $detalhe['email']) );
114   - }
115   -
116   - $sexo = ($detalhe['sexo'] == "M") ? "Masculino" : "Feminino";
117   - $this->addDetalhe( array("Sexo", $sexo) );
118   - $this->url_novo = "atendidos_cad.php";
119   - $this->url_editar = "atendidos_cad.php?cod_pessoa_fj={$detalhe['idpes']}";
120   - $this->url_cancelar = "atendidos_lst.php";
121   -
122   - $this->largura = "100%";
123   - }
  66 + function Gerar()
  67 + {
  68 + $this->titulo = 'Detalhe da Pessoa';
  69 +
  70 + $this->addBanner('imagens/nvp_top_intranet.jpg',
  71 + 'imagens/nvp_vert_intranet.jpg', 'Intranet');
  72 +
  73 + $cod_pessoa = @$_GET['cod_pessoa'];
  74 +
  75 + $objPessoa = new clsPessoaFisica($cod_pessoa);
  76 + $db = new clsBanco();
  77 +
  78 + $detalhe = $objPessoa->queryRapida(
  79 + $cod_pessoa, 'idpes', 'complemento','nome', 'cpf', 'data_nasc',
  80 + 'logradouro', 'idtlog', 'numero', 'apartamento','cidade','sigla_uf',
  81 + 'cep', 'ddd_1', 'fone_1', 'ddd_2', 'fone_2', 'ddd_mov', 'fone_mov',
  82 + 'ddd_fax', 'fone_fax', 'email', 'url', 'tipo', 'sexo'
  83 + );
  84 +
  85 + $this->addDetalhe(array('Nome', $detalhe['nome']));
  86 + $this->addDetalhe(array('CPF', int2cpf($detalhe['cpf'])));
  87 +
  88 + if ($detalhe['data_nasc']) {
  89 + $this->addDetalhe(array('Data de Nascimento', dataFromPgToBr($detalhe['data_nasc'])));
  90 + }
  91 +
  92 + if ($detalhe['logradouro']) {
  93 + if ($detalhe['numero']) {
  94 + $end = ' nº ' . $detalhe['numero'];
  95 + }
  96 +
  97 + if ($detalhe['apartamento']) {
  98 + $end .= ' apto ' . $detalhe['apartamento'];
  99 + }
  100 +
  101 + $this->addDetalhe(array('Endereço',
  102 + strtolower($detalhe['idtlog']) . ': ' . $detalhe['logradouro'] . ' ' . $end)
  103 + );
  104 + }
  105 +
  106 + if ($detalhe['complemento']) {
  107 + $this->addDetalhe(array('Complemento', $detalhe['complemento']));
  108 + }
  109 +
  110 + if ($detalhe['cidade']) {
  111 + $this->addDetalhe(array('Cidade', strtolower($detalhe['cidade'])));
  112 + }
  113 +
  114 + if ($detalhe['sigla_uf']) {
  115 + $this->addDetalhe(array('Estado', strtolower($detalhe['sigla_uf'])));
  116 + }
  117 +
  118 + if ($detalhe['cep']) {
  119 + $this->addDetalhe(array('CEP', int2cep($detalhe['cep'])));
  120 + }
  121 +
  122 + if ($detalhe['fone_1']) {
  123 + $this->addDetalhe(
  124 + array('Telefone 1', sprintf('(%s) %s', $detalhe['ddd_1'], $detalhe['fone_1']))
  125 + );
  126 + }
  127 +
  128 + if ($detalhe['fone_2']) {
  129 + $this->addDetalhe(
  130 + array('Telefone 2', sprintf('(%s) %s', $detalhe['ddd_2'], $detalhe['fone_2']))
  131 + );
  132 + }
  133 +
  134 + if ($detalhe['fone_mov']) {
  135 + $this->addDetalhe(
  136 + array('Celular', sprintf('(%s) %s', $detalhe['ddd_mov'], $detalhe['fone_mov']))
  137 + );
  138 + }
  139 +
  140 + if ($detalhe['fone_fax']) {
  141 + $this->addDetalhe(
  142 + array('Fax', sprintf('(%s) %s', $detalhe['ddd_fax'], $detalhe['fone_fax']))
  143 + );
  144 + }
  145 +
  146 + if ($detalhe['url']) {
  147 + $this->addDetalhe(array('Site', $detalhe['url']));
  148 + }
  149 +
  150 + if ($detalhe['email']) {
  151 + $this->addDetalhe(array('E-mail', $detalhe['email']));
  152 + }
  153 +
  154 + $sexo = $detalhe['sexo'] == 'M' ? 'Masculino' : 'Feminino';
  155 +
  156 + $this->addDetalhe(array('Sexo', $sexo));
  157 +
  158 + $this->url_novo = 'atendidos_cad.php';
  159 + $this->url_editar = 'atendidos_cad.php?cod_pessoa_fj=' . $detalhe['idpes'];
  160 + $this->url_cancelar = 'atendidos_lst.php';
  161 +
  162 + $this->largura = '100%';
  163 + }
124 164 }
125 165  
  166 +// Instancia objeto de página
126 167 $pagina = new clsIndex();
127 168  
  169 +// Instancia objeto de conteúdo
128 170 $miolo = new indice();
129   -$pagina->addForm( $miolo );
130 171  
131   -$pagina->MakeAll();
132   -?>
133 172 \ No newline at end of file
  173 +// Atribui o conteúdo à página
  174 +$pagina->addForm($miolo);
  175 +
  176 +// Gera o código HTML
  177 +$pagina->MakeAll();
134 178 \ No newline at end of file
... ...