[2] | 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 |
|
---|
| 17 |
|
---|
| 18 | // definizione variabile per button 'ok' nei form per il noscript
|
---|
| 19 | $button="<br /><object><noscript><div><input name=\"vai\" type=\"image\" src=\"modules/Elezioni/images/ok2.jpg\" alt=\"ok\" title=\"ok\" /></div></noscript></object>";
|
---|
| 20 |
|
---|
[265] | 21 | $sql="select descrizione,fascia from ".$prefix."_ele_comuni where id_comune=$id_comune";
|
---|
| 22 | $rescomu = $dbi->prepare("$sql");
|
---|
| 23 | $rescomu->execute();
|
---|
| 24 |
|
---|
| 25 | list($descr_com,$fascia)=$rescomu->fetch(PDO::FETCH_NUM);
|
---|
[2] | 26 |
|
---|
| 27 |
|
---|
| 28 |
|
---|
| 29 | // inizio tabella
|
---|
[139] | 30 | echo "<table class=\"table-main\"><tr>";
|
---|
[140] | 31 | echo "<td >
|
---|
| 32 | <form id=\"m\" method=\"post\" action=\"modules.php\">
|
---|
| 33 | <div><label class=\"blu\" for=\"m\">
|
---|
| 34 | <input type=\"hidden\" name=\"name\" value=\"Elezioni\" />
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | <select name=\"op\" class=\"moduloform\" onclick=\"javascript:top.location.href='modules.php?name=Elezioni&op='+this.options[this.options.selectedIndex].value\">";
|
---|
[139] | 38 |
|
---|
[140] | 39 |
|
---|
| 40 | echo "<option value=\"gruppo\" type=\"hidden\" > Home </option>";
|
---|
| 41 |
|
---|
| 42 |
|
---|
| 43 |
|
---|
| 44 |
|
---|
| 45 | echo "</select>$button</label></div></form>
|
---|
| 46 | </td>";
|
---|
[139] | 47 |
|
---|
[2] | 48 | /***********************************
|
---|
| 49 | Scelta Comune
|
---|
| 50 | ***********************************/
|
---|
| 51 |
|
---|
| 52 | if ($multicomune=='1')
|
---|
| 53 | {
|
---|
[265] | 54 | $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";
|
---|
[139] | 55 |
|
---|
[265] | 56 | $sql="$sqlcomu";
|
---|
| 57 | $rescomu = $dbi->prepare("$sql");
|
---|
| 58 | $rescomu->execute();
|
---|
| 59 |
|
---|
| 60 | $esiste_multi=$rescomu->rowCount();
|
---|
[2] | 61 | if ($esiste_multi>=1) {
|
---|
| 62 | echo " <td>
|
---|
| 63 | <form id=\"comuni\" method=\"post\" action=\"modules.php\">
|
---|
| 64 | <div><label class=\"blu\" for=\"comuni\">
|
---|
| 65 | <input type=\"hidden\" name=\"name\" value=\"Elezioni\" />
|
---|
| 66 | <input type=\"hidden\" name=\"op\" value=\"gruppo\" />
|
---|
| 67 | <input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\" />
|
---|
| 68 | <input type=\"hidden\" name=\"info\" value=\"$info\" />
|
---|
| 69 | <input type=\"hidden\" name=\"pag\" value=\"/modules.php?id_cons_gen=\" />
|
---|
| 70 | <input type=\"hidden\" name=\"file\" value=\"index\" />
|
---|
[90] | 71 | <select name=\"op\" class=\"moduloform\" onchange=\"javascript:top.location.href='modules.php?name=Elezioni&op=gruppo&file=index&id_comune='+this.options[this.options.selectedIndex].value\">
|
---|
[2] | 72 | ";
|
---|
| 73 |
|
---|
[265] | 74 | while (list($id,$descrizione,)=$rescomu->fetch(PDO::FETCH_NUM)){
|
---|
[2] | 75 | $sel=($id == $id_comune) ? "selected=\"selected\"":"";
|
---|
| 76 | echo "<option value=\"$id\" $sel >$descrizione</option>";
|
---|
| 77 | }
|
---|
| 78 |
|
---|
| 79 | echo "</select>$button</label></div></form></td>";
|
---|
| 80 | }
|
---|
| 81 | } // fine scelta comune
|
---|
| 82 |
|
---|
| 83 |
|
---|
| 84 |
|
---|
| 85 | /***********************************
|
---|
| 86 | Scelta Consultazione
|
---|
| 87 | ***********************************/
|
---|
| 88 |
|
---|
| 89 |
|
---|
| 90 | echo "<td >";
|
---|
[265] | 91 | $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" ;
|
---|
| 92 | $res = $dbi->prepare("$sql");
|
---|
| 93 | $res->execute();
|
---|
| 94 |
|
---|
| 95 | $esiste=$res->rowCount();
|
---|
[2] | 96 | //se esiste consultazione fa vedere i dati
|
---|
| 97 | if ($esiste>=1) {
|
---|
| 98 | echo "
|
---|
| 99 | <form id=\"consultazione\" method=\"post\" action=\"modules.php\">
|
---|
| 100 | <div><label for=\"consultazione\" class=\"blu\">
|
---|
| 101 | <input id=\"modulo\" type=\"hidden\" name=\"name\" value=\"Elezioni\" />
|
---|
| 102 | <input type=\"hidden\" name=\"op\" value=\"gruppo\" />
|
---|
| 103 | <input type=\"hidden\" name=\"minsez\" value=\"$minsez\" />
|
---|
| 104 | <input type=\"hidden\" name=\"offsetsez\" value=\"$offsetsez\" />
|
---|
| 105 | <input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\" />
|
---|
| 106 | <input type=\"hidden\" name=\"prima\" value=\"1\" />
|
---|
| 107 | <select name=\"id_cons_gen\" class=\"moduloform\" onchange=\"javascript:top.location.href='modules.php?op=gruppo&name=Elezioni&id_comune=$id_comune&file=index&id_cons_gen='+this.options[this.options.selectedIndex].value\">";
|
---|
| 108 |
|
---|
[265] | 109 | while(list($id,$descrizione) = $res->fetch(PDO::FETCH_NUM)) {
|
---|
[2] | 110 |
|
---|
| 111 | $sel = ($id == $id_cons_gen) ? "selected=\"selected\"":"";
|
---|
| 112 | echo "<option value=\"$id\" $sel >$descrizione</option>";
|
---|
| 113 | }
|
---|
| 114 |
|
---|
| 115 | echo "</select>$button</label></div></form></td>";
|
---|
| 116 |
|
---|
| 117 |
|
---|
| 118 |
|
---|
| 119 |
|
---|
| 120 |
|
---|
| 121 |
|
---|
| 122 | /***********************************
|
---|
| 123 | Scelta Info
|
---|
| 124 | ***********************************/
|
---|
| 125 |
|
---|
| 126 | echo "<td>";
|
---|
| 127 |
|
---|
| 128 |
|
---|
| 129 | echo "
|
---|
| 130 | <form id=\"info\" method=\"post\" action=\"modules.php\">
|
---|
| 131 | <div><label class=\"blu\" for=\"info\">
|
---|
| 132 | <input type=\"hidden\" name=\"name\" value=\"Elezioni\" />
|
---|
| 133 | <input type=\"hidden\" name=\"op\" value=\"come\" />
|
---|
| 134 | <input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\" />
|
---|
| 135 | <input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\" />
|
---|
| 136 | <input type=\"hidden\" name=\"file\" value=\"index\" />
|
---|
| 137 | <select name=\"op\" class=\"moduloform\" onchange=\"javascript:top.location.href='modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&op=come&id_comune=$id_comune&file=index&info='+this.options[this.options.selectedIndex].value\">";
|
---|
| 138 |
|
---|
| 139 | echo "<option value=\"\" >----- "._INFO."</option>";
|
---|
| 140 |
|
---|
| 141 | $temp = array('confronti'=>'','come'=>'','numeri'=>'','servizi'=>'','link'=>'','dati'=>'','affluenze_sez'=>'','votanti'=>'');
|
---|
| 142 | $temp[$info]='selected="selected"';
|
---|
| 143 | echo "<option value=\"confronti\" ".$temp['confronti']." >"._CONFRONTI."</option>";
|
---|
| 144 | echo "<option value=\"come\" ".$temp['come']." >"._COME."</option>";
|
---|
| 145 | echo "<option value=\"numeri\" ".$temp['numeri']." >"._NUMERI."</option>";
|
---|
| 146 | echo "<option value=\"servizi\" ".$temp['servizi']." >"._SERVIZI."</option>";
|
---|
| 147 | echo "<option value=\"link\" ".$temp['link']." >"._LINK."</option>";
|
---|
| 148 | echo "<option value=\"dati\" ".$temp['dati']." >"._DATI."</option>";
|
---|
| 149 | // tolte per circo da mettere bene
|
---|
| 150 | echo "<option value=\"affluenze_sez\" ".$temp['affluenze_sez']." >"._AFFLUENZE."</option>";
|
---|
| 151 | echo "<option value=\"votanti\" ".$temp['votanti']." >"._VOTANTI."</option>";
|
---|
| 152 |
|
---|
| 153 | echo "</select>$button
|
---|
| 154 | </label></div></form></td>";
|
---|
| 155 | unset ($temp);
|
---|
| 156 | /***********************************
|
---|
| 157 | Scelta Dati
|
---|
| 158 | ***********************************/
|
---|
[265] | 159 | $sql="SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ";
|
---|
| 160 | $res = $dbi->prepare("$sql");
|
---|
| 161 | $res->execute();
|
---|
| 162 |
|
---|
| 163 | list($num_circ) = $res->fetch(PDO::FETCH_NUM);
|
---|
[2] | 164 |
|
---|
| 165 | echo "<td>";
|
---|
| 166 |
|
---|
| 167 | echo "<form id=\"risultati\" method=\"post\" action=\"modules.php\">
|
---|
| 168 | <div><label class=\"blu\" for=\"risultati\">"; //._RISULTATI;
|
---|
| 169 | echo "<input type=\"hidden\" name=\"name\" value=\"Elezioni\" />
|
---|
| 170 | <input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\" />
|
---|
| 171 | <input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\" />
|
---|
| 172 | <input type=\"hidden\" name=\"file\" value=\"index\" />
|
---|
| 173 | <select name=\"op\" class=\"moduloform\" onchange=\"javascript:top.location.href='modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op='+this.options[this.options.selectedIndex].value\">";
|
---|
| 174 |
|
---|
| 175 | echo "<option value=\"\" >----- "._RISULTATI."</option>";
|
---|
| 176 | $temp = array('gruppo_circo'=>'','gruppo_sezione'=>'','lista_circo'=>'','lista_sezione'=>'','candidato_circo'=>'','candidato_sezione'=>'','consiglieri'=>'');
|
---|
[342] | 177 | $temp[$op]='selected="selected"';
|
---|
| 178 | if (!$votog) {
|
---|
[2] | 179 | if (!$circo and $num_circ>1)
|
---|
| 180 | echo "<option value=\"gruppo_circo\" ".$temp['gruppo_circo'].">".substr(_GRUPPO." "._PER." "._CIRCO,0,33)."</option>";
|
---|
| 181 | echo "<option value=\"gruppo_sezione\" ".$temp['gruppo_sezione'].">".substr(_GRUPPO." "._PER." "._SEZIONI,0,33)."</option>";
|
---|
[194] | 182 | }
|
---|
[282] | 183 | if (!$votol and ($fascia>$limite || $limite==0)){ // si vota per la lista
|
---|
| 184 | if ($genere>2) {
|
---|
[2] | 185 | if (!$circo and $num_circ>1)
|
---|
| 186 | echo "<option value=\"lista_circo\" ".$temp['lista_circo']." >".substr(_LISTA." "._PER." "._CIRCO,0,33)."</option>";
|
---|
| 187 | echo "<option value=\"lista_sezione\" ".$temp['lista_sezione']." >".substr(_LISTA." "._PER." "._SEZIONI,0,33)."</option>";
|
---|
| 188 | }
|
---|
| 189 |
|
---|
| 190 | }
|
---|
| 191 |
|
---|
| 192 | if ($genere>3 and !$votoc) {
|
---|
| 193 | if (!$votoc){
|
---|
| 194 | if(!$circo and $num_circ>1)
|
---|
| 195 | echo "<option value=\"candidato_circo\" ".$temp['candidato_circo']." >".substr(_CONSI." "._PER." "._CIRCO,0,33)."</option>";
|
---|
| 196 | echo "<option value=\"candidato_sezione\" ".$temp['candidato_sezione']." >".substr(_CONSI." "._PER." "._SEZIONI,0,33)."</option>";
|
---|
| 197 |
|
---|
| 198 | }
|
---|
| 199 | }
|
---|
[265] | 200 | $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" ;
|
---|
| 201 | $resc = $dbi->prepare("$sql");
|
---|
| 202 | $resc->execute();
|
---|
| 203 |
|
---|
| 204 | list($chiusa)=$resc->fetch(PDO::FETCH_NUM);
|
---|
[212] | 205 | if ($hondt>=1 and $chiusa==1) {
|
---|
[213] | 206 | echo "<option value=\"consiglieri\" ".$temp['consiglieri']." >"._CALCONS."</option>";
|
---|
[2] | 207 |
|
---|
| 208 |
|
---|
| 209 | }
|
---|
| 210 | echo "</select>$button
|
---|
| 211 | </label></div></form></td>";
|
---|
| 212 | unset ($temp);
|
---|
| 213 |
|
---|
| 214 |
|
---|
| 215 | /***********************************
|
---|
| 216 | Scelta Grafici
|
---|
| 217 | ***********************************/
|
---|
| 218 |
|
---|
| 219 | echo "<td >";
|
---|
| 220 |
|
---|
[42] | 221 | $temp = array('affluenze_graf'=>'','graf_votanti'=>'','graf_gruppo'=>'','graf_lista'=>'','graf_candidato'=>'');
|
---|
[89] | 222 | if(!isset($visgralista))
|
---|
| 223 | $temp[$op]='selected="selected"';
|
---|
[42] | 224 | else $temp['graf_lista']='selected="selected"';
|
---|
[2] | 225 | # <div><label class=\"blu\" for=\"grafici\">"._GRAFICI."
|
---|
| 226 |
|
---|
| 227 | echo "<form id=\"grafici\" method=\"post\" action=\"modules.php\">
|
---|
| 228 | <div><label class=\"blu\" for=\"grafici\">
|
---|
| 229 | <input type=\"hidden\" name=\"name\" value=\"Elezioni\" />
|
---|
| 230 | <input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\" />
|
---|
| 231 | <input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\" />
|
---|
| 232 | <input type=\"hidden\" name=\"file\" value=\"index\" />
|
---|
| 233 | <select name=\"op\" class=\"moduloform\" onchange=\"javascript:top.location.href='modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op='+this.options[this.options.selectedIndex].value\">";
|
---|
| 234 | echo "<option value=\"\" >----- "._GRAFICI."</option>";
|
---|
| 235 |
|
---|
| 236 | echo "<option value=\"affluenze_graf\" ".$temp['affluenze_graf']." >"._AFFLUENZE."</option>";
|
---|
| 237 | echo "<option value=\"graf_votanti\" ".$temp['graf_votanti']." >"._VOTI."</option>";
|
---|
[343] | 238 | if(!$votog)
|
---|
[89] | 239 | echo "<option value=\"graf_gruppo\" ".$temp['graf_gruppo']." >"._GRUPPO."</option>";
|
---|
[290] | 240 | if($hondt==0) $limite=0;
|
---|
[343] | 241 | if(($genere>2) and ($fascia>$limite || $limite==0))
|
---|
[209] | 242 | echo "<option value=\"graf_lista&visgralista=1\" ".$temp['graf_lista'].">"._LISTA."</option>";
|
---|
[2] | 243 | if ($genere>3){
|
---|
[254] | 244 | if (!$circo && !$votog && !$votoc)
|
---|
[2] | 245 | echo "<option value=\"graf_candidato\" ".$temp['graf_candidato']." >"._CONSI."</option>";
|
---|
| 246 | }
|
---|
| 247 | unset ($temp);
|
---|
| 248 |
|
---|
| 249 | echo "</select>$button
|
---|
| 250 | </label></div></form></td>";
|
---|
| 251 |
|
---|
| 252 | } // fine verifica esistenza consultazione : variabile $esiste
|
---|
| 253 |
|
---|
| 254 |
|
---|
| 255 |
|
---|
| 256 | ################ tema #####
|
---|
| 257 | if ($tema_on=="1"){
|
---|
| 258 | echo "<td>";
|
---|
| 259 | include("modules/Elezioni/tema.php");
|
---|
| 260 | echo "</td>";
|
---|
| 261 | }
|
---|
| 262 |
|
---|
| 263 |
|
---|
| 264 | echo "</tr></table>";
|
---|
| 265 |
|
---|
| 266 |
|
---|
| 267 |
|
---|
| 268 | ?>
|
---|