Commit 8d5287f191513e9a057615264ddd1728c881ff99
1 parent
33c34751
Exists in
mysqli
Classe DB
Showing
1 changed file
with
7 additions
and
6 deletions
Show diff stats
restrito/sis_secretaria/manutencao.php
| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | modificá-lo sob os termos da Licença GPL2. |
| 9 | 9 | ***********************************************************************************/ |
| 10 | 10 | |
| 11 | + include_once(DIR_CLASSES_LEIACESSO."/db.class.php"); | |
| 11 | 12 | include_once("../inc/autenticar.php"); |
| 12 | 13 | |
| 13 | 14 | //função de validação dos dados do formulario do cadastro de usuario ------------------- |
| ... | ... | @@ -41,11 +42,11 @@ |
| 41 | 42 | //verifica se ja existe registro cadastrado com a informaçao passada --- |
| 42 | 43 | |
| 43 | 44 | if ($acao=="Incluir") |
| 44 | - $sql = "select * from sis_secretaria where sigla = '$sigla'"; | |
| 45 | + $sql = "select * from sis_secretaria where sigla = '".DB::esc($sigla)."'"; | |
| 45 | 46 | else |
| 46 | - $sql = "select * from sis_secretaria where sigla = '$sigla' and idsecretaria <> $idsecretaria"; | |
| 47 | + $sql = "select * from sis_secretaria where sigla = '".DB::esc($sigla)."' and idsecretaria <> ".DB::esc($idsecretaria); | |
| 47 | 48 | |
| 48 | - if(mysql_num_rows(execQuery($sql)) > 0) | |
| 49 | + if(mysqli_num_rows(DB::execQuery($sql)) > 0) | |
| 49 | 50 | { |
| 50 | 51 | $erro = "Já existe SIC cadastrada com a sigla informada"; |
| 51 | 52 | return false; |
| ... | ... | @@ -64,10 +65,10 @@ |
| 64 | 65 | { |
| 65 | 66 | $acao = "Alterar"; |
| 66 | 67 | |
| 67 | - $sql = "select * from sis_secretaria where idsecretaria = $codigo"; | |
| 68 | + $sql = "select * from sis_secretaria where idsecretaria = ".DB::esc($codigo); | |
| 68 | 69 | |
| 69 | - $resultado = execQuery($sql); | |
| 70 | - $registro = mysql_fetch_array($resultado); | |
| 70 | + $resultado = DB::execQuery($sql); | |
| 71 | + $registro = mysqli_fetch_array($resultado); | |
| 71 | 72 | |
| 72 | 73 | $idsecretaria = $registro["idsecretaria"]; |
| 73 | 74 | $nome = addslashes($registro["nome"]); | ... | ... |