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