[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);
|
---|
[254] | 26 |
|
---|
[352] | 27 | echo ' <table style="border:0px;text-align:left;width=100%;border-collapse: collapse;"><tr><td style="padding: 0px;">
|
---|
| 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\">
|
---|
[254] | 84 | ".substr($descrizione,0,60)."</a></li>";
|
---|
[242] | 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)
|
---|
[254] | 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,50)."</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,50)."</a></li>";
|
---|
[242] | 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)
|
---|
[254] | 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,50)."</a></li>";
|
---|
[242] | 140 |
|
---|
[254] | 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,50)."</a></li>";
|
---|
[242] | 142 |
|
---|
| 143 |
|
---|
| 144 | }
|
---|
| 145 |
|
---|
| 146 | }
|
---|
| 147 | if ($genere>3 and !$votoc) {
|
---|
| 148 | if (!$votoc){
|
---|
| 149 | if(!$circo and $num_circ>1)
|
---|
[254] | 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,50)."</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,50)."</a></li>";
|
---|
[242] | 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 |
|
---|
[265] | 159 | list($chiusa)=$resc->fetch(PDO::FETCH_NUM);
|
---|
| 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\">";
|
---|
[290] | 179 | if($hondt==0) $limite=0;
|
---|
[242] | 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)
|
---|
[242] | 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>";
|
---|
[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
|
---|
[243] | 245 | /*
|
---|
[242] | 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 | */
|
---|
[242] | 250 |
|
---|
[243] | 251 | echo "</ul></header></tr></td></table>";
|
---|
[242] | 252 |
|
---|
| 253 |
|
---|
| 254 |
|
---|
| 255 |
|
---|
[243] | 256 |
|
---|
[242] | 257 |
|
---|
| 258 |
|
---|
| 259 |
|
---|
| 260 |
|
---|
| 261 | ?>
|
---|