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