Commit 61d414458ae52c932cf396417aff474680173eb8

Authored by Eriksen Costa Paixão
1 parent 28892f8f
Exists in master

by Eriksen: Corrigido erro na query UPDATE do método Edita()

ieducar/intranet/include/pessoa/clsFisica.inc.php
1 <?php 1 <?php
2 -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
3 -* *  
4 -* @author Prefeitura Municipal de Itaja� *  
5 -* @updated 29/03/2007 *  
6 -* Pacote: i-PLB Software P�blico Livre e Brasileiro *  
7 -* *  
8 -* Copyright (C) 2006 PMI - Prefeitura Municipal de Itaja� *  
9 -* ctima@itajai.sc.gov.br *  
10 -* *  
11 -* Este programa � software livre, voc� pode redistribu�-lo e/ou *  
12 -* modific�-lo sob os termos da Licen�a P�blica Geral GNU, conforme *  
13 -* publicada pela Free Software Foundation, tanto a vers�o 2 da *  
14 -* Licen�a como (a seu crit�rio) qualquer vers�o mais nova. *  
15 -* *  
16 -* Este programa � distribu�do na expectativa de ser �til, mas SEM *  
17 -* QUALQUER GARANTIA. Sem mesmo a garantia impl�cita de COMERCIALI- *  
18 -* ZA��O ou de ADEQUA��O A QUALQUER PROP�SITO EM PARTICULAR. Con- *  
19 -* sulte a Licen�a P�blica Geral GNU para obter mais detalhes. *  
20 -* *  
21 -* Voc� deve ter recebido uma c�pia da Licen�a P�blica Geral GNU *  
22 -* junto com este programa. Se n�o, escreva para a Free Software *  
23 -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA *  
24 -* 02111-1307, USA. *  
25 -* *  
26 -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */  
27 -require_once ("include/clsBanco.inc.php");  
28 -require_once ("include/Geral.inc.php");  
29 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 +
  24 +require_once 'include/clsBanco.inc.php';
  25 +require_once 'include/Geral.inc.php';
  26 +
  27 +/**
  28 + * clsFisica class.
  29 + *
  30 + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br>
  31 + * @license http://creativecommons.org/licenses/GPL/2.0/legalcode.pt CC GNU GPL
  32 + * @package Core
  33 + * @subpackage pessoa
  34 + * @since Classe disponível desde a versão 1.0.0
  35 + * @version $Id$
  36 + */
30 class clsFisica 37 class clsFisica
31 { 38 {
32 var $idpes; 39 var $idpes;
@@ -158,7 +165,7 @@ class clsFisica @@ -158,7 +165,7 @@ class clsFisica
158 $this->ref_cod_religiao = $ref_cod_religiao; 165 $this->ref_cod_religiao = $ref_cod_religiao;
159 166
160 $cpf = idFederal2int($cpf); 167 $cpf = idFederal2int($cpf);
161 - 168 +
162 if(is_numeric($cpf)) 169 if(is_numeric($cpf))
163 { 170 {
164 $this->cpf = $cpf; 171 $this->cpf = $cpf;
@@ -445,24 +452,29 @@ class clsFisica @@ -445,24 +452,29 @@ class clsFisica
445 if($this->justificativa_provisorio) 452 if($this->justificativa_provisorio)
446 { 453 {
447 $set .= "$gruda justificativa_provisorio = '{$this->justificativa_provisorio}'"; 454 $set .= "$gruda justificativa_provisorio = '{$this->justificativa_provisorio}'";
  455 + $gruda = ", ";
448 } 456 }
449 if($this->idpes_rev) 457 if($this->idpes_rev)
450 { 458 {
451 $set .= "$gruda idpes_rev = '{$this->idpes_rev}'"; 459 $set .= "$gruda idpes_rev = '{$this->idpes_rev}'";
  460 + $gruda = ", ";
452 } 461 }
453 if($this->cpf) 462 if($this->cpf)
454 { 463 {
455 $set .= "$gruda cpf = '{$this->cpf}'"; 464 $set .= "$gruda cpf = '{$this->cpf}'";
  465 + $gruda = ", ";
456 } 466 }
457 467
458 if(is_numeric($this->ref_cod_sistema) || $this->ref_cod_sistema == "NULL") 468 if(is_numeric($this->ref_cod_sistema) || $this->ref_cod_sistema == "NULL")
459 { 469 {
460 $set .= "$gruda ref_cod_sistema = {$this->ref_cod_sistema}"; 470 $set .= "$gruda ref_cod_sistema = {$this->ref_cod_sistema}";
  471 + $gruda = ", ";
461 } 472 }
462 - 473 +
463 if(is_numeric($this->ref_cod_religiao)) 474 if(is_numeric($this->ref_cod_religiao))
464 { 475 {
465 $set .= "$gruda ref_cod_religiao = {$this->ref_cod_religiao}"; 476 $set .= "$gruda ref_cod_religiao = {$this->ref_cod_religiao}";
  477 + $gruda = ", ";
466 } 478 }
467 479
468 if ($set) 480 if ($set)
@@ -628,9 +640,9 @@ class clsFisica @@ -628,9 +640,9 @@ class clsFisica
628 { 640 {
629 $where .= "{$whereAnd}justificativa_provisorio = '$str_justificativa_provisorio'"; 641 $where .= "{$whereAnd}justificativa_provisorio = '$str_justificativa_provisorio'";
630 } 642 }
631 - 643 +
632 $int_cpf = idFederal2int($int_cpf); 644 $int_cpf = idFederal2int($int_cpf);
633 - 645 +
634 if(is_numeric($int_cpf)) 646 if(is_numeric($int_cpf))
635 { 647 {
636 $where .= "{$whereAnd}cpf like '%$int_cpf%'"; 648 $where .= "{$whereAnd}cpf like '%$int_cpf%'";
@@ -780,7 +792,7 @@ class clsFisica @@ -780,7 +792,7 @@ class clsFisica
780 $tupla["idocup"] = new clsOcupacao( $tupla["idocup"]); 792 $tupla["idocup"] = new clsOcupacao( $tupla["idocup"]);
781 793
782 return $tupla; 794 return $tupla;
783 - 795 +
784 } 796 }
785 }elseif($this->cpf) 797 }elseif($this->cpf)
786 { 798 {
@@ -816,7 +828,7 @@ class clsFisica @@ -816,7 +828,7 @@ class clsFisica
816 } 828 }
817 return false; 829 return false;
818 } 830 }
819 - 831 +
820 function getIdade( $data_nasc ) 832 function getIdade( $data_nasc )
821 { 833 {
822 if( is_string( $data_nasc ) ) 834 if( is_string( $data_nasc ) )