Commit 506cc55c431a263829f2c5f4ff65acd57e6708c0

Authored by Eriksen Costa Paixão
1 parent 472347bb
Exists in master

Refactoring para coding standards

Showing 1 changed file with 310 additions and 315 deletions   Show diff stats
ieducar/intranet/educar_matricula_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 - Matr&iacute;cula" );  
37 - $this->processoAp = "578";  
38 - } 48 + function Formular()
  49 + {
  50 + $this->SetTitulo($this->_instituicao . ' i-Educar - Matrícula');
  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;  
49 -  
50 - var $ref_cod_matricula;  
51 - var $ref_cod_reserva_vaga;  
52 - var $ref_ref_cod_escola;  
53 - var $ref_ref_cod_serie;  
54 - var $ref_usuario_exc;  
55 - var $ref_usuario_cad;  
56 - var $ref_cod_aluno;  
57 - var $aprovado;  
58 - var $data_cadastro;  
59 - var $data_exclusao;  
60 - var $ativo;  
61 -  
62 - function Gerar()  
63 - {  
64 - @session_start();  
65 - $this->pessoa_logada = $_SESSION['id_pessoa'];  
66 - session_write_close();  
67 -  
68 - $this->titulo = "Matr&iacute;cula - Detalhe";  
69 - $this->addBanner( "imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet" );  
70 -  
71 - $this->ref_cod_matricula=$_GET["cod_matricula"];  
72 -  
73 - $obj_matricula = new clsPmieducarMatricula();  
74 - $lst_matricula = $obj_matricula->lista( $this->ref_cod_matricula );  
75 - if($lst_matricula)  
76 - $registro = array_shift($lst_matricula);  
77 -  
78 - if( !$registro )  
79 - {  
80 - header( "location: educar_matricula_lst.php?ref_cod_aluno={$registro['ref_cod_aluno']}" );  
81 - die();  
82 - }  
83 -  
84 - if( class_exists( "clsPmieducarCurso" ) )  
85 - {  
86 - $obj_ref_cod_curso = new clsPmieducarCurso( $registro["ref_cod_curso"] );  
87 - $det_ref_cod_curso = $obj_ref_cod_curso->detalhe();  
88 - $registro["ref_cod_curso"] = $det_ref_cod_curso["nm_curso"];  
89 - }  
90 - else  
91 - {  
92 - $registro["ref_cod_curso"] = "Erro na geracao";  
93 - echo "<!--\nErro\nClasse nao existente: clsPmieducarCurso\n-->";  
94 - }  
95 - if( class_exists( "clsPmieducarSerie" ) )  
96 - {  
97 - $obj_serie = new clsPmieducarSerie( $registro["ref_ref_cod_serie"] );  
98 - $det_serie = $obj_serie->detalhe();  
99 - $registro["ref_ref_cod_serie"] = $det_serie["nm_serie"];  
100 - }  
101 - else  
102 - {  
103 - $registro["ref_ref_cod_serie"] = "Erro na geracao";  
104 - echo "<!--\nErro\nClasse nao existente: clsPmieducarSerie\n-->";  
105 - }  
106 - if( class_exists( "clsPmieducarInstituicao" ) )  
107 - {  
108 - $obj_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );  
109 - $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe();  
110 - $registro["ref_cod_instituicao"] = $obj_cod_instituicao_det["nm_instituicao"];  
111 - }  
112 - else  
113 - {  
114 - $registro["ref_cod_instituicao"] = "Erro na gera&ccedil;&atilde;o";  
115 - echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarInstituicao\n-->";  
116 - }  
117 - if( class_exists( "clsPmieducarEscola" ) )  
118 - {  
119 - $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_ref_cod_escola"] );  
120 - $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();  
121 - $registro["ref_ref_cod_escola"] = $det_ref_cod_escola["nome"];  
122 - }  
123 - else  
124 - {  
125 - $registro["ref_ref_cod_escola"] = "Erro na gera&ccedil;&atilde;o";  
126 - echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarEscola\n-->";  
127 - }  
128 - if( class_exists( "clsPmieducarAluno" ) )  
129 - {  
130 - $obj_aluno = new clsPmieducarAluno();  
131 - $lst_aluno = $obj_aluno->lista( $registro["ref_cod_aluno"],null,null,null,null,null,null,null,null,null,1 );  
132 - if ( is_array($lst_aluno) )  
133 - {  
134 - $det_aluno = array_shift($lst_aluno);  
135 - $nm_aluno = $det_aluno["nome_aluno"];  
136 - }  
137 - }  
138 - else  
139 - {  
140 - $nm_aluno = "Erro na geracao";  
141 - echo "<!--\nErro\nClasse nao existente: clsPmieducarAluno\n-->";  
142 - }  
143 -  
144 -  
145 - $obj_mat_turma = new clsPmieducarMatriculaTurma();  
146 - $det_mat_turma = $obj_mat_turma->lista($this->ref_cod_matricula,null,null,null,null,null,null,null,1);  
147 -  
148 - if($det_mat_turma){  
149 - $det_mat_turma = array_shift($det_mat_turma);  
150 - $obj_turma = new clsPmieducarTurma($det_mat_turma['ref_cod_turma']);  
151 - $det_turma = $obj_turma->detalhe();  
152 - $nm_turma = $det_turma['nm_turma'];  
153 - }  
154 -  
155 - if( $registro["cod_matricula"] )  
156 - {  
157 - $this->addDetalhe( array( "N&uacute;mero Matr&iacute;cula", "{$registro["cod_matricula"]}") );  
158 - }  
159 - if( $nm_aluno )  
160 - {  
161 - $this->addDetalhe( array( "Aluno", "{$nm_aluno}") );  
162 - }  
163 - if( $registro["ref_cod_instituicao"] )  
164 - {  
165 - $this->addDetalhe( array( "Institui&ccedil;&atilde;o", "{$registro["ref_cod_instituicao"]}") );  
166 - }  
167 - if( $registro["ref_ref_cod_escola"] )  
168 - {  
169 - $this->addDetalhe( array( "Escola", "{$registro["ref_ref_cod_escola"]}") );  
170 - }  
171 - if( $registro["ref_cod_curso"] )  
172 - {  
173 - $this->addDetalhe( array( "Curso", "{$registro["ref_cod_curso"]}") );  
174 - }  
175 - if( $registro["ref_ref_cod_serie"] )  
176 - {  
177 - $this->addDetalhe( array( "S&eacute;rie", "{$registro["ref_ref_cod_serie"]}") );  
178 - }  
179 - if($nm_turma)  
180 - {  
181 - $this->addDetalhe( array( "Turma", "{$nm_turma}") );  
182 - }  
183 - if( $registro["ref_cod_reserva_vaga"] )  
184 - {  
185 - $this->addDetalhe( array( "N&uacute;mero Reserva Vaga", "{$registro["ref_cod_reserva_vaga"]}") );  
186 - }  
187 - if( $registro["aprovado"] )  
188 - {  
189 - if ($registro["aprovado"] == 1)  
190 - {  
191 - $aprovado = "Aprovado";  
192 - }  
193 - elseif ($registro["aprovado"] == 2)  
194 - {  
195 - $aprovado = "Reprovado";  
196 - }  
197 - elseif ($registro["aprovado"] == 3)  
198 - {  
199 - $aprovado = "Em Andamento";  
200 - }  
201 - elseif ($registro["aprovado"] == 4)  
202 - {  
203 - $aprovado = "Transferido";  
204 - }  
205 - elseif ($registro["aprovado"] == 5)  
206 - {  
207 - $aprovado = "Reclassificado";  
208 - }  
209 - elseif ($registro["aprovado"] == 6)  
210 - {  
211 - $aprovado = "Abandono";  
212 - }  
213 - elseif ($registro["aprovado"] == 7)  
214 - {  
215 - $aprovado = "Em Exame";  
216 - }  
217 - $this->addDetalhe( array( "Situa&ccedil;&atilde;o", "{$aprovado}") );  
218 - }  
219 -  
220 - $this->addDetalhe( array( "Formando", $registro["formando"] == 0 ? "N&atilde;o" : "Sim" ));  
221 -  
222 - $obj_permissoes = new clsPermissoes();  
223 - if( $obj_permissoes->permissao_cadastra( 578, $this->pessoa_logada, 7 ) )  
224 - {  
225 -// $this->array_botao = array("Nova Matr&iacute;cula");  
226 -// $this->array_botao_url = array("educar_matricula_cad.php?ref_cod_aluno={$registro['ref_cod_aluno']}");  
227 -  
228 - /**  
229 - * verifica se existe transferencia  
230 - */  
231 - if ($registro["aprovado"] != 4 && $registro["aprovado"] != 6)  
232 - {  
233 - $obj_transferencia = new clsPmieducarTransferenciaSolicitacao();  
234 - $lst_transferencia = $obj_transferencia->lista( null,null,null,null,null,$registro['cod_matricula'],null,null,null,null,null,1,null,null,$registro['ref_cod_aluno'],false);  
235 - // verifica se existe uma solicitacao de transferencia INTERNA  
236 - if(is_array($lst_transferencia))  
237 - $det_transferencia = array_shift($lst_transferencia);  
238 - $data_transferencia = $det_transferencia["data_transferencia"];  
239 - }  
240 -  
241 - if ($registro["aprovado"] == 3 && (!is_array($lst_transferencia) && !isset($data_transferencia) ))  
242 - {  
243 - $this->array_botao[] = "Cancelar Matr&iacute;cula";  
244 - $this->array_botao_url_script[] = "if(confirm(\"Deseja realmente cancelar esta matrícula?\"))go(\"educar_matricula_cad.php?cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}\")";  
245 -  
246 - $this->array_botao[] = "Ocorr&ecirc;ncias Disciplinares";  
247 - $this->array_botao_url_script[] = "go(\"educar_matricula_ocorrencia_disciplinar_lst.php?ref_cod_matricula={$registro['cod_matricula']}\")";  
248 -  
249 - if ($registro["ref_ref_cod_serie"])  
250 - {  
251 - $this->array_botao[] = "Dispensa de Disciplinas";  
252 - $this->array_botao_url_script[] = "go(\"educar_dispensa_disciplina_lst.php?ref_cod_matricula={$registro['cod_matricula']}\")";  
253 - }  
254 -  
255 - $this->array_botao[] = "Enturmar";  
256 - $this->array_botao_url_script[] = "go(\"educar_matricula_turma_lst.php?ref_cod_matricula={$registro['cod_matricula']}\")";  
257 -  
258 - $this->array_botao[] = "Abandono";  
259 - $this->array_botao_url_script[] = "if(confirm(\"Deseja confirmar o abandono desta matrícula?\"))go(\"educar_matricula_abandono_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}\");";  
260 -  
261 - if ($registro["ref_ref_cod_serie"])  
262 - {  
263 - $this->array_botao[] = "Reclassificar";  
264 - $this->array_botao_url_script[] = "go(\"educar_matricula_reclassificar_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}\")";  
265 - }  
266 -  
267 - }  
268 -  
269 - if ($registro["aprovado"] != 4 && $registro["aprovado"] != 6)  
270 - {  
271 - if ( is_array($lst_transferencia) && !isset($data_transferencia))  
272 - {  
273 - // verifica se existe uma solicitacao de transferencia INTERNA  
274 -// if ( !isset($data_transferencia) )  
275 -/// {  
276 - $this->array_botao[] = "Cancelar Solicita&ccedil;&atilde;o Transfer&ecirc;ncia";  
277 - $this->array_botao_url_script[] = "go(\"educar_transferencia_solicitacao_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}&cancela=true\")";  
278 -  
279 -// }  
280 - }  
281 - else  
282 - {  
283 - if ($registro["ref_ref_cod_serie"])  
284 - {  
285 - $this->array_botao[] = "Solicitar Transfer&ecirc;ncia";  
286 - $this->array_botao_url_script[] = "go(\"educar_transferencia_solicitacao_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}\")";  
287 - }  
288 - }  
289 -  
290 - if($registro["aprovado"] ==3 && (!is_array($lst_transferencia) && !isset($data_transferencia) ))  
291 - {  
292 - if($registro["formando"] == 0 )  
293 - {  
294 - $this->array_botao[] = "Formando";  
295 - $this->array_botao_url_script[] = "if(confirm(\"Deseja marcar a matrícula como formando?\"))go(\"educar_matricula_formando_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}&formando=1\")";  
296 - }  
297 - else  
298 - {  
299 - $this->array_botao[] = "Desmarcar como Formando";  
300 - $this->array_botao_url_script[] = "if(confirm(\"Deseja desmarcar a matrícula como formando?\"))go(\"educar_matricula_formando_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}&formando=0\")";  
301 - }  
302 - }  
303 - }  
304 - if($registro['aprovado'] == 4 || $det_transferencia)  
305 - {  
306 - $this->array_botao[] = "Imprimir Atestado Freqüência";  
307 - //$this->array_botao_url_script[] = "go(\"educar_relatorio_atestado_frequencia.php?cod_matricula={$registro['cod_matricula']}\")";  
308 - $this->array_botao_url_script[] = "showExpansivelImprimir(400, 200, \"educar_relatorio_atestado_frequencia.php?cod_matricula={$registro['cod_matricula']}\",[], \"Relatório Atestado de Freqüência\")";  
309 -  
310 - }  
311 -  
312 - }  
313 -  
314 - $this->url_cancelar = "educar_matricula_lst.php?ref_cod_aluno={$registro['ref_cod_aluno']}";  
315 - $this->largura = "100%";  
316 - } 67 + var $titulo;
  68 +
  69 + var $ref_cod_matricula;
  70 + var $ref_cod_reserva_vaga;
  71 + var $ref_ref_cod_escola;
  72 + var $ref_ref_cod_serie;
  73 + var $ref_usuario_exc;
  74 + var $ref_usuario_cad;
  75 + var $ref_cod_aluno;
  76 + var $aprovado;
  77 + var $data_cadastro;
  78 + var $data_exclusao;
  79 + var $ativo;
  80 +
  81 + function Gerar()
  82 + {
  83 + @session_start();
  84 + $this->pessoa_logada = $_SESSION['id_pessoa'];
  85 + session_write_close();
  86 +
  87 + $this->titulo = "Matrícula - Detalhe";
  88 + $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
  89 +
  90 + $this->ref_cod_matricula = $_GET["cod_matricula"];
  91 +
  92 + $obj_matricula = new clsPmieducarMatricula();
  93 + $lst_matricula = $obj_matricula->lista($this->ref_cod_matricula);
  94 +
  95 + if ($lst_matricula) {
  96 + $registro = array_shift($lst_matricula);
  97 + }
  98 +
  99 + if (! $registro) {
  100 + header("Location: educar_matricula_lst.php?ref_cod_aluno=" . $registro['ref_cod_aluno']);
  101 + die();
  102 + }
  103 +
  104 + if (class_exists('clsPmieducarCurso')) {
  105 + $obj_ref_cod_curso = new clsPmieducarCurso($registro['ref_cod_curso']);
  106 + $det_ref_cod_curso = $obj_ref_cod_curso->detalhe();
  107 + $registro['ref_cod_curso'] = $det_ref_cod_curso['nm_curso'];
  108 + }
  109 + else {
  110 + $registro['ref_cod_curso'] = 'Erro na geracao';
  111 + echo "<!--\nErro\nClasse nao existente: clsPmieducarCurso\n-->";
  112 + }
  113 +
  114 + if (class_exists('clsPmieducarSerie')) {
  115 + $obj_serie = new clsPmieducarSerie($registro['ref_ref_cod_serie']);
  116 + $det_serie = $obj_serie->detalhe();
  117 + $registro['ref_ref_cod_serie'] = $det_serie['nm_serie'];
  118 + }
  119 + else {
  120 + $registro['ref_ref_cod_serie'] = 'Erro na geracao';
  121 + echo "<!--\nErro\nClasse nao existente: clsPmieducarSerie\n-->";
  122 + }
  123 +
  124 + if (class_exists('clsPmieducarInstituicao')) {
  125 + $obj_cod_instituicao = new clsPmieducarInstituicao( $registro['ref_cod_instituicao'] );
  126 + $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe();
  127 + $registro['ref_cod_instituicao'] = $obj_cod_instituicao_det['nm_instituicao'];
  128 + }
  129 + else {
  130 + $registro['ref_cod_instituicao'] = 'Erro na geracao';
  131 + echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarInstituicao\n-->";
  132 + }
  133 +
  134 + if (class_exists('clsPmieducarEscola')) {
  135 + $obj_ref_cod_escola = new clsPmieducarEscola( $registro['ref_ref_cod_escola'] );
  136 + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
  137 + $registro['ref_ref_cod_escola'] = $det_ref_cod_escola['nome'];
  138 + }
  139 + else {
  140 + $registro['ref_ref_cod_escola'] = 'Erro na geracao';
  141 + echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarEscola\n-->";
  142 + }
  143 +
  144 + if (class_exists('clsPmieducarAluno')) {
  145 + $obj_aluno = new clsPmieducarAluno();
  146 + $lst_aluno = $obj_aluno->lista($registro['ref_cod_aluno'], NULL, NULL, NULL,
  147 + NULL, NULL, NULL, NULL, NULL, NULL, 1);
  148 +
  149 + if (is_array($lst_aluno)) {
  150 + $det_aluno = array_shift($lst_aluno);
  151 + $nm_aluno = $det_aluno['nome_aluno'];
  152 + }
  153 + }
  154 + else {
  155 + $nm_aluno = 'Erro na geracao';
  156 + echo "<!--\nErro\nClasse nao existente: clsPmieducarAluno\n-->";
  157 + }
  158 +
  159 +
  160 + $obj_mat_turma = new clsPmieducarMatriculaTurma();
  161 + $det_mat_turma = $obj_mat_turma->lista($this->ref_cod_matricula, NULL, NULL,
  162 + NULL, NULL, NULL, NULL, NULL, 1);
  163 +
  164 + if ($det_mat_turma){
  165 + $det_mat_turma = array_shift($det_mat_turma);
  166 + $obj_turma = new clsPmieducarTurma($det_mat_turma['ref_cod_turma']);
  167 + $det_turma = $obj_turma->detalhe();
  168 + $nm_turma = $det_turma['nm_turma'];
  169 + }
  170 +
  171 + if ($registro['cod_matricula']) {
  172 + $this->addDetalhe(array('Número Matrícula', $registro['cod_matricula']));
  173 + }
  174 +
  175 + if ($nm_aluno) {
  176 + $this->addDetalhe(array('Aluno', $nm_aluno));
  177 + }
  178 +
  179 + if ($registro['ref_cod_instituicao']) {
  180 + $this->addDetalhe(array('Instituição', $registro['ref_cod_instituicao']));
  181 + }
  182 +
  183 + if ($registro['ref_ref_cod_escola']) {
  184 + $this->addDetalhe(array('Escola', $registro['ref_ref_cod_escola']));
  185 + }
  186 +
  187 + if ($registro['ref_cod_curso']) {
  188 + $this->addDetalhe(array('Curso', $registro['ref_cod_curso']));
  189 + }
  190 +
  191 + if ($registro['ref_ref_cod_serie']) {
  192 + $this->addDetalhe(array('Série', $registro['ref_ref_cod_serie']));
  193 + }
  194 +
  195 + if ($nm_turma) {
  196 + $this->addDetalhe(array('Turma', $nm_turma));
  197 + }
  198 +
  199 + if ($registro['ref_cod_reserva_vaga']) {
  200 + $this->addDetalhe(array('Número Reserva Vaga', $registro['ref_cod_reserva_vaga']));
  201 + }
  202 +
  203 + if ($registro['aprovado']) {
  204 + if ($registro['aprovado'] == 1) {
  205 + $aprovado = 'Aprovado';
  206 + }
  207 + elseif ($registro['aprovado'] == 2) {
  208 + $aprovado = 'Reprovado';
  209 + }
  210 + elseif ($registro['aprovado'] == 3) {
  211 + $aprovado = 'Em Andamento';
  212 + }
  213 + elseif ($registro['aprovado'] == 4) {
  214 + $aprovado = 'Transferido';
  215 + }
  216 + elseif ($registro['aprovado'] == 5) {
  217 + $aprovado = 'Reclassificado';
  218 + }
  219 + elseif ($registro['aprovado'] == 6) {
  220 + $aprovado = 'Abandono';
  221 + }
  222 + elseif ($registro['aprovado'] == 7) {
  223 + $aprovado = 'Em Exame';
  224 + }
  225 +
  226 + $this->addDetalhe(array('Situação', $aprovado));
  227 + }
  228 +
  229 + $this->addDetalhe(array('Formando', $registro['formando'] == 0 ? 'N&atilde;o' : 'Sim'));
  230 +
  231 + $obj_permissoes = new clsPermissoes();
  232 + if ($obj_permissoes->permissao_cadastra(578, $this->pessoa_logada, 7)) {
  233 + // verifica se existe transferencia
  234 + if ($registro['aprovado'] != 4 && $registro['aprovado'] != 6) {
  235 + $obj_transferencia = new clsPmieducarTransferenciaSolicitacao();
  236 +
  237 + $lst_transferencia = $obj_transferencia->lista(NULL, NULL, NULL, NULL,
  238 + NULL, $registro['cod_matricula'], NULL, NULL, NULL, NULL, NULL, 1,
  239 + NULL, NULL, $registro['ref_cod_aluno'], FALSE);
  240 +
  241 + // verifica se existe uma solicitacao de transferencia INTERNA
  242 + if (is_array($lst_transferencia)) {
  243 + $det_transferencia = array_shift($lst_transferencia);
  244 + }
  245 +
  246 + $data_transferencia = $det_transferencia['data_transferencia'];
  247 + }
  248 +
  249 + if ($registro['aprovado'] == 3 &&
  250 + (!is_array($lst_transferencia) && !isset($data_transferencia))
  251 + ) {
  252 + $this->array_botao[] = 'Cancelar Matrícula';
  253 + $this->array_botao_url_script[] = "if(confirm(\"Deseja realmente cancelar esta matrícula?\"))go(\"educar_matricula_cad.php?cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}\")";
  254 +
  255 + $this->array_botao[] = 'Ocorrências Disciplinares';
  256 + $this->array_botao_url_script[] = "go(\"educar_matricula_ocorrencia_disciplinar_lst.php?ref_cod_matricula={$registro['cod_matricula']}\")";
  257 +
  258 + if ($registro['ref_ref_cod_serie']) {
  259 + $this->array_botao[] = 'Dispensa de Disciplinas';
  260 + $this->array_botao_url_script[] = "go(\"educar_dispensa_disciplina_lst.php?ref_cod_matricula={$registro['cod_matricula']}\")";
  261 + }
  262 +
  263 + $this->array_botao[] = 'Enturmar';
  264 + $this->array_botao_url_script[] = "go(\"educar_matricula_turma_lst.php?ref_cod_matricula={$registro['cod_matricula']}\")";
  265 +
  266 + $this->array_botao[] = 'Abandono';
  267 + $this->array_botao_url_script[] = "if(confirm(\"Deseja confirmar o abandono desta matrícula?\"))go(\"educar_matricula_abandono_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}\");";
  268 +
  269 + if ($registro['ref_ref_cod_serie']) {
  270 + $this->array_botao[] = 'Reclassificar';
  271 + $this->array_botao_url_script[] = "go(\"educar_matricula_reclassificar_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}\")";
  272 + }
  273 + }
  274 +
  275 + if ($registro['aprovado'] != 4 && $registro['aprovado'] != 6) {
  276 + if (is_array($lst_transferencia) && !isset($data_transferencia)) {
  277 + $this->array_botao[] = 'Cancelar Solicitação Transferência';
  278 + $this->array_botao_url_script[] = "go(\"educar_transferencia_solicitacao_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}&cancela=true\")";
  279 + }
  280 + else {
  281 + if ($registro['ref_ref_cod_serie']) {
  282 + $this->array_botao[] = 'Solicitar Transferência';
  283 + $this->array_botao_url_script[] = "go(\"educar_transferencia_solicitacao_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}\")";
  284 + }
  285 + }
  286 +
  287 + if ($registro['aprovado'] == 3 &&
  288 + (!is_array($lst_transferencia) && !isset($data_transferencia))
  289 + ) {
  290 + if ($registro['formando'] == 0) {
  291 + $this->array_botao[] = 'Formando';
  292 + $this->array_botao_url_script[] = "if(confirm(\"Deseja marcar a matrícula como formando?\"))go(\"educar_matricula_formando_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}&formando=1\")";
  293 + }
  294 + else {
  295 + $this->array_botao[] = "Desmarcar como Formando";
  296 + $this->array_botao_url_script[] = "if(confirm(\"Deseja desmarcar a matrícula como formando?\"))go(\"educar_matricula_formando_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}&formando=0\")";
  297 + }
  298 + }
  299 + }
  300 +
  301 + if ($registro['aprovado'] == 4 || $det_transferencia) {
  302 + $this->array_botao[] = 'Imprimir Atestado Frequência';
  303 + $this->array_botao_url_script[] = "showExpansivelImprimir(400, 200, \"educar_relatorio_atestado_frequencia.php?cod_matricula={$registro['cod_matricula']}\",[], \"Relatório Atestado de Freqüência\")";
  304 + }
  305 + }
  306 +
  307 + $this->url_cancelar = 'educar_matricula_lst.php?ref_cod_aluno=' . $registro['ref_cod_aluno'];
  308 + $this->largura = '100%';
  309 + }
317 } 310 }
318 311
319 -// cria uma extensao da classe base 312 +// Instancia objeto de página
320 $pagina = new clsIndexBase(); 313 $pagina = new clsIndexBase();
321 -// cria o conteudo 314 +
  315 +// Instancia objeto de conteúdo
322 $miolo = new indice(); 316 $miolo = new indice();
323 -// adiciona o conteudo na clsBase  
324 -$pagina->addForm( $miolo );  
325 -// gera o html  
326 -$pagina->MakeAll();  
327 -?>  
328 \ No newline at end of file 317 \ No newline at end of file
  318 +
  319 +// Atribui o conteúdo à página
  320 +$pagina->addForm($miolo);
  321 +
  322 +// Gera o código HTML
  323 +$pagina->MakeAll();
329 \ No newline at end of file 324 \ No newline at end of file