[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)) {
|
---|
[254] | 106 | echo "<li class=\"icon matita\" ><a href=\"modules.php?op=gruppo&name=Elezioni&id_comune=$id_comune&file=index&id_cons_gen=$id\">
|
---|
| 107 | ".substr($descrizione,0,33)."</a></li>";
|
---|
| 108 |
|
---|
| 109 | }
|
---|
| 110 |
|
---|
| 111 |
|
---|
| 112 | echo "</ul></li>";
|
---|
| 113 |
|
---|
| 114 |
|
---|
| 115 |
|
---|
| 116 |
|
---|
| 117 |
|
---|
| 118 | /***********************************
|
---|
| 119 | Scelta Info
|
---|
| 120 | ***********************************/
|
---|
| 121 | //$temp = array('confronti'=>'','come'=>'','numeri'=>'','servizi'=>'','link'=>'','dati'=>'','affluenze_sez'=>'','votanti'=>'');
|
---|
| 122 |
|
---|
| 123 | echo " <li><a href=\"#\"><strong>"._INFO."</strong></a>
|
---|
| 124 | <ul>";
|
---|
| 125 | echo "
|
---|
| 126 | <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>
|
---|
| 127 | <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>
|
---|
| 128 | <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>
|
---|
| 129 | <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>
|
---|
| 130 | <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>
|
---|
| 131 | <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>
|
---|
| 132 | <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>
|
---|
| 133 | <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>
|
---|
| 134 |
|
---|
| 135 | ";
|
---|
| 136 |
|
---|
| 137 |
|
---|
| 138 | echo "</ul></li>";
|
---|
| 139 |
|
---|
| 140 |
|
---|
| 141 | /***********************************
|
---|
| 142 | Scelta Dati
|
---|
| 143 | ***********************************/
|
---|
| 144 |
|
---|
[265] | 145 | $sql="SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ";
|
---|
| 146 | $res = $dbi->prepare("$sql");
|
---|
| 147 | $res->execute();
|
---|
| 148 |
|
---|
| 149 | list($num_circ) = $res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 150 | echo " <li><a href=\"#\"><strong>"._RISULTATI."</strong></a>
|
---|
| 151 | <ul>";
|
---|
| 152 | if ($genere!=4) {
|
---|
| 153 | if (!$circo and $num_circ>1)
|
---|
| 154 | 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>";
|
---|
| 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_sezione\">".substr(_GRUPPO." "._PER." "._SEZIONI,0,36)."</a></li>";
|
---|
| 156 | }
|
---|
| 157 |
|
---|
[282] | 158 | if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
|
---|
[254] | 159 | if ($genere>2) {
|
---|
| 160 | if (!$circo and $num_circ>1)
|
---|
| 161 | 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>";
|
---|
| 162 |
|
---|
| 163 | 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>";
|
---|
| 164 |
|
---|
| 165 |
|
---|
| 166 | }
|
---|
| 167 |
|
---|
| 168 | }
|
---|
| 169 | if ($genere>3 and !$votoc) {
|
---|
| 170 | if (!$votoc){
|
---|
| 171 | if(!$circo and $num_circ>1)
|
---|
| 172 | 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>";
|
---|
| 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_sezione\">".substr(_CONSI." "._PER." "._SEZIONI,0,36)."</a></li>";
|
---|
| 174 |
|
---|
| 175 | }
|
---|
| 176 | }
|
---|
[265] | 177 | $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" ;
|
---|
| 178 | $resc = $dbi->prepare("$sql");
|
---|
| 179 | $resc->execute();
|
---|
[254] | 180 |
|
---|
[265] | 181 | list($chiusa)=$resc->fetch(PDO::FETCH_NUM);
|
---|
| 182 |
|
---|
[254] | 183 | if ($hondt>=1 and $chiusa==1) {
|
---|
| 184 | 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>";
|
---|
| 185 |
|
---|
| 186 | }
|
---|
| 187 |
|
---|
| 188 |
|
---|
| 189 | echo "</ul></li>";
|
---|
| 190 |
|
---|
| 191 |
|
---|
| 192 |
|
---|
| 193 |
|
---|
| 194 | /***********************************
|
---|
| 195 | Scelta Grafici
|
---|
| 196 | ***********************************/
|
---|
| 197 |
|
---|
| 198 | echo " <li><a href=\"#\"><strong>"._GRAFICI."</strong></a>
|
---|
| 199 | <ul>";
|
---|
| 200 |
|
---|
| 201 |
|
---|
| 202 | 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>";
|
---|
| 203 |
|
---|
| 204 | 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>";
|
---|
| 205 | #inutile if($genere!=4 || $tipo_cons==8)
|
---|
| 206 | 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] | 207 | if($hondt==0) $limite=0;
|
---|
[292] | 208 | if(($genere==3 || $genere==5) and ($fascia>$limite || $limite==0))
|
---|
[254] | 209 | 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>";
|
---|
| 210 |
|
---|
| 211 | if ($genere>3){
|
---|
| 212 | if (!$circo && !$votog && !$votoc) {
|
---|
| 213 | 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>";
|
---|
| 214 | }
|
---|
| 215 | }
|
---|
| 216 |
|
---|
| 217 | echo "</ul></li>";
|
---|
| 218 |
|
---|
| 219 |
|
---|
| 220 | } // fine verifica esistenza consultazione : variabile $esiste
|
---|
| 221 |
|
---|
| 222 |
|
---|
| 223 |
|
---|
| 224 | ################ tema #####
|
---|
| 225 | if ($tema_on=="1"){
|
---|
| 226 |
|
---|
| 227 |
|
---|
| 228 | include("temi/facebook/tema.php");
|
---|
| 229 |
|
---|
| 230 | }
|
---|
| 231 | //echo "</div>";
|
---|
| 232 | echo " <li><a href=\"#\"><strong>"._OPTIONS."</strong></a>
|
---|
| 233 | <ul>";
|
---|
| 234 |
|
---|
| 235 | language();
|
---|
| 236 |
|
---|
| 237 | flash();
|
---|
| 238 |
|
---|
| 239 | noblocco();
|
---|
| 240 | echo "</ul></li>";
|
---|
| 241 |
|
---|
| 242 | echo "<li><a href=\"http://www.eleonline.it/site/modules.php?name=Contatti\"><i><span style=\"font-size:10px;\">
|
---|
| 243 | by luciano apolito & roberto gigli</span></i></a>
|
---|
| 244 | </li>";
|
---|
| 245 |
|
---|
| 246 | echo "</div>";
|
---|
| 247 |
|
---|
| 248 |
|
---|
| 249 | # linguaggio x demo
|
---|
| 250 |
|
---|
| 251 | function language(){
|
---|
| 252 | global $lang,$name,$op,$file,$filelang,$id_comune,$op,$id_cons,$id_cons_gen;
|
---|
| 253 | $filename=$filelang;
|
---|
| 254 | // linguaggio
|
---|
| 255 |
|
---|
| 256 | $menulist='';
|
---|
| 257 | // scelta linguaggio
|
---|
| 258 | $langdir = dir("modules/Elezioni/language");
|
---|
| 259 | while($func=$langdir->read()) {
|
---|
| 260 | if(substr($func, 0, 5) == "lang-") {
|
---|
| 261 | $menulist .= "$func ";
|
---|
| 262 | }
|
---|
| 263 | }
|
---|
| 264 | closedir($langdir->handle);
|
---|
| 265 | $menulist = explode(" ", $menulist);
|
---|
| 266 | sort($menulist);
|
---|
| 267 | for ($i=0; $i < sizeof($menulist); $i++) {
|
---|
| 268 | if($menulist[$i]!="") {
|
---|
| 269 | $tl = preg_replace("/lang-/","",$menulist[$i]);
|
---|
| 270 | $tl = preg_replace("/.php/","",$tl);
|
---|
| 271 | $altlang = ucfirst($tl);
|
---|
| 272 |
|
---|
| 273 | if ($lang==$tl) $bordo="class=\"bordo\"";else $bordo="class=\"nobordo\"";
|
---|
| 274 | 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>";
|
---|
| 275 | }
|
---|
| 276 | }
|
---|
| 277 |
|
---|
| 278 | }
|
---|
| 279 |
|
---|
| 280 |
|
---|
| 281 |
|
---|
| 282 |
|
---|
| 283 |
|
---|
| 284 |
|
---|
| 285 | ########################### Blocchi
|
---|
| 286 | # flash x demo
|
---|
| 287 | function flash(){
|
---|
| 288 | global $flash,$name,$id_comune,$op,$id_cons,$id_cons_gen;
|
---|
| 289 |
|
---|
| 290 | if ($flash=='1'){
|
---|
| 291 | 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>";
|
---|
| 292 |
|
---|
| 293 | }else{
|
---|
| 294 |
|
---|
| 295 | 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>";
|
---|
| 296 |
|
---|
| 297 |
|
---|
| 298 | }
|
---|
| 299 |
|
---|
| 300 | }
|
---|
| 301 |
|
---|
| 302 |
|
---|
| 303 | # blocco no
|
---|
| 304 | function noblocco(){
|
---|
| 305 | global $blocco,$name,$id_comune,$op,$id_cons,$id_cons_gen;
|
---|
| 306 |
|
---|
| 307 | if ($blocco=='1'){
|
---|
| 308 | 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>";
|
---|
| 309 |
|
---|
| 310 | }else{
|
---|
| 311 |
|
---|
| 312 | 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>";
|
---|
| 313 |
|
---|
| 314 | }
|
---|
| 315 |
|
---|
| 316 | }
|
---|
| 317 |
|
---|
| 318 |
|
---|
| 319 |
|
---|
| 320 |
|
---|
| 321 |
|
---|
| 322 |
|
---|
| 323 |
|
---|
| 324 | ?>
|
---|