Commit e5f8a8bd1473691d09d1dcc7f2ad5af5d9455cf2

Authored by Eriksen Costa
1 parent e2f6c6e1
Exists in master

Refactoring para coding standards

Showing 1 changed file with 797 additions and 776 deletions   Show diff stats
ieducar/intranet/educar_aluno_det.php
1 <?php 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 -require_once ("include/clsBase.inc.php");  
28 -require_once ("include/clsDetalhe.inc.php");  
29 -require_once ("include/clsBanco.inc.php");  
30 -require_once( "include/pmieducar/geral.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 @@license@@
  26 + * @package iEd_Pmieducar
  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 +require_once 'include/pmieducar/geral.inc.php';
  35 +
  36 +/**
  37 + * clsIndexBase class.
  38 + *
  39 + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br>
  40 + * @category i-Educar
  41 + * @license @@license@@
  42 + * @package iEd_Pmieducar
  43 + * @since Classe disponível desde a versão 1.0.0
  44 + * @version @@package_version@@
  45 + */
32 class clsIndexBase extends clsBase 46 class clsIndexBase extends clsBase
33 { 47 {
34 - function Formular()  
35 - {  
36 - $this->SetTitulo( "{$this->_instituicao} i-Educar - Aluno" );  
37 - $this->processoAp = "578";  
38 - } 48 + function Formular()
  49 + {
  50 + $this->SetTitulo($this->_instituicao . ' i-Educar - Aluno');
  51 + $this->processoAp = 578;
  52 + }
39 } 53 }
40 54
  55 +/**
  56 + * indice class.
  57 + *
  58 + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br>
  59 + * @category i-Educar
  60 + * @license @@license@@
  61 + * @package iEd_Pmieducar
  62 + * @since Classe disponível desde a versão 1.0.0
  63 + * @version @@package_version@@
  64 + */
41 class indice extends clsDetalhe 65 class indice extends clsDetalhe
42 { 66 {
43 - /**  
44 - * Titulo no topo da pagina  
45 - *  
46 - * @var int  
47 - */  
48 - var $titulo; 67 + var $titulo;
  68 +
  69 + var $cod_aluno;
  70 + var $ref_idpes_responsavel;
  71 + var $idpes_pai;
  72 + var $idpes_mae;
  73 + var $ref_cod_pessoa_educ;
  74 + var $ref_cod_aluno_beneficio;
  75 + var $ref_cod_religiao;
  76 + var $ref_usuario_exc;
  77 + var $ref_usuario_cad;
  78 + var $ref_idpes;
  79 + var $data_cadastro;
  80 + var $data_exclusao;
  81 + var $ativo;
  82 + var $nm_pai;
  83 + var $nm_mae;
  84 + var $ref_cod_raca;
  85 +
  86 + function Gerar()
  87 + {
  88 + @session_start();
  89 + $this->pessoa_logada = $_SESSION['id_pessoa'];
  90 + session_write_close();
  91 +
  92 + $this->titulo = 'Aluno - Detalhe';
  93 + $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet');
  94 +
  95 + $this->cod_aluno = $_GET['cod_aluno'];
  96 +
  97 + $tmp_obj = new clsPmieducarAluno($this->cod_aluno);
  98 + $registro = $tmp_obj->detalhe();
  99 +
  100 + if (! $registro) {
  101 + header('Location: educar_aluno_lst.php');
  102 + die();
  103 + }
  104 + else {
  105 + foreach ($registro as $key => $value) {
  106 + $this->$key = $value;
  107 + }
  108 + }
49 109
50 - var $cod_aluno;  
51 - var $ref_idpes_responsavel;  
52 - var $idpes_pai;  
53 - var $idpes_mae;  
54 - var $ref_cod_pessoa_educ;  
55 - var $ref_cod_aluno_beneficio;  
56 - var $ref_cod_religiao;  
57 - var $ref_usuario_exc;  
58 - var $ref_usuario_cad;  
59 - var $ref_idpes;  
60 - var $data_cadastro;  
61 - var $data_exclusao;  
62 - var $ativo;  
63 - var $nm_pai;  
64 - var $nm_mae;  
65 - var $ref_cod_raca; 110 + if ($this->ref_idpes) {
  111 + $obj_pessoa_fj = new clsPessoaFj($this->ref_idpes);
  112 + $det_pessoa_fj = $obj_pessoa_fj->detalhe();
66 113
67 - function Gerar()  
68 - {  
69 - @session_start();  
70 - $this->pessoa_logada = $_SESSION['id_pessoa'];  
71 - session_write_close(); 114 + $obj_fisica = new clsFisica($this->ref_idpes);
  115 + $det_fisica = $obj_fisica->detalhe();
72 116
73 - $this->titulo = "Aluno - Detalhe";  
74 - $this->addBanner( "imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet" ); 117 + $obj_fisica_raca = new clsCadastroFisicaRaca();
  118 + $lst_fisica_raca = $obj_fisica_raca->lista( $this->ref_idpes );
75 119
76 - $this->cod_aluno=$_GET["cod_aluno"]; 120 + if ($lst_fisica_raca) {
  121 + $det_fisica_raca = array_shift($lst_fisica_raca);
77 122
78 - $tmp_obj = new clsPmieducarAluno( $this->cod_aluno );  
79 - $registro = $tmp_obj->detalhe(); 123 + $obj_raca = new clsCadastroRaca($det_fisica_raca['ref_cod_raca']);
  124 + $det_raca = $obj_raca->detalhe();
  125 + }
80 126
81 - if( ! $registro )  
82 - {  
83 - header( "location: educar_aluno_lst.php" );  
84 - die();  
85 - }  
86 - else{ 127 + $registro['nome_aluno'] = $det_pessoa_fj['nome'];
  128 + $registro['cpf'] = int2IdFederal($det_fisica['cpf']);
  129 + $registro['data_nasc'] = dataToBrasil($det_fisica['data_nasc']);
  130 + $registro['sexo'] = $det_fisica['sexo'] == 'F' ? 'Feminino' : 'Masculino';
87 131
88 - foreach ($registro as $key => $value) {  
89 - $this->$key = $value;  
90 - }  
91 - }  
92 -  
93 - if($this->ref_idpes){  
94 -  
95 - $obj_pessoa_fj = new clsPessoaFj($this->ref_idpes);  
96 - $det_pessoa_fj = $obj_pessoa_fj->detalhe(); 132 + $obj_estado_civil = new clsEstadoCivil();
  133 + $obj_estado_civil_lista = $obj_estado_civil->lista();
97 134
98 - $obj_fisica = new clsFisica($this->ref_idpes);  
99 - $det_fisica = $obj_fisica->detalhe(); 135 + $lista_estado_civil = array();
100 136
101 - $obj_fisica_raca = new clsCadastroFisicaRaca();  
102 - $lst_fisica_raca = $obj_fisica_raca->lista( $this->ref_idpes );  
103 - if ($lst_fisica_raca)  
104 - {  
105 - $det_fisica_raca = array_shift($lst_fisica_raca); 137 + if ($obj_estado_civil_lista) {
  138 + foreach ($obj_estado_civil_lista as $estado_civil) {
  139 + $lista_estado_civil[$estado_civil['ideciv']] = $estado_civil['descricao'];
  140 + }
  141 + }
  142 +
  143 + $registro['ideciv'] = $lista_estado_civil[$det_fisica['ideciv']->ideciv];
  144 + $registro['email'] = $det_pessoa_fj['email'];
  145 + $registro['url'] = $det_pessoa_fj['url'];
  146 +
  147 + $registro['nacionalidade'] = $det_fisica['nacionalidade'];
106 148
107 - $obj_raca = new clsCadastroRaca( $det_fisica_raca['ref_cod_raca'] );  
108 - $det_raca = $obj_raca->detalhe();  
109 - } 149 + $registro['naturalidade'] = $det_fisica['idmun_nascimento']->detalhe();
  150 + $registro['naturalidade'] = $registro['naturalidade']['nome'];
  151 +
  152 + $registro['pais_origem'] = $det_fisica['idpais_estrangeiro']->detalhe();
  153 + $registro['pais_origem'] = $registro['pais_origem']['nome'];
  154 +
  155 + $registro['ref_idpes_responsavel'] = $det_fisica['idpes_responsavel'];
  156 +
  157 + $this->idpes_pai = $det_fisica['idpes_pai'];
  158 + $this->idpes_mae = $det_fisica['idpes_mae'];
  159 +
  160 + $this->nm_pai = $detalhe_aluno['nm_pai'];
  161 + $this->nm_mae = $detalhe_aluno['nm_mae'];
  162 +
  163 + if ($this->idpes_pai) {
  164 + $obj_pessoa_pai = new clsPessoaFj($this->idpes_pai);
  165 + $det_pessoa_pai = $obj_pessoa_pai->detalhe();
  166 +
  167 + if ($det_pessoa_pai) {
  168 + $registro['nm_pai'] = $det_pessoa_pai['nome'];
  169 +
  170 + // CPF
  171 + $obj_cpf = new clsFisica($this->idpes_pai);
  172 + $det_cpf = $obj_cpf->detalhe();
  173 +
  174 + if ($det_cpf['cpf']) {
  175 + $this->cpf_pai = int2CPF($det_cpf['cpf']);
  176 + }
  177 + }
  178 + }
  179 +
  180 + if ($this->idpes_mae) {
  181 + $obj_pessoa_mae = new clsPessoaFj($this->idpes_mae);
  182 + $det_pessoa_mae = $obj_pessoa_mae->detalhe();
110 183
111 - $registro["nome_aluno"] = $det_pessoa_fj["nome"]; 184 + if ($det_pessoa_mae) {
  185 + $registro['nm_mae'] = $det_pessoa_mae['nome'];
112 186
113 - $registro["cpf"] = int2IdFederal($det_fisica["cpf"]); 187 + // CPF
  188 + $obj_cpf = new clsFisica($this->idpes_mae);
  189 + $det_cpf = $obj_cpf->detalhe();
114 190
  191 + if ($det_cpf['cpf']) {
  192 + $this->cpf_mae = int2CPF($det_cpf['cpf']);
  193 + }
  194 + }
  195 + }
115 196
116 - $registro["data_nasc"] = dataToBrasil($det_fisica["data_nasc"]); 197 + $registro['ddd_fone_1'] = $det_pessoa_fj['ddd_1'];
  198 + $registro['fone_1'] = $det_pessoa_fj['fone_1'];
117 199
118 - $registro["sexo"] = $det_fisica["sexo"] == "F" ? "Feminino" : "Masculino"; 200 + $registro['ddd_fone_2'] = $det_pessoa_fj['ddd_2'];
  201 + $registro['fone_2'] = $det_pessoa_fj['fone_2'];
119 202
120 - $obj_estado_civil = new clsEstadoCivil();  
121 - $obj_estado_civil_lista = $obj_estado_civil->lista(); 203 + $registro['ddd_fax'] = $det_pessoa_fj['ddd_fax'];
  204 + $registro['fone_fax'] = $det_pessoa_fj['fone_fax'];
122 205
123 - $lista_estado_civil = array(); 206 + $registro['ddd_mov'] = $det_pessoa_fj['ddd_mov'];
  207 + $registro['fone_mov'] = $det_pessoa_fj['fone_mov'];
124 208
125 - if($obj_estado_civil_lista){ 209 + $obj_deficiencia_pessoa = new clsCadastroFisicaDeficiencia();
  210 + $obj_deficiencia_pessoa_lista = $obj_deficiencia_pessoa->lista($this->ref_idpes);
126 211
127 - foreach ($obj_estado_civil_lista as $estado_civil)  
128 - {  
129 - $lista_estado_civil[$estado_civil["ideciv"]] = $estado_civil["descricao"];  
130 - } 212 + if ($obj_deficiencia_pessoa_lista) {
  213 + $deficiencia_pessoa = array();
  214 +
  215 + foreach ($obj_deficiencia_pessoa_lista as $deficiencia) {
  216 + $obj_def = new clsCadastroDeficiencia($deficiencia['ref_cod_deficiencia']);
  217 + $det_def = $obj_def->detalhe();
  218 +
  219 + $deficiencia_pessoa[$deficiencia['ref_cod_deficiencia']] = $det_def['nm_deficiencia'];
  220 + }
  221 + }
  222 +
  223 + $ObjDocumento = new clsDocumento($this->ref_idpes);
  224 + $detalheDocumento = $ObjDocumento->detalhe();
  225 +
  226 + $registro['rg'] = $detalheDocumento['rg'];
  227 +
  228 + if ($detalheDocumento['data_exp_rg']) {
  229 + $registro['data_exp_rg'] = date('d/m/Y',
  230 + strtotime(substr($detalheDocumento['data_exp_rg'], 0, 19)));
  231 + }
  232 +
  233 + $registro['sigla_uf_exp_rg'] = $detalheDocumento['sigla_uf_exp_rg'];
  234 + $registro['tipo_cert_civil'] = $detalheDocumento['tipo_cert_civil'];
  235 + $registro['num_termo'] = $detalheDocumento['num_termo'];
  236 + $registro['num_livro'] = $detalheDocumento['num_livro'];
  237 + $registro['num_folha'] = $detalheDocumento['num_folha'];
  238 +
  239 + if ($detalheDocumento['data_emissao_cert_civil']) {
  240 + $registro['data_emissao_cert_civil'] = date('d/m/Y',
  241 + strtotime(substr($detalheDocumento['data_emissao_cert_civil'], 0, 19)));
  242 + }
  243 +
  244 + $registro['sigla_uf_cert_civil'] = $detalheDocumento['sigla_uf_cert_civil'];
  245 + $registro['cartorio_cert_civil'] = $detalheDocumento['cartorio_cert_civil'];
  246 + $registro['num_cart_trabalho'] = $detalheDocumento['num_cart_trabalho'];
  247 + $registro['serie_cart_trabalho'] = $detalheDocumento['serie_cart_trabalho'];
  248 +
  249 + if ($detalheDocumento['data_emissao_cart_trabalho']) {
  250 + $registro['data_emissao_cart_trabalho'] = date('d/m/Y',
  251 + strtotime(substr($detalheDocumento['data_emissao_cart_trabalho'], 0, 19)));
  252 + }
  253 +
  254 + $registro['sigla_uf_cart_trabalho'] = $detalheDocumento['sigla_uf_cart_trabalho'];
  255 + $registro['num_tit_eleitor'] = $detalheDocumento['num_titulo_eleitor'];
  256 + $registro['zona_tit_eleitor'] = $detalheDocumento['zona_titulo_eleitor'];
  257 + $registro['secao_tit_eleitor'] = $detalheDocumento['secao_titulo_eleitor'];
  258 + $registro['idorg_exp_rg'] = $detalheDocumento['ref_idorg_rg'];
  259 +
  260 + $obj_endereco = new clsPessoaEndereco($this->ref_idpes);
  261 +
  262 + if ($obj_endereco_det = $obj_endereco->detalhe()) {
  263 + $registro['id_cep'] = $obj_endereco_det['cep']->cep;
  264 + $registro['id_bairro'] = $obj_endereco_det['idbai']->idbai;
  265 + $registro['id_logradouro'] = $obj_endereco_det['idlog']->idlog;
  266 + $registro['numero'] = $obj_endereco_det['numero'];
  267 + $registro['letra'] = $obj_endereco_det['letra'];
  268 + $registro['complemento'] = $obj_endereco_det['complemento'];
  269 + $registro['andar'] = $obj_endereco_det['andar'];
  270 + $registro['apartamento'] = $obj_endereco_det['apartamento'];
  271 + $registro['bloco'] = $obj_endereco_det['bloco'];
  272 + $registro['nm_logradouro'] = $obj_endereco_det['logradouro'];
  273 + $registro['cep_'] = int2CEP($registro['id_cep']);
  274 +
  275 + $obj_bairro = new clsBairro($registro['id_bairro']);
  276 + $obj_bairro_det = $obj_bairro->detalhe();
  277 +
  278 + if ($obj_bairro_det) {
  279 + $registro['nm_bairro']= $obj_bairro_det['nome'];
  280 + }
  281 +
  282 + $obj_log = new clsLogradouro($registro['id_logradouro']);
  283 + $obj_log_det = $obj_log->detalhe();
  284 +
  285 + if ($obj_log_det) {
  286 + $registro['nm_logradouro'] = $obj_log_det['nome'];
  287 + $registro['idtlog'] = $obj_log_det['idtlog']->detalhe();
  288 + $registro['idtlog'] = $registro['idtlog']['descricao'];
  289 +
  290 + $obj_mun = new clsMunicipio($obj_log_det['idmun']);
  291 + $det_mun = $obj_mun->detalhe();
  292 +
  293 + if ($det_mun) {
  294 + $registro['cidade'] = ucfirst(strtolower($det_mun['nome']));
  295 + }
  296 + }
  297 +
  298 + $obj_bairro = new clsBairro($registro["id_bairro"]);
  299 + $obj_bairro_det = $obj_bairro->detalhe();
  300 +
  301 + if ($obj_bairro_det) {
  302 + $registro['nm_bairro'] = $obj_bairro_det['nome'];
  303 + }
  304 + }
  305 + else {
  306 + $obj_endereco = new clsEnderecoExterno($this->ref_idpes);
  307 +
  308 + if ($obj_endereco_det = $obj_endereco->detalhe()) {
  309 + $registro['id_cep'] = $obj_endereco_det['cep'];
  310 + $registro['cidade'] = $obj_endereco_det['cidade'];
  311 + $registro['nm_bairro'] = $obj_endereco_det['bairro'];
  312 + $registro['nm_logradouro'] = $obj_endereco_det['logradouro'];
  313 + $registro['numero'] = $obj_endereco_det['numero'];
  314 + $registro['letra'] = $obj_endereco_det['letra'];
  315 + $registro['complemento'] = $obj_endereco_det['complemento'];
  316 + $registro['andar'] = $obj_endereco_det['andar'];
  317 + $registro['apartamento'] = $obj_endereco_det['apartamento'];
  318 + $registro['bloco'] = $obj_endereco_det['bloco'];
  319 + $registro['idtlog'] = $obj_endereco_det['idtlog']->detalhe();
  320 + $registro['idtlog'] = $registro['idtlog']['descricao'];
  321 +
  322 + $det_uf = $obj_endereco_det['sigla_uf']->detalhe();
  323 + $registro['ref_sigla_uf'] = $det_uf['nome'];
  324 +
  325 + $registro['cep_'] = int2CEP($registro['id_cep']);
  326 + }
  327 + }
  328 + }
  329 +
  330 + if ($registro['cod_aluno']) {
  331 + $this->addDetalhe(array('Código Aluno', $registro['cod_aluno']));
  332 + }
  333 +
  334 + if ($registro['nome_aluno']) {
  335 + $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno']));
  336 + }
  337 +
  338 + if (idFederal2int($registro['cpf'])) {
  339 + $this->addDetalhe(array('CPF', $registro['cpf']));
  340 + }
  341 +
  342 + if ($registro['data_nasc']) {
  343 + $this->addDetalhe(array('Data de Nascimento', $registro['data_nasc']));
  344 + }
  345 +
  346 + /**
  347 + * Analfabeto.
  348 + */
  349 + $this->addDetalhe(array('Analfabeto', $registro['analfabeto'] == 0 ? 'Não' : 'Sim'));
  350 +
  351 + if ($registro['sexo']) {
  352 + $this->addDetalhe(array('Sexo', $registro['sexo']));
  353 + }
  354 +
  355 + if ($registro['ideciv']) {
  356 + $this->addDetalhe(array('Estado Civil', $registro['ideciv']));
  357 + }
  358 +
  359 + if ($registro['id_cep']) {
  360 + $this->addDetalhe(array('CEP', $registro['cep_']));
  361 + }
  362 +
  363 + if ($registro['ref_sigla_uf']) {
  364 + $this->addDetalhe(array('UF', $registro['ref_sigla_uf']));
  365 + }
  366 +
  367 + if ($registro['cidade']) {
  368 + $this->addDetalhe(array('Cidade', $registro['cidade']));
  369 + }
  370 +
  371 + if ($registro['nm_bairro']) {
  372 + $this->addDetalhe(array('Bairro', $registro['nm_bairro']));
  373 + }
  374 +
  375 + if ($registro['nm_logradouro']) {
  376 + $logradouro = '';
  377 +
  378 + if ($registro['idtlog']) {
  379 + $logradouro .= $registro['idtlog'] . ' ';
  380 + }
  381 +
  382 + $logradouro .= $registro['nm_logradouro'];
  383 + $this->addDetalhe(array('Logradouro', $logradouro));
  384 + }
  385 +
  386 + if ($registro['numero']) {
  387 + $this->addDetalhe(array('Número', $registro['numero']));
  388 + }
  389 +
  390 + if ($registro['letra']) {
  391 + $this->addDetalhe(array('Letra', $registro['letra']));
  392 + }
  393 +
  394 + if ($registro['complemento']) {
  395 + $this->addDetalhe(array('Complemento', $registro['complemento']));
  396 + }
  397 +
  398 + if ($registro['bloco']) {
  399 + $this->addDetalhe(array('Bloco', $registro['bloco']));
  400 + }
  401 +
  402 + if ($registro['andar']) {
  403 + $this->addDetalhe(array('Andar', $registro['andar']));
  404 + }
  405 +
  406 + if ($registro['apartamento']) {
  407 + $this->addDetalhe(array('Apartamento', $registro['apartamento']));
  408 + }
  409 +
  410 + if ($registro['naturalidade']) {
  411 + $this->addDetalhe(array('Naturalidade', $registro['naturalidade']));
  412 + }
  413 +
  414 + if ($registro['nacionalidade']) {
  415 + $lista_nacionalidade = array(
  416 + 'NULL' => 'Selecione',
  417 + 1 => 'Brasileiro',
  418 + 2 => 'Naturalizado Brasileiro',
  419 + 3 => 'Estrangeiro'
  420 + );
131 421
132 - } 422 + $registro['nacionalidade'] = $lista_nacionalidade[$registro['nacionalidade']];
  423 + $this->addDetalhe(array('Nacionalidade', $registro['nacionalidade']));
  424 + }
133 425
134 - $registro["ideciv"] = $lista_estado_civil[$det_fisica["ideciv"]->ideciv ]; 426 + if ($registro['pais_origem']) {
  427 + $this->addDetalhe(array('País de Origem', $registro['pais_origem']));
  428 + }
135 429
136 - $registro["email"] = $det_pessoa_fj["email"]; 430 + $responsavel = $tmp_obj->getResponsavelAluno();
137 431
  432 + if ($responsavel) {
  433 + $this->addDetalhe(array('Responsável Aluno', $responsavel['nome_responsavel']));
  434 + }
138 435
139 - $registro["url"] = $det_pessoa_fj["url"]; 436 + if ($registro['ref_idpes_responsavel']) {
  437 + $obj_pessoa_resp = new clsPessoaFj($registro['ref_idpes_responsavel']);
  438 + $det_pessoa_resp = $obj_pessoa_resp->detalhe();
140 439
141 - $registro["nacionalidade"] = $det_fisica["nacionalidade"]; 440 + if ($det_pessoa_resp) {
  441 + $registro['ref_idpes_responsavel'] = $det_pessoa_resp['nome'];
  442 + }
142 443
143 - $registro["naturalidade"] = $det_fisica["idmun_nascimento"]->detalhe(); 444 + $this->addDetalhe(array('Responsável', $registro['ref_idpes_responsavel']));
  445 + }
144 446
145 - $registro["naturalidade"] = $registro["naturalidade"]["nome"];  
146 - //$detalhe_pais_origem = $det_fisica["idpais_estrangeiro"]; 447 + if ($registro['nm_pai']) {
  448 + $this->addDetalhe(array('Pai', $registro['nm_pai']));
  449 + }
147 450
148 - $registro["pais_origem"] = $det_fisica["idpais_estrangeiro"]->detalhe();  
149 - $registro["pais_origem"] =$registro["pais_origem"]["nome"]; 451 + if ($registro["nm_mae"]) {
  452 + $this->addDetalhe(array('Mãe', $registro['nm_mae']));
  453 + }
150 454
151 - $registro["ref_idpes_responsavel"] = $det_fisica["idpes_responsavel"]; 455 + if ($registro['fone_1']) {
  456 + if ($registro['ddd_fone_1']) {
  457 + $registro['ddd_fone_1'] = sprintf('(%s)&nbsp;', $registro['ddd_fone_1']);
  458 + }
152 459
153 - $this->idpes_pai = $det_fisica["idpes_pai"];  
154 - $this->idpes_mae = $det_fisica["idpes_mae"]; 460 + $this->addDetalhe(array('Telefone 1', $registro['ddd_fone_1'] . $registro['fone_1']));
  461 + }
155 462
  463 + if ($registro['fone_2']) {
  464 + if ($registro['ddd_fone_2']) {
  465 + $registro['ddd_fone_2'] = sprintf('(%s)&nbsp;', $registro['ddd_fone_2']);
  466 + }
156 467
157 - $this->nm_pai = $detalhe_aluno["nm_pai"];  
158 - $this->nm_mae = $detalhe_aluno["nm_mae"]; 468 + $this->addDetalhe(array('Telefone 2', $registro['ddd_fone_2'] . $registro['fone_2']));
  469 + }
159 470
  471 + if ($registro['fone_mov']) {
  472 + if ($registro['ddd_mov']) {
  473 + $registro['ddd_mov'] = sprintf('(%s)&nbsp;', $registro['ddd_mov']);
  474 + }
160 475
161 - if($this->idpes_pai)  
162 - {  
163 - $obj_pessoa_pai = new clsPessoaFj($this->idpes_pai);  
164 - $det_pessoa_pai = $obj_pessoa_pai->detalhe();  
165 - if($det_pessoa_pai)  
166 - {  
167 - $registro['nm_pai'] = $det_pessoa_pai["nome"];  
168 - //cpf  
169 - $obj_cpf = new clsFisica($this->idpes_pai);  
170 - $det_cpf = $obj_cpf->detalhe();  
171 - if( $det_cpf["cpf"] )  
172 - {  
173 - $this->cpf_pai = int2CPF( $det_cpf["cpf"] );  
174 - }  
175 - }  
176 - }  
177 - if($this->idpes_mae)  
178 - {  
179 - $obj_pessoa_mae = new clsPessoaFj($this->idpes_mae);  
180 - $det_pessoa_mae = $obj_pessoa_mae->detalhe();  
181 - if($det_pessoa_mae)  
182 - {  
183 - $registro['nm_mae'] = $det_pessoa_mae["nome"];  
184 - //cpf  
185 - $obj_cpf = new clsFisica($this->idpes_mae);  
186 - $det_cpf = $obj_cpf->detalhe();  
187 - if( $det_cpf["cpf"] )  
188 - {  
189 - $this->cpf_mae = int2CPF( $det_cpf["cpf"] );  
190 - }  
191 - }  
192 - } 476 + $this->addDetalhe(array('Celular', $registro['ddd_mov'] . $registro['fone_mov']));
  477 + }
193 478
194 - //$registro["nm_pai"] = $det_fisica["nm_pai"];  
195 - //$registro["nm_mae"] = $det_fisica["nm_mae"]; 479 + if ($registro['fone_fax']) {
  480 + if($registro['ddd_fax']) {
  481 + $registro['ddd_fax'] = sprintf('(%s)&nbsp;', $registro['ddd_fax']);
  482 + }
196 483
197 - $registro["ddd_fone_1"] = $det_pessoa_fj["ddd_1"];  
198 - $registro["fone_1"] = $det_pessoa_fj["fone_1"]; 484 + $this->addDetalhe(array('Fax', $registro['ddd_fax'] . $registro['fone_fax']));
  485 + }
199 486
200 - $registro["ddd_fone_2"] = $det_pessoa_fj["ddd_2"];  
201 - $registro["fone_2"] = $det_pessoa_fj["fone_2"]; 487 + if ($registro['email']) {
  488 + $this->addDetalhe(array('E-mail', $registro['email']));
  489 + }
202 490
203 - $registro["ddd_fax"] = $det_pessoa_fj["ddd_fax"];  
204 - $registro["fone_fax"] = $det_pessoa_fj["fone_fax"]; 491 + if ($registro['url']) {
  492 + $this->addDetalhe(array('Página Pessoal', $registro['url']));
  493 + }
205 494
206 - $registro["ddd_mov"] = $det_pessoa_fj["ddd_mov"];  
207 - $registro["fone_mov"] = $det_pessoa_fj["fone_mov"]; 495 + if ($registro['ref_cod_aluno_beneficio']) {
  496 + $obj_beneficio = new clsPmieducarAlunoBeneficio($registro['ref_cod_aluno_beneficio']);
  497 + $obj_beneficio_det = $obj_beneficio->detalhe();
  498 +
  499 + $this->addDetalhe(array('Benefício', $obj_beneficio_det['nm_beneficio']));
  500 + }
  501 +
  502 + if ($registro['ref_cod_religiao']) {
  503 + $obj_religiao = new clsPmieducarReligiao($registro['ref_cod_religiao']);
  504 + $obj_religiao_det = $obj_religiao->detalhe();
208 505
209 -  
210 -  
211 - $obj_deficiencia_pessoa = new clsCadastroFisicaDeficiencia();  
212 -  
213 - $obj_deficiencia_pessoa_lista = $obj_deficiencia_pessoa->lista($this->ref_idpes);  
214 -  
215 - if($obj_deficiencia_pessoa_lista)  
216 - {  
217 - $deficiencia_pessoa = array();  
218 - foreach ($obj_deficiencia_pessoa_lista as $deficiencia)  
219 - {  
220 - $obj_def = new clsCadastroDeficiencia($deficiencia["ref_cod_deficiencia"]);  
221 - $det_def = $obj_def->detalhe();  
222 - $deficiencia_pessoa[$deficiencia["ref_cod_deficiencia"]] = $det_def["nm_deficiencia"];  
223 - }  
224 - }  
225 -  
226 -  
227 - $ObjDocumento = new clsDocumento($this->ref_idpes);  
228 - $detalheDocumento = $ObjDocumento->detalhe();  
229 -  
230 - $registro["rg"] = $detalheDocumento['rg'];  
231 -  
232 - if($detalheDocumento['data_exp_rg'])  
233 - {  
234 - $registro["data_exp_rg"] = date( "d/m/Y", strtotime( substr($detalheDocumento['data_exp_rg'],0,19) ) );  
235 - }  
236 -  
237 - $registro["sigla_uf_exp_rg"] = $detalheDocumento['sigla_uf_exp_rg'];  
238 - $registro["tipo_cert_civil"] = $detalheDocumento['tipo_cert_civil'];  
239 - $registro["num_termo"] = $detalheDocumento['num_termo'];  
240 - $registro["num_livro"] = $detalheDocumento['num_livro'];  
241 - $registro["num_folha"] = $detalheDocumento['num_folha'];  
242 -  
243 - if($detalheDocumento['data_emissao_cert_civil'])  
244 - {  
245 - $registro["data_emissao_cert_civil"] = date( "d/m/Y", strtotime( substr($detalheDocumento['data_emissao_cert_civil'],0,19) ) );  
246 - }  
247 -  
248 - $registro["sigla_uf_cert_civil"] = $detalheDocumento['sigla_uf_cert_civil'];  
249 -  
250 - $registro["cartorio_cert_civil"] = $detalheDocumento['cartorio_cert_civil'];  
251 - $registro["num_cart_trabalho"] = $detalheDocumento['num_cart_trabalho'];  
252 - $registro["serie_cart_trabalho"] = $detalheDocumento['serie_cart_trabalho'];  
253 -  
254 - if($detalheDocumento['data_emissao_cart_trabalho'])  
255 - {  
256 - $registro["data_emissao_cart_trabalho"] = date( "d/m/Y", strtotime( substr($detalheDocumento['data_emissao_cart_trabalho'],0,19) ) );  
257 - }  
258 -  
259 - $registro["sigla_uf_cart_trabalho"] = $detalheDocumento['sigla_uf_cart_trabalho'];  
260 - $registro["num_tit_eleitor"] = $detalheDocumento['num_titulo_eleitor'];  
261 - $registro["zona_tit_eleitor"] = $detalheDocumento['zona_titulo_eleitor'];  
262 - $registro["secao_tit_eleitor"] = $detalheDocumento['secao_titulo_eleitor'];  
263 - $registro["idorg_exp_rg"] = $detalheDocumento['ref_idorg_rg'];  
264 -  
265 - $obj_endereco = new clsPessoaEndereco($this->ref_idpes);  
266 -  
267 - if($obj_endereco_det = $obj_endereco->detalhe()){  
268 -  
269 - $registro["id_cep"] = $obj_endereco_det['cep']->cep;  
270 - //$this->cep_ = $obj_endereco_det['ref_cep'];  
271 - $registro["id_bairro"] = $obj_endereco_det['idbai']->idbai;  
272 - $registro["id_logradouro"] = $obj_endereco_det['idlog']->idlog;  
273 - $registro["numero"] = $obj_endereco_det['numero'];  
274 - $registro["letra"] = $obj_endereco_det['letra'];  
275 - $registro["complemento"] = $obj_endereco_det['complemento'];  
276 - $registro["andar"] = $obj_endereco_det['andar'];  
277 - $registro["apartamento"] = $obj_endereco_det['apartamento'];  
278 - $registro["bloco"] = $obj_endereco_det['bloco'];  
279 -  
280 - //$registro["ref_idtlog"] = $obj_endereco_det['idtlog'];  
281 -  
282 - //$registro["cidade = $obj_endereco_det['cidade'];  
283 - //$registro["nm_bairro"] = $obj_endereco_det['bairro'];  
284 - $registro["nm_logradouro"] = $obj_endereco_det['logradouro'];  
285 -  
286 - //$registro["ref_sigla_uf = $this->ref_sigla_uf_ = $obj_endereco_det['sigla_uf'];  
287 -  
288 - $registro["cep_"] = int2CEP($registro["id_cep"]);  
289 -  
290 - $obj_bairro = new clsBairro($registro["id_bairro"] );  
291 - $obj_bairro_det = $obj_bairro->detalhe();  
292 -  
293 - if($obj_bairro_det){  
294 -  
295 - $registro["nm_bairro"]= $obj_bairro_det["nome"];  
296 - }  
297 -  
298 - $obj_log = new clsLogradouro($registro["id_logradouro"] );  
299 - $obj_log_det = $obj_log->detalhe();  
300 -  
301 - if($obj_log_det){  
302 -  
303 - $registro["nm_logradouro"] = $obj_log_det["nome"];  
304 -  
305 - $registro["idtlog"] = $obj_log_det["idtlog"]->detalhe();  
306 - $registro["idtlog"] = $registro["idtlog"]["descricao"];  
307 - $obj_mun = new clsMunicipio( $obj_log_det["idmun"]);  
308 - $det_mun = $obj_mun->detalhe();  
309 - if($det_mun)  
310 - $registro["cidade"] = ucfirst(strtolower($det_mun["nome"]));  
311 - }  
312 -  
313 - $obj_bairro = new clsBairro($registro["id_bairro"]);  
314 - $obj_bairro_det = $obj_bairro->detalhe();  
315 -  
316 - if($obj_bairro_det){  
317 -  
318 - $registro["nm_bairro"] = $obj_bairro_det["nome"];  
319 - }  
320 - }  
321 - else  
322 - {  
323 -  
324 - $obj_endereco = new clsEnderecoExterno($this->ref_idpes);  
325 -  
326 - if($obj_endereco_det = $obj_endereco->detalhe()){  
327 -  
328 - $registro["id_cep"] = $obj_endereco_det['cep'];  
329 - $registro["cidade"] = $obj_endereco_det['cidade'];  
330 - $registro["nm_bairro"] = $obj_endereco_det['bairro'];  
331 - $registro["nm_logradouro"] = $obj_endereco_det['logradouro'];  
332 -  
333 - $registro["numero"] = $obj_endereco_det['numero'];  
334 - $registro["letra"] = $obj_endereco_det['letra'];  
335 - $registro["complemento"] = $obj_endereco_det['complemento'];  
336 - $registro["andar"] = $obj_endereco_det['andar'];  
337 - $registro["apartamento"] = $obj_endereco_det['apartamento'];  
338 - $registro["bloco"] = $obj_endereco_det['bloco'];  
339 -  
340 - $registro["idtlog"] = $obj_endereco_det['idtlog']->detalhe();  
341 - $registro["idtlog"] = $registro["idtlog"]["descricao"] ;  
342 -  
343 - $det_uf = $obj_endereco_det['sigla_uf']->detalhe();  
344 - $registro["ref_sigla_uf"] = $det_uf["nome"];  
345 -  
346 - $registro["cep_"]= int2CEP($registro["id_cep"]);  
347 -  
348 - //$this->id_cep = int2CEP($this->cep_);  
349 -  
350 -  
351 -  
352 - }  
353 - }  
354 - }  
355 -  
356 - if( $registro["cod_aluno"] )  
357 - {  
358 - $this->addDetalhe( array( "C&oacute;digo Aluno", "{$registro["cod_aluno"]}") );  
359 - }  
360 -  
361 - if( $registro["nome_aluno"] )  
362 - {  
363 - $this->addDetalhe( array( "Nome Aluno", "{$registro["nome_aluno"]}") );  
364 - }  
365 -  
366 - if( idFederal2int($registro["cpf"]) )  
367 - {  
368 - $this->addDetalhe( array( "CPF", "{$registro["cpf"]}") );  
369 - }  
370 -  
371 - if( $registro["data_nasc"] )  
372 - {  
373 - $this->addDetalhe( array( "Data de Nascimento", "{$registro["data_nasc"]}") );  
374 - }  
375 -  
376 - /**  
377 - * analfabeto  
378 - */  
379 - $this->addDetalhe( array( "Analfabeto", $registro['analfabeto'] == 0 ? "N&atilde;o" : "Sim") );  
380 -  
381 -  
382 - if( $registro["sexo"] )  
383 - {  
384 - $this->addDetalhe( array( "Sexo", "{$registro["sexo"]}") );  
385 - }  
386 -  
387 - if( $registro["ideciv"] )  
388 - {  
389 - $this->addDetalhe( array( "Estado Civil", "{$registro["ideciv"]}") );  
390 - }  
391 - if( $registro["id_cep"] )  
392 - {  
393 - $this->addDetalhe( array( "CEP", "{$registro["cep_"]}") );  
394 - }  
395 -  
396 - if( $registro["ref_sigla_uf"] )  
397 - {  
398 - $this->addDetalhe( array( "UF", "{$registro["ref_sigla_uf"]}") );  
399 - }  
400 -  
401 - if( $registro["cidade"] )  
402 - {  
403 - $this->addDetalhe( array( "Cidade", "{$registro["cidade"]}") );  
404 - }  
405 -  
406 - if( $registro["nm_bairro"] )  
407 - {  
408 - $this->addDetalhe( array( "Bairro", "{$registro["nm_bairro"]}") );  
409 - }  
410 -  
411 - if( $registro["nm_logradouro"] )  
412 - {  
413 - $logradouro = "";  
414 - if( $registro["idtlog"] )  
415 - {  
416 - $logradouro .= "{$registro["idtlog"]}: ";  
417 - }  
418 - $logradouro .= $registro["nm_logradouro"];  
419 - $this->addDetalhe( array( "Logradouro", "{$logradouro}") );  
420 - }  
421 - if( $registro["numero"] )  
422 - {  
423 - $this->addDetalhe( array( "N&uacute;mero", "{$registro["numero"]}") );  
424 - }  
425 -  
426 - if( $registro["letra"] )  
427 - {  
428 - $this->addDetalhe( array( "Letra", "{$registro["letra"]}") );  
429 - }  
430 -  
431 - if( $registro["complemento"] )  
432 - {  
433 - $this->addDetalhe( array( "Complemento", "{$registro["complemento"]}") );  
434 - }  
435 -  
436 - if( $registro["bloco"] )  
437 - {  
438 - $this->addDetalhe( array( "Bloco", "{$registro["bloco"]}") );  
439 - }  
440 -  
441 - if( $registro["andar"] )  
442 - {  
443 - $this->addDetalhe( array( "Andar", "{$registro["andar"]}") );  
444 - }  
445 -  
446 - if( $registro["apartamento"] )  
447 - {  
448 - $this->addDetalhe( array( "Apartamento", "{$registro["apartamento"]}") );  
449 - }  
450 -  
451 - if( $registro["naturalidade"] )  
452 - {  
453 - $this->addDetalhe( array( "Naturalidade", "{$registro["naturalidade"]}") );  
454 - }  
455 -  
456 - if( $registro["nacionalidade"] )  
457 - {  
458 - $lista_nacionalidade = array('NULL' => "Selecione", '1' => "Brasileiro", '2' => "Naturalizado Brasileiro", '3' => "Estrangeiro");  
459 - $registro["nacionalidade"] = $lista_nacionalidade[$registro["nacionalidade"]];  
460 - $this->addDetalhe( array( "Nacionalidade", "{$registro["nacionalidade"]}") );  
461 - }  
462 -  
463 - if( $registro["pais_origem"] )  
464 - {  
465 - $this->addDetalhe( array( "Pa&iacute;s de Origem", "{$registro["pais_origem"]}") );  
466 - }  
467 -  
468 - $responsavel = $tmp_obj->getResponsavelAluno();  
469 -  
470 - if( $responsavel )  
471 - {  
472 -  
473 - $this->addDetalhe( array( "Respons&aacute;vel Aluno", "{$responsavel["nome_responsavel"]}") );  
474 - }  
475 -  
476 - if( $registro["ref_idpes_responsavel"] )  
477 - {  
478 - $obj_pessoa_resp = new clsPessoaFj($registro["ref_idpes_responsavel"]);  
479 - $det_pessoa_resp = $obj_pessoa_resp->detalhe();  
480 - if($det_pessoa_resp)  
481 - {  
482 - $registro["ref_idpes_responsavel"] = $det_pessoa_resp["nome"];  
483 - }  
484 - $this->addDetalhe( array( "Respons&aacute;vel", "{$registro["ref_idpes_responsavel"]}") );  
485 - }  
486 -  
487 - if( $registro["nm_pai"] )  
488 - {  
489 - $this->addDetalhe( array( "Pai", "{$registro["nm_pai"]}") );  
490 - }  
491 -  
492 - if( $registro["nm_mae"] )  
493 - {  
494 - $this->addDetalhe( array( "M&atilde;e", "{$registro["nm_mae"]}") );  
495 - }  
496 -  
497 - if( $registro["fone_1"] )  
498 - {  
499 - if($registro["ddd_fone_1"])  
500 - $registro["ddd_fone_1"] = "({$registro["ddd_fone_1"]})&nbsp;";  
501 -  
502 - $this->addDetalhe( array( "Telefone 1", "{$registro["ddd_fone_1"]}{$registro["fone_1"]}") );  
503 - }  
504 -  
505 - if( $registro["fone_2"] )  
506 - {  
507 - if($registro["ddd_fone_2"])  
508 - $registro["ddd_fone_2"] = "({$registro["ddd_fone_2"]})&nbsp;";  
509 -  
510 - $this->addDetalhe( array( "Telefone 2", "{$registro["ddd_fone_2"]}{$registro["fone_2"]}") );  
511 - }  
512 -  
513 - if( $registro["fone_mov"] )  
514 - {  
515 - if($registro["ddd_mov"])  
516 - $registro["ddd_mov"] = "({$registro["ddd_mov"]})&nbsp;";  
517 -  
518 - $this->addDetalhe( array( "Celular", "{$registro["ddd_mov"]}{$registro["fone_mov"]}") );  
519 - }  
520 -  
521 -  
522 - if( $registro["fone_fax"] )  
523 - {  
524 - if($registro["ddd_fax"])  
525 - $registro["ddd_fax"] = "({$registro["ddd_fax"]})&nbsp;";  
526 -  
527 - $this->addDetalhe( array( "Fax", "{$registro["ddd_fax"]}{$registro["fone_fax"]}") );  
528 - }  
529 -  
530 - if( $registro["email"] )  
531 - {  
532 - $this->addDetalhe( array( "e-mail", "{$registro["email"]}") );  
533 - }  
534 -  
535 - if( $registro["url"] )  
536 - {  
537 - $this->addDetalhe( array( "P&aacute;gina Pessoal", "{$registro["url"]}") );  
538 - }  
539 -  
540 - if( $registro["ref_cod_aluno_beneficio"] )  
541 - {  
542 - $obj_beneficio = new clsPmieducarAlunoBeneficio($registro["ref_cod_aluno_beneficio"]);  
543 - $obj_beneficio_det= $obj_beneficio->detalhe();  
544 -  
545 - $this->addDetalhe( array( "Benef&iacute;cio", "{$obj_beneficio_det["nm_beneficio"]}") );  
546 - }  
547 - if( $registro["ref_cod_religiao"] )  
548 - {  
549 -  
550 - $obj_religiao = new clsPmieducarReligiao($registro["ref_cod_religiao"]);  
551 - $obj_religiao_det= $obj_religiao->detalhe();  
552 -  
553 - $this->addDetalhe( array( "Religi&atilde;o", "{$obj_religiao_det["nm_religiao"]}") );  
554 - }  
555 - if( $det_raca["nm_raca"] )  
556 - {  
557 - $this->addDetalhe( array( "Ra&ccedil;a", "{$det_raca["nm_raca"]}") );  
558 - }  
559 -  
560 - if($deficiencia_pessoa){  
561 -  
562 - $tabela = "<table border=0 width='300' cellpadding=3><tr bgcolor='A1B3BD' align='center'><td>Defici&ecirc;ncias</td></tr>";  
563 - $cor = "#D1DADF";  
564 - foreach ($deficiencia_pessoa as $indice=>$valor)  
565 - {  
566 -  
567 - $cor = $cor == "#D1DADF" ? "#E4E9ED" : "#D1DADF";  
568 - $tabela .= "<tr bgcolor=$cor align='center'><td>{$valor}</td></tr>";  
569 - }  
570 - $tabela .= "</table>";  
571 - $this->addDetalhe(array("Defici&ecirc;ncias", $tabela));  
572 - }  
573 -//******  
574 - if( $registro["rg"] )  
575 - {  
576 - $this->addDetalhe(array("Rg", $registro["rg"]));  
577 - }  
578 -  
579 - if( $registro["data_exp_rg"] )  
580 - {  
581 - $this->addDetalhe(array("Data Expedição RG", $registro["data_exp_rg"]));  
582 - }  
583 -  
584 - if( $registro["idorg_exp_rg"] )  
585 - {  
586 - $this->addDetalhe(array("Órgão Expedição RG", $registro["idorg_exp_rg"]));  
587 - }  
588 -  
589 - if( $registro["sigla_uf_exp_rg"] )  
590 - {  
591 - $this->addDetalhe(array("Estado Expedidor", $registro["sigla_uf_exp_rg"]));  
592 - }  
593 -  
594 - if( $registro["tipo_cert_civil"] )  
595 - {  
596 - $lista_tipo_cert_civil = array();  
597 - $lista_tipo_cert_civil["0"] = "Selecione";  
598 - $lista_tipo_cert_civil[91] = "Nascimento";  
599 - $lista_tipo_cert_civil[92] = "Casamento";  
600 -  
601 - $this->addDetalhe(array("Tipo Certificado Civil", $registro["tipo_cert_civil"]));  
602 - }  
603 -  
604 - if( $registro["num_termo"] )  
605 - {  
606 - $this->addDetalhe(array("Termo", $registro["num_termo"]));  
607 - }  
608 -  
609 - if( $registro["num_livro"] )  
610 - {  
611 - $this->addDetalhe(array("Livro", $registro["num_livro"]));  
612 - }  
613 -  
614 - if( $registro["num_folha"] )  
615 - {  
616 - $this->addDetalhe(array("Folha", $registro["num_folha"]));  
617 - }  
618 -  
619 - if( $registro["data_emissao_cert_civil"] )  
620 - {  
621 - $this->addDetalhe(array("Emissão Certidão Civil", $registro["data_emissao_cert_civil"]));  
622 - }  
623 -  
624 - if( $registro["sigla_uf_cert_civil"] )  
625 - {  
626 - $this->addDetalhe(array("Sigla Certidão Civil", $registro["sigla_uf_cert_civil"]));  
627 - }  
628 -  
629 - if( $registro["cartorio_cert_civil"] )  
630 - {  
631 - $this->addDetalhe(array("Cartório", $registro["cartorio_cert_civil"]));  
632 - }  
633 -  
634 - if( $registro["num_tit_eleitor"] )  
635 - {  
636 - $this->addDetalhe(array("Título de Eleitor", $registro["num_tit_eleitor"]));  
637 - }  
638 -  
639 - if( $registro["zona_tit_eleitor"] )  
640 - {  
641 - $this->addDetalhe(array("Zona", $registro["zona_tit_eleitor"]));  
642 - }  
643 -  
644 - if( $registro["secao_tit_eleitor"] )  
645 - {  
646 - $this->addDetalhe(array("Seção", $registro["secao_tit_eleitor"]));  
647 - }  
648 -  
649 - if( $registro["caminho_foto"] )  
650 - {  
651 - $this->addDetalhe(array("Foto", "<img src='arquivos/educar/aluno/small/{$registro["caminho_foto"]}' border='0'>"));  
652 - }  
653 -  
654 - $this->addDetalhe(array("Matrícula", $this->montaTabelaMatricula()));  
655 - //** Verificacao de permissao para cadastro  
656 - $obj_permissao = new clsPermissoes();  
657 - if($obj_permissao->permissao_cadastra(578, $this->pessoa_logada,7))  
658 - {  
659 - $this->url_novo = "educar_aluno_cad.php";  
660 - $this->url_editar = "educar_aluno_cad.php?cod_aluno={$registro["cod_aluno"]}";  
661 -  
662 -  
663 - $this->array_botao = array("Matr&iacute;cula", "Atualizar Hist&oacute;rico", "Ficha do Aluno");  
664 - $this->array_botao_url_script = array("go( \"educar_matricula_lst.php?ref_cod_aluno={$registro['cod_aluno']}\" );", "go( \"educar_historico_escolar_lst.php?ref_cod_aluno={$registro['cod_aluno']}\" );", "showExpansivelImprimir(400, 200, \"educar_relatorio_aluno_dados.php?ref_cod_aluno={$registro['cod_aluno']}\",[], \"Relatório i-Educar\" )");  
665 - }  
666 - //**  
667 - $this->url_cancelar = "educar_aluno_lst.php";  
668 - $this->largura = "100%";  
669 - }  
670 -  
671 - function montaTabelaMatricula()  
672 - {  
673 - $sql = "SELECT cod_matricula FROM pmieducar.matricula WHERE ref_cod_aluno = {$this->cod_aluno} AND ativo = 1 ORDER BY cod_matricula DESC";  
674 - $db = new clsBanco();  
675 - $db->Consulta($sql);  
676 - if ($db->Num_Linhas())  
677 - {  
678 - while ($db->ProximoRegistro())  
679 - {  
680 - list($ref_cod_matricula) = $db->Tupla();  
681 - if (is_numeric($ref_cod_matricula))  
682 - {  
683 - $obj_matricula = new clsPmieducarMatricula();  
684 - $obj_matricula->setOrderby("ano ASC");  
685 - $lst_matricula = $obj_matricula->lista( $ref_cod_matricula );  
686 - if($lst_matricula)  
687 - $registro = array_shift($lst_matricula);  
688 - $table .= "<table class='tableDetalhe'><tr class='formdktd'><td colspan=2><strong>Matrícula - Ano {$registro["ano"]}</strong></td></tr>";  
689 - $obj_ref_cod_curso = new clsPmieducarCurso( $registro["ref_cod_curso"] );  
690 - $det_ref_cod_curso = $obj_ref_cod_curso->detalhe();  
691 - $nm_curso = $det_ref_cod_curso["nm_curso"];  
692 - $obj_serie = new clsPmieducarSerie( $registro["ref_ref_cod_serie"] );  
693 - $det_serie = $obj_serie->detalhe();  
694 - $nm_serie = $det_serie["nm_serie"];  
695 - $obj_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );  
696 - $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe();  
697 - $nm_instituicao = $obj_cod_instituicao_det["nm_instituicao"];  
698 - $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_ref_cod_escola"] );  
699 - $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();  
700 - $nm_escola = $det_ref_cod_escola["nome"];  
701 - $obj_mat_turma = new clsPmieducarMatriculaTurma();  
702 - $det_mat_turma = $obj_mat_turma->lista($ref_cod_matricula,null,null,null,null,null,null,null,1);  
703 - if($det_mat_turma){  
704 - $det_mat_turma = array_shift($det_mat_turma);  
705 - $obj_turma = new clsPmieducarTurma($det_mat_turma['ref_cod_turma']);  
706 - $det_turma = $obj_turma->detalhe();  
707 - $nm_turma = $det_turma['nm_turma'];  
708 - } else {  
709 - $nm_turma = "";  
710 - }  
711 - $transferencias = array();  
712 - if ($registro["aprovado"] == 1)  
713 - {  
714 - $aprovado = "Aprovado";  
715 - }  
716 - elseif ($registro["aprovado"] == 2)  
717 - {  
718 - $aprovado = "Reprovado";  
719 - }  
720 - elseif ($registro["aprovado"] == 3)  
721 - {  
722 - $aprovado = "Em Andamento";  
723 - }  
724 - elseif ($registro["aprovado"] == 4)  
725 - {  
726 - if (is_numeric($registro["cod_matricula"]))  
727 - {  
728 - $aprovado = "Transferido";  
729 - $sql = "SELECT  
730 - ref_cod_matricula_entrada,  
731 - ref_cod_matricula_saida,  
732 - to_char(data_transferencia, 'DD/MM/YYYY') as dt_transferencia  
733 - FROM  
734 - pmieducar.transferencia_solicitacao  
735 - WHERE  
736 - (ref_cod_matricula_entrada = {$registro["cod_matricula"]}  
737 - OR ref_cod_matricula_saida = {$registro["cod_matricula"]})  
738 - AND ativo = 1";  
739 - $db2 = new clsBanco();  
740 - $db2->Consulta($sql);  
741 - if ($db2->Num_Linhas())  
742 - {  
743 - while ($db2->ProximoRegistro())  
744 - {  
745 - list($ref_cod_matricula_entrada, $ref_cod_matricula_saida, $dt_transferencia) = $db2->Tupla();  
746 - if ($ref_cod_matricula_saida == $registro["cod_matricula"])  
747 - {  
748 - $transferencias[] = array("data_trans" => $dt_transferencia, "desc" => "Data Transferência Saída");  
749 - }  
750 - elseif ($ref_cod_matricula_entrada == $registro["cod_matricula"])  
751 - {  
752 - $transferencias[] = array("data_trans" => $dt_transferencia, "desc" => "Data Transferência Admissão");  
753 - }  
754 - }  
755 - }  
756 - }  
757 - }  
758 - elseif ($registro["aprovado"] == 5)  
759 - {  
760 - $aprovado = "Reclassificado";  
761 - }  
762 - elseif ($registro["aprovado"] == 6)  
763 - {  
764 - $aprovado = "Abandono";  
765 - }  
766 - elseif ($registro["aprovado"] == 7)  
767 - {  
768 - $aprovado = "Em Exame";  
769 - }  
770 - $formando = $registro["formando"] == 0 ? "N&atilde;o" : "Sim";  
771 - $table .= "<tr class='formlttd'><td>Número da Matrícula</td><td>{$registro["cod_matricula"]}</td></tr>";  
772 - $table .= "<tr class='formmdtd'><td>Instituição</td><td>{$nm_instituicao}</td></tr>";  
773 - $table .= "<tr class='formlttd'><td>Escola</td><td>{$nm_escola}</td></tr>";  
774 - $table .= "<tr class='formmdtd'><td>Curso</td><td>{$nm_curso}</td></tr>";  
775 - $table .= "<tr class='formlttd'><td>Série</td><td>{$nm_serie}</td></tr>";  
776 - $table .= "<tr class='formmdtd'><td>Turma</td><td>{$nm_turma}</td></tr>";  
777 - $table .= "<tr class='formlttd'><td>Situação</td><td>{$aprovado}</td></tr>";  
778 -  
779 - $class = "formmdtd";  
780 - if (is_array($transferencias))  
781 - {  
782 - asort($transferencias);  
783 - foreach ($transferencias as $trans)  
784 - {  
785 - $table .= "<tr class='{$class}'><td>{$trans["desc"]}</td><td>{$trans["data_trans"]}</td></tr>";  
786 - $class = $class == "formmdtd" ? "formlttd" : "formmdtd";  
787 - }  
788 - }  
789 - if ($registro["aprovado"] < 4)  
790 - {  
791 - if (is_numeric($registro["cod_matricula"]))  
792 - {  
793 - $sql = "SELECT to_char(data_transferencia, 'DD/MM/YYYY') FROM pmieducar.transferencia_solicitacao  
794 - WHERE ref_cod_matricula_entrada = {$registro["cod_matricula"]} AND ativo = 1";  
795 - $db2 = new clsBanco();  
796 - $data_transferencia = $db2->CampoUnico($sql);  
797 - if ($data_transferencia)  
798 - {  
799 - $table .= "<tr class='{$class}'><td>Data Transferência Admissão</td><td>{$data_transferencia}</td></tr>";  
800 - $class = $class == "formmdtd" ? "formlttd" : "formmdtd";  
801 - }  
802 - }  
803 - }  
804 - $table .= "<tr class='{$class}'><td>Formando</td><td>{$formando}</td></tr>";  
805 - $table .= "</table>";  
806 - }  
807 - }  
808 - }  
809 - else  
810 - {  
811 - return "<strong>O aluno não está matriculado em nenhuma escola</strong>";  
812 - }  
813 - return $table;  
814 - }  
815 - 506 + $this->addDetalhe(array('Religião', $obj_religiao_det['nm_religiao']));
  507 + }
  508 +
  509 + if ($det_raca['nm_raca']) {
  510 + $this->addDetalhe(array('Raça', $det_raca['nm_raca']));
  511 + }
  512 +
  513 + if ($deficiencia_pessoa) {
  514 + $tabela = '<table border="0" width="300" cellpadding="3"><tr bgcolor="#A1B3BD" align="center"><td>Deficiências</td></tr>';
  515 + $cor = '#D1DADF';
  516 +
  517 + foreach ($deficiencia_pessoa as $indice => $valor) {
  518 + $cor = $cor == '#D1DADF' ? '#E4E9ED' : '#D1DADF';
  519 +
  520 + $tabela .= sprintf('<tr bgcolor="%s" align="center"><td>%s</td></tr>',
  521 + $cor, $valor);
  522 + }
  523 +
  524 + $tabela .= '</table>';
  525 +
  526 + $this->addDetalhe(array('Deficiências', $tabela));
  527 + }
  528 +
  529 + if ($registro['rg']) {
  530 + $this->addDetalhe(array('RG', $registro['rg']));
  531 + }
  532 +
  533 + if ($registro['data_exp_rg']) {
  534 + $this->addDetalhe(array('Data de Expedição RG', $registro['data_exp_rg']));
  535 + }
  536 +
  537 + if ($registro['idorg_exp_rg']) {
  538 + $this->addDetalhe(array('Órgão Expedição RG', $registro['idorg_exp_rg']));
  539 + }
  540 +
  541 + if ($registro['sigla_uf_exp_rg']) {
  542 + $this->addDetalhe(array('Estado Expedidor', $registro['sigla_uf_exp_rg']));
  543 + }
  544 +
  545 + /**
  546 + * @todo CoreExt_Enum?
  547 + */
  548 + if ($registro['tipo_cert_civil']) {
  549 + $lista_tipo_cert_civil = array();
  550 + $lista_tipo_cert_civil["0"] = 'Selecione';
  551 + $lista_tipo_cert_civil[91] = 'Nascimento';
  552 + $lista_tipo_cert_civil[92] = 'Casamento';
  553 +
  554 + $this->addDetalhe(array('Tipo Certificado Civil', $registro['tipo_cert_civil']));
  555 + }
  556 +
  557 + if ($registro['num_termo']) {
  558 + $this->addDetalhe(array('Termo', $registro['num_termo']));
  559 + }
  560 +
  561 + if ($registro['num_livro']) {
  562 + $this->addDetalhe(array('Livro', $registro['num_livro']));
  563 + }
  564 +
  565 + if ($registro['num_folha']) {
  566 + $this->addDetalhe(array('Folha', $registro['num_folha']));
  567 + }
  568 +
  569 + if ($registro['data_emissao_cert_civil']) {
  570 + $this->addDetalhe(array('Emissão Certidão Civil', $registro['data_emissao_cert_civil']));
  571 + }
  572 +
  573 + if ($registro['sigla_uf_cert_civil']) {
  574 + $this->addDetalhe(array('Sigla Certidão Civil', $registro['sigla_uf_cert_civil']));
  575 + }
  576 +
  577 + if ($registro['cartorio_cert_civil']) {
  578 + $this->addDetalhe(array('Cartório', $registro['cartorio_cert_civil']));
  579 + }
  580 +
  581 + if ($registro['num_tit_eleitor']) {
  582 + $this->addDetalhe(array('Título de Eleitor', $registro['num_tit_eleitor']));
  583 + }
  584 +
  585 + if ($registro['zona_tit_eleitor']) {
  586 + $this->addDetalhe(array('Zona', $registro['zona_tit_eleitor']));
  587 + }
  588 +
  589 + if ($registro['secao_tit_eleitor']) {
  590 + $this->addDetalhe(array('Seção', $registro['secao_tit_eleitor']));
  591 + }
  592 +
  593 + if ($registro['caminho_foto']) {
  594 + $this->addDetalhe(array(
  595 + 'Foto',
  596 + sprintf(
  597 + '<img src="arquivos/educar/aluno/small/%s" border="0">',
  598 + $registro['caminho_foto']
  599 + )
  600 + ));
  601 + }
  602 +
  603 + $this->addDetalhe(array('Matrícula', $this->montaTabelaMatricula()));
  604 +
  605 + // Verificação de permissão para cadastro.
  606 + $obj_permissao = new clsPermissoes();
  607 + if ($obj_permissao->permissao_cadastra(578, $this->pessoa_logada, 7)) {
  608 + $this->url_novo = 'educar_aluno_cad.php';
  609 + $this->url_editar = 'educar_aluno_cad.php?cod_aluno=' . $registro['cod_aluno'];
  610 +
  611 + $this->array_botao = array('Matrícula', 'Atualizar Histórico', 'Ficha do Aluno');
  612 + $this->array_botao_url_script = array(
  613 + sprintf('go("educar_matricula_lst.php?ref_cod_aluno=%d");', $registro['cod_aluno']),
  614 + sprintf('go("educar_historico_escolar_lst.php?ref_cod_aluno=%d");', $registro['cod_aluno']),
  615 + sprintf('showExpansivelImprimir(400, 200, "educar_relatorio_aluno_dados.php?ref_cod_aluno=%d", [], "Relatório i-Educar")', $registro['cod_aluno'])
  616 + );
  617 + }
  618 +
  619 + $this->url_cancelar = 'educar_aluno_lst.php';
  620 + $this->largura = '100%';
  621 + }
  622 +
  623 + function montaTabelaMatricula()
  624 + {
  625 + $sql = sprintf('SELECT
  626 + cod_matricula
  627 + FROM
  628 + pmieducar.matricula
  629 + WHERE
  630 + ref_cod_aluno = %d
  631 + AND ativo = 1
  632 + ORDER BY
  633 + cod_matricula DESC', $this->cod_aluno);
  634 +
  635 + $db = new clsBanco();
  636 + $db->Consulta($sql);
  637 +
  638 + if ($db->Num_Linhas()) {
  639 + while ($db->ProximoRegistro()) {
  640 + list($ref_cod_matricula) = $db->Tupla();
  641 +
  642 + if (is_numeric($ref_cod_matricula)) {
  643 + $obj_matricula = new clsPmieducarMatricula();
  644 + $obj_matricula->setOrderby('ano ASC');
  645 + $lst_matricula = $obj_matricula->lista($ref_cod_matricula);
  646 +
  647 + if ($lst_matricula) {
  648 + $registro = array_shift($lst_matricula);
  649 + }
  650 +
  651 + $table .= sprintf(
  652 + '<table class="tableDetalhe">
  653 + <tr class="formdktd">
  654 + <td colspan="2"><strong>Matrícula - Ano %d</strong></td>
  655 + </tr>',
  656 + $registro['ano']
  657 + );
  658 +
  659 + $obj_ref_cod_curso = new clsPmieducarCurso($registro['ref_cod_curso']);
  660 + $det_ref_cod_curso = $obj_ref_cod_curso->detalhe();
  661 + $nm_curso = $det_ref_cod_curso['nm_curso'];
  662 +
  663 + $obj_serie = new clsPmieducarSerie($registro['ref_ref_cod_serie']);
  664 + $det_serie = $obj_serie->detalhe();
  665 + $nm_serie = $det_serie['nm_serie'];
  666 +
  667 + $obj_cod_instituicao = new clsPmieducarInstituicao($registro['ref_cod_instituicao']);
  668 + $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe();
  669 + $nm_instituicao = $obj_cod_instituicao_det['nm_instituicao'];
  670 +
  671 + $obj_ref_cod_escola = new clsPmieducarEscola($registro['ref_ref_cod_escola']);
  672 + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
  673 + $nm_escola = $det_ref_cod_escola['nome'];
  674 +
  675 + $obj_mat_turma = new clsPmieducarMatriculaTurma();
  676 + $det_mat_turma = $obj_mat_turma->lista($ref_cod_matricula, NULL, NULL,
  677 + NULL, NULL, NULL, NULL, NULL, 1);
  678 +
  679 + if ($det_mat_turma) {
  680 + $det_mat_turma = array_shift($det_mat_turma);
  681 +
  682 + $obj_turma = new clsPmieducarTurma($det_mat_turma['ref_cod_turma']);
  683 + $det_turma = $obj_turma->detalhe();
  684 + $nm_turma = $det_turma['nm_turma'];
  685 + }
  686 + else {
  687 + $nm_turma = '';
  688 + }
  689 +
  690 + $transferencias = array();
  691 +
  692 + if ($registro['aprovado'] == 1) {
  693 + $aprovado = 'Aprovado';
  694 + }
  695 + elseif ($registro['aprovado'] == 2) {
  696 + $aprovado = 'Reprovado';
  697 + }
  698 + elseif ($registro['aprovado'] == 3) {
  699 + $aprovado = 'Em Andamento';
  700 + }
  701 + elseif ($registro['aprovado'] == 4) {
  702 + if (is_numeric($registro['cod_matricula'])) {
  703 + $aprovado = 'Transferido';
  704 +
  705 + $sql = sprintf('SELECT
  706 + ref_cod_matricula_entrada,
  707 + ref_cod_matricula_saida,
  708 + to_char(data_transferencia, \'DD/MM/YYYY\') AS dt_transferencia
  709 + FROM
  710 + pmieducar.transferencia_solicitacao
  711 + WHERE
  712 + (ref_cod_matricula_entrada = %d
  713 + OR ref_cod_matricula_saida = %d)
  714 + AND ativo = 1',
  715 + $registro['cod_matricula'], $registro['cod_matricula']
  716 + );
  717 +
  718 + $db2 = new clsBanco();
  719 + $db2->Consulta($sql);
  720 +
  721 + if ($db2->Num_Linhas()) {
  722 + while ($db2->ProximoRegistro()) {
  723 + list($ref_cod_matricula_entrada, $ref_cod_matricula_saida,
  724 + $dt_transferencia) = $db2->Tupla();
  725 +
  726 + if ($ref_cod_matricula_saida == $registro['cod_matricula']) {
  727 + $transferencias[] = array(
  728 + 'data_trans' => $dt_transferencia,
  729 + 'desc' => 'Data Transferência Saída'
  730 + );
  731 + }
  732 + elseif ($ref_cod_matricula_entrada == $registro['cod_matricula']) {
  733 + $transferencias[] = array(
  734 + 'data_trans' => $dt_transferencia,
  735 + 'desc' => 'Data Transferência Admissão'
  736 + );
  737 + }
  738 + }
  739 + }
  740 + }
  741 + }
  742 + elseif ($registro['aprovado'] == 5) {
  743 + $aprovado = 'Reclassificado';
  744 + }
  745 + elseif ($registro['aprovado'] == 6) {
  746 + $aprovado = 'Abandono';
  747 + }
  748 + elseif ($registro['aprovado'] == 7) {
  749 + $aprovado = 'Em Exame';
  750 + }
  751 +
  752 + $formando = $registro['formando'] == 0 ? 'Não' : 'Sim';
  753 +
  754 + $table .= sprintf(
  755 + '<tr class="formlttd"><td>Número da Matrícula</td><td>%s</td></tr>',
  756 + $registro['cod_matricula']
  757 + );
  758 +
  759 + $table .= sprintf(
  760 + '<tr class="formmdtd"><td>Instituição</td><td>%s</td></tr>',
  761 + $nm_instituicao
  762 + );
  763 +
  764 + $table .= sprintf(
  765 + '<tr class="formlttd"><td>Escola</td><td>%s</td></tr>',
  766 + $nm_escola
  767 + );
  768 +
  769 + $table .= sprintf(
  770 + '<tr class="formmdtd"><td>Série</td><td>%s</td></tr>',
  771 + $nm_serie
  772 + );
  773 +
  774 + $table .= sprintf(
  775 + '<tr class="formlttd"><td>Turma</td><td>%s</td></tr>',
  776 + $nm_turma
  777 + );
  778 +
  779 + $table .= sprintf(
  780 + '<tr class="formmdtd"><td>Situação</td><td>%s</td></tr>',
  781 + $aprovado
  782 + );
  783 +
  784 + $class = 'formmdtd';
  785 +
  786 + if (is_array($transferencias)) {
  787 + asort($transferencias);
  788 +
  789 + foreach ($transferencias as $trans) {
  790 + $table .= sprintf(
  791 + '<tr class="%s"><td>%s</td><td>%s</td></tr>',
  792 + $class, $trans['desc'], $trans['data_trans']
  793 + );
  794 +
  795 + $class = $class == 'formmdtd' ? 'formlttd' : 'formmdtd';
  796 + }
  797 + }
  798 +
  799 + if ($registro['aprovado'] < 4) {
  800 + if (is_numeric($registro["cod_matricula"])) {
  801 + $sql = sprintf('SELECT
  802 + to_char(data_transferencia, \'DD/MM/YYYY\')
  803 + FROM
  804 + pmieducar.transferencia_solicitacao
  805 + WHERE
  806 + ref_cod_matricula_entrada = %d
  807 + AND ativo = 1', $registro['cod_matricula']);
  808 +
  809 + $db2 = new clsBanco();
  810 + $data_transferencia = $db2->CampoUnico($sql);
  811 +
  812 + if ($data_transferencia) {
  813 + $table .= sprintf('
  814 + <tr class="%s">
  815 + <td>Data Transferência Admissão</td>
  816 + <td>%s</td>
  817 + </tr>',
  818 + $class, $data_transferencia);
  819 +
  820 + $class = $class == 'formmdtd' ? 'formlttd' : 'formmdtd';
  821 + }
  822 + }
  823 + }
  824 +
  825 + $table .= sprintf('<tr class="%s"><td>Formando</td><td>%s</td></tr>',
  826 + $class == 'formmdtd' ? 'formlttd' : 'formmdtd', $formando);
  827 +
  828 + $table .= '</table>';
  829 + }
  830 + }
  831 + }
  832 + else {
  833 + return '<strong>O aluno não está matriculado em nenhuma escola</strong>';
  834 + }
  835 +
  836 + return $table;
  837 + }
816 } 838 }
817 839
818 -  
819 -  
820 -// cria uma extensao da classe base 840 +// Instancia o objeto da página
821 $pagina = new clsIndexBase(); 841 $pagina = new clsIndexBase();
822 -// cria o conteudo 842 +
  843 +// Instancia o objeto de conteúdo
823 $miolo = new indice(); 844 $miolo = new indice();
824 -// adiciona o conteudo na clsBase  
825 -$pagina->addForm( $miolo );  
826 -// gera o html  
827 -$pagina->MakeAll();  
828 845
829 -?>  
830 \ No newline at end of file 846 \ No newline at end of file
  847 +// Passa o conteúdo para a página
  848 +$pagina->addForm($miolo);
  849 +
  850 +// Gera o HTML
  851 +$pagina->MakeAll();
831 \ No newline at end of file 852 \ No newline at end of file