Commit 3f5a175a8599c48a535d1ecca8ab60790556c656

Authored by Lucas Schmoeller da Silva
1 parent 9c8c1313
Exists in master

#36 Alterando função de conversão de data no cadastro de falta/atraso para servidores

Showing 1 changed file with 5 additions and 2 deletions   Show diff stats
ieducar/intranet/educar_falta_atraso_cad.php
... ... @@ -32,6 +32,7 @@ require_once 'include/clsBase.inc.php';
32 32 require_once 'include/clsCadastro.inc.php';
33 33 require_once 'include/clsBanco.inc.php';
34 34 require_once 'include/pmieducar/geral.inc.php';
  35 +require_once 'Portabilis/Date/Utils.php';
35 36  
36 37 /**
37 38 * clsIndexBase class.
... ... @@ -102,7 +103,7 @@ class indice extends clsCadastro
102 103 $registro = $obj->detalhe();
103 104  
104 105 if ($registro) {
105   - // passa todos os valores obtidos no registro para atributos do objeto
  106 + // passa to$this->data_falta_atraso = Portabilis_Date_Utils::brToPgSQL($this->data_falta_atraso);dos os valores obtidos no registro para atributos do objeto
106 107 foreach ($registro as $campo => $val) {
107 108 $this->$campo = $val;
108 109 }
... ... @@ -170,6 +171,8 @@ class indice extends clsCadastro
170 171 $this->pessoa_logada = $_SESSION['id_pessoa'];
171 172 @session_write_close();
172 173  
  174 + $this->data_falta_atraso = Portabilis_Date_Utils::brToPgSQL($this->data_falta_atraso);
  175 +
173 176 $obj_permissoes = new clsPermissoes();
174 177 $obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7,
175 178 sprintf('educar_falta_atraso_lst.php?ref_cod_servidor=%d&ref_cod_instituicao=%d',
... ... @@ -183,7 +186,7 @@ class indice extends clsCadastro
183 186 }
184 187 elseif ($this->tipo == 2) {
185 188 $db = new clsBanco();
186   - $dia_semana = $db->CampoUnico(sprintf('(SELECT EXTRACT (DOW FROM date \'%s\') + 1 )', dataToBanco($this->data_falta_atraso)));
  189 + $dia_semana = $db->CampoUnico(sprintf('(SELECT EXTRACT (DOW FROM date \'%s\') + 1 )', $this->data_falta_atraso));
187 190  
188 191 $obj_ser = new clsPmieducarServidor();
189 192 $horas = $obj_ser->qtdhoras( $this->ref_cod_servidor, $this->ref_cod_escola, $this->ref_cod_instituicao, $dia_semana );
... ...