[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>
|
---|
| 124 | <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>
|
---|
| 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 | }
|
---|
[265] | 168 | $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" ;
|
---|
| 169 | $resc = $dbi->prepare("$sql");
|
---|
| 170 | $resc->execute();
|
---|
[254] | 171 |
|
---|
[265] | 172 | list($chiusa)=$resc->fetch(PDO::FETCH_NUM);
|
---|
| 173 |
|
---|
[254] | 174 | if ($hondt>=1 and $chiusa==1) {
|
---|
| 175 | 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>";
|
---|
| 176 |
|
---|
| 177 | }
|
---|
| 178 |
|
---|
| 179 |
|
---|
| 180 | echo "</ul></li>";
|
---|
| 181 |
|
---|
| 182 |
|
---|
| 183 |
|
---|
| 184 |
|
---|
| 185 | /***********************************
|
---|
| 186 | Scelta Grafici
|
---|
| 187 | ***********************************/
|
---|
| 188 |
|
---|
| 189 | echo " <li><a href=\"#\"><strong>"._GRAFICI."</strong></a>
|
---|
| 190 | <ul>";
|
---|
| 191 |
|
---|
| 192 |
|
---|
| 193 | 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>";
|
---|
| 194 |
|
---|
| 195 | 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] | 196 | if (($genere==5 and $votog) or !$votog)
|
---|
[342] | 197 | 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] | 198 | if($hondt==0) $limite=0;
|
---|
[343] | 199 | if(($genere>2) and ($fascia>$limite || $limite==0))
|
---|
[254] | 200 | 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>";
|
---|
| 201 |
|
---|
[343] | 202 | if ($genere>1 and !$votoc){
|
---|
| 203 | 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] | 204 | }
|
---|
| 205 |
|
---|
| 206 | echo "</ul></li>";
|
---|
| 207 |
|
---|
| 208 |
|
---|
| 209 | } // fine verifica esistenza consultazione : variabile $esiste
|
---|
| 210 |
|
---|
| 211 |
|
---|
| 212 |
|
---|
| 213 | ################ tema #####
|
---|
| 214 | if ($tema_on=="1"){
|
---|
| 215 |
|
---|
| 216 |
|
---|
| 217 | include("temi/facebook/tema.php");
|
---|
| 218 |
|
---|
| 219 | }
|
---|
| 220 | //echo "</div>";
|
---|
| 221 | echo " <li><a href=\"#\"><strong>"._OPTIONS."</strong></a>
|
---|
| 222 | <ul>";
|
---|
| 223 |
|
---|
| 224 | language();
|
---|
| 225 |
|
---|
| 226 | flash();
|
---|
| 227 |
|
---|
| 228 | noblocco();
|
---|
| 229 | echo "</ul></li>";
|
---|
| 230 |
|
---|
| 231 | echo "<li><a href=\"http://www.eleonline.it/site/modules.php?name=Contatti\"><i><span style=\"font-size:10px;\">
|
---|
| 232 | by luciano apolito & roberto gigli</span></i></a>
|
---|
| 233 | </li>";
|
---|
| 234 |
|
---|
[347] | 235 | echo "</ul></div>";
|
---|
[254] | 236 |
|
---|
| 237 |
|
---|
| 238 | # linguaggio x demo
|
---|
| 239 |
|
---|
| 240 | function language(){
|
---|
| 241 | global $lang,$name,$op,$file,$filelang,$id_comune,$op,$id_cons,$id_cons_gen;
|
---|
| 242 | $filename=$filelang;
|
---|
| 243 | // linguaggio
|
---|
| 244 |
|
---|
| 245 | $menulist='';
|
---|
| 246 | // scelta linguaggio
|
---|
| 247 | $langdir = dir("modules/Elezioni/language");
|
---|
| 248 | while($func=$langdir->read()) {
|
---|
| 249 | if(substr($func, 0, 5) == "lang-") {
|
---|
| 250 | $menulist .= "$func ";
|
---|
| 251 | }
|
---|
| 252 | }
|
---|
| 253 | closedir($langdir->handle);
|
---|
| 254 | $menulist = explode(" ", $menulist);
|
---|
| 255 | sort($menulist);
|
---|
| 256 | for ($i=0; $i < sizeof($menulist); $i++) {
|
---|
| 257 | if($menulist[$i]!="") {
|
---|
| 258 | $tl = preg_replace("/lang-/","",$menulist[$i]);
|
---|
| 259 | $tl = preg_replace("/.php/","",$tl);
|
---|
| 260 | $altlang = ucfirst($tl);
|
---|
| 261 |
|
---|
| 262 | if ($lang==$tl) $bordo="class=\"bordo\"";else $bordo="class=\"nobordo\"";
|
---|
| 263 | 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>";
|
---|
| 264 | }
|
---|
| 265 | }
|
---|
| 266 |
|
---|
| 267 | }
|
---|
| 268 |
|
---|
| 269 |
|
---|
| 270 |
|
---|
| 271 |
|
---|
| 272 |
|
---|
| 273 |
|
---|
| 274 | ########################### Blocchi
|
---|
| 275 | # flash x demo
|
---|
| 276 | function flash(){
|
---|
| 277 | global $flash,$name,$id_comune,$op,$id_cons,$id_cons_gen;
|
---|
| 278 |
|
---|
| 279 | if ($flash=='1'){
|
---|
| 280 | 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>";
|
---|
| 281 |
|
---|
| 282 | }else{
|
---|
| 283 |
|
---|
| 284 | 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>";
|
---|
| 285 |
|
---|
| 286 |
|
---|
| 287 | }
|
---|
| 288 |
|
---|
| 289 | }
|
---|
| 290 |
|
---|
| 291 |
|
---|
| 292 | # blocco no
|
---|
| 293 | function noblocco(){
|
---|
| 294 | global $blocco,$name,$id_comune,$op,$id_cons,$id_cons_gen;
|
---|
| 295 |
|
---|
| 296 | if ($blocco=='1'){
|
---|
| 297 | 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>";
|
---|
| 298 |
|
---|
| 299 | }else{
|
---|
| 300 |
|
---|
| 301 | 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>";
|
---|
| 302 |
|
---|
| 303 | }
|
---|
| 304 |
|
---|
| 305 | }
|
---|
| 306 |
|
---|
| 307 |
|
---|
| 308 |
|
---|
| 309 |
|
---|
| 310 |
|
---|
| 311 |
|
---|
| 312 |
|
---|
| 313 | ?>
|
---|