Changeset 256 for trunk/admin/modules/Elezioni/ele_configurazione.php
- Timestamp:
- Jan 16, 2019, 7:06:35 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_configurazione.php
r255 r256 15 15 // Offset - visualizza il numero di elementi per pagina 16 16 $offset=5; 17 17 global $dbi; 18 18 $aid=$_SESSION['aid']; 19 $dbi=$_SESSION['dbi'];20 19 $prefix=$_SESSION['prefix']; 21 20 $currentlang=$_SESSION['lang']; … … 26 25 27 26 $id_comune=$_SESSION['id_comune']; 27 28 include("modules/Elezioni/funzionidata.php"); 29 include("modules/Elezioni/ele.php"); 28 30 $row=cur_cons(); 29 31 $tipo_cons=$row[0];$id_cons=$row[1]; 30 31 include("modules/Elezioni/funzionidata.php");32 include("modules/Elezioni/ele.php");33 32 34 33 if (isset($param['do'])) get_magic_quotes_gpc() ? $do=$param['do']:$do=addslashes($param['do']); else $do=''; … … 73 72 echo "<form name=\"gruppo2\" enctype=\"multipart/form-data\" method=\"post\" action=\"admin.php\">" 74 73 ."<input type=\"hidden\" name=\"op\" value=\"confconsiglio\">"; 75 $resl = mysql_query("SELECT * FROM ".$prefix."_config", $dbi); 76 $gru=mysql_fetch_array($resl); 74 $sql="SELECT * FROM ".$prefix."_config"; 75 $sth = $dbi->prepare("$sql"); 76 $sth->execute(); 77 $gru = $sth->fetch(PDO::FETCH_BOTH); 77 78 echo "<input type=\"hidden\" name=\"do\" value=\"update\">"; 78 79 echo "<input type=\"hidden\" name=\"op\" value=\"configurazione\">"; … … 89 90 90 91 91 $resmod = mysql_query("SELECT tema FROM ".$prefix."_ele_temi order by tema", $dbi); 92 92 $sql="SELECT tema FROM ".$prefix."_ele_temi order by tema"; 93 $sth = $dbi->prepare("$sql"); 94 $sth->execute(); 95 $row = $sth->fetchAll(); 93 96 echo "<td><select name=\"tema2\">\n"; 94 95 while (list($desc) = mysql_fetch_row($resmod)){ 97 foreach($row as $com) {$desc=$com[0]; 96 98 if (!$gru['tema']) $gru['tema']=$desc; 97 99 $sel= ($gru['tema']==$desc) ? "selected":""; … … 117 119 echo"<td><b>"._SITENAME."</b></td><td><input type=\"text\" name=\"sitename\" value=\"".$gru['sitename']."\"></td></tr>"; 118 120 119 $resmod = mysql_query("SELECT id_comune,descrizione FROM ".$prefix."_ele_comuni order by descrizione", $dbi); 121 $sql = "SELECT id_comune,descrizione FROM ".$prefix."_ele_comuni order by descrizione"; 122 $sth = $dbi->prepare("$sql"); 123 $sth->execute(); 124 $row = $sth->fetchAll(); 120 125 echo "<tr><td><b>"._SITEISTAT."</b></td>"; 121 126 echo "<td><select name=\"siteistat\"><option value=\"\">"; 122 while (list($id_comune2,$desc) = mysql_fetch_row($resmod)){ 127 foreach($row as $com) 128 {$id_comune2=$com[0];$desc=$com[1]; 123 129 if (!$gru['siteistat']) $gru['siteistat']=$id_comune2; 124 130 $sel= ($gru['siteistat']==$id_comune2) ? "selected":""; … … 187 193 #displayerrors='$displayerrors', 188 194 #per il momento non Ú usato: , site_logo='$site_logo' 189 $result = mysql_query("update ".$prefix."_config set sitename='$sitename', testata='$stemmablob', nome_testata='$stemmanome', blocco='$blocco', multicomune='$multicomune', language='$language2', siteistat='$siteistat', adminmail='$adminmail', siteurl='$siteurl', flash='$flash2', tema='$tema2',gkey='$gkey',ed_user='$ed_user',googlemaps='$googlemaps',editor='$editor',tema_on='$tema_on'", $dbi) || die("Errore di aggiornamento dei dati!".mysql_error()); 195 $sql = "update ".$prefix."_config set sitename='$sitename', testata='$stemmablob', nome_testata='$stemmanome', blocco='$blocco', multicomune='$multicomune', language='$language2', siteistat='$siteistat', adminmail='$adminmail', siteurl='$siteurl', flash='$flash2', tema='$tema2',gkey='$gkey',ed_user='$ed_user',googlemaps='$googlemaps',editor='$editor',tema_on='$tema_on'"; 196 $sth = $dbi->prepare("$sql"); 197 $sth->execute(); 190 198 if ($tema2=='facebook') 191 199 $_SESSION['tema']=$tema2; … … 223 231 if ( (preg_match('/^([_0-9a-zA-Z]+)([_0-9a-zA-Z]{3})$/',$tlist[$i])) ) $files=$tlist[$i]; 224 232 if($files!=''){ 225 $sql = mysql_query("SELECT id FROM ".$prefix."_ele_temi where tema='$files'", $dbi); 226 if($sql){ 227 list($idwid) = mysql_fetch_row($sql); 228 $id = intval($idwid); 229 } 233 $sql = "SELECT id FROM ".$prefix."_ele_temi where tema='$files'"; 234 $sth = $dbi->prepare("$sql"); 235 $sth->execute(); 236 $row = $sth->fetch(PDO::FETCH_BOTH); 237 $id = intval($row[0]); 238 230 239 if (empty($id)) { // inserisce widget db se non esiste 231 $result = mysql_query("insert into ".$prefix."_ele_temi (id,tema) values ( NULL,'$files')", $dbi); 240 $sql="insert into ".$prefix."_ele_temi (id,tema) values ( NULL,'$files')"; 241 $sth = $dbi->prepare("$sql"); 242 $sth->execute(); 232 243 } 233 }244 } 234 245 235 246 … … 243 254 244 255 # se non esiste cancella dal db 245 $sql2 = mysql_query("SELECT * FROM ".$prefix."_ele_temi", $dbi); 246 while ($row = mysql_fetch_array($sql2)) { 256 $sql = "SELECT * FROM ".$prefix."_ele_temi"; 257 $sth = $dbi->prepare("$sql"); 258 $sth->execute(); 259 $sql2 = $sth->fetch(PDO::FETCH_BOTH); 260 foreach($sql2 as $row){ 247 261 $esi=0; 248 262 for ($i=0; $i < sizeof($tlist); $i++) { … … 251 265 } 252 266 if($esi!=1){ 253 $del=mysql_query("DELETE FROM ".$prefix."_ele_tema WHERE id = '$row[id]'",$dbi); 267 $sql="DELETE FROM ".$prefix."_ele_temi WHERE id = '$row[id]'"; 268 $sth = $dbi->prepare("$sql"); 269 $sth->execute(); 254 270 } 255 271 }
Note:
See TracChangeset
for help on using the changeset viewer.