source: trunk/admin/modules/Elezioni/ele_riepilogo.php@ 185

Last change on this file since 185 was 174, checked in by roby, 12 years ago

sistemazioni su report voti - da terminare

File size: 5.2 KB
Line 
1<?php
2
3/************************************************************************/
4/* Eleonline - Raccolta e diffusione dei dati elettorali */
5/* by Roberto Gigli & Luciano Apolito */
6/* http://www.eleonline.it */
7/* info@eleonline.it luciano@aniene.net rgigli@libero.it */
8/************************************************************************/
9/* Modulo Controllo dei voti */
10/* Amministrazione */
11/************************************************************************/
12
13if (!defined('ADMIN_FILE')) {
14 die ("You can't access this file directly...");
15}
16
17$aid=$_SESSION['aid'];
18$dbi=$_SESSION['dbi'];
19$prefix=$_SESSION['prefix'];
20$currentlang=$_SESSION['lang'];
21$id_comune=$_SESSION['id_comune'];
22$id_cons_gen=$_GET['id_cons_gen'];
23$bgcolor1=$_SESSION['bgcolor1'];
24$bgcolor2=$_SESSION['bgcolor2'];
25
26$perms=ChiSei($id_cons_gen);
27if ($perms<16 or !$id_cons_gen) die("$perms Non hai i permessi per inserire dati, o non hai scelto la consultazione!");
28$res = mysql_query("SELECT t1.tipo_cons,t2.id_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'" , $dbi);
29list($tipo_cons,$id_cons) = mysql_fetch_row($res);
30$res = mysql_query("SELECT genere,voto_g,voto_l FROM ".$prefix."_ele_tipo where tipo_cons='$tipo_cons' " , $dbi);
31 list($genere,$votog,$votol) = mysql_fetch_row($res);
32
33include("modules/Elezioni/funzionidata.php");
34include("modules/Elezioni/ele.php");
35if (! get_magic_quotes_gpc()) $magic='addslashes'; else $magic='';
36if (isset($param['ops'])) get_magic_quotes_gpc() ? $ops=$param['ops']:$ops=addslashes($param['ops']); else $ops='';
37if (isset($param['pag'])) $pag=intval($param['pag']); else $pag=0;
38if (isset($param['num_ref'])) $num_ref=intval($param['num_ref']);
39if (isset($param['num_refs'])) $num_refs=intval($param['num_refs']);
40ele();
41//**************************************************************************
42// ELE
43//**************************************************************************
44
45 global $prefix, $dbi,$fascia,$limite,$genere,$votog;
46 $res = mysql_query("SELECT sum(maschi),sum(femmine) FROM ".$prefix."_ele_sezioni where id_cons='$id_cons'", $dbi);
47 list($totm,$totf) = mysql_fetch_row($res);
48 $totel=$totm+$totf;
49 $res = mysql_query("SELECT data,orario FROM `soraldo_ele_rilaff` where id_cons_gen=$id_cons_gen order by data desc, orario desc limit 0,1", $dbi);
50 list($giorno,$ora)=mysql_fetch_row($res);
51 $res = mysql_query("SELECT sum(voti_donne),sum(voti_uomini),sum(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_cons='$id_cons' and data='$giorno' and orario='$ora'", $dbi);
52 list($votf,$votm,$votc) = mysql_fetch_row($res);
53 $res = mysql_query("SELECT sum(solo_gruppo),sum(validi),sum(nulli),sum(bianchi),sum(contestati), sum(voti_nulli),sum(validi_lista),sum(voti_nulli_lista),sum(contestati_lista),sum(solo_lista) FROM ".$prefix."_ele_sezioni where id_cons=$id_cons", $dbi);
54 list($sg,$validi,$nulli,$bianchi,$contestati,$votinulli,$validilista,$nullilista,$contestatilista,$sl)=mysql_fetch_row($res);
55 echo "<center>";
56 echo "<fieldset><legend>"._VOTANTI."</legend>";
57 echo "<table border=\"1\" width=\"100%\"><tr><th>"._ISCRITTI."</TH><TH>"._UOMINI."</TH><TH>"._DONNE."</TH><TH>"._VOTIU."</TH><TH>"._VOTID."</TH><TH>"._VOTIE."</TH></TR>";
58 ECHO "<TR><TH>".number_format($totel,0,',','.')."</TH><TH>".number_format($totm,0,',','.')."</TH><TH>".number_format($totf,0,',','.')."</TH><TH>".number_format($votm,0,',','.')."</TH><TH>".number_format($votf,0,',','.')."</TH><TH>".number_format($votc,0,',','.')."</TH></TR></table><br/>";
59 ECHO "</fieldset><br/><br/><br/>";
60 $totnulli=$nulli+$bianchi+$contestati+$votinulli;
61 if ($votog) echo "<fieldset><legend>"._VOTI_LISTA."</legend>";
62 else echo "<fieldset><legend>"._GRUPPO."</legend>";
63 echo "<table border=\"1\" width=\"100%\"><tr><th><b>"._VALIDI."</b></th><th>"._NULLI."</th><th>"._BIANCHI."</th><th>"._CONTESTATI."</th><th>"._VOTINULLI."</th><th>"._TOTNON."</th></TR>";
64 ECHO "<TR><TH>".number_format($validi,0,',','.')."</TH><TH>".number_format($nulli,0,',','.')."</TH><TH>".number_format($bianchi,0,',','.')."</TH><TH>".number_format($contestati,0,',','.')."</TH><TH>".number_format($votinulli,0,',','.')."</TH><TH>".number_format($totnulli,0,',','.')."</TH></TR></table><br/>";
65 ECHO "</fieldset><br/><br/><br/>";
66 if ($genere==5 and !$votog) {
67 $totnullil=$nullilista+$contestatilista;
68 echo "<fieldset><legend>"._VOTI_LISTA."</legend>";
69 echo "<table border=\"1\" width=\"100%\"><tr><th>"._VALIDI."</th><th>"._VOTINULLI."</th><th>"._CONTESTATI."</th>";
70 // if ($genere==5 and !$votog)
71 echo "<th>"._SOLO_GRUPPO."</th>";
72 echo "<th>"._TOTNON."</th></TR>";
73 ECHO "<TR><TH>".number_format($validilista,0,',','.')."</TH><TH>".number_format($nullilista,0,',','.')."</TH><TH>".number_format($contestatilista,0,',','.')."</TH>";
74 if($genere==5 and !$votog)
75 echo "<TH>".number_format($sg,0,',','.')."</TH>";
76 echo "<TH>".number_format($totnullil,0,',','.')."</TH></TR></table><br/>";
77 ECHO "</fieldset>";
78 }
79 echo "</center>";
80
81
82
83echo "</table>\n</td></tr></table>\n";
84
85 include ("footer.php");
86
87?>
Note: See TracBrowser for help on using the repository browser.