[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'=>'');
|
---|
| 177 | $temp[$op]='selected="selected"';
|
---|
| 178 |
|
---|
| 179 | if ($genere!=4) {
|
---|
| 180 | if (!$circo and $num_circ>1)
|
---|
| 181 | echo "<option value=\"gruppo_circo\" ".$temp['gruppo_circo'].">".substr(_GRUPPO." "._PER." "._CIRCO,0,33)."</option>";
|
---|
| 182 | echo "<option value=\"gruppo_sezione\" ".$temp['gruppo_sezione'].">".substr(_GRUPPO." "._PER." "._SEZIONI,0,33)."</option>";
|
---|
[194] | 183 | }
|
---|
[2] | 184 | if (!$votol and $fascia>$limite){ // si vota per la lista
|
---|
| 185 | if ($genere>2) {
|
---|
| 186 | if (!$circo and $num_circ>1)
|
---|
| 187 | echo "<option value=\"lista_circo\" ".$temp['lista_circo']." >".substr(_LISTA." "._PER." "._CIRCO,0,33)."</option>";
|
---|
| 188 | echo "<option value=\"lista_sezione\" ".$temp['lista_sezione']." >".substr(_LISTA." "._PER." "._SEZIONI,0,33)."</option>";
|
---|
| 189 | }
|
---|
| 190 |
|
---|
| 191 | }
|
---|
| 192 |
|
---|
| 193 | if ($genere>3 and !$votoc) {
|
---|
| 194 | if (!$votoc){
|
---|
| 195 | if(!$circo and $num_circ>1)
|
---|
| 196 | echo "<option value=\"candidato_circo\" ".$temp['candidato_circo']." >".substr(_CONSI." "._PER." "._CIRCO,0,33)."</option>";
|
---|
| 197 | echo "<option value=\"candidato_sezione\" ".$temp['candidato_sezione']." >".substr(_CONSI." "._PER." "._SEZIONI,0,33)."</option>";
|
---|
| 198 |
|
---|
| 199 | }
|
---|
| 200 | }
|
---|
[265] | 201 | $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" ;
|
---|
| 202 | $resc = $dbi->prepare("$sql");
|
---|
| 203 | $resc->execute();
|
---|
| 204 |
|
---|
| 205 | list($chiusa)=$resc->fetch(PDO::FETCH_NUM);
|
---|
[212] | 206 | if ($hondt>=1 and $chiusa==1) {
|
---|
[213] | 207 | echo "<option value=\"consiglieri\" ".$temp['consiglieri']." >"._CALCONS."</option>";
|
---|
[2] | 208 |
|
---|
| 209 |
|
---|
| 210 | }
|
---|
| 211 | echo "</select>$button
|
---|
| 212 | </label></div></form></td>";
|
---|
| 213 | unset ($temp);
|
---|
| 214 |
|
---|
| 215 |
|
---|
| 216 | /***********************************
|
---|
| 217 | Scelta Grafici
|
---|
| 218 | ***********************************/
|
---|
| 219 |
|
---|
| 220 | echo "<td >";
|
---|
| 221 |
|
---|
[42] | 222 | $temp = array('affluenze_graf'=>'','graf_votanti'=>'','graf_gruppo'=>'','graf_lista'=>'','graf_candidato'=>'');
|
---|
[89] | 223 | if(!isset($visgralista))
|
---|
| 224 | $temp[$op]='selected="selected"';
|
---|
[42] | 225 | else $temp['graf_lista']='selected="selected"';
|
---|
[2] | 226 | # <div><label class=\"blu\" for=\"grafici\">"._GRAFICI."
|
---|
| 227 |
|
---|
| 228 | echo "<form id=\"grafici\" method=\"post\" action=\"modules.php\">
|
---|
| 229 | <div><label class=\"blu\" for=\"grafici\">
|
---|
| 230 | <input type=\"hidden\" name=\"name\" value=\"Elezioni\" />
|
---|
| 231 | <input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\" />
|
---|
| 232 | <input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\" />
|
---|
| 233 | <input type=\"hidden\" name=\"file\" value=\"index\" />
|
---|
| 234 | <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\">";
|
---|
| 235 | echo "<option value=\"\" >----- "._GRAFICI."</option>";
|
---|
| 236 |
|
---|
| 237 | echo "<option value=\"affluenze_graf\" ".$temp['affluenze_graf']." >"._AFFLUENZE."</option>";
|
---|
| 238 | echo "<option value=\"graf_votanti\" ".$temp['graf_votanti']." >"._VOTI."</option>";
|
---|
| 239 | #inutile if($genere!=4 || $tipo_cons==8)
|
---|
[89] | 240 | echo "<option value=\"graf_gruppo\" ".$temp['graf_gruppo']." >"._GRUPPO."</option>";
|
---|
[95] | 241 | if(($genere==5 or $genere==3) and $fascia>$limite)
|
---|
[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 | ?>
|
---|