Commit b2fa1ffb1b1bc516b4266141fda5d6e474a541cd
Committed by
GitHub
Exists in
2.9
and in
7 other branches
Merge pull request #6346 from portabilis/remove-paginas-antigas
Remove páginas antigas de alunos
Showing
4 changed files
with
0 additions
and
2627 deletions
Show diff stats
ieducar/intranet/educar_aluno_cad.php
... | ... | @@ -1,2181 +0,0 @@ |
1 | -<?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 | - * @category i-Educar | |
25 | - * @license @@license@@ | |
26 | - * @package iEd_Include | |
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/clsCadastro.inc.php'; | |
33 | -require_once 'include/clsBanco.inc.php'; | |
34 | -require_once 'include/pmieducar/geral.inc.php'; | |
35 | - | |
36 | -require_once 'App/Model/SimNao.php'; | |
37 | -require_once 'App/Model/ZonaLocalizacao.php'; | |
38 | -require_once 'Educacenso/Model/AlunoDataMapper.php'; | |
39 | -require_once 'Transporte/Model/AlunoDataMapper.php'; | |
40 | -require_once 'Transporte/Model/Responsavel.php'; | |
41 | - | |
42 | -/** | |
43 | - * clsIndexBase class. | |
44 | - * | |
45 | - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
46 | - * @category i-Educar | |
47 | - * @license @@license@@ | |
48 | - * @package iEd_Pmieducar | |
49 | - * @since Classe disponível desde a versão 1.0.0 | |
50 | - * @version @@package_version@@ | |
51 | - */ | |
52 | -class clsIndexBase extends clsBase | |
53 | -{ | |
54 | - function Formular() | |
55 | - { | |
56 | - $this->SetTitulo($this->_instituicao . ' i-Educar - Aluno'); | |
57 | - $this->processoAp = 578; | |
58 | - } | |
59 | -} | |
60 | - | |
61 | -/** | |
62 | - * indice class. | |
63 | - * | |
64 | - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
65 | - * @category i-Educar | |
66 | - * @license @@license@@ | |
67 | - * @package iEd_Pmieducar | |
68 | - * @since Classe disponível desde a versão 1.0.0 | |
69 | - * @version @@package_version@@ | |
70 | - */ | |
71 | -class indice extends clsCadastro | |
72 | -{ | |
73 | - var $pessoa_logada; | |
74 | - | |
75 | - var $cod_aluno; | |
76 | - var $ref_idpes_responsavel; | |
77 | - var $idpes_pai; | |
78 | - var $idpes_mae; | |
79 | - var $ref_cod_aluno_beneficio; | |
80 | - var $ref_cod_religiao; | |
81 | - var $ref_idpes; | |
82 | - var $nm_mae; | |
83 | - var $cpf_mae; | |
84 | - var $nm_pai; | |
85 | - var $cpf_pai; | |
86 | - | |
87 | - var $ref_cod_raca; | |
88 | - | |
89 | - var $foto_excluida = 0; | |
90 | - var $analfabeto; | |
91 | - var $foto_antiga; | |
92 | - | |
93 | - | |
94 | - var $passo; | |
95 | - var $nome; | |
96 | - | |
97 | - var $caminho_foto; | |
98 | - | |
99 | - var $email; | |
100 | - var $ddd_fone_1; | |
101 | - var $fone_1; | |
102 | - var $ddd_fone_2; | |
103 | - var $fone_2; | |
104 | - var $ddd_mov; | |
105 | - var $fone_mov; | |
106 | - var $ddd_fax; | |
107 | - var $fone_fax; | |
108 | - | |
109 | - //fisica | |
110 | - var $data_nascimento; | |
111 | - var $sexo; | |
112 | - var $cpf; | |
113 | - | |
114 | - //juridica | |
115 | - var $cnpj; | |
116 | - var $nm_fantasia; | |
117 | - var $insc_estadual; | |
118 | - var $nome_contato; | |
119 | - | |
120 | - var $foto; | |
121 | - var $tipo_responsavel; | |
122 | - | |
123 | - var $id_bairro; | |
124 | - var $id_logradouro; | |
125 | - | |
126 | - var $idtlog; | |
127 | - | |
128 | - var $numero; | |
129 | - var $letra; | |
130 | - var $complemento; | |
131 | - var $andar; | |
132 | - var $apartamento; | |
133 | - var $bloco; | |
134 | - var $deficiencia; | |
135 | - var $deficiencia_exc; | |
136 | - | |
137 | - //endereco_externo | |
138 | - var $ref_sigla_uf; | |
139 | - var $ref_sigla_uf_; | |
140 | - var $ref_idtlog; | |
141 | - var $id_cidade; | |
142 | - var $id_cep; | |
143 | - var $ref_idtlog_; | |
144 | - var $id_log; | |
145 | - | |
146 | - var $pais_origem; | |
147 | - | |
148 | - var $cep_; | |
149 | - var $nm_bairro; | |
150 | - var $nm_logradouro; | |
151 | - | |
152 | - | |
153 | - var $ref_cod_pessoa_deficiencia; | |
154 | - | |
155 | - var $isEnderecoExterno = 0; | |
156 | - | |
157 | - var $endereco_original_is_externo; | |
158 | - | |
159 | - var $cpf_; | |
160 | - var $ideciv; | |
161 | - | |
162 | - var $inc; | |
163 | - var $exc; | |
164 | - var $back; | |
165 | - | |
166 | - var $url; | |
167 | - | |
168 | - var $nacionalidade; | |
169 | - var $idmun_nascimento; | |
170 | - | |
171 | - var $rg, | |
172 | - $data_exp_rg, | |
173 | - $sigla_uf_exp_rg, | |
174 | - $tipo_cert_civil, | |
175 | - $num_termo, | |
176 | - $num_livro, | |
177 | - $num_folha, | |
178 | - $data_emissao_cert_civil, | |
179 | - $sigla_uf_cert_civil, | |
180 | - $cartorio_cert_civil, | |
181 | - $num_cart_trabalho, | |
182 | - $serie_cart_trabalho, | |
183 | - $data_emissao_cart_trabalho, | |
184 | - $sigla_uf_cart_trabalho, | |
185 | - $num_tit_eleitor, | |
186 | - $zona_tit_eleitor, | |
187 | - $secao_tit_eleitor, | |
188 | - $idorg_exp_rg; | |
189 | - | |
190 | - var $sem_cpf; | |
191 | - | |
192 | - var $ref_cod_sistema; | |
193 | - | |
194 | - var $retorno; | |
195 | - var $tab_habilitado; | |
196 | - | |
197 | - function Inicializar() | |
198 | - { | |
199 | - $this->tab_habilitado = TRUE; | |
200 | - | |
201 | - $this->cod_aluno= $_GET['cod_aluno']; | |
202 | - | |
203 | - $this->retorno = 'Novo'; | |
204 | - | |
205 | - $obj_permissoes = new clsPermissoes(); | |
206 | - $obj_permissoes->permissao_cadastra(578, $this->pessoa_logada, 7, 'educar_aluno_lst.php'); | |
207 | - | |
208 | - if (is_numeric($this->cod_aluno)) { | |
209 | - $ref_cod_aluno = $this->cod_aluno; | |
210 | - $obj = new clsPmieducarAluno($this->cod_aluno); | |
211 | - $registro = $obj->detalhe(); | |
212 | - | |
213 | - if ($registro) { | |
214 | - foreach ($registro as $campo => $val) { | |
215 | - // passa todos os valores obtidos no registro para atributos do objeto | |
216 | - $this->$campo = $val; | |
217 | - } | |
218 | - | |
219 | - $obj_matricula = new clsPmieducarMatricula(); | |
220 | - $lst_matricula = $obj_matricula->lista(NULL, NULL, NULL, NULL, NULL, NULL, $this->cod_aluno); | |
221 | - if ($lst_matricula) { | |
222 | - //** verificao de permissao para exclusao | |
223 | - $this->fexcluir = $obj_permissoes->permissao_excluir(578, $this->pessoa_logada, 7); | |
224 | - } | |
225 | - | |
226 | - $this->retorno = 'Editar'; | |
227 | - $this->tab_habilitado = FALSE; | |
228 | - } | |
229 | - } | |
230 | - | |
231 | - $this->url_cancelar = $this->cod_aluno ? 'educar_aluno_det.php?cod_aluno=' . $this->cod_aluno : 'educar_aluno_lst.php'; | |
232 | - $this->nome_url_cancelar = 'Cancelar'; | |
233 | - | |
234 | - return $this->retorno; | |
235 | - } | |
236 | - | |
237 | - function Gerar() | |
238 | - { | |
239 | - $this->fexcluir = FALSE; | |
240 | - $this->campoTabInicio('educar_cad', true); | |
241 | - $this->campoOculto('retorno', $this->retorno); | |
242 | - $this->campoOculto('bloqueado', 1); | |
243 | - | |
244 | - if (is_int((int)$this->cpf) && !empty($this->cpf)) { | |
245 | - $cpf = int2CPF($this->cpf); | |
246 | - } | |
247 | - else { | |
248 | - $cpf = $this->cpf; | |
249 | - } | |
250 | - | |
251 | - if (!$this->cod_aluno) { | |
252 | - $this->campoAdicionaTab('CPF', $this->tab_habilitado); | |
253 | - $opcoes = array('' => 'Pesquise a pessoa clicando na lupa ao lado'); | |
254 | - $this->campoCpf('cpf_', 'CPF', $cpf, FALSE, | |
255 | - '<img border="0" onclick="pesquisa_valores_popless(\'educar_pesquisa_aluno_lst2.php?campo1=ref_idpes&campo3=cpf&campo4=cpf_\', \'nome\')" src="imagens/lupa.png">'); | |
256 | - } | |
257 | - | |
258 | - $this->campoOculto('ref_idpes', $this->ref_idpes); | |
259 | - $this->campoAdicionaTab('Dados Pessoais', $this->tab_habilitado); | |
260 | - | |
261 | - if (!empty($this->ref_idpes)) { | |
262 | - $obj_aluno = new clsPmieducarAluno(); | |
263 | - $lista_aluno = $obj_aluno->lista(NULL, NULL, NULL, NULL, NULL, | |
264 | - $this->ref_idpes, NULL, NULL, NULL, NULL); | |
265 | - | |
266 | - if($lista_aluno) { | |
267 | - $det_aluno = array_shift($lista_aluno); | |
268 | - } | |
269 | - } | |
270 | - | |
271 | - if ($det_aluno['cod_aluno']) { | |
272 | - $this->cod_aluno = $det_aluno['cod_aluno']; | |
273 | - $this->ref_cod_aluno_beneficio = $det_aluno['ref_cod_aluno_beneficio']; | |
274 | - $this->ref_cod_religiao = $det_aluno['ref_cod_religiao']; | |
275 | - $this->caminho_foto = $det_aluno['caminho_foto']; | |
276 | - } | |
277 | - | |
278 | - $this->campoOculto('cod_aluno', $this->cod_aluno); | |
279 | - $this->campoOculto('ref_idpes', $this->ref_idpes); | |
280 | - | |
281 | - if ($this->ref_idpes != 'NULL') { | |
282 | - if ($this->ref_idpes) { | |
283 | - $obj_pessoa = new clsPessoaFj($this->ref_idpes); | |
284 | - $det_pessoa = $obj_pessoa->detalhe(); | |
285 | - | |
286 | - $obj_fisica = new clsFisica($this->ref_idpes); | |
287 | - $det_fisica = $obj_fisica->detalhe(); | |
288 | - | |
289 | - $obj_fisica_raca = new clsCadastroFisicaRaca($this->ref_idpes); | |
290 | - $det_fisica_raca = $obj_fisica_raca->detalhe(); | |
291 | - $this->ref_cod_raca = $det_fisica_raca['ref_cod_raca']; | |
292 | - | |
293 | - $this->nome = $det_pessoa['nome']; | |
294 | - | |
295 | - $this->email = $det_pessoa['email']; | |
296 | - | |
297 | - $this->ideciv = $det_fisica['ideciv']->ideciv; | |
298 | - | |
299 | - $this->data_nascimento = dataToBrasil($det_fisica['data_nasc']); | |
300 | - | |
301 | - $this->cpf = $det_fisica['cpf']; | |
302 | - | |
303 | - $obj_documento = new clsDocumento($this->ref_idpes); | |
304 | - $obj_documento_det = $obj_documento->detalhe(); | |
305 | - | |
306 | - $this->ddd_fone_1 = $det_pessoa['ddd_1']; | |
307 | - $this->fone_1 = $det_pessoa['fone_1']; | |
308 | - | |
309 | - $this->ddd_fone_2 = $det_pessoa['ddd_2']; | |
310 | - $this->fone_2 = $det_pessoa['fone_2']; | |
311 | - | |
312 | - $this->ddd_fax = $det_pessoa['ddd_fax']; | |
313 | - $this->fone_fax = $det_pessoa['fone_fax']; | |
314 | - | |
315 | - $this->ddd_mov = $det_pessoa['ddd_mov']; | |
316 | - $this->fone_mov = $det_pessoa['fone_mov']; | |
317 | - | |
318 | - $this->email = $det_pessoa['email']; | |
319 | - $this->url = $det_pessoa['url']; | |
320 | - | |
321 | - $this->sexo = $det_fisica['sexo']; | |
322 | - | |
323 | - $this->nacionalidade = $det_fisica['nacionalidade']; | |
324 | - $this->idmun_nascimento = $det_fisica['idmun_nascimento']->idmun; | |
325 | - | |
326 | - $detalhe_pais_origem = $det_fisica['idpais_estrangeiro']->detalhe(); | |
327 | - $this->pais_origem = $detalhe_pais_origem['idpais']; | |
328 | - | |
329 | - $this->ref_idpes_responsavel = $det_fisica['idpes_responsavel']; | |
330 | - | |
331 | - $this->idpes_pai = $det_fisica['idpes_pai']; | |
332 | - $this->idpes_mae = $det_fisica['idpes_mae']; | |
333 | - | |
334 | - $obj_aluno = new clsPmieducarAluno(NULL, NULL, NULL, NULL, NULL, $this->ref_idpes); | |
335 | - $detalhe_aluno = $obj_aluno->detalhe(); | |
336 | - | |
337 | - if ($detalhe_aluno) { | |
338 | - $this->nm_pai = $detalhe_aluno['nm_pai']; | |
339 | - $this->nm_mae = $detalhe_aluno['nm_mae']; | |
340 | - } | |
341 | - | |
342 | - $obj_endereco = new clsPessoaEndereco($this->ref_idpes); | |
343 | - | |
344 | - if ($obj_endereco_det = $obj_endereco->detalhe()) { | |
345 | - $this->isEnderecoExterno = 0; | |
346 | - | |
347 | - $this->id_cep = $obj_endereco_det['cep']->cep; | |
348 | - $this->id_bairro = $obj_endereco_det['idbai']->idbai; | |
349 | - $this->id_logradouro = $obj_endereco_det['idlog']->idlog; | |
350 | - $this->numero = $obj_endereco_det['numero']; | |
351 | - $this->letra = $obj_endereco_det['letra']; | |
352 | - $this->complemento = $obj_endereco_det['complemento']; | |
353 | - $this->andar = $obj_endereco_det['andar']; | |
354 | - $this->apartamento = $obj_endereco_det['apartamento']; | |
355 | - $this->bloco = $obj_endereco_det['bloco']; | |
356 | - | |
357 | - $this->ref_idtlog = $obj_endereco_det['idtlog']; | |
358 | - $this->nm_bairro = $obj_endereco_det['bairro']; | |
359 | - $this->nm_logradouro = $obj_endereco_det['logradouro']; | |
360 | - | |
361 | - $this->cep_ = int2CEP($this->id_cep); | |
362 | - } | |
363 | - else { | |
364 | - $obj_endereco = new clsEnderecoExterno($this->ref_idpes); | |
365 | - | |
366 | - if ($obj_endereco_det = $obj_endereco->detalhe()) { | |
367 | - $this->isEnderecoExterno = 1; | |
368 | - | |
369 | - $this->id_cep = $obj_endereco_det['cep']; | |
370 | - $this->cidade = $obj_endereco_det['cidade']; | |
371 | - $this->nm_bairro = $obj_endereco_det['bairro']; | |
372 | - $this->nm_logradouro = $obj_endereco_det['logradouro']; | |
373 | - | |
374 | - $this->id_bairro = NULL; | |
375 | - $this->id_logradouro = NULL; | |
376 | - $this->numero = $obj_endereco_det['numero']; | |
377 | - $this->letra = $obj_endereco_det['letra']; | |
378 | - $this->complemento = $obj_endereco_det['complemento']; | |
379 | - $this->andar = $obj_endereco_det['andar']; | |
380 | - $this->apartamento = $obj_endereco_det['apartamento']; | |
381 | - $this->bloco = $obj_endereco_det['bloco']; | |
382 | - | |
383 | - $this->ref_idtlog = $this->idtlog = $obj_endereco_det['idtlog']->idtlog; | |
384 | - $this->ref_sigla_uf = $this->ref_sigla_uf_ = $obj_endereco_det['sigla_uf']->sigla_uf; | |
385 | - $this->cep_ = int2CEP($this->id_cep); | |
386 | - } | |
387 | - } | |
388 | - | |
389 | - $this->zona_localizacao = $obj_endereco_det['zona_localizacao']; | |
390 | - } | |
391 | - } | |
392 | - | |
393 | - if ($this->isEnderecoExterno == 0) { | |
394 | - $obj_bairro = new clsBairro($this->id_bairro); | |
395 | - $this->cep_ = int2CEP($this->id_cep); | |
396 | - | |
397 | - $obj_bairro_det = $obj_bairro->detalhe(); | |
398 | - | |
399 | - if ($obj_bairro_det) { | |
400 | - $this->nm_bairro = $obj_bairro_det["nome"]; | |
401 | - } | |
402 | - | |
403 | - $obj_log = new clsLogradouro($this->id_logradouro); | |
404 | - $obj_log_det = $obj_log->detalhe(); | |
405 | - | |
406 | - if($obj_log_det) { | |
407 | - $this->nm_logradouro = $obj_log_det["nome"]; | |
408 | - $this->ref_idtlog = $obj_log_det["idtlog"]->idtlog; | |
409 | - | |
410 | - $obj_mun = new clsMunicipio( $obj_log_det["idmun"]); | |
411 | - $det_mun = $obj_mun->detalhe(); | |
412 | - | |
413 | - if ($det_mun) { | |
414 | - $this->cidade = ucfirst(strtolower($det_mun["nome"])); | |
415 | - } | |
416 | - | |
417 | - $this->ref_sigla_uf = $this->ref_sigla_uf_ = $det_mun['sigla_uf']->sigla_uf; | |
418 | - } | |
419 | - | |
420 | - $obj_bairro = new clsBairro($obj_endereco_det["ref_idbai"]); | |
421 | - $obj_bairro_det = $obj_bairro->detalhe(); | |
422 | - | |
423 | - if ($obj_bairro_det) { | |
424 | - $this->nm_bairro = $obj_bairro_det["nome"]; | |
425 | - } | |
426 | - } | |
427 | - | |
428 | - $this->campoTexto('nome', 'Nome', $this->nome, 30, 100, TRUE); | |
429 | - | |
430 | - if ($this->cpf && $this->ref_idpes) { | |
431 | - if (!$this->cpf) { | |
432 | - $this->campoRotulo('cpf_2', 'CPF', $this->cpf); | |
433 | - } | |
434 | - else { | |
435 | - $this->campoRotulo('cpf_2', 'CPF', int2CPF($this->cpf)); | |
436 | - } | |
437 | - } | |
438 | - else { | |
439 | - if(!$this->cpf) { | |
440 | - $this->campoCpf('cpf_2', 'CPF', $this->cpf); | |
441 | - $this->campoOculto('sem_cpf', 1); | |
442 | - } | |
443 | - else { | |
444 | - $this->campoCpf('cpf_2', 'CPF', int2CPF($this->cpf), FALSE); | |
445 | - } | |
446 | - } | |
447 | - | |
448 | - $this->campoData('data_nascimento', 'Data de Nascimento', $this->data_nascimento, TRUE); | |
449 | - | |
450 | - $lista = array( | |
451 | - '' => 'Selecione', | |
452 | - 'F' => 'Feminino', | |
453 | - 'M' => 'Masculino' | |
454 | - ); | |
455 | - | |
456 | - $this->campoLista('sexo', 'Sexo', $lista, $this->sexo); | |
457 | - | |
458 | - $obj_estado_civil = new clsEstadoCivil(); | |
459 | - $obj_estado_civil_lista = $obj_estado_civil->lista(); | |
460 | - | |
461 | - $lista_estado_civil = array('' => 'Selecione'); | |
462 | - | |
463 | - if ($obj_estado_civil_lista) { | |
464 | - foreach ($obj_estado_civil_lista as $estado_civil) { | |
465 | - $lista_estado_civil[$estado_civil['ideciv']] = $estado_civil['descricao']; | |
466 | - } | |
467 | - } | |
468 | - | |
469 | - $this->campoLista('ideciv', 'Estado Civil', $lista_estado_civil, $this->ideciv); | |
470 | - | |
471 | - $obj_religiao = new clsPmieducarReligiao(); | |
472 | - $obj_religia_lista = $obj_religiao->lista(NULL, NULL, NULL, NULL, NULL, | |
473 | - NULL, NULL, NULL, 1); | |
474 | - | |
475 | - $lista_religiao = array('NULL' => 'Selecione'); | |
476 | - if($obj_religia_lista) { | |
477 | - foreach ($obj_religia_lista as $religiao) { | |
478 | - $lista_religiao[$religiao["cod_religiao"]] = $religiao["nm_religiao"]; | |
479 | - } | |
480 | - } | |
481 | - | |
482 | - $this->campoLista('ref_cod_religiao', 'Religião', $lista_religiao, | |
483 | - $this->ref_cod_religiao, '', FALSE, '', '', '', FALSE); | |
484 | - | |
485 | - $opcoes_raca = array('' => 'Selecione'); | |
486 | - $obj_raca = new clsCadastroRaca(); | |
487 | - $lst_raca = $obj_raca->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, TRUE); | |
488 | - | |
489 | - if ($lst_raca) { | |
490 | - foreach ($lst_raca as $raca) { | |
491 | - $opcoes_raca[$raca['cod_raca']] = $raca['nm_raca']; | |
492 | - } | |
493 | - } | |
494 | - | |
495 | - $this->campoLista('ref_cod_raca', 'Raça', $opcoes_raca, | |
496 | - $this->ref_cod_raca, '', FALSE, '', '', '', FALSE); | |
497 | - | |
498 | - $this->campoQuebra2('#224488'); | |
499 | - | |
500 | - if ($this->idpes_pai) { | |
501 | - $obj_pessoa_pai = new clsPessoaFj($this->idpes_pai); | |
502 | - $det_pessoa_pai = $obj_pessoa_pai->detalhe(); | |
503 | - | |
504 | - if($det_pessoa_pai) { | |
505 | - $this->nm_pai = $det_pessoa_pai['nome']; | |
506 | - | |
507 | - // cpf | |
508 | - $obj_cpf = new clsFisica($this->idpes_pai); | |
509 | - $det_cpf = $obj_cpf->detalhe(); | |
510 | - | |
511 | - if ($det_cpf['cpf']) { | |
512 | - $this->cpf_pai = int2CPF($det_cpf['cpf']); | |
513 | - } | |
514 | - } | |
515 | - } | |
516 | - | |
517 | - if($this->idpes_mae) { | |
518 | - $obj_pessoa_mae = new clsPessoaFj($this->idpes_mae); | |
519 | - $det_pessoa_mae = $obj_pessoa_mae->detalhe(); | |
520 | - | |
521 | - if ($det_pessoa_mae) { | |
522 | - $this->nm_mae = $det_pessoa_mae['nome']; | |
523 | - | |
524 | - //cpf | |
525 | - $obj_cpf = new clsFisica($this->idpes_mae); | |
526 | - $det_cpf = $obj_cpf->detalhe(); | |
527 | - | |
528 | - if ($det_cpf['cpf']) { | |
529 | - $this->cpf_mae = int2CPF($det_cpf['cpf']); | |
530 | - } | |
531 | - } | |
532 | - } | |
533 | - | |
534 | - $this->campoTexto('nm_pai', 'Nome do Pai', $this->nm_pai, 30, 255, FALSE); | |
535 | - | |
536 | - $this->campoCpf('cpf_pai', 'CPF pai',$this->cpf_pai, FALSE, | |
537 | - $this->cpf_pai ? '': ' (preencher sempre que possível)'); | |
538 | - | |
539 | - $this->campoTexto('nm_mae', 'Nome da Mãe',$this->nm_mae, 30, 255, FALSE); | |
540 | - $this->campoCpf('cpf_mae', 'CPF mãe', $this->cpf_mae, FALSE, | |
541 | - $this->cpf_mae ? '': ' (preencher sempre que possível)'); | |
542 | - | |
543 | - $lista = array('' => 'Responsável'); | |
544 | - | |
545 | - if ($this->ref_idpes_responsavel != 'NULL') { | |
546 | - $obj_pessoa_resp = new clsPessoaFj($this->ref_idpes_responsavel); | |
547 | - $det_pessoa_resp = $obj_pessoa_resp->detalhe(); | |
548 | - | |
549 | - if ($det_pessoa_resp) { | |
550 | - $lista[$det_pessoa_resp['idpes']] = $det_pessoa_resp['nome']; | |
551 | - } | |
552 | - } | |
553 | - | |
554 | - $parametros = new clsParametrosPesquisas(); | |
555 | - $parametros->setSubmit(0); | |
556 | - $parametros->adicionaCampoSelect('ref_idpes_responsavel', 'idpes', 'nome'); | |
557 | - $parametros->setPessoa('F'); | |
558 | - $parametros->setPessoaNovo('S'); | |
559 | - $parametros->setPessoaCPF('N'); | |
560 | - $parametros->setPessoaTela('frame'); | |
561 | - $parametros->setCodSistema(1); | |
562 | - $this->campoListaPesq('ref_idpes_responsavel', 'Responsavel', $lista, | |
563 | - $this->ref_idpes_responsavel, 'pesquisa_pessoa_lst.php', '', FALSE, '', '', | |
564 | - NULL, NULL, '', FALSE, $parametros->serializaCampos(), FALSE); | |
565 | - | |
566 | - $this->campoQuebra2('#224488'); | |
567 | - | |
568 | - if ($this->tipo_responsavel) { | |
569 | - if ($this->nm_pai) | |
570 | - $this->tipo_responsavel = 'p'; | |
571 | - elseif ($this->nm_mae) | |
572 | - $this->tipo_responsavel = 'm'; | |
573 | - elseif ($this->ref_idpes_responsavel) | |
574 | - $this->tipo_responsavel = 'r'; | |
575 | - } | |
576 | - | |
577 | - $opcoes = array( | |
578 | - 'p' => 'Pai', | |
579 | - 'm' => 'Mãe', | |
580 | - 'r' => 'Responsável' | |
581 | - ); | |
582 | - $this->campoRadio('tipo_responsavel', 'Responsável', $opcoes, $this->tipo_responsavel); | |
583 | - | |
584 | - $this->campoQuebra2('#224488'); | |
585 | - | |
586 | - $disabled = $this->isEnderecoExterno ? FALSE : TRUE; | |
587 | - | |
588 | - $this->campoOculto('isEnderecoExterno', $this->isEnderecoExterno); | |
589 | - | |
590 | - $urlPesquisaCep = 'educar_pesquisa_cep_log_bairro.php?' . | |
591 | - 'campo1=nm_bairro&campo2=id_bairro&campo3=id_cep&campo4=nm_logradouro&' . | |
592 | - 'campo5=id_logradouro&campo6=ref_sigla_uf&campo7=cidade&' . | |
593 | - 'campo8=ref_idtlog_&campo9=isEnderecoExterno&campo10=cep_&' . | |
594 | - 'campo11=ref_sigla_uf_&campo12=ref_idtlog&campo13=id_cidade&' . | |
595 | - 'campo14=zona_localizacao'; | |
596 | - | |
597 | - $urlPesquisaCep = sprintf( | |
598 | - "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\'miolo\' id=\'miolo\' frameborder=\'0\' height=\'100%%\' width=\'500\' marginheight=\'0\' marginwidth=\'0\' src=\'%s\'></iframe>');\">", | |
599 | - $urlPesquisaCep | |
600 | - ); | |
601 | - | |
602 | - $this->campoCep('cep_', 'CEP', $this->cep_, TRUE, '-', $urlPesquisaCep, $disabled); | |
603 | - | |
604 | - $this->campoTexto('cidade', 'Cidade', $this->cidade, 30, 255, TRUE, FALSE, | |
605 | - TRUE, '', '', '', '', $disabled); | |
606 | - | |
607 | - $obj_uf = new clsUf(FALSE, FALSE, 1); | |
608 | - $lst_uf = $obj_uf->lista(FALSE, FALSE, FALSE, FALSE, FALSE, 'sigla_uf'); | |
609 | - $array_uf = array('' => 'Selecione um estado'); | |
610 | - | |
611 | - foreach ($lst_uf as $uf) { | |
612 | - $array_uf[$uf['sigla_uf']] = $uf['nome']; | |
613 | - } | |
614 | - | |
615 | - $this->campoLista('ref_sigla_uf_', ' Estado', $array_uf, | |
616 | - $this->ref_sigla_uf, '', FALSE, '','', $disabled); | |
617 | - | |
618 | - $this->campoTexto('nm_bairro', 'Bairro', $this->nm_bairro, 30, 255, TRUE, | |
619 | - FALSE, FALSE, '', '', '', '', $disabled); | |
620 | - | |
621 | - $tipo_logradouro_array = array('' => 'Tipo de Logradouro'); | |
622 | - | |
623 | - $obj_tipo_logradouro = new clsTipoLogradouro(); | |
624 | - $obj_tipo_logradouro_lista = $obj_tipo_logradouro->lista(); | |
625 | - | |
626 | - if ($obj_tipo_logradouro_lista) { | |
627 | - foreach ($obj_tipo_logradouro_lista as $key => $tipo_log) { | |
628 | - $tipo_logradouro_array[$tipo_log["idtlog"]] = $tipo_log["descricao"]; | |
629 | - } | |
630 | - } | |
631 | - | |
632 | - $this->campoLista('ref_idtlog', 'Logradouro', $tipo_logradouro_array, | |
633 | - $this->ref_idtlog, '', TRUE, '', '', $this->isEnderecoExterno ? FALSE : TRUE, TRUE); | |
634 | - | |
635 | - $this->campoTexto('nm_logradouro', 'Logradouro', $this->nm_logradouro, 30, 255, | |
636 | - TRUE, FALSE, FALSE, '', '', '', '', $disabled); | |
637 | - | |
638 | - $zl = App_Model_ZonaLocalizacao::getInstance(); | |
639 | - $this->campoLista('zona_localizacao', 'Zona Localização', $zl->getEnums(), | |
640 | - $this->zona_localizacao, FALSE, FALSE, FALSE, FALSE, $disabled); | |
641 | - | |
642 | - $this->campoNumero('numero', 'Número', $this->numero, 4, 6, FALSE, '', | |
643 | - '', FALSE, FALSE, TRUE); | |
644 | - $this->campoTexto('letra', ' Letra', $this->letra, 4, 1, FALSE); | |
645 | - $this->campoTexto('complemento', 'Complemento', $this->complemento, 30, 50, FALSE); | |
646 | - $this->campoTexto('bloco', 'Bloco', $this->bloco, 30, 50, FALSE); | |
647 | - $this->campoNumero('andar', 'Andar', $this->andar, 4, 2, FALSE, '', '', | |
648 | - FALSE, FALSE, TRUE); | |
649 | - $this->campoNumero('apartamento', ' Apartamento', $this->apartamento, | |
650 | - 4, 6, FALSE); | |
651 | - | |
652 | - $this->campoLista('nacionalidade', 'Nacionalidade', $lista_nacionalidade, | |
653 | - $this->nacionalidade, 'tmpObj = document.getElementById("pais_origem"); if(this.value != 1) { tmpObj.disabled = false; } else { tmpObj.selectedIndex = 27; tmpObj.disabled = true; }', | |
654 | - TRUE, '', '', '', FALSE); | |
655 | - | |
656 | - | |
657 | - $lista_mun_nasc = array('NULL' => 'Selecione a cidade'); | |
658 | - | |
659 | - $obj_mun_nasc = new clsMunicipio($this->idmun_nascimento); | |
660 | - $det_mun_nasc = $obj_mun_nasc->detalhe(); | |
661 | - | |
662 | - if ($det_mun_nasc["nome"]) { | |
663 | - $lista_mun_nasc[$det_mun_nasc["idmun"]] = $det_mun_nasc["nome"]; | |
664 | - } | |
665 | - | |
666 | - $this->campoListaPesq('idmun_nascimento', 'Naturalidade', $lista_mun_nasc, | |
667 | - $this->idmun_nascimento, 'educar_pesquisa_municipio_lst.php?campo1=idmun_nascimento', '', FALSE, '', '', NULL, NULL, '', TRUE); | |
668 | - | |
669 | - $this->nacionalidade = $this->nacionalidade ? $this->nacionalidade : 1; | |
670 | - | |
671 | - $lista_nacionalidade = array( | |
672 | - 'NULL' => 'Selecione', | |
673 | - '1' => 'Brasileiro', | |
674 | - '2' => 'Naturalizado Brasileiro', | |
675 | - '3' => 'Estrangeiro' | |
676 | - ); | |
677 | - | |
678 | - $this->campoLista('nacionalidade', 'Nacionalidade', $lista_nacionalidade, | |
679 | - $this->nacionalidade, 'tmpObj = document.getElementById("pais_origem"); if(this.value != 1) { tmpObj.disabled = false; } else { tmpObj.selectedIndex = 27; tmpObj.disabled = true; }', | |
680 | - TRUE, '', '', '', FALSE); | |
681 | - | |
682 | - $lista_pais_origem = array('NULL' => 'País de origem'); | |
683 | - $obj_pais = new clsPais(); | |
684 | - $obj_pais_lista = $obj_pais->lista(NULL, NULL, NULL, '', '', 'nome asc'); | |
685 | - | |
686 | - if ($obj_pais_lista) { | |
687 | - foreach ($obj_pais_lista as $key => $pais) { | |
688 | - $lista_pais_origem[$pais['idpais']] = $pais['nome']; | |
689 | - } | |
690 | - } | |
691 | - | |
692 | - // se a nacionalidade for "BRASILEIRO" seleciona o brasil e deixa inativo | |
693 | - $this->pais_origem = $this->nacionalidade == 1 ? 1 : $this->pais_origem; | |
694 | - | |
695 | - $this->campoLista('pais_origem', ' País de Origem', $lista_pais_origem, | |
696 | - $this->pais_origem, '', '', '', '', $this->nacionalidade == 1, FALSE); | |
697 | - | |
698 | - $this->campoQuebra2('#224488'); | |
699 | - | |
700 | - // Transporte escolar | |
701 | - $transporteMapper = new Transporte_Model_AlunoDataMapper(); | |
702 | - $transporte = NULL; | |
703 | - | |
704 | - try { | |
705 | - $transporte = $transporteMapper->find(array($this->cod_aluno)); | |
706 | - } | |
707 | - catch (Exception $e) { | |
708 | - } | |
709 | - | |
710 | - $bit = App_Model_SimNao::getInstance(); | |
711 | - $this->campoLista('transporte_aluno', 'Transporte', $bit->getEnums(), | |
712 | - !is_null($transporte) ? 1 : 0, 'transporteResponsavel();'); | |
713 | - | |
714 | - $responsavel = Transporte_Model_Responsavel::getInstance(); | |
715 | - $this->campoLista('transporte_responsavel', 'Responsável', $responsavel->getEnums(), | |
716 | - !is_null($transporte) ? $transporte->get('responsavel') : 0); | |
717 | - | |
718 | - $this->campoQuebra2('#224488'); | |
719 | - | |
720 | - $obj_beneficio = new clsPmieducarAlunoBeneficio(); | |
721 | - $obj_beneficio_lista = $obj_beneficio->lista(NULL, NULL, NULL, NULL, NULL, | |
722 | - NULL, NULL, NULL, NULL, 1); | |
723 | - | |
724 | - $lista_beneficio = array('NULL' => 'Selecione'); | |
725 | - | |
726 | - if ($obj_beneficio_lista) { | |
727 | - foreach ($obj_beneficio_lista as $beneficio) { | |
728 | - $lista_beneficio[$beneficio['cod_aluno_beneficio']] = $beneficio['nm_beneficio']; | |
729 | - } | |
730 | - } | |
731 | - | |
732 | - $this->campoLista('ref_cod_aluno_beneficio', 'Benefício', | |
733 | - $lista_beneficio, $this->ref_cod_aluno_beneficio, '', FALSE, '', '', FALSE, FALSE); | |
734 | - | |
735 | - $lista_analfabeto = array( | |
736 | - 1 => 'Não', | |
737 | - 0 => 'Sim' | |
738 | - ); | |
739 | - | |
740 | - $this->campoLista('analfabeto', 'Alfabetizado', $lista_analfabeto, | |
741 | - $this->analfabeto, '', FALSE, '', '', FALSE, FALSE); | |
742 | - | |
743 | - $this->campoNumero('ddd_fone_1', 'Telefone', $this->ddd_fone_1, 1, 3, FALSE, | |
744 | - '', '', FALSE, FALSE, TRUE); | |
745 | - | |
746 | - $this->campoNumero('fone_1', 'Telefone', $this->fone_1, 11, 11); | |
747 | - | |
748 | - $this->campoNumero('ddd_mov', 'Celular', $this->ddd_mov, 1, 3, FALSE, '', '', | |
749 | - FALSE, FALSE, TRUE); | |
750 | - | |
751 | - $this->campoNumero('fone_mov', 'Celular', $this->fone_mov, 11, 11); | |
752 | - | |
753 | - $this->campoEmail('email', 'Email', $this->email, 30, 255, FALSE); | |
754 | - | |
755 | - if (!empty($this->caminho_foto)) { | |
756 | - $this->campoRotulo('foto_antiga_', 'Arquivo', | |
757 | - sprintf(' | |
758 | - <img src="arquivos/educar/aluno/small/%s" border="0"> | |
759 | - <a href="javascript:void(0);" onclick="document.getElementById(\'foto_excluida\').value=1; setVisibility(\'tr_foto_antiga_\', false); setVisibility(\'tr_foto\', true);"><img src="imagens/nvp_bola_xis.gif" border="0"></a>', $this->caminho_foto)); | |
760 | - } | |
761 | - | |
762 | - $this->campoOculto('foto_excluida', 0); | |
763 | - $this->campoArquivo('foto', 'Foto', '', '20', '', FALSE); | |
764 | - | |
765 | - $this->campoOculto('id_bairro', $this->id_bairro); | |
766 | - $this->campoOculto('id_cep', $this->id_cep); | |
767 | - $this->campoOculto('id_logradouro', $this->id_logradouro); | |
768 | - $this->campoOculto('id_cidade', $this->id_cidade); | |
769 | - $this->campoOculto('ref_idtlog_', $this->ref_idtlog); | |
770 | - $this->campoOculto('ref_sigla_uf', $this->ref_sigla_uf); | |
771 | - | |
772 | - $this->campoTexto('nome', 'Nome', $this->nome, 30, 100, TRUE); | |
773 | - | |
774 | - if ($this->cpf && $this->ref_idpes) { | |
775 | - if (!$this->cpf) { | |
776 | - $this->campoRotulo('cpf_2','CPF',$this->cpf); | |
777 | - } | |
778 | - else { | |
779 | - $this->campoRotulo('cpf_2','CPF',int2CPF($this->cpf)); | |
780 | - } | |
781 | - } | |
782 | - else { | |
783 | - if (!$this->cpf) { | |
784 | - $this->campoOculto('sem_cpf',1); | |
785 | - } | |
786 | - } | |
787 | - | |
788 | - $this->campoData('data_nascimento', 'Data de Nascimento', $this->data_nascimento, TRUE); | |
789 | - | |
790 | - $lista = array( | |
791 | - '' => 'Selecione', | |
792 | - 'F' => 'Feminino', | |
793 | - 'M' => 'Masculino' | |
794 | - ); | |
795 | - $this->campoLista('sexo','Sexo', $lista, $this->sexo); | |
796 | - | |
797 | - $obj_estado_civil = new clsEstadoCivil(); | |
798 | - $obj_estado_civil_lista = $obj_estado_civil->lista(); | |
799 | - | |
800 | - $lista_estado_civil = array('' => 'Selecione'); | |
801 | - | |
802 | - if ($obj_estado_civil_lista) { | |
803 | - foreach ($obj_estado_civil_lista as $estado_civil) { | |
804 | - $lista_estado_civil[$estado_civil['ideciv']] = $estado_civil['descricao']; | |
805 | - } | |
806 | - } | |
807 | - | |
808 | - $this->campoLista('ideciv','Estado Civil',$lista_estado_civil,$this->ideciv); | |
809 | - | |
810 | - $obj_religiao = new clsPmieducarReligiao(); | |
811 | - $obj_religia_lista = $obj_religiao->lista(NULL, NULL, NULL, NULL, NULL, NULL, | |
812 | - NULL, NULL, 1); | |
813 | - | |
814 | - $lista_religiao = array('NULL' => 'Selecione'); | |
815 | - if ($obj_religia_lista) { | |
816 | - foreach ($obj_religia_lista as $religiao) { | |
817 | - $lista_religiao[$religiao['cod_religiao']] = $religiao['nm_religiao']; | |
818 | - } | |
819 | - } | |
820 | - | |
821 | - $this->campoLista('ref_cod_religiao', 'Religião', $lista_religiao, | |
822 | - $this->ref_cod_religiao, '', FALSE, '', '', '', FALSE); | |
823 | - | |
824 | - $opcoes_raca = array( '' => 'Selecione' ); | |
825 | - $obj_raca = new clsCadastroRaca(); | |
826 | - $lst_raca = $obj_raca->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, TRUE); | |
827 | - | |
828 | - if ($lst_raca) { | |
829 | - foreach ($lst_raca as $raca) { | |
830 | - $opcoes_raca[$raca['cod_raca']] = $raca['nm_raca']; | |
831 | - } | |
832 | - } | |
833 | - | |
834 | - $this->campoLista('ref_cod_raca', 'Raça', $opcoes_raca, | |
835 | - $this->ref_cod_raca, '', FALSE, '', '', '', FALSE); | |
836 | - | |
837 | - $this->campoQuebra2('#224488'); | |
838 | - | |
839 | - if ($this->idpes_pai) { | |
840 | - $obj_pessoa_pai = new clsPessoaFj($this->idpes_pai); | |
841 | - $det_pessoa_pai = $obj_pessoa_pai->detalhe(); | |
842 | - | |
843 | - if ($det_pessoa_pai) { | |
844 | - $this->nm_pai = $det_pessoa_pai['nome']; | |
845 | - | |
846 | - // cpf | |
847 | - $obj_cpf = new clsFisica($this->idpes_pai); | |
848 | - $det_cpf = $obj_cpf->detalhe(); | |
849 | - if ($det_cpf['cpf']) { | |
850 | - $this->cpf_pai = int2CPF( $det_cpf['cpf'] ); | |
851 | - } | |
852 | - } | |
853 | - } | |
854 | - | |
855 | - if ($this->idpes_mae) { | |
856 | - $obj_pessoa_mae = new clsPessoaFj($this->idpes_mae); | |
857 | - $det_pessoa_mae = $obj_pessoa_mae->detalhe(); | |
858 | - if ($det_pessoa_mae) { | |
859 | - $this->nm_mae = $det_pessoa_mae['nome']; | |
860 | - | |
861 | - // cpf | |
862 | - $obj_cpf = new clsFisica($this->idpes_mae); | |
863 | - $det_cpf = $obj_cpf->detalhe(); | |
864 | - | |
865 | - if ($det_cpf['cpf']) { | |
866 | - $this->cpf_mae = int2CPF($det_cpf['cpf']); | |
867 | - } | |
868 | - } | |
869 | - } | |
870 | - | |
871 | - $this->campoTexto('nm_pai', 'Nome do Pai', $this->nm_pai, 30, 255, FALSE); | |
872 | - $this->campoCpf('cpf_pai', 'CPF pai', $this->cpf_pai, FALSE, | |
873 | - $this->cpf_pai ? '': ' (preencher sempre que possível)'); | |
874 | - | |
875 | - $this->campoTexto('nm_mae', 'Nome da Mãe', $this->nm_mae, 30, 255, FALSE); | |
876 | - $this->campoCpf('cpf_mae', 'CPF mãe', $this->cpf_mae, FALSE, | |
877 | - $this->cpf_mae ? '': ' (preencher sempre que possível)'); | |
878 | - | |
879 | - $lista = array('' => 'Responsável'); | |
880 | - | |
881 | - if ($this->ref_idpes_responsavel != 'NULL') { | |
882 | - $obj_pessoa_resp = new clsPessoaFj($this->ref_idpes_responsavel); | |
883 | - $det_pessoa_resp = $obj_pessoa_resp->detalhe(); | |
884 | - if($det_pessoa_resp) { | |
885 | - $lista[$det_pessoa_resp['idpes']] = $det_pessoa_resp['nome']; | |
886 | - } | |
887 | - } | |
888 | - | |
889 | - $parametros = new clsParametrosPesquisas(); | |
890 | - $parametros->setSubmit(0); | |
891 | - $parametros->adicionaCampoSelect('ref_idpes_responsavel', 'idpes', 'nome'); | |
892 | - $parametros->setPessoa('F'); | |
893 | - $parametros->setPessoaNovo('S'); | |
894 | - $parametros->setPessoaCPF('N'); | |
895 | - $parametros->setPessoaTela('frame'); | |
896 | - $parametros->setCodSistema(1); | |
897 | - $this->campoListaPesq('ref_idpes_responsavel', 'Responsavel', $lista, | |
898 | - $this->ref_idpes_responsavel, 'pesquisa_pessoa_lst.php', '', FALSE, '', | |
899 | - '', NULL, NULL, '', FALSE, $parametros->serializaCampos(), FALSE); | |
900 | - | |
901 | - $this->campoQuebra2('#224488'); | |
902 | - if (!$this->tipo_responsavel) { | |
903 | - if($this->nm_pai) | |
904 | - $this->tipo_responsavel = 'p'; | |
905 | - elseif($this->nm_mae) | |
906 | - $this->tipo_responsavel = 'm'; | |
907 | - elseif($this->ref_idpes_responsavel) | |
908 | - $this->tipo_responsavel = 'r'; | |
909 | - } | |
910 | - | |
911 | - $opcoes = array( | |
912 | - '' => 'Sem Responsável', | |
913 | - 'p' => 'Pai', | |
914 | - 'm' => 'Mãe', | |
915 | - 'r' => 'Responsável' | |
916 | - ); | |
917 | - $this->campoRadio('tipo_responsavel', 'Responsável', $opcoes, $this->tipo_responsavel); | |
918 | - | |
919 | - $this->campoQuebra2('#224488'); | |
920 | - | |
921 | - $disabled = $this->isEnderecoExterno ? FALSE : TRUE; | |
922 | - | |
923 | - $this->campoOculto('isEnderecoExterno', $this->isEnderecoExterno); | |
924 | - | |
925 | - $this->campoCep('cep_', 'CEP', $this->cep_, TRUE, '-', | |
926 | - //"<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\'miolo\' id=\'miolo\' frameborder=\'0\' height=\'100%\' width=\'500\' marginheight=\'0\' marginwidth=\'0\' src=\'educar_pesquisa_cep_log_bairro.php?campo1=nm_bairro&campo2=id_bairro&campo3=id_cep&campo4=nm_logradouro&campo5=id_logradouro&campo6=ref_sigla_uf&campo7=cidade&campo8=ref_idtlog_&campo9=isEnderecoExterno&campo10=cep_&campo11=ref_sigla_uf_&campo12=ref_idtlog&campo13=id_cidade\'></iframe>');\">", | |
927 | - $urlPesquisaCep, | |
928 | - $disabled); | |
929 | - | |
930 | - $this->campoTexto('cidade', 'Cidade', $this->cidade, 30, 255, TRUE, FALSE, | |
931 | - TRUE, '', '', '', '', $disabled); | |
932 | - | |
933 | - $obj_uf = new clsUf(FALSE, FALSE, 1); | |
934 | - $lst_uf = $obj_uf->lista(FALSE, FALSE, FALSE, FALSE, FALSE, 'sigla_uf'); | |
935 | - $array_uf = array('' => 'Selecione um estado'); | |
936 | - foreach ($lst_uf as $uf) { | |
937 | - $array_uf[$uf['sigla_uf']] = $uf['nome']; | |
938 | - } | |
939 | - | |
940 | - $this->campoLista('ref_sigla_uf_', ' Estado', $array_uf, | |
941 | - $this->ref_sigla_uf, '', FALSE, '', '', $disabled); | |
942 | - | |
943 | - $this->campoTexto('nm_bairro', 'Bairro', $this->nm_bairro, 30, 255, TRUE, | |
944 | - FALSE, FALSE, '', '', '', '', $disabled); | |
945 | - | |
946 | - $tipo_logradouro_array = array('' => 'Tipo de Logradouro'); | |
947 | - | |
948 | - $obj_tipo_logradouro = new clsTipoLogradouro(); | |
949 | - $obj_tipo_logradouro_lista = $obj_tipo_logradouro->lista(); | |
950 | - | |
951 | - if ($obj_tipo_logradouro_lista) { | |
952 | - foreach ($obj_tipo_logradouro_lista as $key => $tipo_log) { | |
953 | - $tipo_logradouro_array[$tipo_log['idtlog']] = $tipo_log['descricao']; | |
954 | - } | |
955 | - } | |
956 | - | |
957 | - $this->campoLista('ref_idtlog', 'Logradouro', $tipo_logradouro_array, | |
958 | - $this->ref_idtlog, '', TRUE, '', '', $this->isEnderecoExterno ? FALSE : TRUE, TRUE); | |
959 | - | |
960 | - $this->campoTexto('nm_logradouro', 'Logradouro', $this->nm_logradouro, 30, | |
961 | - 255, TRUE, FALSE, FALSE, '', '', '', '', $disabled); | |
962 | - | |
963 | - $this->campoNumero('numero', 'Número', $this->numero, 4, 6, FALSE, | |
964 | - '', '', FALSE, FALSE, TRUE); | |
965 | - | |
966 | - $this->campoTexto('letra', ' Letra', $this->letra, 4, 1, FALSE); | |
967 | - | |
968 | - $this->campoTexto('complemento', 'Complemento', $this->complemento, 30, 50, FALSE); | |
969 | - | |
970 | - $this->campoTexto('bloco', 'Bloco', $this->bloco, 30, 50, FALSE); | |
971 | - | |
972 | - $this->campoNumero('andar', 'Andar', $this->andar, 4, 2, FALSE, '', '', | |
973 | - FALSE, FALSE, TRUE); | |
974 | - | |
975 | - $this->campoNumero('apartamento', ' Apartamento', $this->apartamento, | |
976 | - 4, 6, FALSE); | |
977 | - | |
978 | - $lista_mun_nasc = array('NULL' => 'Selecione a cidade'); | |
979 | - | |
980 | - $obj_mun_nasc = new clsMunicipio($this->idmun_nascimento); | |
981 | - $det_mun_nasc = $obj_mun_nasc->detalhe(); | |
982 | - | |
983 | - if ($det_mun_nasc['nome']) { | |
984 | - $lista_mun_nasc[$det_mun_nasc['idmun']] = $det_mun_nasc['nome']; | |
985 | - } | |
986 | - | |
987 | - $this->campoListaPesq('idmun_nascimento', 'Naturalidade', $lista_mun_nasc, | |
988 | - $this->idmun_nascimento, 'educar_pesquisa_municipio_lst.php?campo1=idmun_nascimento', | |
989 | - '', FALSE, '', '', NULL, NULL, '', TRUE); | |
990 | - | |
991 | - $this->nacionalidade = $this->nacionalidade ? $this->nacionalidade : 1; | |
992 | - | |
993 | - $lista_nacionalidade = array( | |
994 | - 'NULL' => 'Selecione', | |
995 | - '1' => 'Brasileiro', | |
996 | - '2' => 'Naturalizado Brasileiro', | |
997 | - '3' => 'Estrangeiro' | |
998 | - ); | |
999 | - | |
1000 | - $this->campoLista('nacionalidade','Nacionalidade', $lista_nacionalidade, | |
1001 | - $this->nacionalidade, "tmpObj = document.getElementById('pais_origem'); if (this.value!=1) { tmpObj.disabled = false; } else { tmpObj.selectedIndex = 27; tmpObj.disabled = true; }", | |
1002 | - TRUE, '', '', '', FALSE); | |
1003 | - | |
1004 | - $lista_pais_origem = array('NULL' => 'País de origem'); | |
1005 | - $obj_pais = new clsPais(); | |
1006 | - $obj_pais_lista = $obj_pais->lista(null,null,null,'','','nome asc'); | |
1007 | - | |
1008 | - if ($obj_pais_lista) { | |
1009 | - foreach ($obj_pais_lista as $key => $pais) { | |
1010 | - $lista_pais_origem[$pais['idpais']] = $pais['nome']; | |
1011 | - } | |
1012 | - } | |
1013 | - | |
1014 | - // se a nacionalidade for "BRASILEIRO" seleciona o brasil e deixa inativo | |
1015 | - $this->pais_origem = $this->nacionalidade == 1 ? 1 : $this->pais_origem; | |
1016 | - $this->campoLista('pais_origem',' País de Origem', $lista_pais_origem, | |
1017 | - $this->pais_origem, '', '', '', '', $this->nacionalidade == 1, FALSE); | |
1018 | - | |
1019 | - $this->campoQuebra2('#224488'); | |
1020 | - | |
1021 | - $obj_beneficio = new clsPmieducarAlunoBeneficio(); | |
1022 | - $obj_beneficio_lista = $obj_beneficio->lista(NULL, NULL, NULL, NULL, NULL, | |
1023 | - NULL, NULL, NULL, NULL, 1); | |
1024 | - | |
1025 | - $lista_beneficio = array('NULL' => "Selecione"); | |
1026 | - | |
1027 | - if ($obj_beneficio_lista) { | |
1028 | - foreach ($obj_beneficio_lista as $beneficio) { | |
1029 | - $lista_beneficio[$beneficio['cod_aluno_beneficio']] = $beneficio['nm_beneficio']; | |
1030 | - } | |
1031 | - } | |
1032 | - | |
1033 | - $this->campoLista('ref_cod_aluno_beneficio', 'Benefício', $lista_beneficio, | |
1034 | - $this->ref_cod_aluno_beneficio, '', FALSE, '', '', FALSE, FALSE); | |
1035 | - | |
1036 | - $lista_analfabeto = array( | |
1037 | - 1 => 'Não', | |
1038 | - 0 => 'Sim' | |
1039 | - ); | |
1040 | - $this->campoLista('analfabeto', 'Alfabetizado', $lista_analfabeto, | |
1041 | - $this->analfabeto, '', FALSE, '', '', FALSE, FALSE); | |
1042 | - | |
1043 | - $this->campoNumero('ddd_fone_1', 'Telefone', $this->ddd_fone_1, 1, 3, | |
1044 | - FALSE, '', '', FALSE, FALSE, TRUE); | |
1045 | - $this->campoNumero('fone_1', 'Telefone', $this->fone_1, 11, 11); | |
1046 | - $this->campoNumero('ddd_mov', 'Celular', $this->ddd_mov, 1, 3, FALSE, '', '', | |
1047 | - FALSE, FALSE, TRUE); | |
1048 | - $this->campoNumero('fone_mov', 'Celular', $this->fone_mov, 11, 11); | |
1049 | - | |
1050 | - $this->campoEmail('email', 'Email', $this->email, 30, 255, FALSE); | |
1051 | - | |
1052 | - if (!empty($this->caminho_foto)) { | |
1053 | - $this->campoRotulo('foto_antiga_','Arquivo',sprintf('<img src="arquivos/educar/aluno/small/%s" border="0"> <a href="javascript:void(0);" onclick="document.getElementById(\'foto_excluida\').value=1; setVisibility(\'tr_foto_antiga_\', false); setVisibility(\'tr_foto\',true);"> <img src="imagens/nvp_bola_xis.gif" border="0"></a>', $this->caminho_foto)); | |
1054 | - } | |
1055 | - | |
1056 | - $this->campoArquivo('foto', 'Foto', '', '20', '', FALSE); | |
1057 | - | |
1058 | - $this->campoOculto('id_bairro', $this->id_bairro); | |
1059 | - $this->campoOculto('id_cep', $this->id_cep); | |
1060 | - $this->campoOculto('id_logradouro', $this->id_logradouro); | |
1061 | - $this->campoOculto('id_cidade', $this->id_cidade); | |
1062 | - $this->campoOculto('ref_idtlog_', $this->ref_idtlog); | |
1063 | - $this->campoOculto('ref_sigla_uf', $this->ref_sigla_uf); | |
1064 | - $this->campoOculto('cpf', $this->cpf); | |
1065 | - | |
1066 | - $this->campoAdicionaTab('Deficiência', $this->tab_habilitado); | |
1067 | - | |
1068 | - if ($this->ref_idpes) { | |
1069 | - $obj_deficiencia_pessoa = new clsCadastroFisicaDeficiencia(); | |
1070 | - $obj_deficiencia_pessoa_lista = $obj_deficiencia_pessoa->lista($this->ref_idpes); | |
1071 | - } | |
1072 | - | |
1073 | - if ($this->inc != 2 && !$this->exc) { | |
1074 | - if ($obj_deficiencia_pessoa_lista) { | |
1075 | - $deficiencia_pessoa = array(); | |
1076 | - | |
1077 | - foreach ($obj_deficiencia_pessoa_lista as $deficiencia) { | |
1078 | - $obj_def = new clsCadastroDeficiencia($deficiencia['ref_cod_deficiencia']); | |
1079 | - $det_def = $obj_def->detalhe(); | |
1080 | - $deficiencia_pessoa[$deficiencia['ref_cod_deficiencia']] = $det_def['nm_deficiencia']; | |
1081 | - } | |
1082 | - | |
1083 | - $deficiencia_aluno = array(); | |
1084 | - $deficiencia_aluno = $deficiencia_pessoa; | |
1085 | - } | |
1086 | - } | |
1087 | - | |
1088 | - | |
1089 | - $obj_deficiencias = new clsCadastroDeficiencia(); | |
1090 | - $lista_deficiencias = $obj_deficiencias->lista(); | |
1091 | - | |
1092 | - $lista = array('' => 'Selecione'); | |
1093 | - | |
1094 | - if($lista_deficiencias) { | |
1095 | - foreach ($lista_deficiencias as $deficiencia) { | |
1096 | - $lista[$deficiencia['cod_deficiencia']] = $deficiencia['nm_deficiencia']; | |
1097 | - } | |
1098 | - } | |
1099 | - | |
1100 | - $oculto = $tabela = ''; | |
1101 | - if ($deficiencia_aluno) { | |
1102 | - foreach ($deficiencia_aluno as $indice => $valor) { | |
1103 | - $cor_fundo = $cor_fundo == '#D1DADF' ? '#f5f9fd' : '#D1DADF'; | |
1104 | - $tabela .= "<tr id=\"tr_{$indice}\" bgcolor=\"{$cor_fundo}\" style=\"padding-right: 10px;\">"; | |
1105 | - $tabela .= "<td>{$valor}</td>"; | |
1106 | - $tabela .= "<td align=\"right\" style=\"padding-right: 10px;\">"; | |
1107 | - $tabela .= "<img border=\"0\" onclick=\"excluirLinhaDeficiencia({$indice})\" | |
1108 | - style=\"cursor: pointer;\" src=\"imagens/banco_imagens/excluirrr.png\" | |
1109 | - title=\"Excluir\">"; | |
1110 | - $tabela .= "</td></tr>"; | |
1111 | - $oculto .= "<input type=\"hidden\" id=\"oc_defic[{$indice}]\" name=\"oc_defic[{$indice}]\" value=\"{$indice}\">"; | |
1112 | - } | |
1113 | - } | |
1114 | - | |
1115 | - $this->campoLista('ref_cod_pessoa_deficiencia', 'Deficiência', $lista, | |
1116 | - $this->ref_cod_pessoa_deficiencia, '', FALSE, '', '', FALSE, $obrigatorio); | |
1117 | - | |
1118 | - $this->campoRotulo('incluir2', 'Incluir deficiência', | |
1119 | - "<a href='#' onclick=\"adicionaDeficiencia();\"><img src='imagens/banco_imagens/entrada2.gif' title='Incluir' border=0></a>"); | |
1120 | - | |
1121 | - $this->campoRotulo("tab_defic", "Deficiências", "<table id='tabela_deficiencia' cellspacing='0' cellpadding='2'><tbody>{$tabela}</tbody></table><div id='ocultos_defic'>{$oculto}</div>"); | |
1122 | - | |
1123 | - $this->campoOculto('inc', ''); | |
1124 | - $this->campoOculto('exc', ''); | |
1125 | - | |
1126 | - $this->campoAdicionaTab('Outros Dados', $this->tab_habilitado); | |
1127 | - | |
1128 | - if ($this->ref_idpes) { | |
1129 | - $ObjDocumento = new clsDocumento($this->ref_idpes); | |
1130 | - $detalheDocumento = $ObjDocumento->detalhe(); | |
1131 | - | |
1132 | - $this->rg = $detalheDocumento['rg']; | |
1133 | - | |
1134 | - if ($detalheDocumento['data_exp_rg']) { | |
1135 | - $this->data_exp_rg = date('d/m/Y', | |
1136 | - strtotime(substr($detalheDocumento['data_exp_rg'], 0, 19))); | |
1137 | - } | |
1138 | - | |
1139 | - $this->sigla_uf_exp_rg = $detalheDocumento['sigla_uf_exp_rg']; | |
1140 | - $this->tipo_cert_civil = $detalheDocumento['tipo_cert_civil']; | |
1141 | - $this->num_termo = $detalheDocumento['num_termo']; | |
1142 | - $this->num_livro = $detalheDocumento['num_livro']; | |
1143 | - $this->num_folha = $detalheDocumento['num_folha']; | |
1144 | - | |
1145 | - if ($detalheDocumento['data_emissao_cert_civil']) { | |
1146 | - $this->data_emissao_cert_civil = date('d/m/Y', | |
1147 | - strtotime(substr($detalheDocumento['data_emissao_cert_civil'], 0, 19))); | |
1148 | - } | |
1149 | - | |
1150 | - $this->sigla_uf_cert_civil = $detalheDocumento['sigla_uf_cert_civil']; | |
1151 | - | |
1152 | - $this->cartorio_cert_civil = $detalheDocumento['cartorio_cert_civil']; | |
1153 | - $this->num_cart_trabalho = $detalheDocumento['num_cart_trabalho']; | |
1154 | - $this->serie_cart_trabalho = $detalheDocumento['serie_cart_trabalho']; | |
1155 | - | |
1156 | - if ($detalheDocumento['data_emissao_cart_trabalho']) { | |
1157 | - $this->data_emissao_cart_trabalho = date( "d/m/Y", strtotime( substr($detalheDocumento['data_emissao_cart_trabalho'],0,19) ) ); | |
1158 | - } | |
1159 | - | |
1160 | - $this->sigla_uf_cart_trabalho = $detalheDocumento['sigla_uf_cart_trabalho']; | |
1161 | - $this->num_tit_eleitor = $detalheDocumento['num_tit_eleitor']; | |
1162 | - $this->zona_tit_eleitor = $detalheDocumento['zona_tit_eleitor']; | |
1163 | - $this->secao_tit_eleitor = $detalheDocumento['secao_tit_eleitor']; | |
1164 | - $this->idorg_exp_rg = $detalheDocumento['idorg_exp_rg']; | |
1165 | - } | |
1166 | - | |
1167 | - $objUf = new clsUf(); | |
1168 | - $listauf = $objUf->lista(); | |
1169 | - $listaEstado = array('0' => 'Selecione'); | |
1170 | - | |
1171 | - if ($listauf) { | |
1172 | - foreach ($listauf as $uf) { | |
1173 | - $listaEstado[$uf['sigla_uf']] = $uf['sigla_uf']; | |
1174 | - } | |
1175 | - } | |
1176 | - | |
1177 | - $objOrgaoEmissorRg = new clsOrgaoEmissorRg(); | |
1178 | - $listaOrgaoEmissorRg = $objOrgaoEmissorRg->lista(); | |
1179 | - $listaOrgao = array('0' => 'Selecione'); | |
1180 | - | |
1181 | - if ($listaOrgaoEmissorRg) { | |
1182 | - foreach ($listaOrgaoEmissorRg as $orgaoemissor) { | |
1183 | - $listaOrgao[$orgaoemissor['idorg_rg']] = $orgaoemissor['sigla']; | |
1184 | - } | |
1185 | - } | |
1186 | - | |
1187 | - $this->campoOculto('idpes', $this->idpes); | |
1188 | - | |
1189 | - $this->campoTexto('rg', 'Rg', $this->rg, '10', '10', FALSE); | |
1190 | - $this->campoData('data_exp_rg', 'Data Expedição RG', $this->data_exp_rg, FALSE); | |
1191 | - | |
1192 | - $this->campoLista('idorg_exp_rg', 'Órgão Expedição RG', $listaOrgao, | |
1193 | - $this->idorg_exp_rg, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); | |
1194 | - | |
1195 | - $this->campoLista('sigla_uf_exp_rg', 'Estado Expedidor', $listaEstado, | |
1196 | - $this->sigla_uf_exp_rg, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); | |
1197 | - | |
1198 | - $lista_tipo_cert_civil = array(); | |
1199 | - $lista_tipo_cert_civil['0'] = 'Selecione'; | |
1200 | - $lista_tipo_cert_civil[91] = 'Nascimento'; | |
1201 | - $lista_tipo_cert_civil[92] = 'Casamento'; | |
1202 | - | |
1203 | - $this->campoLista('tipo_cert_civil', 'Tipo Certificado Civil', | |
1204 | - $lista_tipo_cert_civil, $this->tipo_cert_civil, NULL, NULL, NULL, NULL, | |
1205 | - NULL, FALSE); | |
1206 | - | |
1207 | - $this->campoTexto('num_termo', 'Termo', $this->num_termo, '8', '8', FALSE); | |
1208 | - $this->campoTexto('num_livro', 'Livro', $this->num_livro, '8', '8', FALSE); | |
1209 | - $this->campoTexto('num_folha', 'Folha', $this->num_folha, '4', '4', FALSE); | |
1210 | - | |
1211 | - $this->campoData('data_emissao_cert_civil', 'Emissão Certidão Civil', | |
1212 | - $this->data_emissao_cert_civil, FALSE); | |
1213 | - | |
1214 | - $this->campoLista('sigla_uf_cert_civil', 'Sigla Certidão Civil', | |
1215 | - $listaEstado, $this->sigla_uf_cert_civil, FALSE, FALSE, FALSE, FALSE, | |
1216 | - FALSE, FALSE); | |
1217 | - | |
1218 | - $this->campoMemo('cartorio_cert_civil', 'Cartório', $this->cartorio_cert_civil, | |
1219 | - '35', '4', FALSE, FALSE); | |
1220 | - | |
1221 | - $this->campoTexto('num_tit_eleitor', 'Título de Eleitor', $this->num_tit_eleitor, | |
1222 | - '13', '13', FALSE); | |
1223 | - | |
1224 | - $this->campoTexto('zona_tit_eleitor', 'Zona', $this->zona_tit_eleitor, '4', | |
1225 | - '4', FALSE); | |
1226 | - | |
1227 | - $this->campoTexto('secao_tit_eleitor', 'Seção', $this->secao_tit_eleitor, | |
1228 | - '10', '10', FALSE); | |
1229 | - | |
1230 | - // Adiciona uma aba com dados do Inep/Educacenso caso aluno tenha código Inep. | |
1231 | - if (isset($this->cod_aluno)) { | |
1232 | - $alunoMapper = new Educacenso_Model_AlunoDataMapper(); | |
1233 | - | |
1234 | - $alunoInep = NULL; | |
1235 | - try { | |
1236 | - $alunoInep = $alunoMapper->find(array('aluno' => $this->cod_aluno)); | |
1237 | - } | |
1238 | - catch(Exception $e) { | |
1239 | - } | |
1240 | - | |
1241 | - if ($alunoInep) { | |
1242 | - $this->campoAdicionaTab('Educacenso/Inep', $this->tab_habilitado); | |
1243 | - | |
1244 | - $this->campoRotulo('_inep_cod_aluno', 'Código do aluno no Educacenso/Inep', | |
1245 | - $alunoInep->alunoInep); | |
1246 | - | |
1247 | - if (isset($alunoInep->nomeInep)) { | |
1248 | - $this->campoRotulo('_inep_nome_aluno', 'Nome do aluno no Educacenso/Inep', | |
1249 | - $alunoInep->nomeInep); | |
1250 | - } | |
1251 | - } | |
1252 | - } | |
1253 | - | |
1254 | - $this->campoTabFim(); | |
1255 | - } | |
1256 | - | |
1257 | - function Novo() | |
1258 | - { | |
1259 | - if (!$this->cpf && $this->cpf_2) { | |
1260 | - $cpf = idFederal2int($this->cpf_2); | |
1261 | - $obj_pessoa_fisica = new clsPessoaFisica(); | |
1262 | - $lst_pessoa_fisica = $obj_pessoa_fisica->lista(NULL, $cpf); | |
1263 | - | |
1264 | - if ($lst_pessoa_fisica) { | |
1265 | - $this->mensagem = 'CPF Já Cadastrado'; | |
1266 | - return FALSE; | |
1267 | - } | |
1268 | - else { | |
1269 | - die('CPF Não Existente'); | |
1270 | - } | |
1271 | - } | |
1272 | - | |
1273 | - $obj_pessoa = new clsPessoa_($this->ref_idpes); | |
1274 | - | |
1275 | - if($obj_pessoa->detalhe()) { | |
1276 | - $obj_pessoa = new clsPessoa_($this->ref_idpes, $this->nome, NULL, $this->url, | |
1277 | - NULL, $this->pessoa_logada, NULL, $this->email); | |
1278 | - | |
1279 | - if (!$obj_pessoa->edita()) { | |
1280 | - return false; | |
1281 | - } | |
1282 | - } | |
1283 | - else { | |
1284 | - $obj_pessoa = new clsPessoa_($this->ref_idpes, $this->nome, NULL, $this->url, | |
1285 | - 'F', $this->pessoa_logada, NULL, $this->email); | |
1286 | - | |
1287 | - if (!$this->ref_idpes = $obj_pessoa->cadastra()) { | |
1288 | - return FALSE; | |
1289 | - } | |
1290 | - } | |
1291 | - | |
1292 | - if (!$this->cpf) { | |
1293 | - $this->ref_cod_sistema = 1; | |
1294 | - } | |
1295 | - else { | |
1296 | - $this->ref_cod_sistema = 'NULL'; | |
1297 | - } | |
1298 | - | |
1299 | - if (is_string($this->cpf_pai) && $this->cpf_pai != '') { | |
1300 | - | |
1301 | - $this->cpf_pai = idFederal2int($this->cpf_pai); | |
1302 | - $obj_cpf = new clsFisica(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, | |
1303 | - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, | |
1304 | - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,$this->cpf_pai); | |
1305 | - | |
1306 | - $detalhe_cpf = $obj_cpf->detalheCPF(); | |
1307 | - | |
1308 | - if ($detalhe_cpf) { | |
1309 | - $this->idpes_pai = $detalhe_cpf['idpes']; | |
1310 | - $obj_pessoa = new clsPessoa_($this->idpes_pai); | |
1311 | - $det_pessoa = $obj_pessoa->detalhe(); | |
1312 | - | |
1313 | - if ($det_pessoa) { | |
1314 | - if ($this->nm_pai) { | |
1315 | - $obj_pessoa = new clsPessoa_($this->idpes_pai, $this->nm_pai); | |
1316 | - $obj_pessoa->edita(); | |
1317 | - } | |
1318 | - else { | |
1319 | - $this->nm_pai = $det_pessoa['nome']; | |
1320 | - } | |
1321 | - } | |
1322 | - } | |
1323 | - else { | |
1324 | - // cria uma pessoa para o pai | |
1325 | - $obj_pessoa = new clsPessoa_(FALSE, $this->nm_pai, $this->pessoa_logada, | |
1326 | - FALSE, 'F'); | |
1327 | - | |
1328 | - $idpes = $obj_pessoa->cadastra(); | |
1329 | - | |
1330 | - if ($idpes) { | |
1331 | - $this->idpes_pai = $idpes; | |
1332 | - //cadastra como pesso Fisica | |
1333 | - $obj_fisica = new clsFisica($idpes, FALSE,'M', FALSE, FALSE, FALSE, | |
1334 | - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, | |
1335 | - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, $this->pessoa_logada, | |
1336 | - NULL, NULL, $this->cpf_pai); | |
1337 | - | |
1338 | - $obj_fisica->cadastra(); | |
1339 | - } | |
1340 | - } | |
1341 | - } | |
1342 | - else | |
1343 | - { | |
1344 | - $this->idpes_pai = "NULL"; | |
1345 | - } | |
1346 | - | |
1347 | - if( is_string( $this->cpf_mae ) && $this->cpf_mae != "") | |
1348 | - { | |
1349 | - $this->cpf_mae = idFederal2int($this->cpf_mae); | |
1350 | - $obj_cpf = new clsFisica(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, | |
1351 | - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, | |
1352 | - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, $this->cpf_mae); | |
1353 | - | |
1354 | - $detalhe_cpf = $obj_cpf->detalheCPF(); | |
1355 | - | |
1356 | - if ($detalhe_cpf) { | |
1357 | - $this->idpes_mae = $detalhe_cpf['idpes']; | |
1358 | - $obj_pessoa = new clsPessoa_($this->idpes_mae); | |
1359 | - $det_pessoa = $obj_pessoa->detalhe(); | |
1360 | - | |
1361 | - if($det_pessoa) { | |
1362 | - if($this->nm_mae) { | |
1363 | - $obj_pessoa = new clsPessoa_($this->idpes_mae, $this->nm_mae); | |
1364 | - $obj_pessoa->edita(); | |
1365 | - } | |
1366 | - else { | |
1367 | - $this->nm_mae = $det_pessoa['nome']; | |
1368 | - } | |
1369 | - } | |
1370 | - } | |
1371 | - else { | |
1372 | - // cria uma pessoa para a mae | |
1373 | - $obj_pessoa = new clsPessoa_(FALSE, $this->nm_mae, $this->pessoa_logada, | |
1374 | - FALSE, 'F'); | |
1375 | - | |
1376 | - $idpes = $obj_pessoa->cadastra(); | |
1377 | - | |
1378 | - if ($idpes) { | |
1379 | - $this->idpes_mae = $idpes; | |
1380 | - //cadastra como pesso Fisica | |
1381 | - $obj_fisica = new clsFisica($idpes, FALSE, 'F', FALSE, FALSE, FALSE, | |
1382 | - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, | |
1383 | - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, $this->pessoa_logada, | |
1384 | - NULL, NULL, $this->cpf_mae); | |
1385 | - | |
1386 | - $obj_fisica->cadastra(); | |
1387 | - } | |
1388 | - } | |
1389 | - } | |
1390 | - else { | |
1391 | - $this->idpes_mae = "NULL"; | |
1392 | - } | |
1393 | - | |
1394 | - $obj_fisica = new clsFisica($this->ref_idpes, dataToBanco($this->data_nascimento), | |
1395 | - $this->sexo, $this->idpes_mae, $this->idpes_pai, $this->ref_idpes_responsavel, | |
1396 | - NULL, $this->ideciv, NULL, NULL, NULL, $this->nacionalidade, | |
1397 | - $this->pais_origem, NULL, $this->idmun_nascimento, NULL, NULL, NULL, NULL, | |
1398 | - NULL, NULL, NULL, NULL, $this->pessoa_logada, $this->ref_cod_sistema, $this->cpf); | |
1399 | - | |
1400 | - if ($obj_fisica->detalhe()) { | |
1401 | - if (!$this->ref_idpes_responsavel) { | |
1402 | - $this->ref_idpes_responsavel = "NULL"; | |
1403 | - } | |
1404 | - | |
1405 | - $obj_fisica = new clsFisica($this->ref_idpes, dataToBanco($this->data_nascimento), | |
1406 | - $this->sexo, $this->idpes_mae, $this->idpes_pai, $this->ref_idpes_responsavel, | |
1407 | - NULL, $this->ideciv, NULL, NULL, NULL, $this->nacionalidade, $this->pais_origem, | |
1408 | - NULL, $this->idmun_nascimento, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | |
1409 | - NULL, $this->pessoa_logada, $this->ref_cod_sistema); | |
1410 | - | |
1411 | - if (!$obj_fisica->edita()) { | |
1412 | - return FALSE; | |
1413 | - } | |
1414 | - } | |
1415 | - else { | |
1416 | - $obj_fisica = new clsFisica($this->ref_idpes, dataToBanco($this->data_nascimento), | |
1417 | - $this->sexo, $this->idpes_mae, $this->idpes_pai, $this->ref_idpes_responsavel, | |
1418 | - NULL, $this->ideciv, NULL, NULL, NULL, $this->nacionalidade, | |
1419 | - $this->pais_origem, NULL, $this->idmun_nascimento, NULL, NULL, NULL, | |
1420 | - NULL, NULL, NULL, NULL, NULL, $this->pessoa_logada, $this->ref_cod_sistema, | |
1421 | - $this->cpf); | |
1422 | - | |
1423 | - if (!$obj_fisica->cadastra()) { | |
1424 | - return FALSE; | |
1425 | - } | |
1426 | - } | |
1427 | - | |
1428 | - if (is_numeric($this->ref_cod_raca)) { | |
1429 | - $obj_fisica_raca = new clsCadastroFisicaRaca($this->ref_idpes); | |
1430 | - if ($obj_fisica_raca->existe()) { | |
1431 | - $obj_fisica_raca = new clsCadastroFisicaRaca($this->ref_idpes, $this->ref_cod_raca); | |
1432 | - $obj_fisica_raca->edita(); | |
1433 | - } | |
1434 | - else { | |
1435 | - $obj_fisica_raca = new clsCadastroFisicaRaca($this->ref_idpes, $this->ref_cod_raca); | |
1436 | - $obj_fisica_raca->cadastra(); | |
1437 | - } | |
1438 | - } | |
1439 | - else { | |
1440 | - $obj_fisica_raca = new clsCadastroFisicaRaca($this->ref_idpes, $this->ref_cod_raca); | |
1441 | - $obj_fisica_raca->excluir(); | |
1442 | - } | |
1443 | - | |
1444 | - $objTelefone = new clsPessoaTelefone($this->ref_idpes, 1, $this->fone_1, $this->ddd_fone_1); | |
1445 | - if ($objTelefone->detalhe()) { | |
1446 | - $objTelefone->edita(); | |
1447 | - } | |
1448 | - else { | |
1449 | - $objTelefone->cadastra(); | |
1450 | - } | |
1451 | - | |
1452 | - $objTelefone = new clsPessoaTelefone($this->ref_idpes, 2, $this->fone_2, $this->ddd_fone_2); | |
1453 | - if ($objTelefone->detalhe()) { | |
1454 | - $objTelefone->edita(); | |
1455 | - } | |
1456 | - else { | |
1457 | - $objTelefone->cadastra(); | |
1458 | - } | |
1459 | - | |
1460 | - $objTelefone = new clsPessoaTelefone($this->ref_idpes, 3, $this->fone_mov, $this->ddd_mov); | |
1461 | - if ($objTelefone->detalhe()) { | |
1462 | - $objTelefone->edita(); | |
1463 | - } | |
1464 | - else { | |
1465 | - $objTelefone->cadastra(); | |
1466 | - } | |
1467 | - | |
1468 | - $objTelefone = new clsPessoaTelefone($this->ref_idpes, 4, $this->fone_fax, $this->ddd_fax); | |
1469 | - if ($objTelefone->detalhe()) { | |
1470 | - $objTelefone->edita(); | |
1471 | - } | |
1472 | - else { | |
1473 | - $objTelefone->cadastra(); | |
1474 | - } | |
1475 | - | |
1476 | - if ($this->isEnderecoExterno) { | |
1477 | - $this->cep_ = str_replace('-', '', $this->cep_); | |
1478 | - $obj_endereco = new clsEnderecoExterno($this->ref_idpes, 1, | |
1479 | - $this->ref_idtlog, $this->nm_logradouro, $this->numero, $this->letra, | |
1480 | - $this->complemento, $this->nm_bairro, $this->cep_, $this->cidade, | |
1481 | - $this->ref_sigla_uf_, NULL, $this->bloco, $this->apartamento, $this->andar, | |
1482 | - NULL, $this->pessoa_logada, $this->zona_localizacao); | |
1483 | - | |
1484 | - if ($obj_endereco->existe()) { | |
1485 | - if (!$obj_endereco->edita()) { | |
1486 | - return FALSE; | |
1487 | - } | |
1488 | - } | |
1489 | - else { | |
1490 | - if (!$obj_endereco->cadastra()) { | |
1491 | - return FALSE; | |
1492 | - } | |
1493 | - } | |
1494 | - | |
1495 | - if ($this->endereco_original_is_externo != $this->isEnderecoExterno) { | |
1496 | - $obj_endereco = new clsPessoaEndereco($this->ref_idpes); | |
1497 | - $obj_endereco->exclui(); | |
1498 | - } | |
1499 | - } | |
1500 | - else { | |
1501 | - $obj_endereco = new clsPessoaEndereco($this->ref_idpes, $this->id_cep, | |
1502 | - $this->id_logradouro, $this->id_bairro, $this->numero, $this->complemento, | |
1503 | - NULL, $this->letra, $this->bloco, $this->apartamento, $this->andar, null, | |
1504 | - $this->pessoa_logada); | |
1505 | - | |
1506 | - if ($obj_endereco->existe()) { | |
1507 | - if (!$obj_endereco->edita()) { | |
1508 | - return FALSE; | |
1509 | - } | |
1510 | - } | |
1511 | - else { | |
1512 | - if (!$obj_endereco->cadastra()) { | |
1513 | - return FALSE; | |
1514 | - } | |
1515 | - } | |
1516 | - | |
1517 | - if ($this->endereco_original_is_externo != $this->isEnderecoExterno) { | |
1518 | - $obj_endereco = new clsEnderecoExterno($this->ref_idpes); | |
1519 | - $obj_endereco->exclui(); | |
1520 | - } | |
1521 | - } | |
1522 | - | |
1523 | - $this->deficiencia_exc = $_POST['oc_defic_exc']; | |
1524 | - if ($this->deficiencia_exc) { | |
1525 | - foreach ($this->deficiencia_exc as $key => $deficiencia) { | |
1526 | - $obj_deficiencia_pessoa = new clsCadastroFisicaDeficiencia($this->ref_idpes, $deficiencia); | |
1527 | - | |
1528 | - if ($obj_deficiencia_pessoa->detalhe()) { | |
1529 | - $obj_deficiencia_pessoa->excluir(); | |
1530 | - } | |
1531 | - } | |
1532 | - } | |
1533 | - | |
1534 | - $this->deficiencia = $_POST['oc_defic']; | |
1535 | - | |
1536 | - if ($this->deficiencia) { | |
1537 | - foreach ($this->deficiencia as $key => $deficiencia) { | |
1538 | - $obj_deficiencia_pessoa = new clsCadastroFisicaDeficiencia($this->ref_idpes, $key); | |
1539 | - | |
1540 | - if (!$obj_deficiencia_pessoa->detalhe()) { | |
1541 | - $obj_deficiencia_pessoa->cadastra(); | |
1542 | - } | |
1543 | - } | |
1544 | - } | |
1545 | - | |
1546 | - if ($this->data_emissao_cart_trabalho) { | |
1547 | - $this->data_emissao_cart_trabalho = explode('/', $this->data_emissao_cart_trabalho); | |
1548 | - $this->data_emissao_cart_trabalho = "{$this->data_emissao_cart_trabalho[2]}/{$this->data_emissao_cart_trabalho[1]}/{$this->data_emissao_cart_trabalho[0]}"; | |
1549 | - } | |
1550 | - | |
1551 | - if($this->data_emissao_cert_civil) { | |
1552 | - $this->data_emissao_cert_civil = explode('/', $this->data_emissao_cert_civil); | |
1553 | - $this->data_emissao_cert_civil = "{$this->data_emissao_cert_civil[2]}/{$this->data_emissao_cert_civil[1]}/{$this->data_emissao_cert_civil[0]}"; | |
1554 | - } | |
1555 | - | |
1556 | - if($this->data_exp_rg) { | |
1557 | - $this->data_exp_rg = explode('/', $this->data_exp_rg); | |
1558 | - $this->data_exp_rg = "{$this->data_exp_rg[2]}/{$this->data_exp_rg[1]}/{$this->data_exp_rg[0]}"; | |
1559 | - } | |
1560 | - | |
1561 | - $ObjDocumento = new clsDocumento($this->ref_idpes, $this->rg, $this->data_exp_rg, | |
1562 | - $this->sigla_uf_exp_rg, $this->tipo_cert_civil, $this->num_termo, $this->num_livro, | |
1563 | - $this->num_folha, $this->data_emissao_cert_civil, $this->sigla_uf_cert_civil, | |
1564 | - $this->cartorio_cert_civil, $this->num_cart_trabalho, $this->serie_cart_trabalho, | |
1565 | - $this->data_emissao_cart_trabalho, $this->sigla_uf_cart_trabalho, | |
1566 | - $this->num_tit_eleitor, $this->zona_tit_eleitor, $this->secao_tit_eleitor, | |
1567 | - $this->idorg_exp_rg); | |
1568 | - | |
1569 | - if ($ObjDocumento->detalhe()) { | |
1570 | - $ObjDocumento = new clsDocumento($this->ref_idpes, $this->rg, $this->data_exp_rg, | |
1571 | - $this->sigla_uf_exp_rg, $this->tipo_cert_civil, $this->num_termo, | |
1572 | - $this->num_livro, $this->num_folha, $this->data_emissao_cert_civil, | |
1573 | - $this->sigla_uf_cert_civil, $this->cartorio_cert_civil, $this->num_cart_trabalho, | |
1574 | - $this->serie_cart_trabalho, $this->data_emissao_cart_trabalho, | |
1575 | - $this->sigla_uf_cart_trabalho, $this->num_tit_eleitor, $this->zona_tit_eleitor, | |
1576 | - $this->secao_tit_eleitor, $this->idorg_exp_rg); | |
1577 | - | |
1578 | - if (!$ObjDocumento->edita()) { | |
1579 | - return FALSE; | |
1580 | - } | |
1581 | - } | |
1582 | - else { | |
1583 | - $ObjDocumento = new clsDocumento($this->ref_idpes, $this->rg, $this->data_exp_rg, | |
1584 | - $this->sigla_uf_exp_rg, $this->tipo_cert_civil, $this->num_termo, | |
1585 | - $this->num_livro, $this->num_folha, $this->data_emissao_cert_civil, | |
1586 | - $this->sigla_uf_cert_civil, $this->cartorio_cert_civil, $this->num_cart_trabalho, | |
1587 | - $this->serie_cart_trabalho, $this->data_emissao_cart_trabalho, | |
1588 | - $this->sigla_uf_cart_trabalho, $this->num_tit_eleitor, | |
1589 | - $this->zona_tit_eleitor, $this->secao_tit_eleitor, $this->idorg_exp_rg); | |
1590 | - | |
1591 | - if (!$ObjDocumento->cadastra()) { | |
1592 | - return FALSE; | |
1593 | - } | |
1594 | - } | |
1595 | - | |
1596 | - if($this->foto && $this->foto['error'] == 0) { | |
1597 | - $this->foto = $this->geraFotos($this->foto['tmp_name']); | |
1598 | - $obj = new clsPmieducarAluno(NULL, $this->ref_cod_aluno_beneficio, | |
1599 | - $this->ref_cod_religiao, $this->pessoa_logada, $this->pessoa_logada, | |
1600 | - $this->ref_idpes, NULL, NULL, 1, $this->foto, $this->analfabeto, | |
1601 | - $this->nm_pai, $this->nm_mae); | |
1602 | - | |
1603 | - $obj_det = $obj->detalhe(); | |
1604 | - if ($obj_det) { | |
1605 | - if($obj_det['caminho_foto']) { | |
1606 | - $this->caminho_foto = $obj_det['caminho_foto']; | |
1607 | - } | |
1608 | - | |
1609 | - $this->foto_excluida = 1; | |
1610 | - } | |
1611 | - } | |
1612 | - elseif ($this->foto_excluida == 1) { | |
1613 | - $this->foto = 'NULL'; | |
1614 | - } | |
1615 | - elseif (!$this->foto_excluida) { | |
1616 | - $this->foto = $this->foto_antiga; | |
1617 | - } | |
1618 | - | |
1619 | - if ($this->foto_excluida) { | |
1620 | - if (file_exists('arquivos/educar/aluno/big/' . $this->caminho_foto)) { | |
1621 | - unlink('arquivos/educar/aluno/big/' . $this->caminho_foto); | |
1622 | - } | |
1623 | - | |
1624 | - if (file_exists('arquivos/educar/aluno/small/' . $this->caminho_foto)) { | |
1625 | - unlink('arquivos/educar/aluno/small/' . $this->caminho_foto); | |
1626 | - } | |
1627 | - | |
1628 | - if (file_exists('arquivos/educar/aluno/original/' . $this->caminho_foto)) { | |
1629 | - unlink('arquivos/educar/aluno/original/' . $this->caminho_foto); | |
1630 | - } | |
1631 | - } | |
1632 | - | |
1633 | - if (is_numeric($this->idpes_mae) && $this->idpes_mae != 'NULL') { | |
1634 | - $this->nm_mae = 'NULL'; | |
1635 | - } | |
1636 | - | |
1637 | - if (is_numeric($this->idpes_pai) && $this->idpes_pai != 'NULL') { | |
1638 | - $this->nm_pai = 'NULL'; | |
1639 | - } | |
1640 | - | |
1641 | - if (!$this->cod_aluno) { | |
1642 | - $obj = new clsPmieducarAluno(NULL, $this->ref_cod_aluno_beneficio, | |
1643 | - $this->ref_cod_religiao, $this->pessoa_logada, $this->pessoa_logada, | |
1644 | - $this->ref_idpes, NULL, NULL, 1, $this->foto, $this->analfabeto, | |
1645 | - $this->nm_pai, $this->nm_mae, $this->tipo_responsavel); | |
1646 | - | |
1647 | - if ($this->ref_idpes) { | |
1648 | - if ($obj->existePessoa()) { | |
1649 | - $aluno = $obj->edita(); | |
1650 | - $this->cod_aluno = $aluno['cod_aluno']; | |
1651 | - } | |
1652 | - else { | |
1653 | - $this->cod_aluno = $obj->cadastra(); | |
1654 | - } | |
1655 | - } | |
1656 | - } | |
1657 | - else { | |
1658 | - $obj = new clsPmieducarAluno($this->cod_aluno, $this->ref_cod_aluno_beneficio, | |
1659 | - $this->ref_cod_religiao, $this->pessoa_logada, $this->pessoa_logada, | |
1660 | - $this->ref_idpes, NULL, NULL, 1, $this->foto, $this->analfabeto, | |
1661 | - $this->nm_pai, $this->nm_mae, $this->tipo_responsavel); | |
1662 | - | |
1663 | - if ($this->ref_idpes) { | |
1664 | - if ($obj->existePessoa()) { | |
1665 | - $obj->edita(); | |
1666 | - } | |
1667 | - else { | |
1668 | - $obj->cadastra(); | |
1669 | - } | |
1670 | - } | |
1671 | - } | |
1672 | - | |
1673 | - // Atualiza a informação de uso de transporte escolar. | |
1674 | - $this->_cadastraTransporte($this->cod_aluno, $this->transporte_aluno, | |
1675 | - $this->transporte_responsavel, $this->pessoa_logada); | |
1676 | - | |
1677 | - $this->simpleRedirect('educar_aluno_det.php?cod_aluno=' . $this->cod_aluno); | |
1678 | - } | |
1679 | - | |
1680 | - function Editar() | |
1681 | - { | |
1682 | - $this->Novo(); | |
1683 | - } | |
1684 | - | |
1685 | - function Excluir() | |
1686 | - { | |
1687 | - $obj = new clsPmieducarAluno($this->cod_aluno, $this->ref_cod_aluno_beneficio, | |
1688 | - $this->ref_cod_religiao, $this->pessoa_logada, $this->pessoa_logada, | |
1689 | - $this->ref_idpes, $this->data_cadastro, $this->data_exclusao, 0); | |
1690 | - | |
1691 | - $excluiu = $obj->excluir(); | |
1692 | - | |
1693 | - if ($excluiu) { | |
1694 | - $this->mensagem .= "Exclusão efetuada com sucesso.<br>"; | |
1695 | - $this->simpleRedirect('educar_aluno_lst.php'); | |
1696 | - } | |
1697 | - | |
1698 | - $this->mensagem = "Exclusão não realizada.<br>"; | |
1699 | - | |
1700 | - return false; | |
1701 | - } | |
1702 | - | |
1703 | - function geraFotos($fotoOriginal) | |
1704 | - { | |
1705 | - if (!file_exists($fotoOriginal)) { | |
1706 | - return; | |
1707 | - } | |
1708 | - | |
1709 | - list($imagewidth, $imageheight, $img_type) = @GetImageSize($fotoOriginal); | |
1710 | - $src_img_original = ''; | |
1711 | - | |
1712 | - $fim_largura = $imagewidth; | |
1713 | - $fim_altura = $imageheight; | |
1714 | - | |
1715 | - $extensao = $img_type == 2 ? '.jpg' : (($img_type == 3) ? '.png' : ''); | |
1716 | - | |
1717 | - $nome_do_arquivo = array_pop(explode('/', $fotoOriginal)) . $extensao; | |
1718 | - $caminhoDaBig = 'arquivos/educar/aluno/big/' . $nome_do_arquivo; | |
1719 | - $caminhoDaFotoOriginal = 'arquivos/educar/aluno/original/' . $nome_do_arquivo; | |
1720 | - | |
1721 | - if ($imagewidth > 700) { | |
1722 | - $new_w = 700; | |
1723 | - $ratio = ($imagewidth / $new_w); | |
1724 | - $new_h = ceil($imageheight / $ratio); | |
1725 | - | |
1726 | - $fim_largura = $new_w; | |
1727 | - $fim_altura = $new_h; | |
1728 | - | |
1729 | - if (!file_exists($caminhoDaBig)) { | |
1730 | - if ($img_type == 2) { | |
1731 | - $src_img_original = @imagecreatefromjpeg($fotoOriginal); | |
1732 | - $dst_img = @imagecreatetruecolor($new_w, $new_h); | |
1733 | - imagecopyresized($dst_img, $src_img_original, 0, 0, 0, 0, $new_w, | |
1734 | - $new_h, imagesx($src_img_original), imagesy($src_img_original)); | |
1735 | - imagejpeg($dst_img, $caminhoDaBig); | |
1736 | - } | |
1737 | - elseif ($img_type == 3) { | |
1738 | - $src_img_original = @ImageCreateFrompng($fotoOriginal); | |
1739 | - | |
1740 | - $dst_img = @imagecreatetruecolor($new_w,$new_h); | |
1741 | - ImageCopyResized($dst_img,$src_img_original, 0, 0, 0, 0, $new_w, | |
1742 | - $new_h, ImageSX($src_img_original), ImageSY($src_img_original)); | |
1743 | - Imagepng($dst_img, $caminhoDaBig); | |
1744 | - } | |
1745 | - } | |
1746 | - } | |
1747 | - else { | |
1748 | - if (!file_exists($caminhoDaBig)) { | |
1749 | - copy($fotoOriginal, $caminhoDaBig); | |
1750 | - | |
1751 | - if ($img_type == 2) { | |
1752 | - $src_img_original = @imagecreatefromjpeg($fotoOriginal); | |
1753 | - } | |
1754 | - elseif ($img_type == 3) { | |
1755 | - $src_img_original = @imagecreatefrompng($fotoOriginal); | |
1756 | - } | |
1757 | - } | |
1758 | - } | |
1759 | - | |
1760 | - $new_w = 100; | |
1761 | - $ratio = ($imagewidth / $new_w); | |
1762 | - $new_h = round($imageheight / $ratio); | |
1763 | - | |
1764 | - $caminhoDaSmall = 'arquivos/educar/aluno/small/' . $nome_do_arquivo; | |
1765 | - | |
1766 | - if (file_exists($caminhoDaBig)) { | |
1767 | - if ($img_type == 2) { | |
1768 | - $dst_img = @imagecreatetruecolor($new_w, $new_h); | |
1769 | - @imagecopyresized($dst_img, $src_img_original, 0, 0, 0, 0, $new_w, | |
1770 | - $new_h, imagesx($src_img_original), imagesy($src_img_original)); | |
1771 | - | |
1772 | - @imagejpeg($dst_img, $caminhoDaSmall); | |
1773 | - } | |
1774 | - elseif ($img_type == 3) { | |
1775 | - $dst_img = @imagecreatetruecolor($new_w,$new_h); | |
1776 | - @imageCopyResized($dst_img, $src_img_original, 0, 0, 0, 0, $new_w, $new_h, | |
1777 | - ImageSX($src_img_original), imageSY($src_img_original)); | |
1778 | - | |
1779 | - @imagepng($dst_img, $caminhoDaSmall); | |
1780 | - } | |
1781 | - elseif ($img_type == 1) { | |
1782 | - $dst_img=@imagecreatefromgif($src_img_original); | |
1783 | - @imageCopyResized($dst_img, $src_img_original, 0, 0, 0, 0, $new_w, | |
1784 | - $new_h, ImageSX($src_img_original), imageSY($src_img_original)); | |
1785 | - | |
1786 | - @imagegif($dst_img, $caminhoDaSmall); | |
1787 | - } | |
1788 | - } | |
1789 | - | |
1790 | - copy($fotoOriginal, $caminhoDaFotoOriginal); | |
1791 | - if (! (file_exists($fotoOriginal) && file_exists($caminhoDaSmall) && | |
1792 | - file_exists($caminhoDaBig))) { | |
1793 | - die( "<center><br>Um erro ocorreu ao inserir a foto.<br>Por favor tente novamente.</center>" ); | |
1794 | - } | |
1795 | - | |
1796 | - if(file_exists($fotoOriginal)) { | |
1797 | - unlink($fotoOriginal); | |
1798 | - } | |
1799 | - | |
1800 | - return $nome_do_arquivo; | |
1801 | - } | |
1802 | - | |
1803 | - /** | |
1804 | - * Cadastra ou atualiza a informação de uso de transporte escolar. | |
1805 | - * | |
1806 | - * @access protected | |
1807 | - * @param int $codAluno Código do aluno | |
1808 | - * @param bool $transporte [Opcional] TRUE para cadastrar/atualizar e FALSE | |
1809 | - * para remover a informação de uso de transporte escolar | |
1810 | - * @param int $responsavel [Opcional] Código do responsável pelo transporte | |
1811 | - * escolar, valor mapeado para o enum Transporte_Model_Responsavel. Apenas | |
1812 | - * obrigatório caso $transporte = TRUE | |
1813 | - * @param int $user Código do usuário a alterar o registroo | |
1814 | - * @return bool TRUE caso tenha criado/editado/apagado o registro com sucesso | |
1815 | - * @since Método disponível desde a versão 1.2.0 | |
1816 | - */ | |
1817 | - function _cadastraTransporte($codAluno, $transporte = TRUE, $responsavel = NULL, | |
1818 | - $user) | |
1819 | - { | |
1820 | - $data = array( | |
1821 | - 'aluno' => $codAluno, | |
1822 | - 'responsavel' => $responsavel, | |
1823 | - 'user' => $user, | |
1824 | - 'created_at' => 'NOW()' | |
1825 | - ); | |
1826 | - | |
1827 | - $transporteMapper = new Transporte_Model_AlunoDataMapper(); | |
1828 | - | |
1829 | - if ($transporte) { | |
1830 | - if (is_null($responsavel)) { | |
1831 | - return FALSE; | |
1832 | - } | |
1833 | - | |
1834 | - try { | |
1835 | - $transporteMapper->find(array('aluno' => $codAluno)); | |
1836 | - } | |
1837 | - catch (Exception $e) { | |
1838 | - $transporteMapper->save( | |
1839 | - $transporteMapper->createNewEntityInstance($data) | |
1840 | - ); | |
1841 | - } | |
1842 | - } | |
1843 | - else { | |
1844 | - $transporteMapper->delete(array('aluno' => $codAluno)); | |
1845 | - } | |
1846 | - | |
1847 | - return TRUE; | |
1848 | - } | |
1849 | -} | |
1850 | - | |
1851 | -// Instancia objeto de página | |
1852 | -$pagina = new clsIndexBase(); | |
1853 | - | |
1854 | -// Instancia objeto de conteúdo | |
1855 | -$miolo = new indice(); | |
1856 | - | |
1857 | -// Atribui o conteúdo à página | |
1858 | -$pagina->addForm($miolo); | |
1859 | - | |
1860 | -// Gera o código HTML | |
1861 | -$pagina->MakeAll(); | |
1862 | -?> | |
1863 | -<script type="text/javascript"> | |
1864 | - var campos = document.getElementsByName('tipo_responsavel'); | |
1865 | - | |
1866 | - for(var i = 1; i < campos.length; i++) { | |
1867 | - campos[i].onclick = function() { | |
1868 | - analizador(); | |
1869 | - } | |
1870 | - } | |
1871 | - | |
1872 | - function analizador() | |
1873 | - { | |
1874 | - var id_check = 0; | |
1875 | - for(var i = 1; i < campos.length; i++) { | |
1876 | - if(campos[i].checked) | |
1877 | - { | |
1878 | - switch(campos[i].value) { | |
1879 | - case 'p': | |
1880 | - id_check = 1; | |
1881 | - if (!campo_pai.value) { | |
1882 | - alert("Preencha o campo 'Nome do Pai' para poder seleciona-lo!"); | |
1883 | - campo_pai.focus(); | |
1884 | - id_check = 0; | |
1885 | - } | |
1886 | - break; | |
1887 | - | |
1888 | - case 'm': | |
1889 | - id_check = 2; | |
1890 | - if (!campo_mae.value) { | |
1891 | - alert("Preencha o campo 'Nome da Mãe' para poder seleciona-lo!"); | |
1892 | - campo_mae.focus(); | |
1893 | - id_check = 0; | |
1894 | - } | |
1895 | - break; | |
1896 | - | |
1897 | - case 'r': | |
1898 | - id_check = 3; | |
1899 | - if (!campo_resp.value) { | |
1900 | - alert("Preencha o campo 'Responsável' para poder seleciona-lo!"); | |
1901 | - campo_resp.focus(); | |
1902 | - id_check = 0; | |
1903 | - } | |
1904 | - break; | |
1905 | - } | |
1906 | - } | |
1907 | - } | |
1908 | - | |
1909 | - if (id_check) { | |
1910 | - campos[id_check].checked = true; | |
1911 | - } | |
1912 | - else { | |
1913 | - analizador2(); | |
1914 | - } | |
1915 | - } | |
1916 | - | |
1917 | - var campo_pai = $('nm_pai'); | |
1918 | - campo_pai.onkeyup = function() | |
1919 | - { | |
1920 | - if(campo_pai.value) { | |
1921 | - campos[1].checked = true; | |
1922 | - } | |
1923 | - else { | |
1924 | - analizador2(); | |
1925 | - } | |
1926 | - } | |
1927 | - | |
1928 | - var campo_mae = $('nm_mae'); | |
1929 | - campo_mae.onkeyup = function() | |
1930 | - { | |
1931 | - if (campo_pai.value) { | |
1932 | - campos[1].checked = true; | |
1933 | - return; | |
1934 | - } | |
1935 | - if (campo_mae.value) { | |
1936 | - campos[2].checked = true; | |
1937 | - } | |
1938 | - else { | |
1939 | - analizador2(); | |
1940 | - } | |
1941 | - } | |
1942 | - | |
1943 | - var campo_resp = $('ref_idpes_responsavel'); | |
1944 | - campo_resp.onchange = function() | |
1945 | - { | |
1946 | - if (campo_resp.value) { | |
1947 | - campos[3].checked = true; | |
1948 | - } | |
1949 | - else if(campo_mae.value) { | |
1950 | - campos[2].checked = true; | |
1951 | - return; | |
1952 | - } | |
1953 | - else { | |
1954 | - analizador2(); | |
1955 | - } | |
1956 | - } | |
1957 | - | |
1958 | - function analizador2() | |
1959 | - { | |
1960 | - var id_check = 0; | |
1961 | - | |
1962 | - if (campo_pai.value) { | |
1963 | - campo_pai.onkeyup(); | |
1964 | - } | |
1965 | - else if(campo_mae.value) { | |
1966 | - campo_mae.onkeyup(); | |
1967 | - } | |
1968 | - else if(campo_resp.value) { | |
1969 | - campo_resp.onchange(); | |
1970 | - } | |
1971 | - else { | |
1972 | - campos[0].checked = true; | |
1973 | - } | |
1974 | - } | |
1975 | - | |
1976 | - var cor_fundo; | |
1977 | - function adicionaDeficiencia() | |
1978 | - { | |
1979 | - if ($F('ref_cod_pessoa_deficiencia') == '') { | |
1980 | - alert('Selecione uma deficiência para adicionar'); | |
1981 | - } | |
1982 | - else { | |
1983 | - var tabela = $('tabela_deficiencia'); | |
1984 | - var cod_deficiencia; | |
1985 | - var nm_deficiencia; | |
1986 | - | |
1987 | - cod_deficiencia = $F('ref_cod_pessoa_deficiencia'); | |
1988 | - nm_deficiencia = $('ref_cod_pessoa_deficiencia').options[$('ref_cod_pessoa_deficiencia').selectedIndex].text; | |
1989 | - | |
1990 | - if (!$('tr_'+cod_deficiencia)) { | |
1991 | - cor_fundo = cor_fundo == '#D1DADF' ? '#f5f9fd' : '#D1DADF'; | |
1992 | - var row = document.createElement('tr'); | |
1993 | - row.setAttribute('id', 'tr_'+cod_deficiencia); | |
1994 | - row.setAttribute('align', 'center'); | |
1995 | - row.style.backgroundColor = cor_fundo; | |
1996 | - | |
1997 | - var cell1 = document.createElement('td'); | |
1998 | - cell1.setAttribute('align', 'right'); | |
1999 | - cell1.setAttribute('style', 'padding-right:10px;'); | |
2000 | - | |
2001 | - var cell2 = document.createElement('td'); | |
2002 | - | |
2003 | - var img = "<img border='0' title='Excluir' src='imagens/banco_imagens/excluirrr.png' style='cursor:pointer' onclick='excluirLinhaDeficiencia(" + cod_deficiencia + ")'>"; | |
2004 | - | |
2005 | - var text = document.createTextNode(nm_deficiencia); | |
2006 | - | |
2007 | - cell1.innerHTML = img; | |
2008 | - cell2.appendChild(text); | |
2009 | - row.appendChild(cell2); | |
2010 | - row.appendChild(cell1); | |
2011 | - tabela.firstChild.appendChild(row); | |
2012 | - | |
2013 | - var area = document.getElementById('ocultos_defic'); | |
2014 | - var input = document.createElement('input'); | |
2015 | - input.setAttribute('type', 'hidden'); | |
2016 | - input.setAttribute('id', 'oc_defic['+cod_deficiencia+']'); | |
2017 | - input.setAttribute('name', 'oc_defic['+cod_deficiencia+']'); | |
2018 | - input.setAttribute('value', cod_deficiencia); | |
2019 | - area.appendChild(input); | |
2020 | - } | |
2021 | - else { | |
2022 | - alert('Deficiência já selecionada'); | |
2023 | - } | |
2024 | - } | |
2025 | - } | |
2026 | - | |
2027 | - function excluirLinhaDeficiencia(cod_deficiencia) | |
2028 | - { | |
2029 | - var cor = ''; | |
2030 | - var tabela = $('tabela_deficiencia').firstChild; | |
2031 | - var deficiencia = 'tr_'+cod_deficiencia; | |
2032 | - | |
2033 | - for(var i=0; i<tabela.childNodes.length; i++) { | |
2034 | - if (tabela.childNodes[i]) { | |
2035 | - if(tabela.childNodes[i].id == deficiencia) { | |
2036 | - cor = tabela.childNodes[i].bgColor; | |
2037 | - tabela.removeChild(tabela.childNodes[i]); | |
2038 | - } | |
2039 | - | |
2040 | - if(cor != '' && tabela.childNodes[i] && tabela.childNodes[i].tagName == 'TR') { | |
2041 | - tabela.childNodes[i].bgColor = cor; | |
2042 | - cor = (cor == '#d1dadf') ? '#f5f9fd' : '#d1dadf'; | |
2043 | - } | |
2044 | - } | |
2045 | - } | |
2046 | - | |
2047 | - var area = document.getElementById('ocultos_defic'); | |
2048 | - deficiencia = 'oc_defic['+cod_deficiencia+']'; | |
2049 | - | |
2050 | - for (var i = 0; i < area.childNodes.length; i++) { | |
2051 | - if (area.childNodes[i]) { | |
2052 | - if (area.childNodes[i].id == deficiencia) { | |
2053 | - area.removeChild(area.childNodes[i]); | |
2054 | - var areaExc = document.getElementById('ocultos_defic'); | |
2055 | - var inputExc = document.createElement('input'); | |
2056 | - inputExc.setAttribute('type', 'hidden'); | |
2057 | - inputExc.setAttribute('id', 'oc_defic_exc['+cod_deficiencia+']'); | |
2058 | - inputExc.setAttribute('name', 'oc_defic_exc['+cod_deficiencia+']'); | |
2059 | - inputExc.setAttribute('value', cod_deficiencia); | |
2060 | - areaExc.appendChild(inputExc); | |
2061 | - } | |
2062 | - } | |
2063 | - } | |
2064 | - } | |
2065 | - | |
2066 | -<?php | |
2067 | -/** Javascript condicional */ | |
2068 | -if (!$_GET['cod_aluno']) { | |
2069 | -?> | |
2070 | - Event.observe(window, 'load', Init, false); | |
2071 | - | |
2072 | - function Init() | |
2073 | - { | |
2074 | - elemento = $$('div#content1 img'); | |
2075 | - elemento[1].setAttribute('onClick', 'bloqueia();'); | |
2076 | - $('btn_enviar').disabled = true; | |
2077 | - $('btn_enviar').className = 'botaolistagemdisabled'; | |
2078 | - } | |
2079 | - | |
2080 | - function passaPagina() | |
2081 | - { | |
2082 | - LTb0('0', '2'); | |
2083 | - } | |
2084 | - | |
2085 | - function bloqueia() | |
2086 | - { | |
2087 | - if (($F('cpf_') != '' && $F('cpf') == '' && $F('bloqueado') == 1) || | |
2088 | - $F('cpf_') != $F('cpf_2') | |
2089 | - ) { | |
2090 | - $('btn_enviar').disabled = false; | |
2091 | - $('btn_enviar').className = 'botaolistagemdisabled'; | |
2092 | - $('btn_enviar').value = 'Aguarde...'; | |
2093 | - var cpf = $('cpf_').value; | |
2094 | - var xml_dados_pessoa = new ajax(getDados); | |
2095 | - xml_dados_pessoa.envia('educar_aluno_cad_xml.php?cpf=' + cpf); | |
2096 | - } | |
2097 | - else if ($F('cpf') != '' || $F('bloqueado') == 0) { | |
2098 | - validaTab(1); | |
2099 | - LTb0('0', '2'); | |
2100 | - $('btn_enviar').disabled = false; | |
2101 | - $('btn_enviar').className = 'botaolistagem'; | |
2102 | - } | |
2103 | - else { | |
2104 | - alert('Você deve preencher o campo CPF'); | |
2105 | - } | |
2106 | - } | |
2107 | - | |
2108 | - function getDados(xml_dados) | |
2109 | - { | |
2110 | - var DOM_array = xml_dados.getElementsByTagName('dados'); | |
2111 | - | |
2112 | - if (DOM_array.length) { | |
2113 | - var elementos; | |
2114 | - | |
2115 | - for (var i = 1; i <5; i++) { | |
2116 | - elementos = $$('div#content' + i + ' input'); | |
2117 | - for (var j = 0; j < elementos.length; j++) { | |
2118 | - if (elementos[j].id != 'cpf' && elementos[j].id != 'cpf_') { | |
2119 | - elementos[j].value = ''; | |
2120 | - } | |
2121 | - } | |
2122 | - } | |
2123 | - | |
2124 | - var libera = false; | |
2125 | - | |
2126 | - for (var i = 0; i < DOM_array[0].childNodes.length; i++) { | |
2127 | - if (DOM_array[0].childNodes[i].nodeType == 1) { | |
2128 | - try { | |
2129 | - libera = true; | |
2130 | - if (DOM_array[0].childNodes[i].firstChild.nodeValue != '') | |
2131 | - document.getElementById(DOM_array[0].childNodes[i].nodeName).value = | |
2132 | - DOM_array[0].childNodes[i].firstChild.nodeValue; | |
2133 | - } | |
2134 | - catch(e) { | |
2135 | - continue; | |
2136 | - } | |
2137 | - } | |
2138 | - } | |
2139 | - | |
2140 | - $('cpf_2').disabled = true; | |
2141 | - | |
2142 | - if (libera) { | |
2143 | - validaTab(1); | |
2144 | - LTb0('0', '2'); | |
2145 | - $('btn_enviar').disabled = false; | |
2146 | - $('bloqueado').value = 0; | |
2147 | - $('btn_enviar').className = 'botaolistagem'; | |
2148 | - } | |
2149 | - else { | |
2150 | - validaTab(1); | |
2151 | - LTb0('0', '2'); | |
2152 | - $('btn_enviar').disabled = false; | |
2153 | - $('bloqueado').value = 0; | |
2154 | - $('btn_enviar').className = 'botaolistagem'; | |
2155 | - $('cpf_2').value = $F('cpf_'); | |
2156 | - } | |
2157 | - | |
2158 | - $('btn_enviar').value = 'Salvar'; | |
2159 | - } | |
2160 | - | |
2161 | - $('btn_enviar').value = 'Salvar'; | |
2162 | - } | |
2163 | -<?php | |
2164 | -} | |
2165 | -/** Javascript condicional */ | |
2166 | -?> | |
2167 | -Event.observe(window, 'load', transporteResponsavel, false); | |
2168 | - | |
2169 | -function transporteResponsavel() | |
2170 | -{ | |
2171 | - obj1 = document.getElementById('transporte_aluno'); | |
2172 | - obj2 = document.getElementById('transporte_responsavel'); | |
2173 | - | |
2174 | - if (obj1.value == 1) { | |
2175 | - obj2.disabled = false; | |
2176 | - } | |
2177 | - else { | |
2178 | - obj2.disabled = true; | |
2179 | - } | |
2180 | -} | |
2181 | -</script> |
ieducar/intranet/educar_pesquisa_aluno_lst.php
... | ... | @@ -1,197 +0,0 @@ |
1 | -<?php | |
2 | - | |
3 | - | |
4 | -use Illuminate\Support\Facades\Session; | |
5 | - | |
6 | -require_once ("include/clsBase.inc.php"); | |
7 | -require_once ("include/clsListagem.inc.php"); | |
8 | -require_once ("include/clsBanco.inc.php"); | |
9 | -require_once( "include/pmieducar/geral.inc.php" ); | |
10 | - | |
11 | -class clsIndexBase extends clsBase | |
12 | -{ | |
13 | - function Formular() | |
14 | - { | |
15 | - $this->SetTitulo( "{$this->_instituicao} i-Educar - Pesquisa Aluno" ); | |
16 | - $this->processoAp = "578"; | |
17 | - $this->renderBanner = false; | |
18 | - $this->renderMenu = false; | |
19 | - $this->renderMenuSuspenso = false; | |
20 | - } | |
21 | -} | |
22 | - | |
23 | -class indice extends clsListagem | |
24 | -{ | |
25 | - /** | |
26 | - * Referencia pega da session para o idpes do usuario atual | |
27 | - * | |
28 | - * @var int | |
29 | - */ | |
30 | - var $pessoa_logada; | |
31 | - | |
32 | - /** | |
33 | - * Titulo no topo da pagina | |
34 | - * | |
35 | - * @var int | |
36 | - */ | |
37 | - var $titulo; | |
38 | - | |
39 | - /** | |
40 | - * Quantidade de registros a ser apresentada em cada pagina | |
41 | - * | |
42 | - * @var int | |
43 | - */ | |
44 | - var $limite; | |
45 | - | |
46 | - /** | |
47 | - * Inicio dos registros a serem exibidos (limit) | |
48 | - * | |
49 | - * @var int | |
50 | - */ | |
51 | - var $offset; | |
52 | - | |
53 | - //var $cod_aluno; | |
54 | - //var $ref_idpes_responsavel; | |
55 | - /*var $ref_cod_pessoa_educ; | |
56 | - var $ref_cod_aluno_beneficio; | |
57 | - var $ref_cod_religiao; | |
58 | - var $ref_usuario_exc; | |
59 | - var $ref_usuario_cad; | |
60 | - var $ref_idpes; | |
61 | - var $data_cadastro; | |
62 | - var $data_exclusao; | |
63 | - var $ativo; | |
64 | - */ | |
65 | - | |
66 | - var $nome_aluno; | |
67 | - var $cpf_aluno; | |
68 | - var $nome_responsavel; | |
69 | - var $cpf_responsavel; | |
70 | - function Gerar() | |
71 | - { | |
72 | - Session::put('campo1', $_GET["campo1"] ?? Session::get('campo1')); | |
73 | - Session::put('campo3', $_GET["campo3"] ?? Session::get('campo3')); | |
74 | - Session::put('campo4', $_GET["campo4"] ?? Session::get('campo4')); | |
75 | - Session::save(); | |
76 | - Session::start(); | |
77 | - | |
78 | - $this->titulo = "Aluno - Listagem"; | |
79 | - | |
80 | - // passa todos os valores obtidos no GET para atributos do objeto | |
81 | - foreach( $_GET AS $var => $val ){ | |
82 | - $this->$var = ( $val === "" ) ? null: $val; | |
83 | - | |
84 | - } | |
85 | - | |
86 | - $this->addCabecalhos( array( | |
87 | - "Nome", | |
88 | - "CPF", | |
89 | - "Nome Responsável", | |
90 | - "CPF Responsável" | |
91 | - ) ); | |
92 | - | |
93 | - | |
94 | - $this->campoTexto("nome_aluno","Nome do Aluno",$this->nome_aluno,20,255,false); | |
95 | - $this->campoCpf("cpf_aluno","CPF do Aluno",$this->cpf_aluno,false); | |
96 | - $this->campoTexto("nome_responsavel","Nome do Responsável",$this->nome_responsavel,20,false); | |
97 | - $this->campoCpf("cpf_responsavel","CPF do Responsável",$this->cpf_responsavel,false); | |
98 | - | |
99 | - // Paginador | |
100 | - $this->limite = 10; | |
101 | - $this->offset = ( $_GET["pagina_{$this->nome}"] ) ? $_GET["pagina_{$this->nome}"]*$this->limite-$this->limite: 0; | |
102 | - | |
103 | - | |
104 | - $obj_aluno = new clsPmieducarAlunoCMF(); | |
105 | - $obj_aluno->setLimite( $this->limite, $this->offset ); | |
106 | - $lista_aluno = $obj_aluno->lista($this->nome_aluno,idFederal2int($this->cpf_aluno),$this->nome_responsavel,idFederal2int($this->cpf_responsavel)); | |
107 | - $total = $obj_aluno->_total; | |
108 | - | |
109 | - if($lista_aluno) | |
110 | - { | |
111 | - foreach ($lista_aluno as $registro) | |
112 | - { | |
113 | - if($registro["cpf_aluno"]) | |
114 | - $registro["cpf_aluno_"] = int2CPF($registro["cpf_aluno"]); | |
115 | - | |
116 | - if($registro["cpf_responsavel"]) | |
117 | - $registro["cpf_responsavel_"] = int2CPF($registro["cpf_responsavel"]); | |
118 | - | |
119 | - $campo1 = Session::get('campo1'); | |
120 | - $campo3 = Session::get('campo3'); | |
121 | - $campo4 = Session::get('campo4'); | |
122 | - $script = " onclick=\"addVal1('{$campo3}','{$registro['cpf_aluno']}'); addVal1('{$campo1}','{$registro['cod_aluno']}'); addVal1('{$campo4}','{$registro['cpf_aluno_']}'); fecha();\""; | |
123 | - $obj_det = ""; | |
124 | - $obj_cpf_det = ""; | |
125 | - if($registro["idpes_responsavel"]) | |
126 | - { | |
127 | - $obj_resp = new clsPessoa_($registro["idpes_responsavel"]); | |
128 | - $obj_det = $obj_resp->detalhe(); | |
129 | - | |
130 | - $obj_cpf = new clsFisica($registro["idpes_responsavel"]); | |
131 | - $obj_cpf_det = $obj_cpf->detalhe(); | |
132 | - if($obj_cpf_det["cpf"]) | |
133 | - $obj_cpf_det["cpf"] = int2IdFederal($obj_cpf_det["cpf"]); | |
134 | - } | |
135 | - $this->addLinhas( array( | |
136 | - "<a href=\"javascript:void( 0 );\" $script>{$registro["nome_aluno"]}</a>", | |
137 | - "<a href=\"javascript:void( 0 );\" $script>{$registro["cpf_aluno_"]}</a>", | |
138 | - "<a href=\"javascript:void( 0 );\" $script>{$obj_det["nome"]}</a>", | |
139 | - "<a href=\"javascript:void( 0 );\" $script>{$obj_cpf_det["cpf"]}</a>" | |
140 | - ) ); | |
141 | - } | |
142 | - | |
143 | - } | |
144 | - | |
145 | - $this->addPaginador2( "educar_pesquisa_aluno_lst.php", $total, $_GET, $this->nome, $this->limite ); | |
146 | - | |
147 | - //verifica se foi realizado pesquisa | |
148 | - if(isset($_GET["nome_aluno"]) || isset($_GET["nome_responsavel"]) || isset($_GET["cpf_aluno"]) || isset($_GET["cpf_responsavel"]) ) | |
149 | - $ok = true; | |
150 | - | |
151 | - //** Verificacao de permissao para cadastro | |
152 | - $obj_permissao = new clsPermissoes(); | |
153 | - | |
154 | - if($obj_permissao->permissao_cadastra(578, $this->pessoa_logada,7) && $ok) | |
155 | - { | |
156 | - $this->acao = "window.parent.document.getElementById(\"cpf_\").disabled = true; window.parent.document.getElementById(\"ref_idpes\").value = \"\"; window.parent.document.getElementById(\"cpf_\").value = \"\";fecha();"; | |
157 | - //$this->acao = "window.parent.document.getElementById(\"cpf_\").disabled = false; window.parent.fechaExpansivel(\"div_dinamico_\"+(parent.DOM_divs.length*1-1));"; | |
158 | - $this->nome_acao = "Novo"; | |
159 | - } | |
160 | - //** | |
161 | - $this->largura = "100%"; | |
162 | - } | |
163 | -} | |
164 | -// cria uma extensao da classe base | |
165 | -$pagina = new clsIndexBase(); | |
166 | -// cria o conteudo | |
167 | -$miolo = new indice(); | |
168 | -// adiciona o conteudo na clsBase | |
169 | -$pagina->addForm( $miolo ); | |
170 | -// gera o html | |
171 | -$pagina->MakeAll(); | |
172 | -?> | |
173 | -<script> | |
174 | -function addSel1( campo, valor, texto ) | |
175 | -{ | |
176 | - obj = window.parent.document.getElementById( campo ); | |
177 | - novoIndice = obj.options.length; | |
178 | - obj.options[novoIndice] = new Option( texto ); | |
179 | - opcao = obj.options[novoIndice]; | |
180 | - opcao.value = valor; | |
181 | - opcao.selected = true; | |
182 | - setTimeout( "obj.onchange", 100 ); | |
183 | -} | |
184 | - | |
185 | -function addVal1( campo,valor ) | |
186 | -{ | |
187 | - | |
188 | - obj = window.parent.document.getElementById( campo ); | |
189 | - obj.value = valor; | |
190 | -} | |
191 | - | |
192 | -function fecha() | |
193 | -{ | |
194 | - window.parent.fechaExpansivel('div_dinamico_'+(parent.DOM_divs.length*1-1)); | |
195 | - window.parent.document.forms[0].submit(); | |
196 | -} | |
197 | -</script> |
ieducar/intranet/educar_pesquisa_aluno_lst2.php
... | ... | @@ -1,246 +0,0 @@ |
1 | -<?php | |
2 | - | |
3 | -require_once ("include/clsBase.inc.php"); | |
4 | -require_once ("include/clsListagem.inc.php"); | |
5 | -require_once ("include/clsBanco.inc.php"); | |
6 | -require_once( "include/pmieducar/geral.inc.php" ); | |
7 | - | |
8 | -class clsIndexBase extends clsBase | |
9 | -{ | |
10 | - function Formular() | |
11 | - { | |
12 | - $this->SetTitulo( "{$this->_instituicao} i-Educar - Pesquisa Aluno" ); | |
13 | - $this->processoAp = "578"; | |
14 | - $this->renderBanner = false; | |
15 | - $this->renderMenu = false; | |
16 | - $this->renderMenuSuspenso = false; | |
17 | - } | |
18 | -} | |
19 | - | |
20 | -class indice extends clsListagem | |
21 | -{ | |
22 | - /** | |
23 | - * Referencia pega da session para o idpes do usuario atual | |
24 | - * | |
25 | - * @var int | |
26 | - */ | |
27 | - var $pessoa_logada; | |
28 | - | |
29 | - /** | |
30 | - * Titulo no topo da pagina | |
31 | - * | |
32 | - * @var int | |
33 | - */ | |
34 | - var $titulo; | |
35 | - | |
36 | - /** | |
37 | - * Quantidade de registros a ser apresentada em cada pagina | |
38 | - * | |
39 | - * @var int | |
40 | - */ | |
41 | - var $limite; | |
42 | - | |
43 | - /** | |
44 | - * Inicio dos registros a serem exibidos (limit) | |
45 | - * | |
46 | - * @var int | |
47 | - */ | |
48 | - var $offset; | |
49 | - | |
50 | - //var $cod_aluno; | |
51 | - //var $ref_idpes_responsavel; | |
52 | - /*var $ref_cod_pessoa_educ; | |
53 | - var $ref_cod_aluno_beneficio; | |
54 | - var $ref_cod_religiao; | |
55 | - var $ref_usuario_exc; | |
56 | - var $ref_usuario_cad; | |
57 | - var $ref_idpes; | |
58 | - var $data_cadastro; | |
59 | - var $data_exclusao; | |
60 | - var $ativo; | |
61 | - */ | |
62 | - | |
63 | - var $nome_aluno; | |
64 | - var $cpf_aluno; | |
65 | - var $nome_responsavel; | |
66 | - var $cpf_responsavel; | |
67 | - | |
68 | - var $campo1; | |
69 | - var $campo3; | |
70 | - var $campo4; | |
71 | - | |
72 | - function Gerar() | |
73 | - { | |
74 | - $this->titulo = "Aluno - Listagem"; | |
75 | - | |
76 | - // passa todos os valores obtidos no GET para atributos do objeto | |
77 | - foreach( $_GET AS $var => $val ){ | |
78 | - $this->$var = ( $val === "" ) ? null: $val; | |
79 | - | |
80 | - } | |
81 | - | |
82 | - $this->addCabecalhos( array( | |
83 | - "Nome", | |
84 | - "CPF", | |
85 | - "Nome Responsável", | |
86 | - "CPF Responsável" | |
87 | - ) ); | |
88 | - | |
89 | - $this->campoOculto("campo1", $this->campo1); | |
90 | - $this->campoOculto("campo3", $this->campo3); | |
91 | - $this->campoOculto("campo4", $this->campo4); | |
92 | - | |
93 | - $this->campoTexto("nome_aluno","Nome do Aluno",$this->nome_aluno,20,255,false); | |
94 | - $this->campoCpf("cpf_aluno","CPF do Aluno",$this->cpf_aluno,false); | |
95 | - $this->campoTexto("nome_responsavel","Nome do Responsável",$this->nome_responsavel,20,false); | |
96 | - $this->campoCpf("cpf_responsavel","CPF do Responsável",$this->cpf_responsavel,false); | |
97 | - | |
98 | - // Paginador | |
99 | - $this->limite = 10; | |
100 | - $this->offset = ( $_GET["pagina_{$this->nome}"] ) ? $_GET["pagina_{$this->nome}"]*$this->limite-$this->limite: 0; | |
101 | - | |
102 | - $obj_aluno = new clsPmieducarAlunoCMF(); | |
103 | - $obj_aluno->setLimite( $this->limite, $this->offset ); | |
104 | - $lista_aluno = $obj_aluno->lista($this->nome_aluno,idFederal2int($this->cpf_aluno),$this->nome_responsavel,idFederal2int($this->cpf_responsavel)); | |
105 | - $total = $obj_aluno->_total; | |
106 | - | |
107 | - if($lista_aluno) | |
108 | - { | |
109 | - foreach ($lista_aluno as $registro) | |
110 | - { | |
111 | - if($registro["cpf_aluno"]) | |
112 | - $registro["cpf_aluno_"] = int2CPF($registro["cpf_aluno"]); | |
113 | - | |
114 | - if($registro["cpf_responsavel"]) | |
115 | - $registro["cpf_responsavel_"] = int2CPF($registro["cpf_responsavel"]); | |
116 | - $script = " onclick=\"addVal1('{$this->campo3}','{$registro['cpf_aluno']}'); addVal1('{$this->campo1}','{$registro['cod_aluno']}'); addVal1('{$this->campo4}','{$registro['cpf_aluno_']}'); fecha();\""; | |
117 | - $obj_det = ""; | |
118 | - $obj_cpf_det = ""; | |
119 | - if($registro["idpes_responsavel"]) | |
120 | - { | |
121 | - $obj_resp = new clsPessoa_($registro["idpes_responsavel"]); | |
122 | - $obj_det = $obj_resp->detalhe(); | |
123 | - | |
124 | - $obj_cpf = new clsFisica($registro["idpes_responsavel"]); | |
125 | - $obj_cpf_det = $obj_cpf->detalhe(); | |
126 | - if($obj_cpf_det["cpf"]) | |
127 | - $obj_cpf_det["cpf"] = int2IdFederal($obj_cpf_det["cpf"]); | |
128 | - } | |
129 | - $this->addLinhas( array( | |
130 | - "<a href=\"javascript:void( 0 );\" $script>{$registro["nome_aluno"]}</a>", | |
131 | - "<a href=\"javascript:void( 0 );\" $script>{$registro["cpf_aluno_"]}</a>", | |
132 | - "<a href=\"javascript:void( 0 );\" $script>{$obj_det["nome"]}</a>", | |
133 | - "<a href=\"javascript:void( 0 );\" $script>{$obj_cpf_det["cpf"]}</a>" | |
134 | - ) ); | |
135 | - } | |
136 | - | |
137 | - } | |
138 | - | |
139 | - $this->addPaginador2( "educar_pesquisa_aluno_lst2.php", $total, $_GET, $this->nome, $this->limite ); | |
140 | - | |
141 | - //verifica se foi realizado pesquisa | |
142 | - if(isset($_GET["nome_aluno"]) || isset($_GET["nome_responsavel"]) || isset($_GET["cpf_aluno"]) || isset($_GET["cpf_responsavel"]) ) | |
143 | - $ok = true; | |
144 | - | |
145 | - //** Verificacao de permissao para cadastro | |
146 | - $obj_permissao = new clsPermissoes(); | |
147 | - | |
148 | - if($obj_permissao->permissao_cadastra(578, $this->pessoa_logada,7) && $ok) | |
149 | - { | |
150 | - $this->acao = "window.parent.document.getElementById(\"cpf_\").disabled = true; | |
151 | - window.parent.document.getElementById(\"cpf_\").value = \"\"; | |
152 | - window.parent.document.getElementById(\"cpf_2\").disabled = true; | |
153 | - window.parent.document.getElementById(\"cpf_2\").value = \"\"; | |
154 | - window.parent.document.getElementById(\"ref_idpes\").value = \"\"; | |
155 | - window.parent.document.getElementById(\"cpf\").value = \"\"; | |
156 | - window.parent.document.getElementById(\"cpf\").disabled = true; | |
157 | - window.parent.document.getElementById(\"cpf\").value = \"\"; | |
158 | - window.parent.document.getElementById(\"bloqueado\").value = \"0\"; | |
159 | - window.parent.passaPagina(); | |
160 | - fecha1();"; | |
161 | - $this->nome_acao = "Novo"; | |
162 | - } | |
163 | - //** | |
164 | - $this->largura = "100%"; | |
165 | - } | |
166 | -} | |
167 | -// cria uma extensao da classe base | |
168 | -$pagina = new clsIndexBase(); | |
169 | -// cria o conteudo | |
170 | -$miolo = new indice(); | |
171 | -// adiciona o conteudo na clsBase | |
172 | -$pagina->addForm( $miolo ); | |
173 | -// gera o html | |
174 | -$pagina->MakeAll(); | |
175 | -?> | |
176 | -<script> | |
177 | -function addSel1( campo, valor, texto ) | |
178 | -{ | |
179 | - obj = window.parent.document.getElementById( campo ); | |
180 | - novoIndice = obj.options.length; | |
181 | - obj.options[novoIndice] = new Option( texto ); | |
182 | - opcao = obj.options[novoIndice]; | |
183 | - opcao.value = valor; | |
184 | - opcao.selected = true; | |
185 | - setTimeout( "obj.onchange", 100 ); | |
186 | -} | |
187 | - | |
188 | -function addVal1( campo,valor ) | |
189 | -{ | |
190 | - | |
191 | - obj = window.parent.document.getElementById( campo ); | |
192 | - obj.value = valor; | |
193 | -} | |
194 | - | |
195 | -function getDados(xml_dados) | |
196 | -{ | |
197 | - var DOM_array = xml_dados.getElementsByTagName( 'dados' ); | |
198 | - if(DOM_array.length) | |
199 | - { | |
200 | -// var erro = ''; | |
201 | - var elementos; | |
202 | - for (var i = 1; i <5; i++) | |
203 | - { | |
204 | - elementos = window.parent.$$("div#content"+i+" input"); | |
205 | - for (var j = 0; j < elementos.length; j++) | |
206 | - { | |
207 | - if (elementos[j].id != "cpf" && elementos[j].id != "cpf_") | |
208 | - elementos[j].value = ''; | |
209 | - } | |
210 | - } | |
211 | - for (var i = 0; i < DOM_array[0].childNodes.length; i++) | |
212 | - { | |
213 | - if (DOM_array[0].childNodes[i].nodeType == 1) | |
214 | - { | |
215 | - try | |
216 | - { | |
217 | - if (DOM_array[0].childNodes[i].firstChild.nodeValue != '') | |
218 | - window.parent.document.getElementById(DOM_array[0].childNodes[i].nodeName).value = DOM_array[0].childNodes[i].firstChild.nodeValue; | |
219 | - } | |
220 | - catch(e) | |
221 | - { | |
222 | -// erro += DOM_array[0].childNodes[i].nodeName+"\n"; | |
223 | - continue; | |
224 | - } | |
225 | - } | |
226 | - } | |
227 | - window.parent.$('cpf_2').disabled = true; | |
228 | -// alert("ERROS: "+erro); | |
229 | - } | |
230 | - window.parent.fechaExpansivel('div_dinamico_'+(parent.DOM_divs.length*1-1)); | |
231 | -} | |
232 | - | |
233 | -function fecha() | |
234 | -{ | |
235 | - var cpf = window.parent.document.getElementById('cpf').value; | |
236 | - var idpes = window.parent.document.getElementById('ref_idpes').value; | |
237 | - var xml_dados_pessoa = new ajax(getDados); | |
238 | - xml_dados_pessoa.envia("educar_aluno_cad_xml.php?cpf="+cpf+"&idpes="+idpes); | |
239 | -} | |
240 | - | |
241 | -function fecha1() | |
242 | -{ | |
243 | - window.parent.fechaExpansivel('div_dinamico_'+(parent.DOM_divs.length*1-1)); | |
244 | -} | |
245 | - | |
246 | -</script> |
tests/Browser/legacy/intranet.txt
... | ... | @@ -43,7 +43,6 @@ educar_acervo_lst.php |
43 | 43 | educar_aluno_beneficio_cad.php |
44 | 44 | educar_aluno_beneficio_det.php |
45 | 45 | educar_aluno_beneficio_lst.php |
46 | -educar_aluno_cad.php | |
47 | 46 | educar_aluno_det.php |
48 | 47 | educar_aluno_lst.php |
49 | 48 | educar_alunos_defasados_nominal.php |
... | ... | @@ -244,8 +243,6 @@ educar_pagamento_multa_lst.php |
244 | 243 | educar_parecer_turma_cad.php |
245 | 244 | educar_pesquisa_acervo_lst.php |
246 | 245 | educar_pesquisa_aluno.php |
247 | -educar_pesquisa_aluno_lst.php | |
248 | -educar_pesquisa_aluno_lst2.php | |
249 | 246 | educar_pesquisa_cep_log_bairro.php |
250 | 247 | educar_pesquisa_cep_log_bairro2.php |
251 | 248 | educar_pesquisa_cliente_lst.php | ... | ... |