Changeset 253 for trunk/client/modules.php
- Timestamp:
- Mar 12, 2018, 8:53:21 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules.php
r241 r253 99 99 100 100 101 102 101 $dbi = new PDO("mysql:host=$dbhost;charset=latin1", $dbuname, $dbpass, array(PDO::ATTR_EMULATE_PREPARES => false, 102 PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION)); 103 $sql = "use $dbname"; 104 $dbi->exec($sql); 105 106 /* 103 107 104 108 if(!$dbi = mysql_connect($dbhost, $dbuname, $dbpass)){ … … 110 114 } 111 115 mysql_query("SET NAMES 'utf8'", $dbi); 112 116 */ 113 117 # protezione csrf ottobre 2012 - by l.apolito 114 118 if (file_exists("inc/csrf-magic/csrf-magic.php")) { … … 122 126 123 127 # carica i parametri di default sulla tabella 124 $res = mysql_query("SELECT * FROM ".$prefix."_config" , $dbi); 125 $row = mysql_fetch_array($res); 128 $sql = $dbi->prepare("SELECT * FROM ".$prefix."_config"); 129 $sql->execute(); 130 while($riga = $sql->fetchAll(PDO::FETCH_ASSOC)){$row=$riga[0]; 126 131 $sitename = stripslashes($row['sitename']); 127 132 $siteurl = $row['siteurl']; … … 146 151 $ed_user = $row['ed_user']; 147 152 #tema mobile 148 153 } 149 154 150 155 151 156 152 157 # altre config 153 $res = mysql_query("SELECT * FROM ".$prefix."_ele_comuni where id_comune='$siteistat' ", $dbi); 154 $row = mysql_fetch_array($res); 158 $sql = $dbi->prepare("SELECT * FROM ".$prefix."_ele_comuni where id_comune='$siteistat' "); 159 $sql->execute(); 160 $riga = $sql->fetchAll(PDO::FETCH_ASSOC); 161 $row=$riga[0]; 155 162 $id_cons_pred = intval($row['id_cons']); 156 163 if($id_cons_pred=='0')$id_cons_pred=''; 157 164 if(!isset($id_cons_gen)) $id_cons_gen=$id_cons_pred; 158 165 # carica il metodo d'hontd 159 $res = mysql_query("SELECT * FROM ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' ", $dbi); 160 $row = mysql_fetch_array($res); 161 162 163 166 ##$sql = $dbi->prepare("SELECT * FROM ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' "); 167 ##$sql->execute(); 164 168 165 169 $param=strip_tags(strtolower($_SERVER['REQUEST_METHOD'])) == 'get' ? $_GET : $_POST; … … 170 174 $id_cons_bak=intval($param['id_cons_gen']); 171 175 if (isset($param['id_comune'])) $id_combak=intval($param['id_comune']); else $id_combak=$_SESSION['id_comune']; 172 $res = mysql_query("SELECT id_cons,id_conf FROM ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_bak' and id_comune='$id_combak'" , $dbi); 173 list($id_cons,$hondt) = mysql_fetch_row($res); 176 $sql = $dbi->prepare("SELECT id_cons,id_conf FROM ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_bak' and id_comune='$id_combak'"); 177 $sql->execute(); 178 $row = $sql->fetchAll(PDO::FETCH_ASSOC); 179 $id_cons=$row[1];$hondt=$row[2]; 174 180 175 181 // incluso in consiglieri.php, ma io carico le vecchie variabili per compatibilit'a all'indietro 176 182 if($hondt>=1){ 177 183 # proiezione consiglio 178 $r es = mysql_query("SELECT * FROM ".$prefix."_ele_conf where id_conf='$hondt'", $dbi);179 $row = mysql_fetch_array($res);184 $row = $dbi->exec("SELECT * FROM ".$prefix."_ele_conf where id_conf='$hondt'"); 185 180 186 $descrizione_consiglio = $row['descrizione']; 181 187 $LIMITE = intval($row['limite']);
Note:
See TracChangeset
for help on using the changeset viewer.