Changeset 257 for trunk/admin/modules/Elezioni/ele_collegi.php
- Timestamp:
- Feb 9, 2019, 8:45:24 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_collegi.php
r2 r257 41 41 42 42 OpenTable(); 43 $resmod = mysql_query("SELECT t1.id_collegio, t1.descrizione, t2.descrizione FROM ".$prefix."_ele_collegi as t1, ".$prefix."_ele_consultazione as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen=$id_cons_gen order by t1.descrizione asc", $dbi); 43 $sql = "SELECT t1.id_collegio, t1.descrizione, t2.descrizione FROM ".$prefix."_ele_collegi as t1, ".$prefix."_ele_consultazione as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen=$id_cons_gen order by t1.descrizione asc"; 44 $resmod = $dbi->prepare("$sql"); 45 $resmod->execute(); 44 46 echo "<table><tr ALIGN=\"CENTER\">"; 45 47 echo "<td bgcolor=\"$bgcolor1\"><b>"._CONSULTA."</b></td>"; … … 50 52 echo "<input type=\"hidden\" name=\"id_collegio\" value=\"$id_collegio\">"; 51 53 echo "<tr align=\"center\">"; 52 $ressede = mysql_query("SELECT descrizione from ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'", $dbi); 53 list($descr_cons)=mysql_fetch_row($ressede); 54 $sql = "SELECT descrizione from ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'"; 55 $ressede = $dbi->prepare("$sql"); 56 $ressede->execute(); 57 list($descr_cons)=$ressede->fetch(PDO::FETCH_NUM); 54 58 echo "<td>$descr_cons</td>"; 55 59 echo "<td align=\"center\" width=\"32\"><input name=\"desc\" value=\"$desc\"></td>"; … … 64 68 } 65 69 $i=0; 66 while (list($id_collegio2,$desc,$descr_cons) = mysql_fetch_row($resmod)){ //elenco dei modelli inseriti70 while (list($id_collegio2,$desc,$descr_cons) = $resmod->fetch(PDO::FETCH_NUM)){ //elenco dei modelli inseriti 67 71 $i++; 68 72 $bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1']; … … 97 101 die(); 98 102 }else{ 99 $result = mysql_query("delete from ".$prefix."_ele_collegi where id_collegio='$id_collegio'", $dbi); 100 if (!$result) return; 103 $sql = "delete from ".$prefix."_ele_collegi where id_collegio='$id_collegio'"; 104 $result = $dbi->prepare("$sql"); 105 $result->execute(); 106 if (!$result->rowCount()) return; 101 107 Header("Location: admin.php?op=inscollegi&id_cons_gen=$id_cons_gen"); 102 108 } 103 109 } 104 110 if ($do == "add") { 105 $result = mysql_query("insert into ".$prefix."_ele_collegi(id_cons_gen,descrizione) values ('$id_cons_gen','$desc')", $dbi) || die("Impossibile inserire il collegio! ".mysql_error()); 111 $sql = "insert into ".$prefix."_ele_collegi(id_cons_gen,descrizione) values ('$id_cons_gen','$desc')"; 112 $result = $dbi->prepare("$sql"); 113 $result->execute(); 106 114 } 107 115 if ($do == "update") { 108 $result = mysql_query("update ".$prefix."_ele_collegi set descrizione='$desc' , id_cons_gen='$id_cons_gen' where id_collegio='$id_collegio'", $dbi); 109 if (!$result) return; 110 # echo "update ".$prefix."_ele_collegi set descrizione='$desc' , id_cons_gen='$id_cons_gen' where id_collegio='$id_collegio'"; 111 Header("Location: admin.php?op=inscollegi&id_cons_gen=$id_cons_gen&id_collegio=$id_collegio"); 116 $sql= "update ".$prefix."_ele_collegi set descrizione='$desc' , id_cons_gen='$id_cons_gen' where id_collegio='$id_collegio'"; 117 $result = $dbi->prepare("$sql"); 118 $result->execute(); 119 if (!$result->rowCount()) return; 120 Header("Location: admin.php?op=inscollegi&id_cons_gen=$id_cons_gen&id_collegio=$id_collegio"); 112 121 } 113 122 }
Note:
See TracChangeset
for help on using the changeset viewer.