Commit 27046452384c6ab20adf1fe62ad59298834a7b9e

Authored by Leandro Arndt
1 parent 7531d8a7
Exists in mysqli

Classe DB

Showing 1 changed file with 15 additions and 14 deletions   Show diff stats
restrito/lda_solicitacao/cadastro.php
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 10
11 include("manutencao.php"); 11 include("manutencao.php");
12 include("../inc/topo.php"); 12 include("../inc/topo.php");
  13 + include_once(DIR_CLASSES_LEIACESSO."/db.class.php");
13 ?> 14 ?>
14 15
15 <script language="JavaScript" src="../js/XmlHttpLookup.js"></script> 16 <script language="JavaScript" src="../js/XmlHttpLookup.js"></script>
@@ -113,8 +114,8 @@ @@ -113,8 +114,8 @@
113 <td align="left" width="100%"> 114 <td align="left" width="100%">
114 <select name="idsecretaria" id="idsecretaria" onchange="preencheCombo('idcategoriaproblema','imgCarregandoCategoria','buscacategoriaproblema',this.value);"> 115 <select name="idsecretaria" id="idsecretaria" onchange="preencheCombo('idcategoriaproblema','imgCarregandoCategoria','buscacategoriaproblema',this.value);">
115 <option value="">-- selecione --</option> 116 <option value="">-- selecione --</option>
116 - <?php $rsCat = execQuery("select * from sis_secretaria order by nome"); ?>  
117 - <?php while($row=mysql_fetch_array($rsCat)){?> 117 + <?php $rsCat = DB::execQuery("select * from sis_secretaria order by nome"); ?>
  118 + <?php while($row=mysqli_fetch_array($rsCat)){?>
118 <option value="<?php echo $row['idsecretaria'];?>" <?php echo $row['idsecretaria']==$idsecretaria?"selected":""; ?>><?php echo $row['nome'];?></option> 119 <option value="<?php echo $row['idsecretaria'];?>" <?php echo $row['idsecretaria']==$idsecretaria?"selected":""; ?>><?php echo $row['nome'];?></option>
119 <?php }?> 120 <?php }?>
120 </select> 121 </select>
@@ -125,8 +126,8 @@ @@ -125,8 +126,8 @@
125 <td align="left" width="100%"> 126 <td align="left" width="100%">
126 <select name="idcategoriaproblema" id="idcategoriaproblema" onchange="preencheCombo('idproblema','imgCarregandoProblema','buscaproblema',this.value);"> 127 <select name="idcategoriaproblema" id="idcategoriaproblema" onchange="preencheCombo('idproblema','imgCarregandoProblema','buscaproblema',this.value);">
127 <option value="">-- selecione --</option> 128 <option value="">-- selecione --</option>
128 - <?php $rsCat = execQuery("select * from ouv_categoriaproblema where status = 1 and idsecretaria = '$idsecretaria' order by descricao"); ?>  
129 - <?php while($row=mysql_fetch_array($rsCat)){?> 129 + <?php $rsCat = DB::execQuery("select * from ouv_categoriaproblema where status = 1 and idsecretaria = '".DB::esc($idsecretaria)."' order by descricao"); ?>
  130 + <?php while($row=mysqli_fetch_array($rsCat)){?>
130 <option value="<?php echo $row['idcategoriaproblema'];?>" <?php echo $row['idcategoriaproblema']==$idcategoriaproblema?"selected":""; ?>><?php echo $row['descricao'];?></option> 131 <option value="<?php echo $row['idcategoriaproblema'];?>" <?php echo $row['idcategoriaproblema']==$idcategoriaproblema?"selected":""; ?>><?php echo $row['descricao'];?></option>
131 <?php }?> 132 <?php }?>
132 </select> 133 </select>
@@ -138,8 +139,8 @@ @@ -138,8 +139,8 @@
138 <td align="left" width="100%"> 139 <td align="left" width="100%">
139 <select name="idproblema" id="idproblema"> 140 <select name="idproblema" id="idproblema">
140 <option value="">-- selecione --</option> 141 <option value="">-- selecione --</option>
141 - <?php $rsCat = execQuery("select * from ouv_problema where statusproblema = 1 and idcategoria = '$idcategoriaproblema' order by tituloproblema"); ?>  
142 - <?php while($row=mysql_fetch_array($rsCat)){?> 142 + <?php $rsCat = DB::execQuery("select * from ouv_problema where statusproblema = 1 and idcategoria = '".DB::esc($idcategoriaproblema)."' order by tituloproblema"); ?>
  143 + <?php while($row=mysqli_fetch_array($rsCat)){?>
143 <option value="<?php echo $row['idproblema'];?>" <?php echo $row['idproblema']==$idproblema?"selected":""; ?>><?php echo $row['tituloproblema'];?></option> 144 <option value="<?php echo $row['idproblema'];?>" <?php echo $row['idproblema']==$idproblema?"selected":""; ?>><?php echo $row['tituloproblema'];?></option>
144 <?php }?> 145 <?php }?>
145 </select> 146 </select>
@@ -163,8 +164,8 @@ @@ -163,8 +164,8 @@
163 <td align="left"> 164 <td align="left">
164 <select name="idbairroservico" id="idbairroservico" onchange="preencheCombo('idcomunidadeservico','imgCarregando','buscacomunidade',this.value);"> 165 <select name="idbairroservico" id="idbairroservico" onchange="preencheCombo('idcomunidadeservico','imgCarregando','buscacomunidade',this.value);">
165 <option value="">- Bairro -</option> 166 <option value="">- Bairro -</option>
166 - <?php $rsBai = execQuery("select * from gen_bairros where municipio_id = 7221 order by nome"); ?>  
167 - <?php while($row=mysql_fetch_array($rsBai)){?> 167 + <?php $rsBai = DB::execQuery("select * from gen_bairros where municipio_id = 7221 order by nome"); ?>
  168 + <?php while($row=mysqli_fetch_array($rsBai)){?>
168 <option value="<?php echo $row['id'];?>" <?php echo $row['id']==$idbairroservico?"selected":""; ?>><?php echo $row['nome'];?></option> 169 <option value="<?php echo $row['id'];?>" <?php echo $row['id']==$idbairroservico?"selected":""; ?>><?php echo $row['nome'];?></option>
169 <?php }?> 170 <?php }?>
170 </select> 171 </select>
@@ -175,8 +176,8 @@ @@ -175,8 +176,8 @@
175 <td align="left"> 176 <td align="left">
176 <select name="idcomunidadeservico" id="idcomunidadeservico" > 177 <select name="idcomunidadeservico" id="idcomunidadeservico" >
177 <option value="">- Comunidade -</option> 178 <option value="">- Comunidade -</option>
178 - <?php $rsCom = execQuery("select * from gen_conjuntohabitacional where idbairro = $idbairroservico order by descricaoconjuntohabitacional"); ?>  
179 - <?php while($row=mysql_fetch_array($rsCom)){?> 179 + <?php $rsCom = DB::execQuery("select * from gen_conjuntohabitacional where idbairro = ".DB::esc($idbairroservico)." order by descricaoconjuntohabitacional"); ?>
  180 + <?php while($row=mysqli_fetch_array($rsCom)){?>
180 <option value="<?php echo $row['idconjuntohabitacional'];?>" <?php echo $row['idconjuntohabitacional']==$idcomunidadeservico?"selected":""; ?>><?php echo $row['descricaoconjuntohabitacional'];?></option> 181 <option value="<?php echo $row['idconjuntohabitacional'];?>" <?php echo $row['idconjuntohabitacional']==$idcomunidadeservico?"selected":""; ?>><?php echo $row['descricaoconjuntohabitacional'];?></option>
181 <?php }?> 182 <?php }?>
182 </select> 183 </select>
@@ -229,9 +230,9 @@ @@ -229,9 +230,9 @@
229 <table align="center" width="100%" cellpadding="0" cellspacing="1"> 230 <table align="center" width="100%" cellpadding="0" cellspacing="1">
230 <tr><th>Arquivos enviados</th></tr> 231 <tr><th>Arquivos enviados</th></tr>
231 <?php 232 <?php
232 - $rsAnexo = execQuery("select * from ouv_demandaanexo where iddemanda=$iddemanda order by idanexodemanda"); 233 + $rsAnexo = DB::execQuery("select * from ouv_demandaanexo where iddemanda=".DB::esc($iddemanda)." order by idanexodemanda");
233 $i=0; 234 $i=0;
234 - while($row = mysql_fetch_array($rsAnexo)){ 235 + while($row = mysqli_fetch_array($rsAnexo)){
235 $i++; 236 $i++;
236 ?> 237 ?>
237 <tr> 238 <tr>
@@ -299,8 +300,8 @@ @@ -299,8 +300,8 @@
299 <input type="text" name="cidadesolicitante" onmouseover="this.title=this.value" id="cidade" value="<?php echo $cidadesolicitante;?>" maxlength="255" size="38"> 300 <input type="text" name="cidadesolicitante" onmouseover="this.title=this.value" id="cidade" value="<?php echo $cidadesolicitante;?>" maxlength="255" size="38">
300 <select name="estadosolicitante" id="uf"> 301 <select name="estadosolicitante" id="uf">
301 <option value="">- UF -</option> 302 <option value="">- UF -</option>
302 - <?php $rsuf = execQuery("select * from gen_estados order by sigla"); ?>  
303 - <?php while($row=mysql_fetch_array($rsuf)){?> 303 + <?php $rsuf = DB::execQuery("select * from gen_estados order by sigla"); ?>
  304 + <?php while($row=mysqli_fetch_array($rsuf)){?>
304 <option value="<?php echo $row['sigla'];?>" <?php echo $row['sigla']==$estadosolicitante?"selected":""; ?>><?php echo $row['sigla'];?></option> 305 <option value="<?php echo $row['sigla'];?>" <?php echo $row['sigla']==$estadosolicitante?"selected":""; ?>><?php echo $row['sigla'];?></option>
305 <?php }?> 306 <?php }?>
306 </select> 307 </select>