Commit 173ca484eca8cdaeb6cc99caf54394eb59749667
1 parent
e7518d3f
Exists in
master
Corrigida possibilidade de erro de SQL ao usar a data em formato dd/mm/aaaa, con…
…vertendo para o formato [http://pt.wikipedia.org/wiki/ISO_8601 ISO 8601]
Showing
1 changed file
with
9 additions
and
4 deletions
Show diff stats
ieducar/intranet/educar_falta_atraso_compensado_cad.php
... | ... | @@ -153,7 +153,7 @@ class indice extends clsCadastro |
153 | 153 | $obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7, |
154 | 154 | "educar_falta_atraso_det.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_escola={$this->ref_cod_escola}&ref_cod_instituicao={$this->ref_cod_instituicao}"); |
155 | 155 | |
156 | - // | |
156 | + // Transforma a data para o formato aceito pelo banco | |
157 | 157 | $this->data_inicio = dataToBanco($this->data_inicio); |
158 | 158 | $this->data_fim = dataToBanco($this->data_fim); |
159 | 159 | |
... | ... | @@ -171,7 +171,6 @@ class indice extends clsCadastro |
171 | 171 | } |
172 | 172 | |
173 | 173 | $this->mensagem = 'Cadastro não realizado.<br />'; |
174 | - echo "<!--\nErro ao cadastrar clsPmieducarFaltaAtrasoCompensado\nvalores obrigatorios\nis_numeric( $this->ref_cod_escola ) && is_numeric( $this->ref_cod_instituicao ) && is_numeric( $this->ref_cod_servidor ) && is_numeric( $this->ref_usuario_cad ) && is_string( $this->data_inicio ) && is_string( $this->data_fim )\n-->"; | |
175 | 174 | return FALSE; |
176 | 175 | } |
177 | 176 | |
... | ... | @@ -186,6 +185,10 @@ class indice extends clsCadastro |
186 | 185 | sprintf('educar_falta_atraso_det.php?ref_cod_servidor=%d&ref_cod_escola=%d&ref_cod_instituicao=%d', |
187 | 186 | $this->ref_cod_servidor, $this->ref_cod_escola, $this->ref_cod_instituicao)); |
188 | 187 | |
188 | + // Transforma a data para o formato aceito pelo banco | |
189 | + $this->data_inicio = dataToBanco($this->data_inicio); | |
190 | + $this->data_fim = dataToBanco($this->data_fim); | |
191 | + | |
189 | 192 | $obj = new clsPmieducarFaltaAtrasoCompensado($this->cod_compensado, |
190 | 193 | $this->ref_cod_escola, $this->ref_cod_instituicao, $this->ref_cod_servidor, |
191 | 194 | $this->pessoa_logada, $this->pessoa_logada, $this->data_inicio, |
... | ... | @@ -201,7 +204,6 @@ class indice extends clsCadastro |
201 | 204 | } |
202 | 205 | |
203 | 206 | $this->mensagem = 'Edição não realizada.<br />'; |
204 | - echo "<!--\nErro ao editar clsPmieducarFaltaAtrasoCompensado\nvalores obrigatorios\nif( is_numeric( $this->cod_compensado ) && is_numeric( $this->ref_usuario_exc ) )\n-->"; | |
205 | 207 | return FALSE; |
206 | 208 | } |
207 | 209 | |
... | ... | @@ -216,6 +218,10 @@ class indice extends clsCadastro |
216 | 218 | sprintf('educar_falta_atraso_det.php?ref_cod_servidor=%d&ref_cod_escola=%d&ref_cod_instituicao=%d', |
217 | 219 | $this->ref_cod_servidor, $this->ref_cod_escola, $this->ref_cod_instituicao)); |
218 | 220 | |
221 | + // Transforma a data para o formato aceito pelo banco | |
222 | + $this->data_inicio = dataToBanco($this->data_inicio); | |
223 | + $this->data_fim = dataToBanco($this->data_fim); | |
224 | + | |
219 | 225 | $obj = new clsPmieducarFaltaAtrasoCompensado($this->cod_compensado, |
220 | 226 | $this->ref_cod_escola, $this->ref_cod_instituicao, $this->ref_cod_servidor, |
221 | 227 | $this->pessoa_logada, $this->pessoa_logada, $this->data_inicio, |
... | ... | @@ -230,7 +236,6 @@ class indice extends clsCadastro |
230 | 236 | } |
231 | 237 | |
232 | 238 | $this->mensagem = 'Exclusão não realizada.<br />'; |
233 | - echo "<!--\nErro ao excluir clsPmieducarFaltaAtrasoCompensado\nvalores obrigatorios\nif( is_numeric( $this->cod_compensado ) && is_numeric( $this->ref_usuario_exc ) )\n-->"; | |
234 | 239 | return FALSE; |
235 | 240 | } |
236 | 241 | } | ... | ... |