Index: trunk/client/modules/Elezioni/gruppo.php
===================================================================
--- trunk/client/modules/Elezioni/gruppo.php	(revision 113)
+++ trunk/client/modules/Elezioni/gruppo.php	(revision 115)
@@ -616,22 +616,30 @@
 			if (!isset($offsetsez)) $offsetsez=25; //lo 0 viene sostituito dal totale di sezioni presenti
 			if (!isset($minsez)) $minsez=1;
-			echo "<form id=\"voti\" method=\"post\" action=\"modules.php\">";
-			echo "<div><input type=\"hidden\" name=\"name\" value=\"Elezioni\"></input>";			
-			echo "<input type=\"hidden\" name=\"op\" value=\"$op\"></input>";			
-			echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"></input>";			
-			echo "<input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\"></input>";			
-			echo "<table><tr><td>"._SCELTA." "._CONSULTAZIONE.": <select name=\"id_gruppo\">";
-			while(list($id_rif,$descrizione,$num_lis) = mysql_fetch_row($res_lis)) {
-				if (!$id_gruppo) $id_gruppo=$id_rif;
-				$sel = ($id_rif == $id_gruppo) ? "selected=\"selected\"" : "";
-				echo "<option value=\"$id_rif\" $sel>";
-				for ($j=strlen($num_lis);$j<2;$j++) { echo "&nbsp;&nbsp;";}
-				echo $num_lis.") ".strip_tags(substr($descrizione,0,50))."</option>";
-			}
-			echo "</select></td></tr>";
-			echo "<tr><td>"._VIS_PERC.": <input type=\"checkbox\" name=\"perc\" value=\"true\"";
-			if($perc=='true') echo " checked=\"true\"";
-			echo "></td>";
-			echo "<td><input type=\"submit\" name=\"update\" value=\""._OK."\"></td></tr></table></form>";
+			if (!$csv){
+			        echo "<div><h5>$pagina</h5></div>";
+				echo "<form id=\"voti\" method=\"post\" action=\"modules.php\">";
+				echo "<div style=\"text-align:left;width:700px;margin:auto;font-size:12px \">
+					<input type=\"hidden\" name=\"name\" value=\"Elezioni\"></input>";			
+				echo "<input type=\"hidden\" name=\"op\" value=\"$op\"></input>";			
+				echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"></input>";			
+				echo "<input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\"></input>";			
+				echo ""._SCELTA." "._CONSULTAZIONE.": <select name=\"id_gruppo\">";
+				while(list($id_rif,$descrizione,$num_lis) = mysql_fetch_row($res_lis)) {
+					if (!$id_gruppo) $id_gruppo=$id_rif;
+					$sel = ($id_rif == $id_gruppo) ? "selected=\"selected\"" : "";
+					echo "<option value=\"$id_rif\" $sel>";
+					for ($j=strlen($num_lis);$j<2;$j++) { echo "&nbsp;&nbsp;";}
+					echo $num_lis.") ".strip_tags(substr($descrizione,0,50))."</option>";
+				}
+				echo "</select>";
+				echo "<br />"._VIS_PERC.": <input type=\"checkbox\" name=\"perc\" value=\"true\"";
+				if($perc=='true') echo " checked=\"true\"";
+				echo ">";
+				echo "<br /><input type=\"submit\" name=\"update\" value=\""._RICARICA."\"></form></div>";
+
+			 
+
+			}
+
 			$res_ref= mysql_query("select num_gruppo,descrizione from ".$prefix."_ele_gruppo where id_gruppo=$id_gruppo", $dbi);
 			$res = mysql_query("select $tab2, t1.num_gruppo, t1.descrizione , t1.simbolo, 
@@ -648,5 +656,36 @@
 			$num_sez=mysql_num_rows($res);
 			list($num_gruppo,$descr)= mysql_fetch_row($res_ref);
-			echo "<table><tr><td><b>Referendum n. ".$num_gruppo.") </b></td><td>".$descr."</td></tr></table></form>";
+			
+			if (!$csv){
+				# stampa
+				
+				$datipdf="<b>"._COMUNE." $descr_comune</b> - "._RISULTATI.": $descr_cons<br/><b>$pagina</b><br/><br/> ";
+				$datipdf .="<br/><b>Referendum n. ".$num_gruppo." </b><br/>".$descr."";
+				echo "<div style=\"text-align:right;width:900px;margin-left:10px;margin-right:20px;font-size:12px \">"._ESPORTA."<br />";
+				
+			        echo "<a href=\"modules.php?name=Elezioni&amp;op=$op&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;csv=1&amp;perc=$perc&amp;id_gruppo=$id_gruppo&amp;datipdf=$datipdf\" ><img class=\"image\"  src=\"modules/Elezioni/images/printer.gif\" alt=\"Stampa\" /></a>";
+				  echo "<a href=\"modules.php?name=Elezioni&amp;op=$op&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;csv=1&amp;perc=$perc&amp;id_gruppo=$id_gruppo&amp;xls=1&amp;datipdf=$datipdf\" ><img class=\"image\"  src=\"modules/Elezioni/images/csv.gif\" alt=\"Export Csv\" /></a>";
+
+				  echo "<a href=\"modules.php?name=Elezioni&amp;op=$op&amp;id_cons_gen=$id_cons_gen&amp;id_comune=$id_comune&amp;csv=1&amp;perc=$perc&amp;id_gruppo=$id_gruppo&amp;pdf=1&amp;datipdf=$datipdf\" ><img class=\"image\"  src=\"modules/Elezioni/images/pdf.gif\" alt=\"Export Pdf\" /></a>";
+				
+				echo "</div>";
+
+
+// numero sezioni scrutinate
+  	$res4 = mysql_query("select t3.*  from ".$prefix."_ele_voti_ref as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons'  group by t3.id_sez ",$dbi);
+	$numero=mysql_num_rows($res4);
+	$res5 = mysql_query("select t1.*  from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' ",$dbi);
+	$sezioni=mysql_num_rows($res5);
+	
+	if ($numero!=0) echo "<h5><i> "._SEZSCRU." $numero "._SU." $sezioni </i></h5>";
+
+}
+
+
+
+
+
+			if (!$csv)echo "<b>Referendum n. ".$num_gruppo." </b><br />".$descr."";
+
 		$y=1;
 		$ar[0][0]=$tipo2;
@@ -681,20 +720,20 @@
 			$ar[$num_circ][0]=$num_circ."<br />".$desc_circ;
 			if($validi){
-			$ar[$num_circ][$i++]= $perc=='true' ? $si."<br /><span class=\"red\">".number_format($si*100/$validi,2)."%</span>":$si;
-			$ar[$num_circ][$i++]= $perc=='true' ? $no."<br /><span class=\"red\">".number_format($no*100/$validi,2)."%</span>":$no;
+			$ar[$num_circ][$i++]= $perc=='true' ? $si."<br /><span class=\"red\"><i>".number_format($si*100/$validi,2)."%</i></span>":$si;
+			$ar[$num_circ][$i++]= $perc=='true' ? $no."<br /><span class=\"red\"><i>".number_format($no*100/$validi,2)."%</i></span>":$no;
 			}else{
-			$ar[$num_circ][$i++]= $perc=='true' ? $si."<br /><span class=\"red\">0.00%</span>":$si;
-			$ar[$num_circ][$i++]= $perc=='true' ? $no."<br /><span class=\"red\">0.00%</span>":$no;
+			$ar[$num_circ][$i++]= $perc=='true' ? $si."<br /><span class=\"red\"><i>0.00%</i></span>":$si;
+			$ar[$num_circ][$i++]= $perc=='true' ? $no."<br /><span class=\"red\"><i>0.00%</i></span>":$no;
 			}
 			if($votanti){
-			$ar[$num_circ][$i++]= $perc=='true' ? $validi."<br /><span class=\"red\">".number_format($validi*100/$votanti,2)."%</span>":$validi;
-			$ar[$num_circ][$i++]= $perc=='true' ? $nulli."<br /><span class=\"red\">".number_format($nulli*100/$votanti,2)."%</span>":$nulli;
-			$ar[$num_circ][$i++]= $perc=='true' ? $bianchi."<br /><span class=\"red\">".number_format($bianchi*100/$votanti,2)."%</span>":$bianchi;
-			$ar[$num_circ][$i++]= $perc=='true' ? $contestati."<br /><span class=\"red\">".number_format($contestati*100/$votanti,2)."%</span>":$contestati;
+			$ar[$num_circ][$i++]= $perc=='true' ? $validi."<br /><span class=\"red\"><i>".number_format($validi*100/$votanti,2)."%</i></span>":$validi;
+			$ar[$num_circ][$i++]= $perc=='true' ? $nulli."<br /><span class=\"red\"><i>".number_format($nulli*100/$votanti,2)."%</i></span>":$nulli;
+			$ar[$num_circ][$i++]= $perc=='true' ? $bianchi."<br /><span class=\"red\"><i>".number_format($bianchi*100/$votanti,2)."%</i></span>":$bianchi;
+			$ar[$num_circ][$i++]= $perc=='true' ? $contestati."<br /><span class=\"red\"><i>".number_format($contestati*100/$votanti,2)."%</i></span>":$contestati;
 			}else{
-			$ar[$num_circ][$i++]= $perc=='true' ? $validi."<br /><span class=\"red\">0.00%</span>":$validi;
-			$ar[$num_circ][$i++]= $perc=='true' ? $nulli."<br /><span class=\"red\">0.00%</span>":$nulli;
-			$ar[$num_circ][$i++]= $perc=='true' ? $bianchi."<br /><span class=\"red\">0.00%</span>":$bianchi;
-			$ar[$num_circ][$i++]= $perc=='true' ? $contestati."<br /><span class=\"red\">0.00%</span>":$contestati;
+			$ar[$num_circ][$i++]= $perc=='true' ? $validi."<br /><span class=\"red\"><i>0.00%</i></span>":$validi;
+			$ar[$num_circ][$i++]= $perc=='true' ? $nulli."<br /><span class=\"red\"><i>0.00%</i></span>":$nulli;
+			$ar[$num_circ][$i++]= $perc=='true' ? $bianchi."<br /><span class=\"red\"><i>0.00%</i></span>":$bianchi;
+			$ar[$num_circ][$i++]= $perc=='true' ? $contestati."<br /><span class=\"red\"><i>0.00%</i></span>":$contestati;
 			}
 		}
