[2] | 1 | <?php
|
---|
| 2 | /************************************************************************/
|
---|
| 3 | /* Eleonline - Raccolta e diffusione dei dati elettorali */
|
---|
| 4 | /* by Luciano Apolito & Roberto Gigli */
|
---|
| 5 | /* http://www.eleonline.it */
|
---|
| 6 | /* info@eleonline.it luciano@aniene.net rgigli@libero.it */
|
---|
| 7 | /************************************************************************/
|
---|
| 8 |
|
---|
[34] | 9 | if (!defined('ADMIN_FILE')) {
|
---|
[2] | 10 | die ("You can't access this file directly...");
|
---|
| 11 | }
|
---|
| 12 |
|
---|
| 13 | /************************
|
---|
| 14 | Funzione Menu a cascata
|
---|
| 15 | *************************/
|
---|
| 16 |
|
---|
| 17 |
|
---|
| 18 | // definizione variabile per button 'ok' nei form per il noscript
|
---|
| 19 | $button="<br /><object><noscript><div><input name=\"vai\" type=\"image\" src=\"modules/Elezioni/images/ok2.jpg\" alt=\"ok\" title=\"ok\" /></div></noscript></object>";
|
---|
| 20 |
|
---|
[257] | 21 | $sql="select descrizione,fascia from ".$prefix."_ele_comuni where id_comune=$id_comune";
|
---|
| 22 | $sth = $dbi->prepare("$sql");
|
---|
| 23 | $sth->execute();
|
---|
| 24 | $row = $sth->fetch(PDO::FETCH_BOTH);
|
---|
| 25 | list($descr_com,$fascia)=explode($row);
|
---|
[2] | 26 | echo '<style type="text/css">
|
---|
| 27 | html,body{margin:0;padding:0}
|
---|
| 28 | body{background:#FFF;color:#333}
|
---|
| 29 | div#contiene{width:999px;margin:0 auto;background: #3B5998;color:#fff}
|
---|
| 30 | </style>
|
---|
| 31 | <link rel="stylesheet" type="text/css" href="temi/facebook/menu/menu-dd.css">
|
---|
| 32 | <script type="text/javascript" src="temi/facebook/menu/jquery-1.2.6.pack.js"></script>
|
---|
| 33 | <script type="text/javascript" src="temi/facebook/menu/jquery.hoverIntent.minified.js"></script>
|
---|
| 34 | <script type="text/javascript" src="temi/facebook/menu/jquery-ddi2.js"></script>
|
---|
| 35 | <div id="contiene">
|
---|
| 36 |
|
---|
| 37 |
|
---|
| 38 | <ul id="nav"><li>
|
---|
| 39 | <a href="http://www.eleonline.it"><span style="font-size:18px;font: Comics;"><strong>elebook</strong></span></a>
|
---|
| 40 | </li>
|
---|
| 41 | <li>
|
---|
| 42 | <a href="index.php"><strong>Home</strong></a>
|
---|
| 43 | </li>';
|
---|
| 44 |
|
---|
| 45 |
|
---|
| 46 |
|
---|
| 47 | // inizio tabella
|
---|
| 48 |
|
---|
| 49 |
|
---|
| 50 | /***********************************
|
---|
| 51 | Scelta Comune
|
---|
| 52 | ***********************************/
|
---|
| 53 |
|
---|
| 54 | if ($multicomune=='1')
|
---|
| 55 | {
|
---|
[257] | 56 | $sql="select t1.id_comune,t1.descrizione,count(0) from ".$prefix."_ele_comuni as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_comune=t2.id_comune group by t1.id_comune,t1.descrizione order by t1.descrizione asc";
|
---|
| 57 | $sth = $dbi->prepare("$sql");
|
---|
| 58 | $sth->execute();
|
---|
| 59 | $row = $sth->fetch(PDO::FETCH_BOTH);
|
---|
| 60 | $esiste_multi=mysql_num_rows($rescomu);
|
---|
[2] | 61 | if ($esiste_multi>=1) {
|
---|
| 62 | echo " <li>
|
---|
| 63 | <a href=\"#\"><strong>"._COMUNI."</strong></a>
|
---|
| 64 |
|
---|
| 65 | <ul>";
|
---|
| 66 |
|
---|
[257] | 67 | while (list($id,$descrizione,)=$sth->fetch(PDO::FETCH_NUM)){
|
---|
[2] | 68 | echo "<li><a href=\"modules.php?op=gruppo&name=Elezioni&id_comune=$id&file=index\">$descrizione</a></li>";
|
---|
| 69 | }
|
---|
| 70 | echo "</ul></li>";
|
---|
| 71 |
|
---|
| 72 | }
|
---|
| 73 | } // fine scelta comune
|
---|
| 74 |
|
---|
| 75 |
|
---|
| 76 |
|
---|
| 77 | /***********************************
|
---|
| 78 | Scelta Consultazione
|
---|
| 79 | ***********************************/
|
---|
| 80 |
|
---|
[257] | 81 | $sql = "SELECT t1.id_cons_gen,t1.descrizione FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune='$id_comune' and t2.chiusa!='2' order by t1.data_fine desc";
|
---|
| 82 | $sth = $dbi->prepare("$sql");
|
---|
| 83 | $sth->execute();
|
---|
| 84 | $esiste=$sth->rowCount();
|
---|
[2] | 85 | //se esiste consultazione fa vedere i dati
|
---|
| 86 | if ($esiste>=1) {
|
---|
| 87 | echo " <li>
|
---|
| 88 | <a href=\"#\"><strong>"._ELEZIONI."</strong></a>
|
---|
| 89 | <ul>";
|
---|
| 90 |
|
---|
[257] | 91 | while(list($id,$descrizione) = $sth->fetch(PDO::FETCH_NUM)) {
|
---|
[2] | 92 | echo "<li><a href=\"modules.php?op=gruppo&name=Elezioni&id_comune=$id_comune&file=index&id_cons_gen=$id\">
|
---|
| 93 | ".substr($descrizione,0,31)."</a></li>";
|
---|
| 94 |
|
---|
| 95 | }
|
---|
| 96 |
|
---|
| 97 |
|
---|
| 98 | echo "</ul></li>";
|
---|
| 99 |
|
---|
| 100 |
|
---|
| 101 |
|
---|
| 102 |
|
---|
| 103 |
|
---|
| 104 | /***********************************
|
---|
| 105 | Scelta Info
|
---|
| 106 | ***********************************/
|
---|
| 107 | //$temp = array('confronti'=>'','come'=>'','numeri'=>'','servizi'=>'','link'=>'','dati'=>'','affluenze_sez'=>'','votanti'=>'');
|
---|
| 108 |
|
---|
| 109 | echo " <li><a href=\"#\"><strong>"._INFO."</strong></a>
|
---|
| 110 | <ul>";
|
---|
| 111 | echo "
|
---|
| 112 | <li class=\"sep\"><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&op=come&id_comune=$id_comune&file=index&info=confronti\">"._CONFRONTI."</a><span></span></li>
|
---|
| 113 | <li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&op=come&id_comune=$id_comune&file=index&info=come\">"._COME."</a></li>
|
---|
| 114 | <li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&op=come&id_comune=$id_comune&file=index&info=numeri\">"._NUMERI."</a></li>
|
---|
| 115 | <li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&op=come&id_comune=$id_comune&file=index&info=servizi\">"._SERVIZI."</a></li>
|
---|
| 116 | <li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&op=come&id_comune=$id_comune&file=index&info=link\">"._LINK."</a></li>
|
---|
| 117 | <li class=\"sep\"><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&op=come&id_comune=$id_comune&file=index&info=dati\">"._DATI."</a><span></span></li>
|
---|
| 118 | <li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&op=come&id_comune=$id_comune&file=index&info=affluenze_sez\">"._AFFLUENZE."</a></li>
|
---|
| 119 | <li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&op=come&id_comune=$id_comune&file=index&info=votanti\">"._VOTANTI."</a></li>
|
---|
| 120 |
|
---|
| 121 | ";
|
---|
| 122 |
|
---|
| 123 |
|
---|
| 124 | echo "</ul></li>";
|
---|
| 125 |
|
---|
| 126 |
|
---|
| 127 | /***********************************
|
---|
| 128 | Scelta Dati
|
---|
| 129 | ***********************************/
|
---|
| 130 |
|
---|
| 131 | $res = mysql_query("SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ", $dbi);
|
---|
[257] | 132 | $sql = "SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons'";
|
---|
| 133 | $sth = $dbi->prepare("$sql");
|
---|
| 134 | $sth->execute();
|
---|
| 135 | list($num_circ) = $sth->fetch(PDO::FETCH_NUM);
|
---|
[2] | 136 | echo " <li><a href=\"#\"><strong>"._RISULTATI."</strong></a>
|
---|
| 137 | <ul>";
|
---|
| 138 | if ($genere!=4) {
|
---|
| 139 | echo "<li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=gruppo_circo\">".substr(_GRUPPO." "._PER." "._CIRCO,0,33)."</a></li>
|
---|
| 140 | <li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=gruppo_sezione\">".substr(_GRUPPO." "._PER." "._SEZIONI,0,33)."</a></li>";
|
---|
| 141 | }
|
---|
| 142 |
|
---|
| 143 | if (!$votol and $fascia>$limite){ // si vota per la lista
|
---|
| 144 | if ($genere>2) {
|
---|
| 145 | if (!$circo and $num_circ>1)
|
---|
| 146 | echo "<li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=lista_circo\">".substr(_LISTA." "._PER." "._CIRCO,0,33)."</a></li>
|
---|
| 147 | <li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=lista_sezione\">".substr(_LISTA." "._PER." "._SEZIONI,0,33)."</a></li>";
|
---|
| 148 |
|
---|
| 149 |
|
---|
| 150 | }
|
---|
| 151 |
|
---|
| 152 | }
|
---|
| 153 | if ($genere>3 and !$votoc) {
|
---|
| 154 | if (!$votoc){
|
---|
| 155 | if(!$circo and $num_circ>1)
|
---|
| 156 | echo "<li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=candidato_circo\">".substr(_CONSI." "._PER." "._CIRCO,0,33)."</a></li>
|
---|
| 157 | <li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=candidato_sezione\">".substr(_CONSI." "._PER." "._SEZIONI,0,33)."</a></li>";
|
---|
| 158 |
|
---|
| 159 | }
|
---|
| 160 | }
|
---|
| 161 | if ($tipo_cons==3 and $hondt>=1) {
|
---|
| 162 | echo "<li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=consiglieri\">"._CALCONS."</a></li>";
|
---|
| 163 | }
|
---|
| 164 |
|
---|
| 165 |
|
---|
| 166 | echo "</ul></li>";
|
---|
| 167 |
|
---|
| 168 |
|
---|
| 169 |
|
---|
| 170 |
|
---|
| 171 | /***********************************
|
---|
| 172 | Scelta Grafici
|
---|
| 173 | ***********************************/
|
---|
| 174 |
|
---|
| 175 | echo " <li><a href=\"#\"><strong>"._GRAFICI."</strong></a>
|
---|
| 176 | <ul>";
|
---|
| 177 |
|
---|
| 178 |
|
---|
| 179 | echo "<li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=affluenze_graf\">"._AFFLUENZE."</a></li>";
|
---|
| 180 |
|
---|
| 181 | echo "<li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=graf_votanti\">"._VOTI."</a></li>";
|
---|
| 182 | if($genere!=4){
|
---|
| 183 | echo "<li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=graf_gruppo\">"._GRUPPO."</a></li>";
|
---|
| 184 | }
|
---|
| 185 | if ($genere>2){
|
---|
| 186 | if (!$circo && !$votog) {
|
---|
| 187 | echo "<li><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=graf_candidato\">"._CONSI."</a></li>";
|
---|
| 188 | }
|
---|
| 189 | }
|
---|
| 190 |
|
---|
| 191 | echo "</ul></li>";
|
---|
| 192 |
|
---|
| 193 |
|
---|
| 194 | } // fine verifica esistenza consultazione : variabile $esiste
|
---|
| 195 |
|
---|
| 196 |
|
---|
| 197 |
|
---|
| 198 | ################ tema #####
|
---|
| 199 | if ($tema_on=="1"){
|
---|
| 200 |
|
---|
| 201 |
|
---|
| 202 | include("temi/facebook/tema.php");
|
---|
| 203 |
|
---|
| 204 | }
|
---|
| 205 | //echo "</div>";
|
---|
| 206 | echo " <li><a href=\"#\"><strong>"._OPTIONS."</strong></a>
|
---|
| 207 | <ul>";
|
---|
| 208 |
|
---|
| 209 | language();
|
---|
| 210 |
|
---|
| 211 | flash();
|
---|
| 212 |
|
---|
| 213 | noblocco();
|
---|
| 214 | echo "</ul></li>";
|
---|
| 215 | echo "</div>";
|
---|
| 216 |
|
---|
| 217 |
|
---|
| 218 | # linguaggio x demo
|
---|
| 219 |
|
---|
| 220 | function language(){
|
---|
| 221 | global $lang,$name,$op,$file,$filelang,$id_comune,$op,$id_cons,$id_cons_gen;
|
---|
| 222 | $filename=$filelang;
|
---|
| 223 | // linguaggio
|
---|
| 224 |
|
---|
| 225 | $menulist='';
|
---|
| 226 | // scelta linguaggio
|
---|
| 227 | $langdir = dir("modules/Elezioni/language");
|
---|
| 228 | while($func=$langdir->read()) {
|
---|
| 229 | if(substr($func, 0, 5) == "lang-") {
|
---|
| 230 | $menulist .= "$func ";
|
---|
| 231 | }
|
---|
| 232 | }
|
---|
| 233 | closedir($langdir->handle);
|
---|
| 234 | $menulist = explode(" ", $menulist);
|
---|
| 235 | sort($menulist);
|
---|
| 236 | for ($i=0; $i < sizeof($menulist); $i++) {
|
---|
| 237 | if($menulist[$i]!="") {
|
---|
[23] | 238 | $tl = preg_replace("/lang-/","",$menulist[$i]);
|
---|
| 239 | $tl = preg_replace("/.php/","",$tl);
|
---|
[2] | 240 | $altlang = ucfirst($tl);
|
---|
| 241 |
|
---|
| 242 | if ($lang==$tl) $bordo="class=\"bordo\"";else $bordo="class=\"nobordo\"";
|
---|
| 243 | echo "<li><a href=\"modules.php?name=$name&op=$op&id_comune=$id_comune&id_cons=$id_cons&id_cons_gen=$id_cons_gen&newl=$tl\"><img $bordo src=\"modules/Elezioni/images/$tl.gif\" alt=\"$altlang\" title=\"$altlang\" width=\"15\" /> "._LINGUA." $tl</a></li>";
|
---|
| 244 | }
|
---|
| 245 | }
|
---|
| 246 |
|
---|
| 247 | }
|
---|
| 248 |
|
---|
| 249 |
|
---|
| 250 |
|
---|
| 251 |
|
---|
| 252 |
|
---|
| 253 |
|
---|
| 254 | ########################### Blocchi
|
---|
| 255 | # flash x demo
|
---|
| 256 | function flash(){
|
---|
| 257 | global $flash,$name,$id_comune,$op,$id_cons,$id_cons_gen;
|
---|
| 258 |
|
---|
| 259 | if ($flash=='1'){
|
---|
| 260 | echo "<li><a href=\"modules.php?name=$name&op=$op&id_comune=$id_comune&id_cons=$id_cons&id_cons_gen=$id_cons_gen&flash=0\"><img class=\"nobordo\" src=\"modules/Elezioni/images/flashno.gif\" alt=\"NoFlash\" title=\"NoFlash\" width=\"15\"/> "._OFF." Flash</a></li>";
|
---|
| 261 |
|
---|
| 262 | }else{
|
---|
| 263 |
|
---|
| 264 | echo "<li><a href=\"modules.php?name=$name&op=$op&id_comune=$id_comune&id_cons=$id_cons&id_cons_gen=$id_cons_gen&flash=1\"><img class=\"nobordo\" src=\"modules/Elezioni/images/flashyes.gif\" alt=\"YesFlash\" title=\"YesFlash\" width=\"15\" /> "._ON." Flash</a></li>";
|
---|
| 265 |
|
---|
| 266 |
|
---|
| 267 | }
|
---|
| 268 |
|
---|
| 269 | }
|
---|
| 270 |
|
---|
| 271 |
|
---|
| 272 | # blocco no
|
---|
| 273 | function noblocco(){
|
---|
| 274 | global $blocco,$name,$id_comune,$op,$id_cons,$id_cons_gen;
|
---|
| 275 |
|
---|
| 276 | if ($blocco=='1'){
|
---|
| 277 | echo "<li><a href=\"modules.php?name=$name&op=$op&id_comune=$id_comune&id_cons=$id_cons&id_cons_gen=$id_cons_gen&block=0\"><img class=\"nobordo\" src=\"modules/Elezioni/images/close.gif\" alt=\"NoBlocco\" title=\"NoBlocco\" width=\"15\"/> "._OFF." "._BLOCCO."</a></li>";
|
---|
| 278 |
|
---|
| 279 | }else{
|
---|
| 280 |
|
---|
| 281 | echo "<li><a href=\"modules.php?name=$name&op=$op&id_comune=$id_comune&id_cons=$id_cons&id_cons_gen=$id_cons_gen&block=1\"><img class=\"nobordo\" src=\"modules/Elezioni/images/open.gif\" alt=\"YesBlocco\" title=\"YesBlocco\" width=\"15\" /> "._ON." "._BLOCCO."</a></li>";
|
---|
| 282 |
|
---|
| 283 | }
|
---|
| 284 |
|
---|
| 285 | }
|
---|
| 286 |
|
---|
| 287 |
|
---|
| 288 |
|
---|
| 289 |
|
---|
| 290 |
|
---|
| 291 |
|
---|
| 292 |
|
---|
| 293 | ?>
|
---|