Changeset 257 for trunk/admin/modules/Elezioni/ele_operatori_admin.php
- Timestamp:
- Feb 9, 2019, 8:45:24 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_operatori_admin.php
r2 r257 16 16 $offset=15; 17 17 if (!isset($min)) $min=0; 18 18 global $dbi; 19 19 $aid=$_SESSION['aid']; 20 $dbi=$_SESSION['dbi'];21 20 $prefix=$_SESSION['prefix']; 22 21 if (isset($_GET['do'])) $do=$_GET['do']; else $do=''; … … 31 30 32 31 33 $res = mysql_query("SELECT t1.tipo_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t1.id_cons_gen='$id_cons_gen' " , $dbi); 34 list($tipo_cons) = mysql_fetch_row($res); 32 $sql="SELECT t1.tipo_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t1.id_cons_gen='$id_cons_gen' "; 33 $res = $dbi->prepare("$sql"); 34 $res->execute(); 35 list($tipo_cons) = $res->fetch(PDO::FETCH_NUM); 35 36 36 37 $hiddenInfo = "<input type=\"hidden\" name=\"min\" value=\"$min\">"; … … 49 50 OpenTable(); 50 51 51 $resmod = mysql_query("SELECT id_comune,permessi FROM ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='0'", $dbi); 52 list ($id_comu,$permessi) = mysql_fetch_row($resmod); 52 $sql="SELECT id_comune,permessi FROM ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='0'"; 53 $resmod = $dbi->prepare("$sql"); 54 $resmod->execute(); 55 list ($id_comu,$permessi) = $resmod->fetch(PDO::FETCH_NUM); 53 56 if ($perms!=256) 54 57 { … … 56 59 return; 57 60 } 58 $resmod = mysql_query("SELECT * FROM ".$prefix."_ele_operatori where id_cons=0 and id_comune>0", $dbi); 61 $sql="SELECT * FROM ".$prefix."_ele_operatori where id_cons=0 and id_comune>0"; 62 $resmod = $dbi->prepare("$sql"); 63 $resmod->execute(); 59 64 echo "<table><tr></tr><hr><tr align=\"center\">"; 60 65 echo "<td bgcolor=\"$bgcolor1\"><b>"._UTENTE."</b></td>" … … 70 75 echo "<td align=\"center\" width=\"32\"><input name=\"aid2\"></td>"; 71 76 } 72 $ressede = mysql_query("SELECT id_comune, descrizione from ".$prefix."_ele_comuni", $dbi); 77 $sql="SELECT id_comune, descrizione from ".$prefix."_ele_comuni"; 78 $ressede = $dbi->prepare("$sql"); 79 $ressede->execute(); 73 80 echo "<td><select name=\"id_comune2\">"; 74 81 echo "<option value=\"\">"; 75 while(list($id,$descr)= mysql_fetch_row($ressede)){82 while(list($id,$descr)=$ressede->fetch(PDO::FETCH_NUM)){ 76 83 $sel= ($id == $id_comune2) ? "selected":""; 77 84 $arr[$id]="$descr"; … … 95 102 } 96 103 $i=1; 97 while (list($id_cons2,$id_sede2,$id_comune2,$perm,$utente) = mysql_fetch_row($resmod)){ //elenco dei modelli inseriti104 while (list($id_cons2,$id_sede2,$id_comune2,$perm,$utente) = $resmod->fetch(PDO::FETCH_NUM)){ //elenco dei modelli inseriti 98 105 $bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1']; 99 106 echo "<form name=\"modello$i\" action=\"admin.php\">" … … 131 138 if ($do == "add") { 132 139 if ($aid2) { 133 $result = mysql_query("select * from ".$prefix."_ele_operatori where aid='$aid2'", $dbi); 134 $result = mysql_query("insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid) values ('0','0','$id_comune2','$permessi','$aid2')", $dbi) || die("<br><br>Errore di inserimento: ".mysql_error()); 140 # $result = mysql_query("select * from ".$prefix."_ele_operatori where aid='$aid2'", $dbi); 141 $sql="insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid) values ('0','0','$id_comune2','$permessi','$aid2')"; 142 $res = $dbi->prepare("$sql"); 143 $res->execute(); 135 144 Header("Location: admin.php?op=oper_admin&id_cons_gen=$id_cons_gen"); 136 145 } else { … … 141 150 } 142 151 }else if ($do == "update") { 143 $result = mysql_query("update ".$prefix."_ele_operatori set permessi='$permessi' where id_cons='0' and aid='$aid2' ", $dbi) || die("<br><br>Errore di inserimento: ".mysql_error()); 152 $sql="update ".$prefix."_ele_operatori set permessi='$permessi' where id_cons='0' and aid='$aid2' "; 153 $res = $dbi->prepare("$sql"); 154 $res->execute(); 144 155 Header("Location: admin.php?op=oper_admin&id_cons_gen=$id_cons_gen"); 145 156 }
Note:
See TracChangeset
for help on using the changeset viewer.