[2] | 1 | <?php
|
---|
| 2 | /************************************************************************/
|
---|
| 3 | /* Eleonline - Raccolta e diffusione dei dati elettorali */
|
---|
| 4 | /* by Roberto Gigli & Luciano Apolito */
|
---|
| 5 | /* http://www.eleonline.it */
|
---|
| 6 | /* info@eleonline.it luciano@aniene.net rgigli@libero.it */
|
---|
| 7 | /************************************************************************/
|
---|
| 8 | /* Modulo gruppo */
|
---|
| 9 | /* Amministrazione */
|
---|
| 10 | /************************************************************************/
|
---|
| 11 | if (!defined('ADMIN_FILE')) {
|
---|
| 12 | die ("You can't access this file directly...");
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | // Offset - visualizza il numero di elementi per pagina
|
---|
| 16 | $offset=5;
|
---|
| 17 |
|
---|
| 18 | $aid=$_SESSION['aid'];
|
---|
| 19 | $dbi=$_SESSION['dbi'];
|
---|
| 20 | $prefix=$_SESSION['prefix'];
|
---|
| 21 | $currentlang=$_SESSION['lang'];
|
---|
| 22 | $param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST;
|
---|
| 23 | $id_cons_gen=$param['id_cons_gen'];
|
---|
| 24 | $perms=ChiSei($id_cons_gen);
|
---|
| 25 | if ($perms<32) die("Non hai i permessi per inserire dati, o non hai scelto la consultazione!");
|
---|
| 26 |
|
---|
| 27 | $id_comune=$_SESSION['id_comune'];
|
---|
| 28 | $res = mysql_query("SELECT t1.tipo_cons,t2.id_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune' " , $dbi);
|
---|
| 29 | list($tipo_cons,$id_cons) = mysql_fetch_row($res);
|
---|
| 30 |
|
---|
| 31 | include("modules/Elezioni/funzionidata.php");
|
---|
| 32 | include("modules/Elezioni/ele.php");
|
---|
| 33 |
|
---|
| 34 | if (isset($param['do'])) get_magic_quotes_gpc() ? $do=$param['do']:$do=addslashes($param['do']); else $do='';
|
---|
| 35 | if (isset($param['min'])) $min=intval($param['min']); else $min=0;
|
---|
| 36 | if (isset($param['ok'])) get_magic_quotes_gpc() ? $ok=$param['ok']:$ok=addslashes($param['ok']); else $ok='';
|
---|
| 37 | if (isset($param['blocco'])) get_magic_quotes_gpc() ?
|
---|
| 38 | $blocco=$param['blocco']:$blocco=addslashes($param['blocco']); else $blocco='';
|
---|
| 39 | if (isset($param['tema2'])) get_magic_quotes_gpc() ? $tema2=$param['tema2']:$tema2=addslashes($param['tema2']); else $tema2='';
|
---|
| 40 | if (isset($param['multicomune'])) get_magic_quotes_gpc() ? $multicomune=$param['multicomune']:$multicomune=addslashes($param['multicomune']); else $multicomune='';
|
---|
| 41 | if (isset($param['fileout'])) get_magic_quotes_gpc() ? $fileout=$param['fileout']:$fileout=addslashes($param['fileout']); else $fileout='';
|
---|
| 42 | if (isset($param['prefix2'])) get_magic_quotes_gpc() ? $prefix2=$param['prefix2']:$prefix2=addslashes($param['prefix2']); else $prefix2='';
|
---|
| 43 | if (isset($param['adminmail'])) get_magic_quotes_gpc() ? $adminmail=$param['adminmail']:$adminmail=addslashes($param['adminmail']); else $adminmail='';
|
---|
| 44 | if (isset($param['siteurl'])) get_magic_quotes_gpc() ? $siteurl=$param['siteurl']:$siteurl=addslashes($param['siteurl']); else $siteurl='';
|
---|
| 45 | if (isset($param['sitename'])) get_magic_quotes_gpc() ? $sitename=$param['sitename']:$sitename=addslashes($param['sitename']); else $sitename='';
|
---|
| 46 | if (isset($param['siteistat'])) get_magic_quotes_gpc() ? $siteistat=$param['siteistat']:$siteistat=addslashes($param['siteistat']); else $siteistat='';
|
---|
| 47 | if (isset($param['language2'])) get_magic_quotes_gpc() ? $language2=$param['language2']:$language2=addslashes($param['language2']); else $language2='';
|
---|
| 48 | if (isset($param['flash2'])) get_magic_quotes_gpc() ? $flash2=$param['flash2']:$flash2=addslashes($param['flash2']); else $flash2='';
|
---|
| 49 | if (isset($param['displayerrors'])) $displayerrors=intval($param['displayerrors']); else $displayerrors='0';
|
---|
| 50 |
|
---|
| 51 | if (isset($param['gkey'])) get_magic_quotes_gpc() ? $gkey=$param['gkey']:$gkey=addslashes($param['gkey']); else $gkey='';
|
---|
| 52 | if (isset($param['ed_user'])) get_magic_quotes_gpc() ? $ed_user=$param['ed_user']:$ed_user=addslashes($param['ed_user']); else $ed_user='';
|
---|
| 53 | if (isset($param['googlemaps'])) $googlemaps=intval($param['googlemaps']); else $googlemaps='0';
|
---|
| 54 | if (isset($param['editor'])) $editor=intval($param['editor']); else $editor='0';
|
---|
[230] | 55 | if (isset($param['tema_on'])) $tema_on=intval($param['tema_on']); else $tema_on='0';
|
---|
| 56 | if (isset($param['help'])) $help=intval($param['help']);
|
---|
[48] | 57 |
|
---|
[2] | 58 | /******************************************************/
|
---|
| 59 | /*Funzione di visualizzazione globale */
|
---|
| 60 | /*****************************************************/
|
---|
| 61 | function all() {
|
---|
[48] | 62 | global $tipo_cons,$param,$currentlang, $bgcolor1, $bgcolor2, $prefix, $prefix2, $dbi, $offset, $min, $id_cons,$id_cons_gen,$id_comune,$do,$tema,$language,$help;
|
---|
[2] | 63 | global $gkey,$ed_user,$googlemaps,$editor,$tema_on;
|
---|
| 64 | // $restemp = mysql_query("select count(0) from ".$prefix."_ele_conf where tema='$tema'", $dbi);
|
---|
| 65 | // list($numtemp)=mysql_fetch_row($restemp);
|
---|
| 66 |
|
---|
| 67 |
|
---|
[230] | 68 | if (isset($help)) include("language/$language/ele_configurazione.html");
|
---|
[2] | 69 |
|
---|
| 70 | //-----------------------visualizza riga superiore per inserimento -
|
---|
| 71 | echo "<form name=\"gruppo2\" enctype=\"multipart/form-data\" method=\"post\" action=\"admin.php\">"
|
---|
| 72 | ."<input type=\"hidden\" name=\"op\" value=\"confconsiglio\">";
|
---|
| 73 | $resl = mysql_query("SELECT * FROM ".$prefix."_config", $dbi);
|
---|
| 74 | $gru=mysql_fetch_array($resl);
|
---|
| 75 | echo "<input type=\"hidden\" name=\"do\" value=\"update\">";
|
---|
| 76 | echo "<input type=\"hidden\" name=\"op\" value=\"configurazione\">";
|
---|
[53] | 77 | echo "<br><table style=\"color: #000000;\">";
|
---|
[2] | 78 | echo "<tr bgcolor=\"$bgcolor2\"><td colspan=\"4\" align=\"center\"><b>"._CONFIGDEFAULT."</b></td></tr><tr><td> </td></tr>";
|
---|
| 79 | echo "<tr><td>";
|
---|
| 80 | $sel= ($gru['tema_on']==1) ? "selected":"";
|
---|
| 81 | echo "<b>"._TEMAATTIVO."</b></td><td><select name=\"tema_on\"><option value=\"0\">No<option value=\"1\" $sel>Si</select></td>";
|
---|
| 82 | echo "<td>";
|
---|
| 83 | echo "<b>"._TEMA."</b></td>";
|
---|
| 84 | ##########
|
---|
| 85 | $resmod = mysql_query("SELECT tema FROM ".$prefix."_ele_temi order by tema", $dbi);
|
---|
| 86 |
|
---|
[240] | 87 | echo "<td><select name=\"tema2\">\n";
|
---|
| 88 |
|
---|
[2] | 89 | while (list($desc) = mysql_fetch_row($resmod)){
|
---|
| 90 | if (!$gru['tema']) $gru['tema']=$desc;
|
---|
[240] | 91 | $sel= ($gru['tema']==$desc) ? "selected":"";
|
---|
| 92 | echo "<option value=\"".$desc."\" $sel>".$desc."\n";
|
---|
| 93 |
|
---|
[2] | 94 | }
|
---|
| 95 | echo "</select></td></tr>";
|
---|
| 96 | $sel= ($gru['blocco']==1) ? "selected":"";
|
---|
| 97 | echo "<tr><td><b>"._BLOCCO."</b></td><td><select name=\"blocco\"><option value=\"0\">No<option value=\"1\" $sel>Si</select></td>";
|
---|
| 98 | $sel= ($gru['flash']==1) ? "selected":"";
|
---|
| 99 | echo "<td><b>"._FLASH."</b></td><td><select name=\"flash2\"><option value=\"0\">No<option value=\"1\" $sel>Si</select></td>";
|
---|
| 100 | echo "</tr>";
|
---|
| 101 | $sel= ($gru['multicomune']==1) ? "selected":"";
|
---|
| 102 | echo "<tr><td><b>"._MULTICOMUNE."</b></td><td><select name=\"multicomune\"><option value=\"0\">No<option value=\"1\" $sel>Si</select></td>";
|
---|
| 103 | // echo "<td><b>"._FILEOUT."</b></td><td><input type=\"text\" name=\"fileout\">".$gru['fileout']."</td>";
|
---|
| 104 | # echo "</tr>"
|
---|
| 105 | # ."<tr><td><b>"._PREFIX."</b></td><td><input type=\"text\" name=\"prefix2\" value=\"".$gru['prefix']."\"></td>"
|
---|
| 106 | echo "<td><b>"._ADMINMAIL."</b></td><td><input type=\"text\" name=\"adminmail\" value=\"".$gru['adminmail']."\"></td></tr>"
|
---|
| 107 | ."<tr><td><b>"._SITEURL."</b></td><td><input type=\"text\" name=\"siteurl\" value=\"".$gru['siteurl']."\"></td>";
|
---|
| 108 | echo"<td><b>"._TESTATA."</b></td>";
|
---|
[240] | 109 | echo "<td><input type=\"file\" name=\"sitelogo\" size=\"10\"></td><td> </td></tr>";
|
---|
| 110 |
|
---|
| 111 | echo"<td><b>"._SITENAME."</b></td><td><input type=\"text\" name=\"sitename\" value=\"".$gru['sitename']."\"></td></tr>";
|
---|
| 112 |
|
---|
[2] | 113 | $resmod = mysql_query("SELECT id_comune,descrizione FROM ".$prefix."_ele_comuni order by descrizione", $dbi);
|
---|
| 114 | echo "<tr><td><b>"._SITEISTAT."</b></td>";
|
---|
| 115 | echo "<td><select name=\"siteistat\"><option value=\"\">";
|
---|
| 116 | while (list($id_comune2,$desc) = mysql_fetch_row($resmod)){
|
---|
| 117 | if (!$gru['siteistat']) $gru['siteistat']=$id_comune2;
|
---|
| 118 | $sel= ($gru['siteistat']==$id_comune2) ? "selected":"";
|
---|
| 119 | echo "<option value=\"".$id_comune2."\" $sel>".$desc;
|
---|
| 120 | }
|
---|
| 121 | echo "</select></td>";
|
---|
| 122 |
|
---|
| 123 | ##########
|
---|
| 124 | echo "<td><b>"._LANGUAGE."</b></td><td><input type=\"text\" name=\"language2\" value=\"".$gru['language']."\"></td></tr>";
|
---|
| 125 | $sel= ($gru['googlemaps']==1) ? "selected":"";
|
---|
| 126 | echo "<tr><td><b>"._GOOGLEMAPS."</b></td><td><select name=\"googlemaps\"><option value=\"0\">No<option value=\"1\" $sel>Si</select></td>";
|
---|
[240] | 127 | /* tolta la chiave
|
---|
[2] | 128 | echo "<td><b>"._GKEY."</b></td><td><input type=\"text\" name=\"gkey\" value=\"".$gru['gkey']."\"></td></tr>";
|
---|
[240] | 129 | */
|
---|
[2] | 130 | $sel= ($gru['editor']==1) ? "selected":"";
|
---|
[240] | 131 | echo "<td><b>"._EDITOR."</b></td><td><select name=\"editor\"><option value=\"0\">No<option value=\"1\" $sel>Si</select></td></tr>";
|
---|
| 132 |
|
---|
| 133 | /* echo "<td><b>"._EDUSER."</b></td>";
|
---|
[2] | 134 | echo "<td><select name=\"ed_user\">";
|
---|
[240] | 135 |
|
---|
[2] | 136 | $sel=$gru['ed_user']=='Admin'? "selected":"";
|
---|
| 137 | echo "<option value=\"Admin\" $sel>Admin";
|
---|
| 138 | $sel=$gru['ed_user']=='User'? "selected":"";
|
---|
| 139 | echo "<option value=\"User\" $sel>User";
|
---|
| 140 | $sel=$gru['ed_user']=='Eleonline'? "selected":"";
|
---|
| 141 | echo "<option value=\"Eleonline\" $sel>Eleonline</td></tr>";
|
---|
[240] | 142 | */
|
---|
[2] | 143 |
|
---|
| 144 | echo "<tr>";
|
---|
| 145 |
|
---|
| 146 | # $sel= ($gru['displayerrors']==1) ? "selected":"";
|
---|
| 147 | # echo "<td><b>"._DISPLAYERRORS."</b></td><td><select name=\"displayerrors\"><option value=\"0\">No<option value=\"1\" $sel>Si</select>";
|
---|
| 148 | echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">";
|
---|
| 149 | echo "<td><input type=\"submit\" name=\"add\" value=\""._MODIFY."\"></td>";
|
---|
| 150 | echo "</tr>";
|
---|
| 151 | echo "</table>";
|
---|
| 152 | echo "</form><br>";
|
---|
| 153 |
|
---|
| 154 | }
|
---|
| 155 |
|
---|
| 156 | //***********************************************************
|
---|
| 157 | //Funzione di inserimento e gestione dei gruppi
|
---|
| 158 | //************************************************************
|
---|
| 159 |
|
---|
| 160 | function confcons() {
|
---|
| 161 |
|
---|
| 162 | global $id_cons_gen, $prefix, $dbi, $blocco,$tema2,$multicomune,$fileout,$prefix2,$adminmail,$siteurl,$sitename,$siteistat,$language2,$flash2,$displayerrors;
|
---|
| 163 | global $gkey,$ed_user,$googlemaps,$editor,$tema_on;
|
---|
| 164 |
|
---|
| 165 | $aid=$_SESSION['aid'];
|
---|
| 166 | $perms=ChiSei($id_cons_gen);
|
---|
| 167 | if ($perms >128) {
|
---|
| 168 | $stemmablob='';
|
---|
| 169 | $stemmanome='';
|
---|
| 170 | $STEMM=$_FILES['sitelogo'];
|
---|
| 171 | $filestemma=$STEMM['tmp_name'];
|
---|
| 172 | $nomestemma=$STEMM['name'];
|
---|
| 173 | $sqlset='';
|
---|
| 174 | if ($filestemma){
|
---|
| 175 | $fdstemma = fopen ("$filestemma", "rb");
|
---|
| 176 | $stemmacontents = fread ($fdstemma, filesize ("$filestemma"));
|
---|
| 177 | fclose ($fdstemma);
|
---|
| 178 | $stemmablob=addslashes($stemmacontents);
|
---|
| 179 | $stemmanome=addslashes($nomestemma);
|
---|
| 180 | }
|
---|
[230] | 181 | #displayerrors='$displayerrors',
|
---|
[31] | 182 | #per il momento non Ú usato: , site_logo='$site_logo'
|
---|
[240] | 183 | $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());
|
---|
[2] | 184 | if ($tema2=='facebook')
|
---|
| 185 | $_SESSION['tema']=$tema2;
|
---|
| 186 | else $_SESSION['tema']='default';
|
---|
| 187 | Header("Location: admin.php?id_cons_gen=$id_cons_gen");
|
---|
| 188 |
|
---|
| 189 | }
|
---|
| 190 | }
|
---|
| 191 |
|
---|
| 192 | if ($do and $do="modify")
|
---|
| 193 | confcons();
|
---|
| 194 |
|
---|
| 195 | ele();
|
---|
| 196 |
|
---|
| 197 | all();
|
---|
| 198 | echo"</td></tr></table>";
|
---|
| 199 | include("footer.php");
|
---|
| 200 |
|
---|
| 201 |
|
---|
| 202 |
|
---|
| 203 |
|
---|
| 204 | ?>
|
---|
| 205 |
|
---|