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