Commit 3131af77675beb4a28ce6985032a55efaba1896d

Authored by Leandro Arndt
1 parent 752859e0
Exists in mysqli

Classe DB

cadastro/formulario.php
... ... @@ -7,6 +7,9 @@
7 7 Este programa é software livre; você pode redistribuí-lo e/ou
8 8 modificá-lo sob os termos da Licença GPL2.
9 9 ***********************************************************************************/
  10 +
  11 +include_once("../class/db.class.php");
  12 +
10 13 ?>
11 14 <script language="JavaScript" src="<?php echo URL_BASE_SISTEMA;?>js/XmlHttpLookup.js"></script>
12 15  
... ... @@ -61,8 +64,8 @@
61 64 <td align="left">
62 65 <select name="idfaixaetaria" id="idfaixaetaria">
63 66 <option value="">----</option>
64   - <?php $rsFxt = execQuery("select * from lda_faixaetaria order by nome"); ?>
65   - <?php while($rowfxt=mysql_fetch_array($rsFxt)){?>
  67 + <?php $rsFxt = DB::execQuery("select * from lda_faixaetaria order by nome"); ?>
  68 + <?php while($rowfxt=mysqli_fetch_array($rsFxt)){?>
66 69 <option value="<?php echo $rowfxt['idfaixaetaria'];?>" <?php echo $rowfxt['idfaixaetaria']==$idfaixaetaria?"selected":""; ?>><?php echo $rowfxt['nome'];?></option>
67 70 <?php }?>
68 71 </select>
... ... @@ -74,8 +77,8 @@
74 77 <td align="left">
75 78 <select name="idescolaridade" id="idescolaridade">
76 79 <option value="">----</option>
77   - <?php $rsEsc = execQuery("select * from lda_escolaridade order by nome"); ?>
78   - <?php while($rowesc=mysql_fetch_array($rsEsc)){?>
  80 + <?php $rsEsc = DB::execQuery("select * from lda_escolaridade order by nome"); ?>
  81 + <?php while($rowesc=mysqli_fetch_array($rsEsc)){?>
79 82 <option value="<?php echo $rowesc['idescolaridade'];?>" <?php echo $rowesc['idescolaridade']==$idescolaridade?"selected":""; ?>><?php echo $rowesc['nome'];?></option>
80 83 <?php }?>
81 84 </select>
... ... @@ -93,8 +96,8 @@
93 96 <td align="left">
94 97 <select name="idtipotelefone" id="idtipotelefone">
95 98 <option value="">----</option>
96   - <?php $rstel = execQuery("select * from lda_tipotelefone order by nome"); ?>
97   - <?php while($rowtel=mysql_fetch_array($rstel)){?>
  99 + <?php $rstel = DB::execQuery("select * from lda_tipotelefone order by nome"); ?>
  100 + <?php while($rowtel=mysqli_fetch_array($rstel)){?>
98 101 <option value="<?php echo $rowtel['idtipotelefone'];?>" <?php echo $rowtel['idtipotelefone']==$idtipotelefone?"selected":""; ?>><?php echo $rowtel['nome'];?></option>
99 102 <?php }?>
100 103 </select>
... ... @@ -149,8 +152,8 @@
149 152 <td><input type="text" name="cidade" onmouseover="this.title=this.value" id="cidade" value="<?php echo $cidade;?>" maxlength="255" size="35">
150 153 <select name="uf" id="uf">
151 154 <option value="">- UF -</option>
152   - <?php $rsuf = execQuery("select sigla from gen_estados order by sigla"); ?>
153   - <?php while($rowuf=mysql_fetch_array($rsuf)){?>
  155 + <?php $rsuf = DB::execQuery("select sigla from gen_estados order by sigla"); ?>
  156 + <?php while($rowuf=mysqli_fetch_array($rsuf)){?>
154 157 <option value="<?php echo $rowuf['sigla'];?>" <?php echo $rowuf['sigla']==$uf?"selected":""; ?>><?php echo $rowuf['sigla'];?></option>
155 158 <?php }?>
156 159 </select>
... ...
inc/database.php
... ... @@ -34,7 +34,7 @@ function db_open_trans()
34 34  
35 35 $mysqli->autocommit(false);
36 36  
37   - return $mysqli; // mantido para facilitar a transição do código para a global
  37 + return true;
38 38  
39 39 }
40 40  
... ...
restrito/inc/database.php
... ... @@ -34,7 +34,7 @@ function db_open_trans()
34 34  
35 35 $mysqli->autocommit(false);
36 36  
37   - return $mysqli; // mantido para facilitar a transição do código para a global
  37 + return true;
38 38  
39 39 }
40 40  
... ...