[242] | 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 | *************************/
|
---|
[265] | 16 | $sql="select descrizione from ".$prefix."_ele_comuni where id_comune=$id_comune";
|
---|
| 17 | $rescomu = $dbi->prepare("$sql");
|
---|
| 18 | $rescomu->execute();
|
---|
| 19 |
|
---|
| 20 | list($descr_com)=$rescomu->fetch(PDO::FETCH_NUM);
|
---|
| 21 | $sql="select id_fascia from ".$prefix."_ele_cons_comune where id_comune=$id_comune and id_cons='$id_cons'";
|
---|
| 22 | $rescomu = $dbi->prepare("$sql");
|
---|
| 23 | $rescomu->execute();
|
---|
| 24 |
|
---|
| 25 | list($fascia)=$rescomu->fetch(PDO::FETCH_NUM);
|
---|
[242] | 26 |
|
---|
[352] | 27 | echo ' <table style="border:0px;text-align:left;width=100%;border-collapse: collapse;"><tr><td style="padding: 0px;">
|
---|
[242] | 28 | <ul class="main-nav">
|
---|
| 29 | <li>
|
---|
| 30 | <a href="index.php"><strong>Home</strong></a>
|
---|
| 31 | </li>';
|
---|
| 32 |
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 | // inizio tabella
|
---|
| 36 |
|
---|
| 37 |
|
---|
| 38 | /***********************************
|
---|
| 39 | Scelta Comune
|
---|
| 40 | ***********************************/
|
---|
| 41 |
|
---|
| 42 | if ($multicomune=='1')
|
---|
| 43 | {
|
---|
[265] | 44 | $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";
|
---|
| 45 | $rescomu = $dbi->prepare("$sql");
|
---|
| 46 | $rescomu->execute();
|
---|
| 47 |
|
---|
| 48 | $esiste_multi=$rescomu->rowCount();
|
---|
[242] | 49 | if ($esiste_multi>=1) {
|
---|
| 50 | echo " <li class=\"dropdown\">
|
---|
| 51 | <a href=\"#\"><strong>"._COMUNI."</strong></a>
|
---|
| 52 |
|
---|
| 53 | <ul class=\"drop-nav\">";
|
---|
| 54 |
|
---|
[265] | 55 | while (list($id,$descrizione,)=$rescomu->fetch(PDO::FETCH_NUM)){
|
---|
[242] | 56 | echo "<li><a href=\"modules.php?op=gruppo&name=Elezioni&id_comune=$id&file=index\">
|
---|
| 57 | <img src=\"modules/Elezioni/images/logo.gif\" width=\"16\" height=\"16\" class=\"nobordo\"> $descrizione</a></li>";
|
---|
| 58 | }
|
---|
| 59 | echo "</ul></li>";
|
---|
| 60 |
|
---|
| 61 | }
|
---|
| 62 | } // fine scelta comune
|
---|
| 63 |
|
---|
| 64 |
|
---|
| 65 |
|
---|
| 66 | /***********************************
|
---|
| 67 | Scelta Consultazione
|
---|
| 68 | ***********************************/
|
---|
| 69 |
|
---|
[265] | 70 | $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" ;
|
---|
| 71 | $res = $dbi->prepare("$sql");
|
---|
| 72 | $res->execute();
|
---|
| 73 |
|
---|
| 74 | $esiste=$res->rowCount();
|
---|
[242] | 75 | //se esiste consultazione fa vedere i dati
|
---|
| 76 | if ($esiste>=1) {
|
---|
| 77 | echo " <li class=\"dropdown\">
|
---|
| 78 | <a href=\"#\"><strong>"._ELEZIONI."</strong></a>
|
---|
| 79 | <ul class=\"drop-nav\">";
|
---|
| 80 |
|
---|
[265] | 81 | while(list($id,$descrizione) = $res->fetch(PDO::FETCH_NUM)) {
|
---|
[242] | 82 | echo "<li class=\"icon matita\"><a href=\"modules.php?op=gruppo&name=Elezioni&id_comune=$id_comune&file=index&id_cons_gen=$id\">
|
---|
| 83 | ".substr($descrizione,0,31)."</a></li>";
|
---|
| 84 |
|
---|
| 85 | }
|
---|
| 86 |
|
---|
| 87 |
|
---|
| 88 | echo "</ul></li>";
|
---|
| 89 |
|
---|
| 90 |
|
---|
| 91 |
|
---|
| 92 |
|
---|
| 93 |
|
---|
| 94 | /***********************************
|
---|
| 95 | Scelta Info
|
---|
| 96 | ***********************************/
|
---|
| 97 | //$temp = array('confronti'=>'','come'=>'','numeri'=>'','servizi'=>'','link'=>'','dati'=>'','affluenze_sez'=>'','votanti'=>'');
|
---|
| 98 |
|
---|
| 99 | echo " <li class=\"dropdown\">
|
---|
| 100 | <a href=\"#\"><strong>"._INFO."</strong></a>
|
---|
| 101 | <ul class=\"drop-nav\">";
|
---|
| 102 | echo "
|
---|
| 103 | <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>
|
---|
| 104 | <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>
|
---|
| 105 | <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>
|
---|
| 106 | <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>
|
---|
| 107 | <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>
|
---|
| 108 | <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>
|
---|
| 109 | <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>
|
---|
| 110 | <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>
|
---|
| 111 |
|
---|
| 112 | ";
|
---|
| 113 |
|
---|
| 114 |
|
---|
| 115 | echo "</ul></li>";
|
---|
| 116 |
|
---|
| 117 |
|
---|
| 118 | /***********************************
|
---|
| 119 | Scelta Dati
|
---|
| 120 | ***********************************/
|
---|
| 121 |
|
---|
[265] | 122 | $sql="SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ";
|
---|
| 123 | $res = $dbi->prepare("$sql");
|
---|
| 124 | $res->execute();
|
---|
| 125 |
|
---|
| 126 | list($num_circ) = $res->fetch(PDO::FETCH_NUM);
|
---|
[242] | 127 | echo " <li class=\"dropdown\"><a href=\"#\"><strong>"._RISULTATI."</strong></a>
|
---|
| 128 | <ul class=\"drop-nav\">";
|
---|
[344] | 129 | if (($genere==5 and $votog) or !$votog) {
|
---|
[242] | 130 | if (!$circo and $num_circ>1)
|
---|
| 131 | 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>";
|
---|
| 132 | 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>";
|
---|
| 133 | }
|
---|
| 134 |
|
---|
[282] | 135 | if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
|
---|
[242] | 136 | if ($genere>2) {
|
---|
| 137 | if (!$circo and $num_circ>1)
|
---|
| 138 | 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>";
|
---|
| 139 |
|
---|
| 140 | 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>";
|
---|
| 141 |
|
---|
| 142 |
|
---|
| 143 | }
|
---|
| 144 |
|
---|
| 145 | }
|
---|
| 146 | if ($genere>3 and !$votoc) {
|
---|
| 147 | if (!$votoc){
|
---|
| 148 | if(!$circo and $num_circ>1)
|
---|
| 149 | 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>";
|
---|
| 150 | 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>";
|
---|
| 151 |
|
---|
| 152 | }
|
---|
| 153 | }
|
---|
[265] | 154 | $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" ;
|
---|
| 155 | $resc = $dbi->prepare("$sql");
|
---|
| 156 | $resc->execute();
|
---|
[242] | 157 |
|
---|
[265] | 158 | list($chiusa)=$resc->fetch(PDO::FETCH_NUM);
|
---|
| 159 |
|
---|
[242] | 160 | if ($hondt>=1 and $chiusa==1) {
|
---|
| 161 | 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>";
|
---|
| 162 |
|
---|
| 163 | }
|
---|
| 164 |
|
---|
| 165 |
|
---|
| 166 | echo "</ul></li>";
|
---|
| 167 |
|
---|
| 168 |
|
---|
| 169 |
|
---|
| 170 |
|
---|
| 171 | /***********************************
|
---|
| 172 | Scelta Grafici
|
---|
| 173 | ***********************************/
|
---|
| 174 |
|
---|
| 175 | echo " <li class=\"dropdown\">
|
---|
| 176 | <a href=\"#\"><strong>"._GRAFICI."</strong></a>
|
---|
| 177 | <ul class=\"drop-nav\">";
|
---|
| 178 |
|
---|
| 179 |
|
---|
| 180 | 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>";
|
---|
| 181 |
|
---|
| 182 | 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] | 183 | if (($genere==5 and $votog) or !$votog)
|
---|
[342] | 184 | 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] | 185 | if($hondt==0) $limite=0;
|
---|
[343] | 186 | if(($genere>2) and ($fascia>$limite || $limite==0))
|
---|
[242] | 187 | 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>";
|
---|
[343] | 188 | if ($genere>1 and !$votoc){
|
---|
| 189 | 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>";
|
---|
[242] | 190 | }
|
---|
| 191 |
|
---|
| 192 | echo "</ul></li>";
|
---|
| 193 |
|
---|
| 194 |
|
---|
| 195 | } // fine verifica esistenza consultazione : variabile $esiste
|
---|
| 196 |
|
---|
| 197 |
|
---|
| 198 |
|
---|
| 199 | ################ tema #####
|
---|
| 200 | if ($tema_on=="1"){
|
---|
| 201 |
|
---|
| 202 | global $id_circ;
|
---|
| 203 |
|
---|
| 204 | if (! isset($content)) $content="";
|
---|
| 205 | if (! isset($tlist)) $tlist="";
|
---|
| 206 |
|
---|
| 207 | echo "<li class=\"dropdown\"><a href=\"#\"><strong> "._TEMA."</strong></a>
|
---|
| 208 | <ul class=\"drop-nav\">";
|
---|
| 209 |
|
---|
| 210 |
|
---|
| 211 |
|
---|
| 212 | $path = "temi/";
|
---|
| 213 | $handle=opendir($path);
|
---|
| 214 | while ($file = readdir($handle)) {
|
---|
| 215 |
|
---|
| 216 | if ( (preg_match('/^([_0-9a-zA-Z]+)([_0-9a-zA-Z]{3})$/',$file)) ) {
|
---|
| 217 |
|
---|
| 218 | $tlist .= "$file ";
|
---|
| 219 | }
|
---|
| 220 | }
|
---|
| 221 |
|
---|
| 222 | closedir($handle);
|
---|
| 223 | $tlist = explode(" ", $tlist);
|
---|
| 224 | sort($tlist);
|
---|
| 225 | for ($i=0; $i < sizeof($tlist); $i++) {
|
---|
| 226 | if(($tlist[$i]!="") && ($tlist[$i]!="language")) {
|
---|
| 227 | if ($tema == $tlist[$i]) {
|
---|
| 228 | $sel = "selected";
|
---|
| 229 | } else {
|
---|
| 230 | $sel = "";
|
---|
| 231 | }
|
---|
| 232 |
|
---|
| 233 | $files=ucfirst($tlist[$i]);
|
---|
[384] | 234 | echo "<li><a href=\"modules.php?name=Elezioni&id_comune=$id_comune&id_cons_gen=$id_cons_gen&id_circ=$id_circ&tema=$tlist[$i]\">$files</a></li>";
|
---|
[242] | 235 |
|
---|
| 236 |
|
---|
| 237 |
|
---|
| 238 |
|
---|
| 239 |
|
---|
| 240 | }
|
---|
| 241 | }
|
---|
| 242 |
|
---|
| 243 | echo "</ul></li>";
|
---|
| 244 | } // fine tema
|
---|
| 245 | echo "<li><a href=\"http://www.eleonline.it/site/modules.php?name=Contatti\"><i><span style=\"font-size:10px;\">
|
---|
| 246 | by luciano apolito & roberto gigli</span></i></a>
|
---|
| 247 | </li>";
|
---|
[243] | 248 | echo "</ul></header>
|
---|
| 249 | </td></tr></table>";
|
---|
[242] | 250 |
|
---|
| 251 |
|
---|
| 252 |
|
---|
| 253 |
|
---|
| 254 |
|
---|
| 255 |
|
---|
| 256 |
|
---|
| 257 |
|
---|
| 258 |
|
---|
| 259 | ?>
|
---|