source: trunk/client/modules/Elezioni/votanti-inc.php@ 376

Last change on this file since 376 was 376, checked in by roby, 19 months ago

Admin:

  • modificata la funzione aggiornadb per gestire il caso di cambiamento del nome del superutente e tolto il default per tipi campo text
  • modificata la funzione dei controlli per gestire il tipo consultazione Regionali in Sicilia

Install:

  • modificata la funzione di installazione per compatibilità con php 8.0

Client:

  • cambiata l'immagine "vuoto.jpg" nel formato png per gestire la trasparenza
  • modificate le funzioni affluenze e votanti per correggere l'esportazione in pdf e le stampe
  • per il tema Futura2 eliminato il taglio della descrizione della consultazione
File size: 19.4 KB
Line 
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 rgigli@libero.it */
7/************************************************************************/
8
9if (!defined('MODULE_FILE')) {
10 die ("You can't access this file directly...");
11}
12
13$param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ?
14 $_GET : $_POST;
15
16$id_comune= (isset($param['id_comune'])) ? $param['id_comune']:$siteistat;
17if (isset($param['id_cons_gen'])) $id_cons_gen=intval($param['id_cons_gen']); else $id_cons_gen='';
18if (isset($param['op'])) $op=$param['op']; else $op='';
19if (isset($param['minsez'])) $minsez=intval($param['minsez']); else $minsez='';
20if (isset($param['id_lista'])) $id_lista=intval($param['id_lista']); else $id_lista='';
21if (isset($param['id_circ'])) $id_circ=intval($param['id_circ']); else $id_circ='';
22if (isset($param['csv'])) $csv=intval($param['csv']); else $csv='';
23if (isset($param['min'])) $min=intval($param['min']); else $min= 0;
24if (isset($param['orvert'])) $orvert=intval($param['orvert']); else $orvert='';
25if (isset($param['offset'])) $offset=intval($param['offset']); else $offset='';
26if (isset($param['offsetsez'])) $offsetsez=intval($param['offsetsez']); else $offsetsez='';
27if (isset($param['perc'])) $perc=$param['perc']; else $perc='';
28if (isset($param['info'])) $info=addslashes($param['info']); else $info='';
29if (isset($param['files'])) $files=addslashes($param['files']); else $files='';
30if (isset($param['voti_lista'])) $voti_lista=intval($param['voti_lista']); else $voti_lista= 0;
31if (isset($param['perc_lista'])) $perc_lista=$param['perc_lista']; else $perc_lista= 0;
32if (isset($param['lettera'])) $lettera=addslashes($param['lettera']); else $lettera='';
33if (isset($param['id_gruppo'])) $id_gruppo=intval($param['id_gruppo']); else $id_gruppo='';
34if (isset($param['tipo_cons'])) $tipo_cons=intval($param['tipo_cons']); else $tipo_cons='';
35if (isset($param['xls'])) $xls=intval($param['xls']); else $xls='';
36if (isset($param['pdf'])) $pdf=intval($param['pdf']); else $pdf='';
37
38# anti-xss nov. 2009
39$id_comune=htmlentities($id_comune);
40$perc=floatval($perc);
41$perc_lista=floatval($perc_lista);
42#$datipdf= htmlentities($datipdf);
43$op= htmlentities($op);
44$info= htmlentities($info);
45$files=htmlentities($files);
46$lettera=htmlentities($lettera);
47$id_comune=intval($id_comune);
48
49//$id_cons_gen=$_GET['id_cons_gen'];
50$sql="SELECT t1.tipo_cons,t3.genere,t2.id_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".$prefix."_ele_tipo as t3 where t1.tipo_cons=t3.tipo_cons and t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'" ;
51$res = $dbi->prepare("$sql");
52$res->execute();
53list($tipo_cons,$genere,$id_cons) = $res->fetch(PDO::FETCH_NUM);
54if (isset($param['ops'])) $ops=$param['ops']; else $ops='';
55if (isset($param['pag'])) $pag=$param['pag']; else $pag=0;
56if (isset($param['num_ref'])) $num_ref=$param['num_ref'];
57if (isset($param['num_refs'])) $num_refs=$param['num_refs'];
58$bgcolor2='#cacaca';
59if (!IsSet($num_ref)) {
60 $num_ref=1;
61 $sql="SELECT id_gruppo from ".$prefix."_ele_gruppo where id_cons=$id_cons";
62 $resg = $dbi->prepare("$sql");
63 $resg->execute();
64 $num_refs= $resg->rowCount(); //quante pagine?
65}
66//**************************************************************************
67// ELE
68//**************************************************************************
69//controllo_finale($id_cons);
70
71global $prefix, $dbi,$id_circ,$lang, $fascia, $limite, $votog;
72include_once("modules/Elezioni/language/lang-$lang.php");
73# testata
74$datipdf='';
75if($csv==1){
76 include_once("modules/Elezioni/funzioni.php");
77 $sql="SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
78 $res = $dbi->prepare("$sql");
79 $res->execute();
80 list($descr_com) = $res->fetch(PDO::FETCH_NUM);
81 $descr_com =stripslashes($descr_com);
82 $datipdf .= "<div style=\"margin:0px auto; text-align:center;\">";
83 $siteistat=$id_comune;
84 # salva sull'hardisk lo stemma del comune style=\"vertical-align: text-bottom;\"
85 $logo=verificasimbolo();
86 $immagine= "<img src=\"modules/Elezioni/images/$logo\" alt=\"logo\" align=\"left\"/>";
87 if($xls!=1) $datipdf .= "<table><tr><td>$immagine</td><td>";
88 $datipdf .= ""._COMUNE." $descr_com <br/>
89 "._RISULTA." "._CONSULTA."<br/>";
90 $datipdf .= "$descr_cons <br />"._DISCLAIMER."";
91 if($xls!=1) $datipdf .= "</td></tr></table>";
92 $datipdf .="</div>";
93 $html = "<style type=\"text/css\">
94 <!--
95
96 .td-89 {
97 width: 89%;
98 border: 1px;
99 text-align: left;
100 }
101 .td-vuoto {
102 width: 100%;
103 border: 1px;
104 text-align: left;
105 }
106
107 .td-5 {
108 margin: 0px 0 0 0px;
109 width: 5%;
110 /*border: none;*/
111 padding: 0px;
112 text-align: center;
113 }
114
115 .bgw {
116 background: #ffffff;
117 font-size: 13px;
118 font-family: Helvetica;
119 text-align: right;
120 }
121
122 .bggray {
123 background: #ffffff;
124 FONT-SIZE: 13px;
125 FONT-FAMILY: Helvetica;
126 border: 1px;
127 text-align:right;
128 }
129
130 .bggray2 {
131 background: #EFEFEF;
132 FONT-SIZE: 13px;
133 FONT-FAMILY: Helvetica;
134 border: 1px;
135 text-align:right;
136 }
137 -->
138 </style>";
139}
140// icone stampa e grafici style=\"margin:0px auto;
141if ($csv!=1){
142 if(isset($num_ref)) $curref="&amp;num_ref=$num_ref"; else $curref='';
143 if (!isset($html)) $html='';
144 $html .= "<div>
145 <a href=\"modules.php?name=Elezioni&amp;file=index&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;op=graf_votanti\">
146 "._VER_GRAF." <img class=\"image\" src=\"modules/Elezioni/images/grafici.png\" alt=\"\" /></a>
147 <a href=\"modules.php?name=Elezioni&amp;op=come&amp;file=index&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;info=votanti&amp;csv=1&amp;pag=$pag&amp;num_ref=$num_ref&amp;num_refs=$num_refs\">"._VER_STAMPA."
148 <img class=\"image\" src=\"modules/Elezioni/images/printer.png\" alt=\"\" /></a>
149 <a href=\"modules.php?name=Elezioni&amp;op=come&amp;file=index&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;info=votanti&amp;xls=1&csv=1;&amp;pag=$pag&amp;num_ref=$num_ref&amp;num_refs=$num_refs\">
150 <img class=\"image\" src=\"modules/Elezioni/images/csv.gif\" alt=\"\" /></a>
151 <a href=\"modules.php?name=Elezioni&amp;op=come&amp;file=index&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;info=votanti&amp;pdf=1&csv=1;&amp;pag=$pag&amp;num_ref=$num_ref&amp;num_refs=$num_refs\">
152 <a href=\"modules.php?name=Elezioni&amp;op=come&amp;file=index&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;info=votanti&amp;pdf=1&csv=1;&amp;pag=$pag$curref\">
153 <img class=\"image\" src=\"modules/Elezioni/images/pdf.gif\" alt=\"\" /></a>
154 </div>";
155}
156$sql="SELECT sum(maschi),sum(femmine) FROM ".$prefix."_ele_sezioni where id_cons='$id_cons'";
157$res = $dbi->prepare("$sql");
158$res->execute();
159list($totm,$totf) = $res->fetch(PDO::FETCH_NUM);
160$totel=$totm+$totf;
161if (!IsSet($pag)) {$pag=0;} //inizializza il numero di pagina
162/*
163if (!IsSet($num_ref)) {
164 $num_ref=1;
165 $resg = mysql_query("SELECT id_gruppo from ".$prefix."_ele_gruppo where id_cons=$id_cons", $dbi);
166 $num_refs= mysql_num_rows($resg); //quante pagine?
167}
168*/
169if(($genere!=4) and $pag==0){ //diverso da liste a piu' candidati
170 $ops=4; //gestione gruppi (anche liste uninominali)
171}else{
172 $ops=3; //gestione liste
173}
174$sql="SELECT id_gruppo,num_gruppo from ".$prefix."_ele_gruppo where id_cons=$id_cons and num_gruppo=$num_ref";
175$resg = $dbi->prepare("$sql");
176$resg->execute();
177list($idg,$numg) = $resg->fetch(PDO::FETCH_NUM);
178$sql="SELECT id_sez,num_sez,t1.id_sede as id_sede,t2.id_circ as id_circ FROM ".$prefix."_ele_sezioni as t1,".$prefix."_ele_sede as t2 where t1.id_cons='$id_cons' and t1.id_sede=t2.id_sede order by num_sez ";
179$res = $dbi->prepare("$sql");
180$res->execute();
181$max = $res->rowCount(); //quante sezioni?
182$sql="SELECT id_sez,num_sez,t1.id_sede as id_sede,t2.id_circ as id_circ FROM ".$prefix."_ele_sezioni as t1,".$prefix."_ele_sede as t2 where t1.id_cons='$id_cons' and t1.id_sede=t2.id_sede order by num_sez ";
183$res = $dbi->prepare("$sql");
184$res->execute();
185$num_sez = $res->rowCount(); //quante sezioni?
186for ($i=1;$i<=$num_sez;$i++){
187 $sezione[$i]=$res->fetch(PDO::FETCH_BOTH); //inizializza l'array delle sezioni
188 $ar[$i]=0;
189}
190$tab3="_ele_voti_lista";
191if ($genere>0) { //se non e' un referendum
192 if (!($genere==4) and $pag==0){ //se non e' una lista uninominale ed e' la prima pagina
193 $tab="SELECT 0,t2.id_sez,t2.num_sez,t2.validi,'0','0',t2.validi,t2.nulli,t2.bianchi,t2.contestati, t4.id_circ,t2.id_sede,'0',t2.voti_nulli FROM ".$prefix."_ele_sezioni as t2 left join ".$prefix."_ele_sede as t4 on (t2.id_sede=t4.id_sede) where t2.id_cons='$id_cons' and t2.validi+t2.nulli+t2.bianchi+t2.contestati>0 group by t2.id_sez,t2.num_sez,t2.validi,t2.nulli,t2.bianchi,t2.contestati, t4.id_circ,t2.id_sede,t2.voti_nulli order by t2.num_sez ";
194 }else{ // e' una lista uninominale o la seconda pagina
195 # voto disgiunto regione sicilia aggiunge il campo solo lista
196 if(isdisgiunto()){
197 $tab="SELECT '0',t1.id_sez,t1.num_sez,sum(t2.voti),t1.solo_gruppo,t1.solo_lista,t1.validi,t1.nulli,t1.bianchi,t1.contestati, t4.id_circ,t1.id_sede,'0',t1.voti_nulli
198 FROM ".$prefix."_ele_sezioni as t1 left join ".$prefix.$tab3." as t2 on (t1.id_sez=t2.id_sez)
199 left join ".$prefix."_ele_sede as t4 on (t1.id_sede=t4.id_sede)
200 where t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons group by t1.id_sez,t1.num_sez,t1.solo_gruppo,t1.solo_lista,t1.validi,t1.nulli,t1.bianchi,t1.contestati,t4.id_circ,t1.id_sede,t1.voti_nulli order by t1.num_sez ";
201 }else{
202 $tab="SELECT '0',t1.id_sez,t1.num_sez,sum(t2.voti),t1.solo_gruppo,'0',t1.validi,t1.nulli,t1.bianchi,t1.contestati, t4.id_circ,t1.id_sede,'0',t1.voti_nulli
203 FROM ".$prefix."_ele_sezioni as t1 left join ".$prefix.$tab3." as t2 on (t1.id_sez=t2.id_sez)
204 left join ".$prefix."_ele_sede as t4 on (t1.id_sede=t4.id_sede)
205 where t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons group by t1.id_sez,t1.num_sez,t1.solo_gruppo,t1.validi,t1.nulli,t1.bianchi,t1.contestati,t4.id_circ,t1.id_sede,t1.voti_nulli order by t1.num_sez ";
206 }
207 }
208 $riga1 = "";
209 if($pag==0)$riga1 .="<div style=\"text-align: center;\"><h2>"._DETTAGLIO." "._VOTIE."</h2></div>";
210 else $riga1 .="<h4>"._DETTAGLIO." "._VOTIE." "._ASOLA_LISTA."</h4>";
211}else{ // e' un referendum --> t3.id_gruppo vuota per allineare il while (da rifare con array)
212 $tab="SELECT t1.id_gruppo,t1.id_sez,t2.num_sez,t1.si,t1.no,'0',t1.validi,t1.nulli,t1.bianchi,t1.contestati, t4.id_circ,t2.id_sede,t3.num_gruppo,'0'
213 FROM ".$prefix."_ele_voti_ref as t1 left join ".$prefix."_ele_sezioni as t2 on (t1.id_sez=t2.id_sez)
214 left join ".$prefix."_ele_gruppo as t3 on (t1.id_gruppo=t3.id_gruppo) left join ".$prefix."_ele_sede as t4 on (t2.id_sede=t4.id_sede)
215 where t1.id_cons='$id_cons' and t1.id_gruppo='$idg' order by t2.num_sez ";
216 $riga1 = "<div style=\"margin:0px auto;text-align:center;\">";
217 $riga1 .="<h2>"._DETTAGLIO." "._VOTIE."</h2></div>";
218 $sql="select descrizione from ".$prefix."_ele_gruppo where id_gruppo='$idg'";
219 $des = $dbi->prepare("$sql");
220 $des->execute();
221 list($descrizione)=$des->fetch(PDO::FETCH_BOTH);
222 $riga1 .="<h4>$descrizione</h4>";
223}
224$sql="$tab ";
225$res = $dbi->prepare("$sql");
226$res->execute();
227$num_scr = $res->rowCount();
228//$riga2= "<div>"._SEZSCR." $num_scr su $num_sez</div>";//sezioni scrutinate
229$riga2 = "<table style=\"border:1px solid #6A6A6A;\" summary=\"Tabella dei voti espressi\">";
230$riga3 = "<tr class=\"bggray2\">
231<td>"._SEZIONI."</td>
232<td>"._VOTIU."</td>
233<td>"._VOTID."</td>
234<td>"._VOTIE."</td>"; //testata con nomi dei campi
235if ($genere==0) { //se e' un referendum
236 $riga3 .= "<td>"._SI."</td><td>"._NO."</td>";
237} elseif ((($genere==5) or ($genere==3)) and $pag==1){
238 $riga3 .= "<td>Voti "._LISTE."</td>";
239 if(isdisgiunto()){
240 $riga3 .= "<td>Voti "._PRESI."</td>";
241 $riga3 .= "<td>"._SOLO_LISTA."</td>";
242 } // voto disgiunto
243 if (!$votog) $riga3 .= "<td>"._ASOLO_GRUPPO."</td>";
244}
245$riga3 .= "<td>"._VALIDI."</td><td>"._NULLI."</td><td>"._BIANCHI."</td><td>"._CONTESTATI."</td>"
246."</tr>\n";
247$sql="$tab ";
248$res = $dbi->prepare("$sql");
249$res->execute();
250$num_scr = $res->rowCount();
251$righe= "";
252$scrutinate=1;
253$tot_u=0;$tot_d=0;$tot_voti=0; $tot_si=0;$tot_no=0;$tot_validi=0;$tot_nulli=0;$tot_bianchi=0;$tot_contestati=0;
254$tot_sololista=0;$tot_gruppo=0;
255#$si e $no sono valide anche per voti lista e solo gruppo per i non referendum
256while (list($id_gruppo,$id,$num,$si,$no,$sololista,$validi,$nulli,$bianchi,$contestati,$id_circ,$id_sede,$gruppo,$votinulli) = $res->fetch(PDO::FETCH_NUM)){
257 $nulli+=$votinulli;
258 // inserimento numeri di sez non scrutinate
259 while ($scrutinate < $num) {
260 $righe.= "<tr><td><span style=\"color: rgb(255, 0, 0);\">$scrutinate</span></td></tr>\n";
261 $scrutinate++;
262 }
263 # voti sindaco, gruppo o presidente
264 $tab5="SELECT sum(voti) FROM ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id'";
265 $sql="$tab5";
266 $res3 = $dbi->prepare("$sql");
267 $res3->execute();
268 list($sindaco) = $res3->fetch(PDO::FETCH_NUM);
269 $scrutinate++;
270 // fine inserimento
271 $tab2="SELECT max(voti_donne),max(voti_uomini),max(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_cons='$id_cons' and id_sez='$id'";
272 if ($genere==0) $tab2 .= " and id_gruppo=$id_gruppo";
273 $sql=$tab2;
274 $res2 = $dbi->prepare("$sql");
275 $res2->execute();
276 list($votid,$votiu,$voti) = $res2->fetch(PDO::FETCH_NUM);
277// $voti=$votiu+$votid;
278 $tot_gruppo+=$sindaco;
279 $tot_u+=$votiu;
280 $tot_d+=$votid;
281 $tot_voti+=$voti;
282 $tot_si+=$si;
283 $tot_no+=$no;
284 $tot_validi+=$validi;
285 $tot_nulli+=$nulli;
286 $tot_bianchi+=$bianchi;
287 $tot_contestati+=$contestati;
288 $tot_sololista+=$sololista;
289 if($num % 2)
290 $righe .= "<tr class=\"bgw\">";
291 else
292 $righe .= "<tr class=\"bggray2\">";
293 $righe .= "<td>$num</td>
294 <td>".number_format($votiu,0,',','.')."</td>
295 <td>".number_format($votid,0,',','.')."</td>
296 <td>".number_format($voti,0,',','.')."</td>";
297 if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){
298 $righe .= "<td>".number_format($si,0,',','.')."</td>";
299 if(isdisgiunto()){
300 $righe .= "<td>".number_format($sindaco,0,',','.')."</td>";
301 $righe .= "<td>".number_format($sololista,0,',','.')."</td>";
302 }
303 if (!$votog) $righe .= "<td>".number_format($no,0,',','.')."</td>";
304 }
305 $righe .= "<td>".number_format($validi,0,',','.')."</td>
306 <td>$nulli</td>
307 <td>$bianchi</td>
308 <td>$contestati</td></tr>";
309}
310if ($num<$num_sez) {
311 for (;$scrutinate<=$num_sez;$scrutinate++) {
312 $righe .= "<tr><td>";
313 $righe .="<span style=\"color: rgb(255, 0, 0);\">$scrutinate</span></td></tr>";
314 }
315}
316$righet='';
317if($num_scr){
318 $righet = "<tr class=\"bggray\">
319 <td ></td>
320 <td>"._VOTIU."</td>
321 <td>"._VOTID."</td>
322 <td>"._VOTIE."</td>"; //testata con nomi dei campi
323 if ($genere==0) { //se e' un referendum
324 $righet .= "<td>"._SI."</td><td>"._NO."</td>";
325 } elseif ((($genere==5) or ($genere==3)) and $pag==1){
326 $righet .= "<td>Voti "._LISTE."</td>";
327 if(isdisgiunto()){
328 $righet .= "<td>Voti "._PRESI."</td>";
329 $righet .= "<td>"._SOLO_LISTA."</td>";
330 } // voto disgiunto
331 if (!$votog) $righet .= "<td>"._ASOLO_GRUPPO."</td>";
332 }
333 if($totel==0) $totelrip="0.00"; else $totelrip=number_format($tot_voti*100/$totel,2);
334 if($totf==0) $totfrip="0.00"; else $totfrip=number_format($tot_d*100/$totf,2);
335 if($totm==0) $totmrip="0.00"; else $totmrip=number_format($tot_u*100/$totm,2);
336 $righet .= "<td>"._VALIDI."</td><td>"._NULLI."</td><td>"._BIANCHI."</td><td>"._CONTESTATI."</td>"
337 ."</tr><tr class=\"bgw\"><td><b>"._TOT."</b></td><td><b>".number_format($tot_u,0,',','.')."</b><br /><i>(".$totmrip."%)</i></td><td><b>".number_format($tot_d,0,',','.')."</b><br /><i>(".$totfrip."%)</i></td><td><b>".number_format($tot_voti,0,',','.')."</b><br /><i>(".$totelrip."%)</i></td>";
338 // se e' un referendum o una consultazione con raggruppamenti
339 if($tot_validi){
340 if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){
341 $righet .= "<td><b>".number_format($tot_si,0,',','.')."</b><br /><i>(".number_format($tot_si*100/$tot_validi,2)."%)</i></td>";
342 if(isdisgiunto()){
343 $righet .="<td><b>".number_format($tot_gruppo,0,',','.')."</b><br /><i>(".number_format($tot_gruppo*100/$tot_validi,2)."%)</i></td>";
344 $righet .="<td><b>".number_format($tot_sololista,0,',','.')."</b><br /><i>(".number_format($tot_sololista*100/$tot_validi,2)."%)</i></td>";
345 }
346 if(!$votog) $righet .="<td><b>".number_format($tot_no,0,',','.')."</b><br /><i>(".number_format($tot_no*100/$tot_validi,2)."%)</i></td>";
347 }
348 $righet .= "<td><b>".number_format($tot_validi,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_validi*100/$tot_voti,2):'0.00')."%)</i></td><td><b>"
349 .number_format($tot_nulli,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_nulli*100/$tot_voti,2):'0.00')."%)</i></td><td><b>".number_format($tot_bianchi,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_bianchi*100/$tot_voti,2):'0.00')."%)</i></td><td><b>".number_format($tot_contestati,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_contestati*100/$tot_voti,2):'0.00')."%)</i></td></tr>";
350 }else{
351 if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){
352 $righet .= "<td><b>".number_format($tot_si,0,',','.')."</b><br /><i>(0.00%)</i></td><td><b>".number_format($tot_no,0,',','.')."</b><br /><i>(0.00%)</i></td>";
353 }
354 $righet .= "<td><b>0</b><br /><i>(0.00%)</i></td><td><b>"
355 .number_format($tot_nulli,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_nulli*100/$tot_voti,2):'0,00')."%)</i></td><td><b>".number_format($tot_bianchi,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_bianchi*100/$tot_voti,2):'0,00')."%)</i></td><td><b>".number_format($tot_contestati,0,',','.')."</b><br /><i>(".($tot_voti ? number_format($tot_contestati*100/$tot_voti,2):'0,00')."%)</i></td></tr>";
356 }
357}
358$righe .= "</table>";
359if(!isset($html)) $html='';
360$html .= "$riga1";
361$html .= $riga2."";
362$html .= $righet;
363$html .= $riga3;
364$html .= $righe;
365$html .="<div>";
366if($genere==0){ //se e' referendum
367 if ($xls!='1' && $pdf!='1' && $csv!='1'){
368 #'Pagina precedente' e 'Pagina Successiva'
369 $cur=$num_ref;
370 if ($cur>1) {
371 $num_ref--;
372 $html .= "<a href=\"modules.php?name=Elezioni&amp;op=come&amp;file=index&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;info=votanti&amp;num_ref=$num_ref&amp;num_refs=$num_refs&amp;csv=$csv&amp;xls=$xls&amp;pdf=$pdf\">";
373 $html .= "[ <b>"._PREV_MATCH."</b> ]</a>";
374 }
375 if ($cur<$num_refs) {
376 $cur++;
377 $html .= "<a href=\"modules.php?name=Elezioni&amp;op=come&amp;file=index&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;info=votanti&amp;num_ref=$cur&amp;num_refs=$num_refs&amp;csv=$csv&amp;xls=$xls&amp;pdf=$pdf\">";
378
379 $html .= "[ <b>"._NEXT_MATCH."</b> ]</a>";
380 }
381 }
382}
383if($genere==5 or $genere==3){ //se vi sono raggruppamenti
384 if($csv!=1 and $fascia>$limite){
385 $pag=($pag==0 ? 1:0);
386 $html .= "<a href=\"modules.php?name=Elezioni&amp;file=index&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;op=come&amp;info=votanti&amp;pag=$pag&amp;csv=$csv\"><b>";
387 if($pag) $html .= _VOTIL;
388 //_CONTR_CONS;
389 else $html .= _VOTIE;
390 //_CONTR_ESPR;
391 $html .= "</b></a>";
392 }
393}
394if($csv==1){
395 $data=date("d-m-y G:i");
396 $html .="<br/><div style=\"margin:0 auto;text-align:center;\"><i>Stampato: $data</i>";
397 $html .="<br/><i>Eleonline by l. apolito & r. gigli - www.eleonline.it</i></div>";
398}
399$html .= "</div>";
400?>
Note: See TracBrowser for help on using the repository browser.