Commit fad0303bbbcc4c39f338cb0ebb10402adad27f41
1 parent
ac20311c
Exists in
master
Refactoring para coding standards
Showing
2 changed files
with
322 additions
and
310 deletions
Show diff stats
ieducar/intranet/educar_relatorio_registro_transferencias.php
1 | 1 | <?php |
2 | - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
3 | - * * | |
4 | - * @author Prefeitura Municipal de Itajaí * | |
5 | - * @updated 29/03/2007 * | |
6 | - * Pacote: i-PLB Software Público Livre e Brasileiro * | |
7 | - * * | |
8 | - * Copyright (C) 2006 PMI - Prefeitura Municipal de Itajaí * | |
9 | - * ctima@itajai.sc.gov.br * | |
10 | - * * | |
11 | - * Este programa é software livre, você pode redistribuí-lo e/ou * | |
12 | - * modificá-lo sob os termos da Licença Pública Geral GNU, conforme * | |
13 | - * publicada pela Free Software Foundation, tanto a versão 2 da * | |
14 | - * Licença como (a seu critério) qualquer versão mais nova. * | |
15 | - * * | |
16 | - * Este programa é distribuído na expectativa de ser útil, mas SEM * | |
17 | - * QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI- * | |
18 | - * ZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con- * | |
19 | - * sulte a Licença Pública Geral GNU para obter mais detalhes. * | |
20 | - * * | |
21 | - * Você deve ter recebido uma cópia da Licença Pública Geral GNU * | |
22 | - * junto com este programa. Se não, escreva para a Free Software * | |
23 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * | |
24 | - * 02111-1307, USA. * | |
25 | - * * | |
26 | - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
27 | -require_once ("include/clsBase.inc.php"); | |
28 | -require_once ("include/clsCadastro.inc.php"); | |
29 | -require_once ("include/clsBanco.inc.php"); | |
30 | -require_once( "include/pmieducar/geral.inc.php" ); | |
31 | -require_once ("include/clsPDF.inc.php"); | |
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 | + * @license http://creativecommons.org/licenses/GPL/2.0/legalcode.pt CC GNU GPL | |
25 | + * @package Core | |
26 | + * @subpackage pmieducar | |
27 | + * @subpackage Matricula | |
28 | + * @subpackage SolicitacaoTransferencia | |
29 | + * @subpackage Relatorio | |
30 | + * @since Arquivo disponível desde a versão 1.0.0 | |
31 | + * @version $Id$ | |
32 | + */ | |
33 | + | |
34 | +require_once 'include/clsBase.inc.php'; | |
35 | +require_once 'include/clsCadastro.inc.php'; | |
36 | +require_once 'include/clsBanco.inc.php'; | |
37 | +require_once 'include/pmieducar/geral.inc.php'; | |
38 | +require_once 'include/clsPDF.inc.php'; | |
32 | 39 | |
33 | 40 | class clsIndexBase extends clsBase |
34 | 41 | { |
35 | - function Formular() | |
36 | - { | |
37 | - $this->SetTitulo( "{$this->_instituicao} i-Educar - Registro de Matrículas" ); | |
38 | - $this->processoAp = "693"; | |
39 | - } | |
42 | + function Formular() | |
43 | + { | |
44 | + $this->SetTitulo($this->_instituicao . ' i-Educar - Registro de Matrículas'); | |
45 | + $this->processoAp = '693'; | |
46 | + } | |
40 | 47 | } |
41 | 48 | |
42 | 49 | class indice extends clsCadastro |
43 | 50 | { |
44 | - | |
45 | - | |
46 | - /** | |
47 | - * Referencia pega da session para o idpes do usuario atual | |
48 | - * | |
49 | - * @var int | |
50 | - */ | |
51 | - var $pessoa_logada; | |
52 | - | |
53 | - | |
54 | - var $ref_cod_instituicao; | |
55 | - var $ref_cod_escola; | |
56 | - | |
57 | - | |
58 | - var $ano; | |
59 | - | |
60 | - var $nm_escola; | |
61 | - var $nm_instituicao; | |
62 | - | |
63 | - var $pdf; | |
64 | - | |
65 | - | |
66 | - var $page_y = 139; | |
67 | - | |
68 | - function Inicializar() | |
69 | - { | |
70 | - $retorno = "Novo"; | |
71 | - @session_start(); | |
72 | - $this->pessoa_logada = $_SESSION['id_pessoa']; | |
73 | - @session_write_close(); | |
74 | - | |
75 | - return $retorno; | |
76 | - } | |
77 | - | |
78 | - function Gerar() | |
79 | - { | |
80 | - @session_start(); | |
81 | - $this->pessoa_logada = $_SESSION['id_pessoa']; | |
82 | - @session_write_close(); | |
83 | - | |
84 | - if($_POST){ | |
85 | - foreach ($_POST as $key => $value) { | |
86 | - $this->$key = $value; | |
87 | - | |
88 | - } | |
89 | - } | |
90 | - | |
91 | - $this->ano = $ano_atual = date("Y"); | |
92 | - | |
93 | - $this->campoNumero( "ano", "Ano", $this->ano, 4, 4, true ); | |
94 | - | |
95 | - $get_escola = true; | |
96 | - $obrigatorio = false; | |
97 | - $instituicao_obrigatorio = true; | |
98 | - $escola_obrigatorio = true; | |
99 | - | |
100 | - include("include/pmieducar/educar_campo_lista.php"); | |
101 | - | |
102 | - if($this->ref_cod_escola) | |
103 | - $this->ref_ref_cod_escola = $this->ref_cod_escola; | |
104 | - | |
105 | - $this->url_cancelar = "educar_index.php"; | |
106 | - $this->nome_url_cancelar = "Cancelar"; | |
107 | - | |
108 | - $this->acao_enviar = 'acao2()'; | |
109 | - $this->acao_executa_submit = false; | |
110 | - | |
111 | - } | |
112 | - | |
113 | - | |
114 | - | |
51 | + /** | |
52 | + * Referência a usuário da sessão. | |
53 | + * @var int | |
54 | + */ | |
55 | + var $pessoa_logada; | |
56 | + | |
57 | + var $ref_cod_instituicao; | |
58 | + var $ref_cod_escola; | |
59 | + var $ano; | |
60 | + var $nm_escola; | |
61 | + var $nm_instituicao; | |
62 | + | |
63 | + var $pdf; | |
64 | + var $page_y = 139; | |
65 | + | |
66 | + function Inicializar() | |
67 | + { | |
68 | + $retorno = 'Novo'; | |
69 | + session_start(); | |
70 | + $this->pessoa_logada = $_SESSION['id_pessoa']; | |
71 | + session_write_close(); | |
72 | + | |
73 | + return $retorno; | |
74 | + } | |
75 | + | |
76 | + function Gerar() | |
77 | + { | |
78 | + session_start(); | |
79 | + $this->pessoa_logada = $_SESSION['id_pessoa']; | |
80 | + session_write_close(); | |
81 | + | |
82 | + if ($_POST) { | |
83 | + foreach ($_POST as $key => $value) { | |
84 | + $this->$key = $value; | |
85 | + } | |
86 | + } | |
87 | + | |
88 | + $this->ano = $ano_atual = date('Y'); | |
89 | + $this->campoNumero('ano', 'Ano', $this->ano, 4, 4, TRUE); | |
90 | + | |
91 | + $get_escola = TRUE; | |
92 | + $obrigatorio = FALSE; | |
93 | + $instituicao_obrigatorio = TRUE; | |
94 | + $escola_obrigatorio = TRUE; | |
95 | + | |
96 | + include 'include/pmieducar/educar_campo_lista.php'; | |
97 | + | |
98 | + if ($this->ref_cod_escola) { | |
99 | + $this->ref_ref_cod_escola = $this->ref_cod_escola; | |
100 | + } | |
101 | + | |
102 | + $this->url_cancelar = 'educar_index.php'; | |
103 | + $this->nome_url_cancelar = 'Cancelar'; | |
104 | + | |
105 | + $this->acao_enviar = 'acao2()'; | |
106 | + $this->acao_executa_submit = FALSE; | |
107 | + } | |
115 | 108 | } |
116 | 109 | |
117 | -// cria uma extensao da classe base | |
110 | +// Instancia objeto de página | |
118 | 111 | $pagina = new clsIndexBase(); |
119 | -// cria o conteudo | |
112 | + | |
113 | +// Instancia objeto de conteúdo | |
120 | 114 | $miolo = new indice(); |
121 | -// adiciona o conteudo na clsBase | |
122 | -$pagina->addForm( $miolo ); | |
123 | -// gera o html | |
124 | -$pagina->MakeAll(); | |
125 | 115 | |
126 | -?> | |
127 | -<script> | |
116 | +// Atribui o conteúdo à página | |
117 | +$pagina->addForm($miolo); | |
128 | 118 | |
119 | +// Gera o código HTML | |
120 | +$pagina->MakeAll(); | |
121 | +?> | |
122 | +<script type="text/javascript"> | |
129 | 123 | function acao2() |
130 | 124 | { |
131 | 125 | |
132 | - if(!acao()) | |
133 | - return false; | |
134 | - | |
135 | - showExpansivelImprimir(400, 200,'',[], "Registro de Matrículas"); | |
126 | + if(! acao()) { | |
127 | + return false; | |
128 | + } | |
136 | 129 | |
137 | - document.formcadastro.target = 'miolo_'+(DOM_divs.length-1); | |
138 | - | |
139 | - document.formcadastro.submit(); | |
130 | + showExpansivelImprimir(400, 200, '', [], 'Registro de Matrículas'); | |
131 | + document.formcadastro.target = 'miolo_' + (DOM_divs.length - 1); | |
132 | + document.formcadastro.submit(); | |
140 | 133 | } |
141 | 134 | |
142 | 135 | document.formcadastro.action = 'educar_relatorio_registro_transferencias_proc.php'; |
143 | - | |
144 | 136 | </script> |
145 | 137 | \ No newline at end of file | ... | ... |
ieducar/intranet/educar_relatorio_registro_transferencias_proc.php
1 | 1 | <?php |
2 | 2 | |
3 | -/* | |
3 | +/** | |
4 | 4 | * i-Educar - Sistema de gestão escolar |
5 | 5 | * |
6 | 6 | * Copyright (C) 2006 Prefeitura Municipal de Itajaí |
... | ... | @@ -19,15 +19,14 @@ |
19 | 19 | * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto |
20 | 20 | * com este programa; se não, escreva para a Free Software Foundation, Inc., no |
21 | 21 | * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
22 | - */ | |
23 | - | |
24 | -/** | |
25 | - * Relatório de Registro de transferências. | |
26 | 22 | * |
27 | 23 | * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> |
28 | 24 | * @license http://creativecommons.org/licenses/GPL/2.0/legalcode.pt CC GNU GPL |
29 | 25 | * @package Core |
30 | - * @subpackage Relatório | |
26 | + * @subpackage pmieducar | |
27 | + * @subpackage Matricula | |
28 | + * @subpackage SolicitacaoTransferencia | |
29 | + * @subpackage Relatorio | |
31 | 30 | * @since Arquivo disponível desde a versão 1.0.0 |
32 | 31 | * @version $Id$ |
33 | 32 | */ |
... | ... | @@ -43,150 +42,140 @@ class clsIndexBase extends clsBase |
43 | 42 | { |
44 | 43 | function Formular() |
45 | 44 | { |
46 | - $this->SetTitulo( "{$this->_instituicao} i-Educar - Registro de Matrículas" ); | |
47 | - $this->processoAp = "693"; | |
48 | - $this->renderMenu = false; | |
49 | - $this->renderMenuSuspenso = false; | |
45 | + $this->SetTitulo($this->_instituicao . ' i-Educar - Registro de Matrículas'); | |
46 | + $this->processoAp = '916'; | |
47 | + $this->renderMenu = FALSE; | |
48 | + $this->renderMenuSuspenso = FALSE; | |
50 | 49 | } |
51 | 50 | } |
52 | 51 | |
53 | 52 | class indice extends clsCadastro |
54 | 53 | { |
55 | - | |
56 | - | |
57 | 54 | /** |
58 | - * Referencia pega da session para o idpes do usuario atual | |
59 | - * | |
55 | + * Referência a usuário da sessão. | |
60 | 56 | * @var int |
61 | 57 | */ |
62 | 58 | var $pessoa_logada; |
63 | 59 | |
64 | - | |
65 | 60 | var $ref_cod_instituicao; |
66 | 61 | var $ref_cod_escola; |
67 | 62 | var $ref_cod_serie; |
68 | 63 | var $ref_cod_curso; |
69 | - | |
70 | 64 | var $ano; |
71 | - | |
72 | 65 | var $nm_escola; |
73 | 66 | var $nm_instituicao; |
74 | 67 | var $nm_curso; |
75 | 68 | |
76 | 69 | var $pdf; |
77 | - | |
78 | 70 | var $page_y = 139; |
79 | - | |
80 | 71 | var $get_link; |
81 | - | |
82 | 72 | var $campo_assinatura; |
83 | - | |
84 | 73 | var $total = 0; |
85 | 74 | |
86 | 75 | var $meses_do_ano = array( |
87 | - "1" => "JANEIRO" | |
88 | - ,"2" => "FEVEREIRO" | |
89 | - ,"3" => "MARÇO" | |
90 | - ,"4" => "ABRIL" | |
91 | - ,"5" => "MAIO" | |
92 | - ,"6" => "JUNHO" | |
93 | - ,"7" => "JULHO" | |
94 | - ,"8" => "AGOSTO" | |
95 | - ,"9" => "SETEMBRO" | |
96 | - ,"10" => "OUTUBRO" | |
97 | - ,"11" => "NOVEMBRO" | |
98 | - ,"12" => "DEZEMBRO" | |
99 | - ); | |
76 | + '1' => 'JANEIRO', | |
77 | + '2' => 'FEVEREIRO', | |
78 | + '3' => 'MARÇO', | |
79 | + '4' => 'ABRIL', | |
80 | + '5' => 'MAIO', | |
81 | + '6' => 'JUNHO', | |
82 | + '7' => 'JULHO', | |
83 | + '8' => 'AGOSTO', | |
84 | + '9' => 'SETEMBRO', | |
85 | + '10' => 'OUTUBRO', | |
86 | + '11' => 'NOVEMBRO', | |
87 | + '12' => 'DEZEMBRO' | |
88 | + ); | |
100 | 89 | |
101 | 90 | function renderHTML() |
102 | 91 | { |
92 | + $this->ref_cod_instituicao = $_POST['ref_cod_instituicao']; | |
93 | + $this->ref_cod_escola = $_POST['ref_cod_escola']; | |
94 | + $this->ano = $_POST['ano']; | |
103 | 95 | |
104 | - $this->ref_cod_instituicao = $_POST["ref_cod_instituicao"]; | |
105 | - $this->ref_cod_escola = $_POST["ref_cod_escola"]; | |
106 | - $this->ano = $_POST['ano']; | |
107 | - | |
108 | - $fonte = 'arial'; | |
96 | + $fonte = 'arial'; | |
109 | 97 | $corTexto = '#000000'; |
110 | 98 | |
111 | - if (is_numeric($this->ref_cod_instituicao) && is_numeric($this->ref_cod_escola)) | |
112 | - { | |
113 | - | |
99 | + if (is_numeric($this->ref_cod_instituicao) && is_numeric($this->ref_cod_escola)) { | |
114 | 100 | $obj_instituicao = new clsPmieducarInstituicao($this->ref_cod_instituicao); |
115 | 101 | $det_instituicao = $obj_instituicao->detalhe(); |
116 | 102 | $this->nm_instituicao = $det_instituicao["nm_instituicao"]; |
117 | 103 | |
118 | - $sql = " SELECT | |
119 | - fantasia as nome | |
120 | - FROM | |
121 | - pmieducar.escola | |
122 | - , cadastro.juridica | |
123 | - WHERE | |
124 | - ref_cod_instituicao = {$this->ref_cod_instituicao} | |
125 | - AND idpes = ref_idpes | |
126 | - AND cod_escola = {$this->ref_cod_escola} | |
127 | - AND ativo = 1 | |
128 | - UNION | |
129 | - SELECT | |
130 | - nm_escola | |
131 | - FROM | |
132 | - pmieducar.escola | |
133 | - , pmieducar.escola_complemento | |
134 | - WHERE | |
135 | - ref_cod_instituicao = {$this->ref_cod_instituicao} | |
136 | - AND cod_escola = ref_cod_escola | |
137 | - AND cod_escola = {$this->ref_cod_escola} | |
138 | - AND escola.ativo = 1"; | |
104 | + $sql = " | |
105 | + SELECT | |
106 | + fantasia as nome | |
107 | + FROM | |
108 | + pmieducar.escola, | |
109 | + cadastro.juridica | |
110 | + WHERE | |
111 | + ref_cod_instituicao = {$this->ref_cod_instituicao} | |
112 | + AND idpes = ref_idpes | |
113 | + AND cod_escola = {$this->ref_cod_escola} | |
114 | + AND ativo = 1 | |
115 | + UNION | |
116 | + SELECT | |
117 | + nm_escola | |
118 | + FROM | |
119 | + pmieducar.escola, | |
120 | + pmieducar.escola_complemento | |
121 | + WHERE | |
122 | + ref_cod_instituicao = {$this->ref_cod_instituicao} | |
123 | + AND cod_escola = ref_cod_escola | |
124 | + AND cod_escola = {$this->ref_cod_escola} | |
125 | + AND escola.ativo = 1"; | |
126 | + | |
139 | 127 | $db = new clsBanco(); |
140 | 128 | $this->nm_escola = $db->CampoUnico($sql); |
141 | 129 | |
142 | - $sql = "SELECT | |
143 | - cod_matricula, | |
144 | - m.ref_cod_aluno, | |
145 | - (SELECT nome FROM cadastro.pessoa p, pmieducar.aluno a WHERE | |
146 | - a.cod_aluno = m.ref_cod_aluno AND a.ref_idpes = p.idpes) as nome_aluno, | |
147 | - to_char(data_transferencia,'DD/MM/YYYY') as dt_transferencia, | |
148 | - s.nm_serie, | |
149 | - t.nm_turma, | |
150 | - ts.ref_cod_matricula_entrada | |
151 | - FROM | |
152 | - pmieducar.matricula m, | |
153 | - pmieducar.matricula_turma mt, | |
154 | - pmieducar.turma t, | |
155 | - pmieducar.serie s, | |
156 | - pmieducar.transferencia_solicitacao ts | |
157 | - WHERE | |
158 | - m.ref_ref_cod_escola = {$this->ref_cod_escola} | |
159 | - AND ref_cod_matricula_saida = cod_matricula | |
160 | - AND ts.ativo = 1 | |
161 | - AND mt.ref_cod_matricula = m.cod_matricula | |
162 | - AND mt.ref_cod_turma = t.cod_turma | |
163 | - AND t.ref_ref_cod_serie = s.cod_serie | |
164 | - AND m.ano = {$this->ano} | |
165 | - | |
166 | - ORDER BY | |
167 | - nm_turma, | |
168 | - nm_serie, | |
169 | - dt_transferencia"; | |
170 | - //AND data_transferencia IS NOT NULL | |
171 | - //AND EXTRACT (YEAR FROM data_transferencia) = {$this->ano} | |
172 | - $db->Consulta($sql); | |
130 | + $sql = " | |
131 | + SELECT | |
132 | + cod_matricula, | |
133 | + m.ref_cod_aluno, | |
134 | + (SELECT | |
135 | + nome | |
136 | + FROM | |
137 | + cadastro.pessoa p, pmieducar.aluno a | |
138 | + WHERE | |
139 | + a.cod_aluno = m.ref_cod_aluno AND a.ref_idpes = p.idpes) | |
140 | + as nome_aluno, | |
141 | + to_char(data_transferencia,'DD/MM/YYYY') as dt_transferencia, | |
142 | + s.nm_serie, | |
143 | + t.nm_turma, | |
144 | + ts.ref_cod_matricula_entrada | |
145 | + FROM | |
146 | + pmieducar.matricula m, | |
147 | + pmieducar.matricula_turma mt, | |
148 | + pmieducar.turma t, | |
149 | + pmieducar.serie s, | |
150 | + pmieducar.transferencia_solicitacao ts | |
151 | + WHERE | |
152 | + m.ref_ref_cod_escola = {$this->ref_cod_escola} | |
153 | + AND ref_cod_matricula_saida = cod_matricula | |
154 | + AND ts.ativo = 1 | |
155 | + AND mt.ref_cod_matricula = m.cod_matricula | |
156 | + AND mt.ref_cod_turma = t.cod_turma | |
157 | + AND t.ref_ref_cod_serie = s.cod_serie | |
158 | + AND m.ano = {$this->ano} | |
159 | + ORDER BY | |
160 | + nm_turma, | |
161 | + nm_serie, | |
162 | + dt_transferencia"; | |
173 | 163 | |
174 | - if ($db->Num_Linhas()) | |
175 | - { | |
164 | + $db->Consulta($sql); | |
176 | 165 | |
166 | + if ($db->Num_Linhas()) { | |
177 | 167 | $dados = array(); |
178 | - while ($db->ProximoRegistro()) | |
179 | - { | |
168 | + | |
169 | + while ($db->ProximoRegistro()) { | |
180 | 170 | $dados[] = $db->Tupla(); |
181 | 171 | $this->total++; |
182 | 172 | } |
183 | 173 | |
184 | 174 | $this->pdf = new clsPDF("Registro de Matrículas - {$this->ano}", "Registro de Matrículas", "A4", "", false, false); |
185 | - | |
186 | 175 | $obj_instituicao = new clsPmieducarInstituicao(); |
187 | 176 | |
188 | 177 | $this->pdf->largura = 842.0; |
189 | - $this->pdf->altura = 595.0; | |
178 | + $this->pdf->altura = 595.0; | |
190 | 179 | |
191 | 180 | $this->page_y = 125; |
192 | 181 | |
... | ... | @@ -194,72 +183,86 @@ class indice extends clsCadastro |
194 | 183 | |
195 | 184 | $this->addCabecalho(); |
196 | 185 | |
197 | - $esquerda = 30; | |
198 | - $altura = 130 + 18*2; | |
199 | - $direita = 782; | |
186 | + $esquerda = 30; | |
187 | + $altura = 130 + 18 * 2; | |
188 | + $direita = 782; | |
200 | 189 | $tam_texto = 8; |
201 | - $altura = 130; | |
190 | + $altura = 130; | |
202 | 191 | |
203 | 192 | $altura_escrita = 3; |
204 | - foreach ($dados as $dado_transferencia) | |
205 | - { | |
206 | - list($cod_matricula, $ref_cod_aluno, $nome_aluno, $dt_transferencia, $nm_serie, $nm_turma, $ref_cod_matricula_entrada) = $dado_transferencia; | |
207 | - $this->pdf->linha_relativa($esquerda, $altura+=18, 0, 18); | |
193 | + foreach ($dados as $dado_transferencia) { | |
194 | + list($cod_matricula, $ref_cod_aluno, $nome_aluno, $dt_transferencia, | |
195 | + $nm_serie, $nm_turma, $ref_cod_matricula_entrada) = $dado_transferencia; | |
196 | + | |
197 | + $this->pdf->linha_relativa($esquerda, $altura += 18, 0, 18); | |
208 | 198 | $this->pdf->linha_relativa($esquerda, $altura, $direita, 0); |
209 | - $this->pdf->escreve_relativo($cod_matricula, $esquerda + 3, $altura + $altura_escrita, 55, 30, $fonte, $tam_texto, $corTexto, 'center'); | |
199 | + $this->pdf->escreve_relativo($cod_matricula, $esquerda + 3, | |
200 | + $altura + $altura_escrita, 55, 30, $fonte, $tam_texto, $corTexto, 'center'); | |
201 | + | |
210 | 202 | $this->pdf->linha_relativa($esquerda + 55, $altura, 0, 18); |
203 | + $this->pdf->escreve_relativo($nome_aluno, $esquerda + 58, | |
204 | + $altura + $altura_escrita, 300, 30, $fonte, $tam_texto); | |
211 | 205 | |
212 | - $this->pdf->escreve_relativo($nome_aluno, $esquerda + 58, $altura + $altura_escrita, 300, 30, $fonte, $tam_texto); | |
213 | 206 | $this->pdf->linha_relativa($esquerda + 317 - 18, $altura, 0, 18); |
207 | + $this->pdf->escreve_relativo($dt_transferencia, $esquerda + 320 - 18, | |
208 | + $altura + $altura_escrita, 150, 30, $fonte, $tam_texto, $corTexto); | |
214 | 209 | |
215 | - $this->pdf->escreve_relativo($dt_transferencia, $esquerda + 320 - 18, $altura + $altura_escrita, 150, 30, $fonte, $tam_texto, $corTexto); | |
216 | 210 | $this->pdf->linha_relativa($esquerda + 365-11, $altura, 0, 18); |
211 | + $this->pdf->escreve_relativo($nm_serie, $esquerda + 365 - 9, | |
212 | + $altura + $altura_escrita, 72, 30, $fonte, $tam_texto, $corTexto, 'center'); | |
217 | 213 | |
218 | - $this->pdf->escreve_relativo($nm_serie, $esquerda + 365 - 9, $altura + $altura_escrita, 72, 30, $fonte, $tam_texto, $corTexto, 'center'); | |
219 | 214 | $this->pdf->linha_relativa($esquerda + 410+19, $altura, 0, 18); |
215 | + $this->pdf->escreve_relativo($nm_turma, $esquerda + 408 + 10 + 13, | |
216 | + $altura + $altura_escrita, 35, 30, $fonte, $tam_texto, $corTexto, 'center'); | |
220 | 217 | |
221 | - $this->pdf->escreve_relativo($nm_turma, $esquerda + 408 + 10+13, $altura + $altura_escrita, 35, 30, $fonte, $tam_texto, $corTexto, 'center'); | |
222 | 218 | $this->pdf->linha_relativa($esquerda + 449 + 34, $altura, 0, 18); |
223 | 219 | |
224 | - $estabelecimento_destino = null; | |
225 | - if (is_numeric($ref_cod_matricula_entrada)) | |
220 | + $estabelecimento_destino = NULL; | |
221 | + if (is_numeric($ref_cod_matricula_entrada)) { | |
226 | 222 | $estabelecimento_destino = $this->getNomeEscola($ref_cod_matricula_entrada); |
227 | - else | |
228 | - $this->pdf->escreve_relativo("Escola Externa ao Sistema", $esquerda + 452 + 34, $altura + $altura_escrita, 300, 30, $fonte, $tam_texto); | |
229 | - if (!empty($estabelecimento_destino)) | |
230 | - $this->pdf->escreve_relativo($estabelecimento_destino, $esquerda + 452 + 34, $altura + $altura_escrita, 300, 30, $fonte, $tam_texto); | |
223 | + } | |
224 | + else { | |
225 | + $this->pdf->escreve_relativo('Escola Externa ao Sistema', $esquerda + 452 + 34, | |
226 | + $altura + $altura_escrita, 300, 30, $fonte, $tam_texto); | |
227 | + } | |
228 | + | |
229 | + if (!empty($estabelecimento_destino)) { | |
230 | + $this->pdf->escreve_relativo($estabelecimento_destino, $esquerda + 452 + 34, | |
231 | + $altura + $altura_escrita, 300, 30, $fonte, $tam_texto); | |
232 | + } | |
231 | 233 | |
232 | 234 | $this->pdf->linha_relativa($esquerda + 757, $altura, 0, 18); |
233 | 235 | |
234 | - $this->pdf->escreve_relativo(empty($estabelecimento_destino) ? "" : "SC", $esquerda + 763, $altura + $altura_escrita, 50, 30, $fonte, $tam_texto); | |
236 | + $this->pdf->escreve_relativo(empty($estabelecimento_destino) ? '' : 'SC', | |
237 | + $esquerda + 763, $altura + $altura_escrita, 50, 30, $fonte, $tam_texto); | |
238 | + | |
235 | 239 | $this->pdf->linha_relativa($esquerda + 782, $altura, 0, 18); |
236 | 240 | $this->pdf->linha_relativa($esquerda, $altura, $direita, 0); |
237 | 241 | $this->pdf->linha_relativa($esquerda, $altura + 18, $direita, 0); |
238 | - if ($altura > $this->pdf->altura - 50) | |
239 | - { | |
242 | + | |
243 | + if ($altura > $this->pdf->altura - 50) { | |
240 | 244 | $this->pdf->ClosePage(); |
241 | 245 | $this->pdf->OpenPage(); |
242 | 246 | $this->addCabecalho(); |
243 | - $esquerda = 30; | |
244 | - $altura = 130 + 18*2; | |
245 | - $direita = 782; | |
247 | + $esquerda = 30; | |
248 | + $altura = 130 + 18 * 2; | |
249 | + $direita = 782; | |
246 | 250 | $tam_texto = 8; |
247 | - $altura = 130; | |
251 | + $altura = 130; | |
248 | 252 | |
249 | 253 | $altura_escrita = 5; |
250 | 254 | } |
251 | 255 | } |
252 | 256 | |
253 | - if ($altura > $this->pdf->altura - 50) | |
254 | - { | |
257 | + if ($altura > $this->pdf->altura - 50) { | |
255 | 258 | $this->pdf->ClosePage(); |
256 | 259 | $this->pdf->OpenPage(); |
257 | 260 | $this->addCabecalho(); |
258 | - $esquerda = 30; | |
259 | - $altura = 130 + 18*2; | |
260 | - $direita = 782; | |
261 | + $esquerda = 30; | |
262 | + $altura = 130 + 18 * 2; | |
263 | + $direita = 782; | |
261 | 264 | $tam_texto = 8; |
262 | - $altura = 130; | |
265 | + $altura = 130; | |
263 | 266 | |
264 | 267 | $altura_escrita = 5; |
265 | 268 | } |
... | ... | @@ -267,33 +270,40 @@ class indice extends clsCadastro |
267 | 270 | $this->pdf->CloseFile(); |
268 | 271 | $this->get_link = $this->pdf->GetLink(); |
269 | 272 | |
270 | - | |
271 | 273 | echo "<script>window.onload=function(){parent.EscondeDiv('LoadImprimir');window.location='download.php?filename=".$this->get_link."'}</script>"; |
272 | 274 | |
273 | - echo "<html><center>Se o download não iniciar automaticamente <br /><a target='_blank' href='" . $this->get_link . "' style='font-size: 16px; color: #000000; text-decoration: underline;'>clique aqui!</a><br><br> | |
274 | - <span style='font-size: 10px;'>Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br> | |
275 | - | |
276 | - Clique na Imagem para Baixar o instalador<br><br> | |
277 | - <a href=\"http://www.adobe.com.br/products/acrobat/readstep2.html\" target=\"new\"><br><img src=\"imagens/acrobat.gif\" width=\"88\" height=\"31\" border=\"0\"></a> | |
278 | - </span> | |
279 | - </center>"; | |
275 | + echo " | |
276 | + <html> | |
277 | + <center> | |
278 | + Se o download não iniciar automaticamente <br /> | |
279 | + <a target='_blank' href='" . $this->get_link . "' style='font-size: 16px; color: #000000; text-decoration: underline;'>clique aqui!</a><br><br> | |
280 | + <span style='font-size: 10px;'> | |
281 | + Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br> | |
282 | + Clique na Imagem para Baixar o instalador<br><br> | |
283 | + <a href=\"http://www.adobe.com.br/products/acrobat/readstep2.html\" target=\"new\"><br> | |
284 | + <img src=\"imagens/acrobat.gif\" width=\"88\" height=\"31\" border=\"0\"> | |
285 | + </a> | |
286 | + </span> | |
287 | + </center>"; | |
280 | 288 | } |
281 | - else | |
282 | - { | |
283 | - echo '<script> | |
284 | - alert("A escola nesse ano não possui nenhuma expedição de transferência"); | |
285 | - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1)); | |
286 | - </script>'; | |
287 | - return true; | |
289 | + else { | |
290 | + echo ' | |
291 | + <script type="text/javscript"> | |
292 | + alert("A escola nesse ano não possui nenhuma expedição de transferência"); | |
293 | + window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length - 1)); | |
294 | + </script>'; | |
295 | + | |
296 | + return TRUE; | |
288 | 297 | } |
289 | 298 | } |
290 | - else | |
291 | - { | |
292 | - echo '<script> | |
293 | - alert("A escola nesse ano não possui nenhuma expedição de transferência"); | |
294 | - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1)); | |
295 | - </script>'; | |
296 | - return true; | |
299 | + else { | |
300 | + echo ' | |
301 | + <script type="text/javscript"> | |
302 | + alert("A escola nesse ano não possui nenhuma expedição de transferência"); | |
303 | + window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1)); | |
304 | + </script>'; | |
305 | + | |
306 | + return TRUE; | |
297 | 307 | } |
298 | 308 | } |
299 | 309 | |
... | ... | @@ -381,52 +391,62 @@ class indice extends clsCadastro |
381 | 391 | |
382 | 392 | function getNomeEscola($ref_cod_matricula_entrada) { |
383 | 393 | $nome_escola = null; |
384 | - if (is_numeric($ref_cod_matricula_entrada)) | |
385 | - { | |
386 | - $sql = " SELECT | |
387 | - fantasia as nome | |
388 | - FROM | |
389 | - pmieducar.escola | |
390 | - , cadastro.juridica | |
391 | - WHERE | |
392 | - ref_cod_instituicao = {$this->ref_cod_instituicao} | |
393 | - AND idpes = ref_idpes | |
394 | - AND cod_escola = (SELECT ref_ref_cod_escola FROM pmieducar.matricula WHERE cod_matricula = {$ref_cod_matricula_entrada}) | |
395 | - AND ativo = 1 | |
396 | - UNION | |
397 | - SELECT | |
398 | - nm_escola | |
399 | - FROM | |
400 | - pmieducar.escola | |
401 | - , pmieducar.escola_complemento | |
402 | - WHERE | |
403 | - ref_cod_instituicao = {$this->ref_cod_instituicao} | |
404 | - AND cod_escola = ref_cod_escola | |
405 | - AND cod_escola = (SELECT ref_ref_cod_escola FROM pmieducar.matricula WHERE cod_matricula = {$ref_cod_matricula_entrada}) | |
406 | - AND escola.ativo = 1;"; | |
394 | + | |
395 | + if (is_numeric($ref_cod_matricula_entrada)) { | |
396 | + $sql = " | |
397 | + SELECT | |
398 | + fantasia as nome | |
399 | + FROM | |
400 | + pmieducar.escola, | |
401 | + cadastro.juridica | |
402 | + WHERE | |
403 | + ref_cod_instituicao = {$this->ref_cod_instituicao} | |
404 | + AND idpes = ref_idpes | |
405 | + AND cod_escola = (SELECT ref_ref_cod_escola FROM pmieducar.matricula WHERE cod_matricula = {$ref_cod_matricula_entrada}) | |
406 | + AND ativo = 1 | |
407 | + UNION | |
408 | + SELECT | |
409 | + nm_escola | |
410 | + FROM | |
411 | + pmieducar.escola, | |
412 | + pmieducar.escola_complemento | |
413 | + WHERE | |
414 | + ref_cod_instituicao = {$this->ref_cod_instituicao} | |
415 | + AND cod_escola = ref_cod_escola | |
416 | + AND cod_escola = | |
417 | + (SELECT | |
418 | + ref_ref_cod_escola | |
419 | + FROM | |
420 | + pmieducar.matricula | |
421 | + WHERE | |
422 | + cod_matricula = {$ref_cod_matricula_entrada}) | |
423 | + AND escola.ativo = 1;"; | |
424 | + | |
407 | 425 | $db = new clsBanco(); |
408 | 426 | $nome_escola = $db->CampoUnico($sql); |
409 | 427 | } |
428 | + | |
410 | 429 | return $nome_escola; |
411 | 430 | } |
412 | 431 | |
413 | - function Editar() | |
414 | - { | |
415 | - return false; | |
432 | + function Editar() { | |
433 | + return FALSE; | |
416 | 434 | } |
417 | 435 | |
418 | - function Excluir() | |
419 | - { | |
420 | - return false; | |
436 | + function Excluir() { | |
437 | + return FALSE; | |
421 | 438 | } |
422 | 439 | |
423 | 440 | } |
424 | 441 | |
425 | -// cria uma extensao da classe base | |
442 | +// Instancia objeto de página | |
426 | 443 | $pagina = new clsIndexBase(); |
427 | -// cria o conteudo | |
444 | + | |
445 | +// Instancia objeto de conteúdo | |
428 | 446 | $miolo = new indice(); |
429 | -// adiciona o conteudo na clsBase | |
430 | -$pagina->addForm( $miolo ); | |
431 | -// gera o html | |
447 | + | |
448 | +// Atribui o conteúdo à página | |
449 | +$pagina->addForm($miolo); | |
450 | + | |
451 | +// Gera o código HTML | |
432 | 452 | $pagina->MakeAll(); |
433 | 453 | \ No newline at end of file | ... | ... |