Commit d70072645b30379da4cc9f0d2d4d7dbfd0d4c7be

Authored by Leandro Arndt
1 parent 787c8d5f
Exists in mysqli

Classe DB

restrito/inc/database.php
... ... @@ -34,7 +34,7 @@ function db_open_trans()
34 34  
35 35 $mysqli->autocommit(false);
36 36  
37   - return true;
  37 + return $mysqli;
38 38  
39 39 }
40 40  
... ...
restrito/inc/topo.php
... ... @@ -9,6 +9,7 @@
9 9 ***********************************************************************************/
10 10  
11 11 require_once("config.php");
  12 +include_once(DIR_CLASSES_LEIACESSO."/db.class.php");
12 13 ?>
13 14 <!DOCTYPE html>
14 15 <html>
... ... @@ -93,9 +94,9 @@ require_once(&quot;config.php&quot;);
93 94 order by
94 95 m.ordem, t.ordem, t.nome";
95 96  
96   - $rs = execQuery($sql);
  97 + $rs = DB::execQuery($sql);
97 98  
98   - while($row = mysql_fetch_array($rs)){
  99 + while($row = mysqli_fetch_array($rs)){
99 100 ?><li class="opcao"><a href="../inc/menu.php?m=<?php echo $row['idmenu'];?>"><?php echo $row['menu'];?></a></li><?php
100 101 ?><img src="../css/img/pipe.png" /><?php
101 102 }
... ... @@ -114,9 +115,8 @@ require_once(&quot;config.php&quot;);
114 115 $sql = "SELECT siglasecretaria, idsecretaria FROM vw_secretariausuario
115 116 WHERE idusuario = '".getSession('uid')."'";
116 117  
117   - $rs = execQuery($sql);
118   -
119   - while($row = mysql_fetch_array($rs)){
  118 + $rs = DB::execQuery($sql);
  119 + while($row = mysqli_fetch_array($rs)){
120 120 ?><option value="<?php echo md5($row['idsecretaria']);?>" <?php echo (getSession('idsecretaria') == $row['idsecretaria'])?"selected":"";?>><?php echo $row['siglasecretaria'];?></option><?php
121 121 }?>
122 122 </select>
... ...