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