Commit 576d2642b4dbeb31d317b01820ffe51f1daa9a92
1 parent
c91b404e
Exists in
master
Refactoring para coding standards
Showing
1 changed file
with
471 additions
and
435 deletions
Show diff stats
ieducar/intranet/educar_turma_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 | - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
2 | + | |
27 | 3 | /** |
28 | - * @author Adriano Nagasava | |
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 Adriano Nagasava <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 | 29 | */ |
30 | -require_once ("include/clsBase.inc.php"); | |
31 | -require_once ("include/clsDetalhe.inc.php"); | |
32 | -require_once ("include/clsBanco.inc.php"); | |
33 | -require_once( "include/pmieducar/geral.inc.php" ); | |
34 | 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 Adriano Nagasava <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 | + */ | |
35 | 46 | class clsIndexBase extends clsBase |
36 | 47 | { |
37 | - function Formular() | |
38 | - { | |
39 | - $this->SetTitulo( "{$this->_instituicao} i-Educar - Turma" ); | |
40 | - $this->processoAp = "586"; | |
41 | - } | |
48 | + function Formular() | |
49 | + { | |
50 | + $this->SetTitulo($this->_instituicao . ' i-Educar - Turma'); | |
51 | + $this->processoAp = 586; | |
52 | + } | |
42 | 53 | } |
43 | 54 | |
55 | +/** | |
56 | + * indice class. | |
57 | + * | |
58 | + * @author Adriano Nagasava <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 | + */ | |
44 | 65 | class indice extends clsDetalhe |
45 | 66 | { |
46 | - /** | |
47 | - * Titulo no topo da pagina | |
48 | - * | |
49 | - * @var int | |
50 | - */ | |
51 | - var $titulo; | |
52 | - | |
53 | - var $cod_turma; | |
54 | - var $ref_usuario_exc; | |
55 | - var $ref_usuario_cad; | |
56 | - var $ref_ref_cod_serie; | |
57 | - var $ref_ref_cod_escola; | |
58 | - var $ref_cod_infra_predio_comodo; | |
59 | - var $nm_turma; | |
60 | - var $sgl_turma; | |
61 | - var $max_aluno; | |
62 | - var $multiseriada; | |
63 | - var $data_cadastro; | |
64 | - var $data_exclusao; | |
65 | - var $ativo; | |
66 | - var $ref_cod_turma_tipo; | |
67 | - var $hora_inicial; | |
68 | - var $hora_final; | |
69 | - var $hora_inicio_intervalo; | |
70 | - var $hora_fim_intervalo; | |
71 | - | |
72 | - var $ref_cod_instituicao; | |
73 | - var $ref_cod_curso; | |
74 | - | |
75 | - var $ref_cod_instituicao_regente; | |
76 | - var $ref_cod_regente; | |
77 | - | |
78 | - function Gerar() | |
79 | - { | |
80 | - @session_start(); | |
81 | - $this->pessoa_logada = $_SESSION['id_pessoa']; | |
82 | - session_write_close(); | |
83 | - | |
84 | - $this->titulo = "Turma - Detalhe"; | |
85 | - $this->addBanner( "imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet" ); | |
86 | - | |
87 | - $this->cod_turma=$_GET["cod_turma"]; | |
88 | - | |
89 | - $tmp_obj = new clsPmieducarTurma(); | |
90 | - $lst_obj = $tmp_obj->lista( $this->cod_turma, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, | |
91 | - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, array("true", "false") ); | |
92 | - $registro = array_shift($lst_obj); | |
93 | - | |
94 | - foreach ($registro as $key => $value) { | |
95 | - $this->$key = $value; | |
96 | - } | |
97 | - if( ! $registro ) | |
98 | - { | |
99 | - header( "location: educar_turma_lst.php" ); | |
100 | - die(); | |
101 | - } | |
102 | - | |
103 | - if( class_exists( "clsPmieducarTurmaTipo" ) ) | |
104 | - { | |
105 | - $obj_ref_cod_turma_tipo = new clsPmieducarTurmaTipo( $registro["ref_cod_turma_tipo"] ); | |
106 | - $det_ref_cod_turma_tipo = $obj_ref_cod_turma_tipo->detalhe(); | |
107 | - $registro["ref_cod_turma_tipo"] = $det_ref_cod_turma_tipo["nm_tipo"]; | |
108 | - } | |
109 | - else | |
110 | - { | |
111 | - $registro["ref_cod_turma_tipo"] = "Erro na geracao"; | |
112 | - echo "<!--\nErro\nClasse nao existente: clsPmieducarTurmaTipo\n-->"; | |
113 | - } | |
114 | - | |
115 | - if( class_exists( "clsPmieducarInfraPredioComodo" ) ) | |
116 | - { | |
117 | - $obj_ref_cod_infra_predio_comodo = new clsPmieducarInfraPredioComodo( $registro["ref_cod_infra_predio_comodo"] ); | |
118 | - $det_ref_cod_infra_predio_comodo = $obj_ref_cod_infra_predio_comodo->detalhe(); | |
119 | - $registro["ref_cod_infra_predio_comodo"] = $det_ref_cod_infra_predio_comodo["nm_comodo"]; | |
120 | - } | |
121 | - else | |
122 | - { | |
123 | - $registro["ref_cod_infra_predio_comodo"] = "Erro na geracao"; | |
124 | - echo "<!--\nErro\nClasse nao existente: clsPmieducarInfraPredioComodo\n-->"; | |
125 | - } | |
126 | - | |
127 | - if( class_exists( "clsPmieducarInstituicao" ) ) | |
128 | - { | |
129 | - $obj_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] ); | |
130 | - $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe(); | |
131 | - $registro["ref_cod_instituicao"] = $obj_cod_instituicao_det["nm_instituicao"]; | |
132 | - } | |
133 | - else | |
134 | - { | |
135 | - $registro["ref_cod_instituicao"] = "Erro na geração"; | |
136 | - echo "<!--\nErro\nClasse não existente: clsPmieducarInstituicao\n-->"; | |
137 | - } | |
138 | - | |
139 | - if( class_exists( "clsPmieducarEscola" ) ) | |
140 | - { | |
141 | - $this->ref_ref_cod_escola = $registro["ref_ref_cod_escola"]; | |
142 | - $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_ref_cod_escola"] ); | |
143 | - $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); | |
144 | - $registro["ref_ref_cod_escola"] = $det_ref_cod_escola["nome"]; | |
145 | - } | |
146 | - else | |
147 | - { | |
148 | - $registro["ref_cod_escola"] = "Erro na geração"; | |
149 | - echo "<!--\nErro\nClasse não existente: clsPmieducarEscola\n-->"; | |
150 | - } | |
151 | - | |
152 | - if( class_exists( "clsPmieducarCurso" ) ) | |
153 | - { | |
154 | - $obj_ref_cod_curso = new clsPmieducarCurso( $registro["ref_cod_curso"] ); | |
155 | - $det_ref_cod_curso = $obj_ref_cod_curso->detalhe(); | |
156 | - $registro["ref_cod_curso"] = $det_ref_cod_curso["nm_curso"]; | |
157 | - $padrao_ano_escolar = $det_ref_cod_curso["padrao_ano_escolar"]; | |
158 | - } | |
159 | - else | |
160 | - { | |
161 | - $registro["ref_cod_curso"] = "Erro na geracao"; | |
162 | - echo "<!--\nErro\nClasse nao existente: clsPmieducarCurso\n-->"; | |
163 | - } | |
164 | - | |
165 | - if( class_exists( "clsPmieducarSerie" ) ) | |
166 | - { | |
167 | - $this->ref_ref_cod_serie = $registro["ref_ref_cod_serie"]; | |
168 | - $obj_ser = new clsPmieducarSerie( $registro["ref_ref_cod_serie"] ); | |
169 | - $det_ser = $obj_ser->detalhe(); | |
170 | - $registro["ref_ref_cod_serie"] = $det_ser["nm_serie"]; | |
171 | - } | |
172 | - else | |
173 | - { | |
174 | - $registro["ref_ref_cod_serie"] = "Erro na geracao"; | |
175 | - echo "<!--\nErro\nClasse nao existente: clsPmieducarSerie\n-->"; | |
176 | - } | |
177 | - | |
178 | - $obj_permissoes = new clsPermissoes(); | |
179 | - $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); | |
180 | - if ($nivel_usuario == 1) | |
181 | - { | |
182 | - if( $registro["ref_cod_instituicao"] ) | |
183 | - { | |
184 | - $this->addDetalhe( array( "Instituição", "{$registro["ref_cod_instituicao"]}") ); | |
185 | - } | |
186 | - } | |
187 | - if ($nivel_usuario == 1 || $nivel_usuario == 2) | |
188 | - { | |
189 | - if( $registro["ref_ref_cod_escola"] ) | |
190 | - { | |
191 | - $this->addDetalhe( array( "Escola", "{$registro["ref_ref_cod_escola"]}") ); | |
192 | - } | |
193 | - } | |
194 | - if( $registro["ref_cod_curso"] ) | |
195 | - { | |
196 | - $this->addDetalhe( array( "Curso", "{$registro["ref_cod_curso"]}") ); | |
197 | - } | |
198 | - if( $registro["ref_ref_cod_serie"] ) | |
199 | - { | |
200 | - $this->addDetalhe( array( "Série", "{$registro["ref_ref_cod_serie"]}") ); | |
201 | - } | |
202 | - if( $registro["ref_cod_regente"] ) | |
203 | - { | |
204 | - $obj_pessoa = new clsPessoa_($registro["ref_cod_regente"]); | |
205 | - $det = $obj_pessoa->detalhe(); | |
206 | - | |
207 | - $this->addDetalhe( array( "Professor/Regente", "{$det["nome"]}") ); | |
208 | - } | |
209 | - | |
210 | - if( $registro["ref_cod_infra_predio_comodo"] ) | |
211 | - { | |
212 | - $this->addDetalhe( array( "Sala", "{$registro["ref_cod_infra_predio_comodo"]}") ); | |
213 | - } | |
214 | - if( $registro["ref_cod_turma_tipo"] ) | |
215 | - { | |
216 | - $this->addDetalhe( array( "Tipo de Turma", "{$registro["ref_cod_turma_tipo"]}") ); | |
217 | - } | |
218 | - if( $registro["nm_turma"] ) | |
219 | - { | |
220 | - $this->addDetalhe( array( "Turma", "{$registro["nm_turma"]}") ); | |
221 | - } | |
222 | - if( $registro["sgl_turma"] ) | |
223 | - { | |
224 | - $this->addDetalhe( array( "Sigla", "{$registro["sgl_turma"]}") ); | |
225 | - } | |
226 | - if( $registro["max_aluno"] ) | |
227 | - { | |
228 | - $this->addDetalhe( array( "Máximo de Alunos", "{$registro["max_aluno"]}") ); | |
229 | - } | |
230 | - $this->addDetalhe(array("Situação", dbBool($registro["visivel"]) ? "Ativo" : "Desativo")); | |
231 | - if( $registro["multiseriada"] == 1) | |
232 | - { | |
233 | - if ( $registro["multiseriada"] == 1 ) | |
234 | - $registro["multiseriada"] = "sim"; | |
235 | - else | |
236 | - $registro["multiseriada"] = "não"; | |
237 | - | |
238 | - $this->addDetalhe( array( "Multi-Seriada", "{$registro["multiseriada"]}") ); | |
239 | - $obj_serie_mult = new clsPmieducarSerie($registro['ref_ref_cod_serie_mult']); | |
240 | - $det_serie_mult = $obj_serie_mult->detalhe(); | |
241 | - $this->addDetalhe( array( "Série Multi-Seriada", "{$det_serie_mult["nm_serie"]}") ); | |
242 | - | |
243 | - } | |
244 | - if ($padrao_ano_escolar == 1) | |
245 | - { | |
246 | - if( $registro["hora_inicial"] ) | |
247 | - { | |
248 | - $registro["hora_inicial"] = date("H:i", strtotime( $registro["hora_inicial"])); | |
249 | - $this->addDetalhe( array( "Hora Inicial", "{$registro["hora_inicial"]}") ); | |
250 | - } | |
251 | - if( $registro["hora_final"] ) | |
252 | - { | |
253 | - $registro["hora_final"] = date("H:i", strtotime( $registro["hora_final"])); | |
254 | - $this->addDetalhe( array( "Hora Final", "{$registro["hora_final"]}") ); | |
255 | - } | |
256 | - if( $registro["hora_inicio_intervalo"] ) | |
257 | - { | |
258 | - $registro["hora_inicio_intervalo"] = date("H:i", strtotime( $registro["hora_inicio_intervalo"])); | |
259 | - $this->addDetalhe( array( "Hora Início Intervalo", "{$registro["hora_inicio_intervalo"]}") ); | |
260 | - } | |
261 | - if( $registro["hora_fim_intervalo"] ) | |
262 | - { | |
263 | - $registro["hora_fim_intervalo"] = date("H:i", strtotime( $registro["hora_fim_intervalo"])); | |
264 | - $this->addDetalhe( array( "Hora Fim Intervalo", "{$registro["hora_fim_intervalo"]}") ); | |
265 | - } | |
266 | - | |
267 | - } | |
268 | - else if ($padrao_ano_escolar == 0) | |
269 | - { | |
270 | - $obj = new clsPmieducarTurmaModulo(); | |
271 | - $obj->setOrderby("data_inicio ASC"); | |
272 | - $lst = $obj->lista( $this->cod_turma ); | |
273 | - if ($lst) | |
274 | - { | |
275 | - $tabela = "<TABLE> | |
276 | - <TR align=center> | |
277 | - <TD bgcolor=#A1B3BD><B>Nome</B></TD> | |
278 | - <TD bgcolor=#A1B3BD><B>Data Início</B></TD> | |
279 | - <TD bgcolor=#A1B3BD><B>Data Fim</B></TD> | |
280 | - </TR>"; | |
281 | - $cont = 0; | |
282 | - | |
283 | - foreach ( $lst AS $valor ) | |
284 | - { | |
285 | - if ( ($cont % 2) == 0 ) | |
286 | - { | |
287 | - $color = " bgcolor=#E4E9ED "; | |
288 | - } | |
289 | - else | |
290 | - { | |
291 | - $color = " bgcolor=#FFFFFF "; | |
292 | - } | |
293 | - $obj_modulo = new clsPmieducarModulo( $valor["ref_cod_modulo"] ); | |
294 | - $det_modulo = $obj_modulo->detalhe(); | |
295 | - $nm_modulo = $det_modulo["nm_tipo"]; | |
296 | - | |
297 | - $valor["data_inicio"] = dataFromPgToBr($valor["data_inicio"]); | |
298 | - $valor["data_fim"] = dataFromPgToBr($valor["data_fim"]); | |
299 | - | |
300 | - $tabela .= "<TR> | |
301 | - <TD {$color} align=left>{$nm_modulo}</TD> | |
302 | - <TD {$color} align=left>{$valor["data_inicio"]}</TD> | |
303 | - <TD {$color} align=left>{$valor["data_fim"]}</TD> | |
304 | - </TR>"; | |
305 | - $cont++; | |
306 | - } | |
307 | - $tabela .= "</TABLE>"; | |
308 | - } | |
309 | - if( $tabela ) | |
310 | - { | |
311 | - $this->addDetalhe( array( "Módulo", "{$tabela}") ); | |
312 | - } | |
313 | - | |
314 | - $dias_da_semana = array( '' => 'Selecione', 1 => 'Domingo', 2 => 'Segunda', 3 => 'Terça', 4 => 'Quarta', 5 => 'Quinta', 6 => 'Sexta', 7 => 'Sábado' ); | |
315 | - | |
316 | - $obj = new clsPmieducarTurmaDiaSemana(); | |
317 | - $lst = $obj->lista( null, $this->cod_turma ); | |
318 | - if ($lst) | |
319 | - { | |
320 | - $tabela1 = "<TABLE> | |
321 | - <TR align=center> | |
322 | - <TD bgcolor=#A1B3BD><B>Nome</B></TD> | |
323 | - <TD bgcolor=#A1B3BD><B>Hora Inicial</B></TD> | |
324 | - <TD bgcolor=#A1B3BD><B>Hora Final</B></TD> | |
325 | - </TR>"; | |
326 | - $cont = 0; | |
327 | - | |
328 | - foreach ( $lst AS $valor ) | |
329 | - { | |
330 | - if ( ($cont % 2) == 0 ) | |
331 | - { | |
332 | - $color = " bgcolor=#E4E9ED "; | |
333 | - } | |
334 | - else | |
335 | - { | |
336 | - $color = " bgcolor=#FFFFFF "; | |
337 | - } | |
338 | - | |
339 | - $valor["hora_inicial"] = date("H:i", strtotime( $valor["hora_inicial"])); | |
340 | - $valor["hora_final"] = date("H:i", strtotime( $valor["hora_final"])); | |
341 | - | |
342 | - $tabela1 .= "<TR> | |
343 | - <TD {$color} align=left>{$dias_da_semana[$valor["dia_semana"]]}</TD> | |
344 | - <TD {$color} align=left>{$valor["hora_inicial"]}</TD> | |
345 | - <TD {$color} align=left>{$valor["hora_final"]}</TD> | |
346 | - </TR>"; | |
347 | - $cont++; | |
348 | - } | |
349 | - $tabela1 .= "</TABLE>"; | |
350 | - } | |
351 | - if( $tabela1 ) | |
352 | - { | |
353 | - $this->addDetalhe( array( "Dia da Semana", "{$tabela1}") ); | |
354 | - } | |
355 | - | |
356 | - } | |
357 | - | |
358 | - | |
359 | - if($this->ref_ref_cod_escola && $this->ref_ref_cod_serie) | |
360 | - { | |
361 | - $obj = new clsPmieducarEscolaSerieDisciplina(); | |
362 | - $lst = $obj->lista( $this->ref_ref_cod_serie, $this->ref_ref_cod_escola,null,1 ); | |
363 | - if ($lst) | |
364 | - { | |
365 | - $tabela3 = "<TABLE> | |
366 | - <TR align=center> | |
367 | - <TD bgcolor=#A1B3BD><B>Nome</B></TD> | |
368 | - </TR>"; | |
369 | - $cont = 0; | |
370 | - foreach ( $lst AS $valor ) | |
371 | - { | |
372 | - if ( ($cont % 2) == 0 ) | |
373 | - { | |
374 | - $color = " bgcolor=#E4E9ED "; | |
375 | - } | |
376 | - else | |
377 | - { | |
378 | - $color = " bgcolor=#FFFFFF "; | |
379 | - } | |
380 | - $obj_disciplina = new clsPmieducarDisciplina( $valor["ref_cod_disciplina"] ); | |
381 | - $obj_disciplina->setOrderby("nm_disciplina ASC"); | |
382 | - $obj_disciplina_det = $obj_disciplina->detalhe(); | |
383 | - $nm_disciplina = $obj_disciplina_det["nm_disciplina"]; | |
384 | - | |
385 | - $tabela3 .= "<TR> | |
386 | - <TD {$color} align=left>{$nm_disciplina}</TD> | |
387 | - </TR>"; | |
388 | - $cont++; | |
389 | - } | |
390 | - $tabela3 .= "</TABLE>"; | |
391 | - } | |
392 | - } | |
393 | - else | |
394 | - { | |
395 | - | |
396 | - $obj = new clsPmieducarDisciplina(); | |
397 | - $lst = $obj->lista( null,null,null,null,null,null,null,null,null,null,null,null,null,null,$this->ref_cod_curso,$this->ref_cod_instituicao); | |
398 | - if ($lst) | |
399 | - { | |
400 | - $tabela3 = "<TABLE> | |
401 | - <TR align=center> | |
402 | - <TD bgcolor=#A1B3BD><B>Nome</B></TD> | |
403 | - </TR>"; | |
404 | - $cont = 0; | |
405 | - | |
406 | - foreach ( $lst AS $valor ) | |
407 | - { | |
408 | - if ( ($cont % 2) == 0 ) | |
409 | - { | |
410 | - $color = " bgcolor=#E4E9ED "; | |
411 | - } | |
412 | - else | |
413 | - { | |
414 | - $color = " bgcolor=#FFFFFF "; | |
415 | - } | |
416 | - | |
417 | - $tabela3 .= "<TR> | |
418 | - <TD {$color} align=left>{$valor['nm_disciplina']}</TD> | |
419 | - </TR>"; | |
420 | - $cont++; | |
421 | - } | |
422 | - $tabela3 .= "</TABLE>"; | |
423 | - } | |
424 | - } | |
425 | - | |
426 | - if( $tabela3 ) | |
427 | - { | |
428 | - $this->addDetalhe( array( "Disciplina", "{$tabela3}") ); | |
429 | - } | |
430 | - | |
431 | - if ( $obj_permissoes->permissao_cadastra( 586, $this->pessoa_logada, 7 ) ) | |
432 | - { | |
433 | - $this->url_novo = "educar_turma_cad.php"; | |
434 | - $this->url_editar = "educar_turma_cad.php?cod_turma={$registro["cod_turma"]}"; | |
435 | - } | |
436 | - $this->url_cancelar = "educar_turma_lst.php"; | |
437 | - $this->largura = "100%"; | |
438 | - } | |
67 | + var $titulo; | |
68 | + | |
69 | + var $cod_turma; | |
70 | + var $ref_usuario_exc; | |
71 | + var $ref_usuario_cad; | |
72 | + var $ref_ref_cod_serie; | |
73 | + var $ref_ref_cod_escola; | |
74 | + var $ref_cod_infra_predio_comodo; | |
75 | + var $nm_turma; | |
76 | + var $sgl_turma; | |
77 | + var $max_aluno; | |
78 | + var $multiseriada; | |
79 | + var $data_cadastro; | |
80 | + var $data_exclusao; | |
81 | + var $ativo; | |
82 | + var $ref_cod_turma_tipo; | |
83 | + var $hora_inicial; | |
84 | + var $hora_final; | |
85 | + var $hora_inicio_intervalo; | |
86 | + var $hora_fim_intervalo; | |
87 | + | |
88 | + var $ref_cod_instituicao; | |
89 | + var $ref_cod_curso; | |
90 | + | |
91 | + var $ref_cod_instituicao_regente; | |
92 | + var $ref_cod_regente; | |
93 | + | |
94 | + function Gerar() | |
95 | + { | |
96 | + @session_start(); | |
97 | + $this->pessoa_logada = $_SESSION['id_pessoa']; | |
98 | + session_write_close(); | |
99 | + | |
100 | + $this->titulo = 'Turma - Detalhe'; | |
101 | + $this->addBanner( | |
102 | + 'imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet' | |
103 | + ); | |
104 | + | |
105 | + $this->cod_turma = $_GET['cod_turma']; | |
106 | + | |
107 | + $tmp_obj = new clsPmieducarTurma(); | |
108 | + $lst_obj = $tmp_obj->lista($this->cod_turma, NULL, NULL, NULL, NULL, NULL, | |
109 | + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | |
110 | + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | |
111 | + NULL, NULL, NULL, array('true', 'false')); | |
112 | + | |
113 | + $registro = array_shift($lst_obj); | |
114 | + | |
115 | + foreach ($registro as $key => $value) { | |
116 | + $this->$key = $value; | |
117 | + } | |
118 | + | |
119 | + if (! $registro) { | |
120 | + header('Location: educar_turma_lst.php'); | |
121 | + die(); | |
122 | + } | |
123 | + | |
124 | + if (class_exists('clsPmieducarTurmaTipo')) | |
125 | + { | |
126 | + $obj_ref_cod_turma_tipo = new clsPmieducarTurmaTipo( | |
127 | + $registro['ref_cod_turma_tipo'] | |
128 | + ); | |
129 | + | |
130 | + $det_ref_cod_turma_tipo = $obj_ref_cod_turma_tipo->detalhe(); | |
131 | + $registro['ref_cod_turma_tipo'] = $det_ref_cod_turma_tipo['nm_tipo']; | |
132 | + } | |
133 | + else { | |
134 | + $registro['ref_cod_turma_tipo'] = 'Erro na geração'; | |
135 | + } | |
136 | + | |
137 | + if (class_exists('clsPmieducarInfraPredioComodo')) { | |
138 | + $obj_ref_cod_infra_predio_comodo = new clsPmieducarInfraPredioComodo( | |
139 | + $registro['ref_cod_infra_predio_comodo'] | |
140 | + ); | |
141 | + | |
142 | + $det_ref_cod_infra_predio_comodo = $obj_ref_cod_infra_predio_comodo->detalhe(); | |
143 | + $registro['ref_cod_infra_predio_comodo'] = $det_ref_cod_infra_predio_comodo['nm_comodo']; | |
144 | + } | |
145 | + else { | |
146 | + $registro['ref_cod_infra_predio_comodo'] = 'Erro na geração'; | |
147 | + } | |
148 | + | |
149 | + if (class_exists('clsPmieducarInstituicao')) { | |
150 | + $obj_cod_instituicao = new clsPmieducarInstituicao( | |
151 | + $registro['ref_cod_instituicao'] | |
152 | + ); | |
153 | + | |
154 | + $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe(); | |
155 | + $registro['ref_cod_instituicao'] = $obj_cod_instituicao_det['nm_instituicao']; | |
156 | + } | |
157 | + else { | |
158 | + $registro['ref_cod_instituicao'] = 'Erro na geração'; | |
159 | + } | |
160 | + | |
161 | + if (class_exists('clsPmieducarEscola')) { | |
162 | + $this->ref_ref_cod_escola = $registro['ref_ref_cod_escola']; | |
163 | + $obj_ref_cod_escola = new clsPmieducarEscola($registro['ref_ref_cod_escola']); | |
164 | + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); | |
165 | + $registro['ref_ref_cod_escola'] = $det_ref_cod_escola['nome']; | |
166 | + } | |
167 | + else { | |
168 | + $registro['ref_cod_escola'] = 'Erro na geração'; | |
169 | + } | |
170 | + | |
171 | + if (class_exists('clsPmieducarCurso')) { | |
172 | + $obj_ref_cod_curso = new clsPmieducarCurso($registro['ref_cod_curso']); | |
173 | + $det_ref_cod_curso = $obj_ref_cod_curso->detalhe(); | |
174 | + $registro['ref_cod_curso'] = $det_ref_cod_curso['nm_curso']; | |
175 | + $padrao_ano_escolar = $det_ref_cod_curso['padrao_ano_escolar']; | |
176 | + } | |
177 | + else { | |
178 | + $registro['ref_cod_curso'] = 'Erro na geração'; | |
179 | + } | |
180 | + | |
181 | + if (class_exists('clsPmieducarSerie')) { | |
182 | + $this->ref_ref_cod_serie = $registro['ref_ref_cod_serie']; | |
183 | + $obj_ser = new clsPmieducarSerie($registro['ref_ref_cod_serie']); | |
184 | + $det_ser = $obj_ser->detalhe(); | |
185 | + $registro['ref_ref_cod_serie'] = $det_ser['nm_serie']; | |
186 | + } | |
187 | + else { | |
188 | + $registro['ref_ref_cod_serie'] = 'Erro na geração'; | |
189 | + } | |
190 | + | |
191 | + $obj_permissoes = new clsPermissoes(); | |
192 | + $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); | |
193 | + | |
194 | + if ($nivel_usuario == 1) { | |
195 | + if ($registro['ref_cod_instituicao']) { | |
196 | + $this->addDetalhe(array('Instituição', $registro['ref_cod_instituicao'])); | |
197 | + } | |
198 | + } | |
199 | + | |
200 | + if ($nivel_usuario == 1 || $nivel_usuario == 2) { | |
201 | + if ($registro['ref_ref_cod_escola']) { | |
202 | + $this->addDetalhe(array('Escola', $registro['ref_ref_cod_escola'])); | |
203 | + } | |
204 | + } | |
205 | + | |
206 | + if ($registro['ref_cod_curso']) { | |
207 | + $this->addDetalhe(array('Curso', $registro['ref_cod_curso'])); | |
208 | + } | |
209 | + | |
210 | + if ($registro['ref_ref_cod_serie']) { | |
211 | + $this->addDetalhe(array('Série', $registro['ref_ref_cod_serie'])); | |
212 | + } | |
213 | + | |
214 | + if ($registro['ref_cod_regente']) { | |
215 | + $obj_pessoa = new clsPessoa_($registro['ref_cod_regente']); | |
216 | + $det = $obj_pessoa->detalhe(); | |
217 | + | |
218 | + $this->addDetalhe(array('Professor/Regente', $det['nome'])); | |
219 | + } | |
220 | + | |
221 | + if ($registro['ref_cod_infra_predio_comodo']) { | |
222 | + $this->addDetalhe(array('Sala', $registro['ref_cod_infra_predio_comodo'])); | |
223 | + } | |
224 | + | |
225 | + if ($registro['ref_cod_turma_tipo']) { | |
226 | + $this->addDetalhe(array('Tipo de Turma', $registro['ref_cod_turma_tipo'])); | |
227 | + } | |
228 | + | |
229 | + if ($registro['nm_turma']) { | |
230 | + $this->addDetalhe(array('Turma', $registro['nm_turma'])); | |
231 | + } | |
232 | + | |
233 | + if ($registro['sgl_turma']) { | |
234 | + $this->addDetalhe(array('Sigla', $registro['sgl_turma'])); | |
235 | + } | |
236 | + | |
237 | + if ($registro['max_aluno']) { | |
238 | + $this->addDetalhe(array('Máximo de Alunos', $registro['max_aluno'])); | |
239 | + } | |
240 | + | |
241 | + $this->addDetalhe(array('Situação', dbBool($registro['visivel']) ? 'Ativo' : 'Desativo')); | |
242 | + | |
243 | + if ($registro['multiseriada'] == 1) { | |
244 | + if ($registro['multiseriada'] == 1) { | |
245 | + $registro['multiseriada'] = 'sim'; | |
246 | + } | |
247 | + else { | |
248 | + $registro['multiseriada'] = 'não'; | |
249 | + } | |
250 | + | |
251 | + $this->addDetalhe(array('Multi-Seriada', $registro['multiseriada'])); | |
252 | + | |
253 | + $obj_serie_mult = new clsPmieducarSerie($registro['ref_ref_cod_serie_mult']); | |
254 | + $det_serie_mult = $obj_serie_mult->detalhe(); | |
255 | + | |
256 | + $this->addDetalhe(array('Série Multi-Seriada', $det_serie_mult['nm_serie'])); | |
257 | + } | |
258 | + | |
259 | + if ($padrao_ano_escolar == 1) { | |
260 | + if ($registro['hora_inicial']) { | |
261 | + $registro['hora_inicial'] = date('H:i', strtotime($registro['hora_inicial'])); | |
262 | + $this->addDetalhe(array('Hora Inicial', $registro['hora_inicial'])); | |
263 | + } | |
264 | + | |
265 | + if ($registro['hora_final']) { | |
266 | + $registro['hora_final'] = date('H:i', strtotime($registro['hora_final'])); | |
267 | + $this->addDetalhe(array('Hora Final', $registro['hora_final'])); | |
268 | + } | |
269 | + | |
270 | + if ($registro['hora_inicio_intervalo']) { | |
271 | + $registro['hora_inicio_intervalo'] = date('H:i', strtotime($registro['hora_inicio_intervalo'])); | |
272 | + $this->addDetalhe(array('Hora Início Intervalo', $registro['hora_inicio_intervalo'])); | |
273 | + } | |
274 | + | |
275 | + if ($registro['hora_fim_intervalo']) { | |
276 | + $registro['hora_fim_intervalo'] = date('H:i', strtotime($registro['hora_fim_intervalo'])); | |
277 | + $this->addDetalhe(array('Hora Fim Intervalo', $registro['hora_fim_intervalo'])); | |
278 | + } | |
279 | + } | |
280 | + elseif ($padrao_ano_escolar == 0) { | |
281 | + $obj = new clsPmieducarTurmaModulo(); | |
282 | + $obj->setOrderby('data_inicio ASC'); | |
283 | + $lst = $obj->lista($this->cod_turma); | |
284 | + | |
285 | + if ($lst) { | |
286 | + $tabela = ' | |
287 | + <table> | |
288 | + <tr align="center"> | |
289 | + <td bgcolor="#A1B3BD"><b>Nome</b></td> | |
290 | + <td bgcolor="#A1B3BD"><b>Data Início</b></td> | |
291 | + <td bgcolor="#A1B3BD"><b>Data Fim</b></td> | |
292 | + </tr>'; | |
293 | + | |
294 | + $cont = 0; | |
295 | + | |
296 | + foreach ($lst as $valor) { | |
297 | + if (($cont % 2) == 0) { | |
298 | + $color = ' bgcolor="#E4E9ED" '; | |
299 | + } | |
300 | + else { | |
301 | + $color = ' bgcolor="#FFFFFF" '; | |
302 | + } | |
303 | + | |
304 | + $obj_modulo = new clsPmieducarModulo($valor['ref_cod_modulo']); | |
305 | + $det_modulo = $obj_modulo->detalhe(); | |
306 | + $nm_modulo = $det_modulo['nm_tipo']; | |
307 | + | |
308 | + $valor['data_inicio'] = dataFromPgToBr($valor['data_inicio']); | |
309 | + $valor['data_fim'] = dataFromPgToBr($valor['data_fim']); | |
310 | + | |
311 | + $tabela .= sprintf(' | |
312 | + <tr> | |
313 | + <td %s align=left>%s</td> | |
314 | + <td %s align=left>%s</td> | |
315 | + <td %s align=left>%s</td> | |
316 | + </tr>', | |
317 | + $color, $nm_modulo, $color, $valor['data_inicio'], $color, $valor['data_fim'] | |
318 | + ); | |
319 | + | |
320 | + $cont++; | |
321 | + } | |
322 | + | |
323 | + $tabela .= '</table>'; | |
324 | + } | |
325 | + | |
326 | + if ($tabela) { | |
327 | + $this->addDetalhe(array('Módulo', $tabela)); | |
328 | + } | |
329 | + | |
330 | + $dias_da_semana = array( | |
331 | + '' => 'Selecione', | |
332 | + 1 => 'Domingo', | |
333 | + 2 => 'Segunda', | |
334 | + 3 => 'Terça', | |
335 | + 4 => 'Quarta', | |
336 | + 5 => 'Quinta', | |
337 | + 6 => 'Sexta', | |
338 | + 7 => 'Sábado' | |
339 | + ); | |
340 | + | |
341 | + $obj = new clsPmieducarTurmaDiaSemana(); | |
342 | + $lst = $obj->lista(NULL, $this->cod_turma); | |
343 | + | |
344 | + if ($lst) { | |
345 | + $tabela1 = ' | |
346 | + <table> | |
347 | + <tr align="center"> | |
348 | + <td bgcolor="#A1B3BD"><b>Nome</b></td> | |
349 | + <td bgcolor="#A1B3BD"><b>Hora Inicial</b></td> | |
350 | + <td bgcolor="#A1B3BD"><b>Hora Final</b></td> | |
351 | + </tr>'; | |
352 | + | |
353 | + $cont = 0; | |
354 | + | |
355 | + foreach ($lst as $valor) { | |
356 | + if (($cont % 2) == 0) { | |
357 | + $color = ' bgcolor="#E4E9ED" '; | |
358 | + } | |
359 | + else { | |
360 | + $color = ' bgcolor="#FFFFFF" '; | |
361 | + } | |
362 | + | |
363 | + $valor['hora_inicial'] = date('H:i', strtotime($valor['hora_inicial'])); | |
364 | + $valor['hora_final'] = date('H:i', strtotime($valor['hora_final'])); | |
365 | + | |
366 | + $tabela1 .= sprintf(" | |
367 | + <tr> | |
368 | + <td %s align=left>%s</td> | |
369 | + <td %s align=left>%s</td> | |
370 | + <td %s align=left>%s</td> | |
371 | + </tr>", | |
372 | + $color, $dias_da_semana[$valor['dia_semana']], $color, | |
373 | + $valor['hora_inicial'], $color, $valor['hora_final'] | |
374 | + ); | |
375 | + | |
376 | + $cont++; | |
377 | + } | |
378 | + | |
379 | + $tabela1 .= '</table>'; | |
380 | + } | |
381 | + | |
382 | + if ($tabela1) { | |
383 | + $this->addDetalhe(array('Dia da Semana', $tabela1)); | |
384 | + } | |
385 | + } | |
386 | + | |
387 | + if ($this->ref_ref_cod_escola && $this->ref_ref_cod_serie) { | |
388 | + $obj = new clsPmieducarEscolaSerieDisciplina(); | |
389 | + $lst = $obj->lista($this->ref_ref_cod_serie, $this->ref_ref_cod_escola, NULL, 1); | |
390 | + | |
391 | + if ($lst) { | |
392 | + $tabela3 = ' | |
393 | + <table> | |
394 | + <tr align="center"> | |
395 | + <td bgcolor="#A1B3BD"><b>Nome</b></td> | |
396 | + </tr>'; | |
397 | + | |
398 | + $cont = 0; | |
399 | + foreach ($lst as $valor) { | |
400 | + if (($cont % 2) == 0) { | |
401 | + $color = ' bgcolor="#E4E9ED" '; | |
402 | + } | |
403 | + else { | |
404 | + $color = ' bgcolor="#FFFFFF" '; | |
405 | + } | |
406 | + | |
407 | + $obj_disciplina = new clsPmieducarDisciplina($valor['ref_cod_disciplina']); | |
408 | + $obj_disciplina->setOrderby('nm_disciplina ASC'); | |
409 | + $obj_disciplina_det = $obj_disciplina->detalhe(); | |
410 | + $nm_disciplina = $obj_disciplina_det['nm_disciplina']; | |
411 | + | |
412 | + $tabela3 .= sprintf(' | |
413 | + <tr> | |
414 | + <td %s align=left>%s</td> | |
415 | + </tr>', | |
416 | + $color, $nm_disciplina | |
417 | + ); | |
418 | + | |
419 | + $cont++; | |
420 | + } | |
421 | + $tabela3 .= '</table>'; | |
422 | + } | |
423 | + } | |
424 | + else { | |
425 | + $obj = new clsPmieducarDisciplina(); | |
426 | + $lst = $obj->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | |
427 | + NULL, NULL, NULL, NULL, NULL, $this->ref_cod_curso, | |
428 | + $this->ref_cod_instituicao); | |
429 | + | |
430 | + if ($lst) { | |
431 | + $tabela3 = ' | |
432 | + <table> | |
433 | + <tr align="center"> | |
434 | + <td bgcolor="#A1B3BD"><b>Nome</b></td> | |
435 | + </tr>'; | |
436 | + | |
437 | + $cont = 0; | |
438 | + | |
439 | + foreach ($lst as $valor) { | |
440 | + if (($cont % 2) == 0) { | |
441 | + $color = ' bgcolor="#E4E9ED" '; | |
442 | + } | |
443 | + else { | |
444 | + $color = ' bgcolor="#FFFFFF" '; | |
445 | + } | |
446 | + | |
447 | + $tabela3 .= sprintf(' | |
448 | + <tr> | |
449 | + <td %s align=left>%s</TD> | |
450 | + </tr>', | |
451 | + $color, $valor['nm_disciplina'] | |
452 | + ); | |
453 | + | |
454 | + $cont++; | |
455 | + } | |
456 | + | |
457 | + $tabela3 .= '</table>'; | |
458 | + } | |
459 | + } | |
460 | + | |
461 | + if ($tabela3) { | |
462 | + $this->addDetalhe(array('Disciplina', $tabela3)); | |
463 | + } | |
464 | + | |
465 | + if ($obj_permissoes->permissao_cadastra(586, $this->pessoa_logada, 7)) { | |
466 | + $this->url_novo = 'educar_turma_cad.php'; | |
467 | + $this->url_editar = 'educar_turma_cad.php?cod_turma=' . $registro['cod_turma']; | |
468 | + } | |
469 | + | |
470 | + $this->url_cancelar = 'educar_turma_lst.php'; | |
471 | + $this->largura = '100%'; | |
472 | + } | |
439 | 473 | } |
440 | 474 | |
441 | -// cria uma extensao da classe base | |
475 | +// Instancia objeto de página | |
442 | 476 | $pagina = new clsIndexBase(); |
443 | -// cria o conteudo | |
477 | + | |
478 | +// Instancia objeto de conteúdo | |
444 | 479 | $miolo = new indice(); |
445 | -// adiciona o conteudo na clsBase | |
446 | -$pagina->addForm( $miolo ); | |
447 | -// gera o html | |
448 | -$pagina->MakeAll(); | |
449 | -?> | |
450 | 480 | \ No newline at end of file |
481 | + | |
482 | +// Atribui o conteúdo à página | |
483 | +$pagina->addForm($miolo); | |
484 | + | |
485 | +// Gera o código HTML | |
486 | +$pagina->MakeAll(); | |
451 | 487 | \ No newline at end of file | ... | ... |