[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 |
|
---|
[243] | 27 | echo ' <table cellpadding="0" cellspacing="0" style="border:0px;text-align:left;"><tr><td>
|
---|
| 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->fetch(PDO::FETCH_NUM);
|
---|
[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\">";
|
---|
| 130 | if ($genere!=4) {
|
---|
| 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 |
|
---|
| 136 | if (!$votol and $fascia>$limite){ // si vota per la lista
|
---|
| 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\">";
|
---|
| 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>";
|
---|
| 184 | #inutile if($genere!=4 || $tipo_cons==8)
|
---|
| 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>";
|
---|
| 186 | if(($genere==5 or $genere==3) and $fascia>$limite)
|
---|
| 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>";
|
---|
| 188 |
|
---|
| 189 | if ($genere>3){
|
---|
[254] | 190 | if (!$circo && !$votog && !$votoc) {
|
---|
[242] | 191 | 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>";
|
---|
| 192 | }
|
---|
| 193 | }
|
---|
| 194 |
|
---|
| 195 | echo "</ul></li>";
|
---|
| 196 |
|
---|
| 197 |
|
---|
| 198 | } // fine verifica esistenza consultazione : variabile $esiste
|
---|
| 199 |
|
---|
| 200 |
|
---|
| 201 |
|
---|
| 202 | ################ tema #####
|
---|
| 203 | if ($tema_on=="1"){
|
---|
| 204 |
|
---|
| 205 | global $id_circ;
|
---|
| 206 |
|
---|
| 207 | if (! isset($content)) $content="";
|
---|
| 208 | if (! isset($tlist)) $tlist="";
|
---|
| 209 |
|
---|
| 210 | echo "<li class=\"dropdown\"><a href=\"#\"><strong> "._TEMA."</strong></a>
|
---|
| 211 | <ul class=\"drop-nav\">";
|
---|
| 212 |
|
---|
| 213 |
|
---|
| 214 |
|
---|
| 215 | $path = "temi/";
|
---|
| 216 | $handle=opendir($path);
|
---|
| 217 | while ($file = readdir($handle)) {
|
---|
| 218 |
|
---|
| 219 | if ( (preg_match('/^([_0-9a-zA-Z]+)([_0-9a-zA-Z]{3})$/',$file)) ) {
|
---|
| 220 |
|
---|
| 221 | $tlist .= "$file ";
|
---|
| 222 | }
|
---|
| 223 | }
|
---|
| 224 |
|
---|
| 225 | closedir($handle);
|
---|
| 226 | $tlist = explode(" ", $tlist);
|
---|
| 227 | sort($tlist);
|
---|
| 228 | for ($i=0; $i < sizeof($tlist); $i++) {
|
---|
| 229 | if(($tlist[$i]!="") && ($tlist[$i]!="language")) {
|
---|
| 230 | if ($tema == $tlist[$i]) {
|
---|
| 231 | $sel = "selected";
|
---|
| 232 | } else {
|
---|
| 233 | $sel = "";
|
---|
| 234 | }
|
---|
| 235 |
|
---|
| 236 | $files=ucfirst($tlist[$i]);
|
---|
| 237 | echo "<li><a href=\"modules.php?name=Elezioni&id_comune=$id_comune&id_cons_gen=$id_cons_gen&op=$op&id_circ=$id_circ&tema=$tlist[$i]\">$files</a></li>";
|
---|
| 238 |
|
---|
| 239 |
|
---|
| 240 |
|
---|
| 241 |
|
---|
| 242 |
|
---|
| 243 | }
|
---|
| 244 | }
|
---|
| 245 |
|
---|
| 246 | echo "</ul></li>";
|
---|
| 247 | } // fine tema
|
---|
| 248 | echo "<li><a href=\"http://www.eleonline.it/site/modules.php?name=Contatti\"><i><span style=\"font-size:10px;\">
|
---|
| 249 | by luciano apolito & roberto gigli</span></i></a>
|
---|
| 250 | </li>";
|
---|
[243] | 251 | echo "</ul></header>
|
---|
| 252 | </tr></td></table>";
|
---|
[242] | 253 |
|
---|
| 254 |
|
---|
| 255 |
|
---|
| 256 |
|
---|
| 257 |
|
---|
| 258 |
|
---|
| 259 |
|
---|
| 260 |
|
---|
| 261 |
|
---|
| 262 | ?>
|
---|