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