Index: /trunk/client/modules/Elezioni/affluenze.php
===================================================================
--- /trunk/client/modules/Elezioni/affluenze.php	(revision 116)
+++ /trunk/client/modules/Elezioni/affluenze.php	(revision 117)
@@ -18,4 +18,5 @@
 if (isset($param['id_comune'])) $id_comune=intval($param['id_comune']);
 if (isset($param['xls'])) $xls=intval($param['xls']);
+if (isset($param['pdf'])) $pdf=intval($param['pdf']);
 $res = mysql_query("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'" , $dbi);
 list($tipo_cons,$genere,$id_cons) = mysql_fetch_row($res);
@@ -35,10 +36,16 @@
 	$datipdf .= "<div style=\"margin:0px auto; text-align:center;\">";
 	$siteistat=$id_comune;
-	if($xls!=1) $datipdf .= "<table><tr><td><img src=\"modules.php?name=Elezioni&amp;file=foto&amp;id_comune=".$id_comune."\" alt=\"mappa\" /></td><td>";
-        $datipdf .= ""._COMUNE." $descr_com <br/>
-	"._RISULTA." "._CONSULTA."<br/>";
-	$datipdf .= "<h1>$descr_cons</h1>"._DISCLAIMER."";
+	# salva sull'hardisk lo stemma del comune
+	$logo=verificasimbolo();
+	$immagine= "<img src=\"modules/Elezioni/images/$logo\" alt=\"logo\" align=\"left\"/>";
+
+	if($xls!=1) $datipdf .= "<table><tr><td>$immagine</td><td>";
+	
+        $datipdf .= ""._COMUNE." $descr_com <br />
+	"._RISULTA." "._CONSULTA."<br/ >";
+	$datipdf .= "$descr_cons<br />"._DISCLAIMER."
+        <br /><b>"._DETTAGLIO."  "._AFFLUENZE."</b>";
 	if($xls!=1) $datipdf .=  "</td></tr></table>";
-	$datipdf .="	  <h2><b>"._DETTAGLIO."  "._AFFLUENZE."</b></h2></div>";
+	$datipdf .="</div>";
 
 	$html = "<style type=\"text/css\">
@@ -123,4 +130,6 @@
 	<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=affluenze_sez&amp;csv=1&amp;xls=1\">
 	<img class=\"image\" src=\"modules/Elezioni/images/csv.gif\" alt=\"\" /></a>
+<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=affluenze_sez&amp;csv=1&amp;pdf=1\">
+	<img class=\"image\" src=\"modules/Elezioni/images/pdf.gif\" alt=\"\" /></a>
 
 	</div>
@@ -296,4 +305,5 @@
 	     if($genere==0){ //se e' referendum
         #'Pagina precedente' e 'Pagina Successiva'
+	if ($xls!='1' && $pdf!='1' && $csv='1'){
 	$html .= "<div class=\"modulo\">";
 	    $cur=$num_ref;
@@ -311,5 +321,5 @@
 	$html .= "</div>";
 	}
-
+}
 	
 if(!isset($style)) $style='';	
@@ -317,21 +327,30 @@
       $data=date("d-m-y G:i");
       $style .="\t\t\n<br/><br/><br/><div style=\"margin:0px auto;text-align:center;\"><i>Stampato: $data</i></div>";
-      $style .="<br/><div style=\"text-align:center;\"><i>Eleonline by l. apolito & r. gigli - www.eleonline.it</i></div>";		
+      $style .="<br/><div style=\"text-align:center;\"><i>Eleonline by luciano apolito & roberto gigli - www.eleonline.it</i></div>";		
       $style .= "<br/>  ";	
       
 }	
-$html .= "</div>";
+//$html .= "</div>";
 
 
 ############### stampa
-if ($xls!='1'){
+if ($xls!='1' && $pdf!='1'){
       echo "$datipdf $html $style";
-}else{
-	$nomefile="export.xls";
+
+}elseif($xls=="1"){
+	$nomefile="affluenze.xls";
 	header ("Content-Type: application/vnd.ms-excel");
 	header ("Content-Disposition: inline; filename=$nomefile");
-
 	echo "$datipdf";
 	echo "$html \t\n $style";
+}elseif($pdf=='1'){
+		$nomefile="$descr_cons affluenze.pdf";
+		
+		$stampa ="$datipdf $html $style";
+		
+		require_once('inc/hpdf403/html2pdf.class.php');
+		$html2pdf = new HTML2PDF('L','A4', 'it');
+		$html2pdf->WriteHTML($stampa, isset($_GET['vuehtml']));
+		$html2pdf->Output($nomefile);
 }
 
Index: /trunk/client/modules/Elezioni/votanti.php
===================================================================
--- /trunk/client/modules/Elezioni/votanti.php	(revision 116)
+++ /trunk/client/modules/Elezioni/votanti.php	(revision 117)
@@ -74,17 +74,77 @@
 	$datipdf .= "<div style=\"margin:0px auto; text-align:center;\">";
 	$siteistat=$id_comune;
-	if($xls!=1) $datipdf .= "<table><tr><td><img src=\"modules.php?name=Elezioni&amp;file=foto&amp;id_comune=".$id_comune."\" alt=\"mappa\" /></td><td>";
+	# salva sull'hardisk lo stemma del comune
+	$logo=verificasimbolo();
+	$immagine= "<img src=\"modules/Elezioni/images/$logo\" alt=\"logo\" align=\"left\"/>";
+
+	
+
+
+
+	if($xls!=1) $datipdf .= "<table><tr><td>$immagine</td><td>";
         $datipdf .= ""._COMUNE." $descr_com <br/>
 	"._RISULTA." "._CONSULTA."<br/>";
-	$datipdf .= "<h1>$descr_cons</h1>"._DISCLAIMER."";
+	$datipdf .= "$descr_cons <br />"._DISCLAIMER."";
 	if($xls!=1) $datipdf .=  "</td></tr></table>";
 	$datipdf .="</div>";
 	  
 
-
-
-
-
-}
+$html = "<style type=\"text/css\">
+	<!--
+
+	.td-89 {
+	width: 89%;	
+	border: 1px;
+	text-align: left; 
+	}
+	.td-vuoto {
+		
+	width: 100%;	
+	border: 1px;
+	text-align: left; 
+	
+}
+
+
+	.td-5 {
+	
+	margin: 0px 0 0 0px;
+	width: 5%;	
+	/*border: none;*/
+	padding: 0px;
+        
+	text-align: center; 
+	}	
+
+
+
+	.bggray 	{
+		background: #ffffff; 
+		FONT-SIZE: 13px; 
+		FONT-FAMILY: Helvetica;
+		border: 1px;
+	}
+
+	.bggray2 	{
+		background: #EFEFEF; 
+		FONT-SIZE: 13px; 
+		FONT-FAMILY: Helvetica;
+		border: 1px;
+		}
+	-->
+	</style>";
+
+
+
+
+}
+	
+
+
+
+
+
+
+
 
 
@@ -101,4 +161,7 @@
 		<img class=\"image\" src=\"modules/Elezioni/images/csv.gif\" alt=\"\" /></a>
 
+<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\">
+		<img class=\"image\" src=\"modules/Elezioni/images/pdf.gif\" alt=\"\" /></a>
+
 
 	</div>";
@@ -144,7 +207,7 @@
 		}
 		
-		$riga1 = "<div style=\"margin:0px auto;text-align:center;\">";
-		if($pag==0)$riga1 .="<h2>"._DETTAGLIO." "._VOTIE."</h2></div>";
-		else $riga1 .="<h2>"._DETTAGLIO." "._VOTIE." "._ASOLA_LISTA."</h2></div>";
+		$riga1 = "";
+		if($pag==0)$riga1 .="<h2>"._DETTAGLIO." "._VOTIE."</h2>";
+		else $riga1 .="<h2>"._DETTAGLIO." "._VOTIE." "._ASOLA_LISTA."</h2>";
 		
 	}else{ // e' un referendum
@@ -154,5 +217,5 @@
 		where t1.id_cons='$id_cons' and t1.id_gruppo='$idg' order by t2.num_sez ";
 		$riga1  = "<div style=\"margin:0px auto;text-align:center;\">";
-		$riga1 ="<h2>"._DETTAGLIO." "._VOTIE."</h2></div>";
+		$riga1  .="<h2>"._DETTAGLIO." "._VOTIE."</h2></div>";
 		
 		$des = mysql_query("select descrizione from ".$prefix."_ele_gruppo where id_gruppo='$idg'", $dbi);
@@ -165,5 +228,5 @@
 
 	$riga2 = "<table style=\"border:1px solid #6A6A6A;\" summary=\"Tabella dei voti espressi\">";
-	$riga3 = "<tr class=\"bggray\">
+	$riga3 = "<tr class=\"bggray2\">
 	<td>"._SEZIONI."</td>
     	<td>"._VOTIU."</td>
@@ -204,5 +267,5 @@
 		$tot_bianchi+=$bianchi;
 		$tot_contestati+=$contestati;
-		$righe .= "<tr class=\"bggray\">
+		$righe .= "<tr class=\"bggray2\">
 		<td>$num</td>
 		<td>".number_format($votiu,0,',','.')."</td>
@@ -259,5 +322,5 @@
 	}
 	$righe .= "</table>";
-
+        if(!isset($html)) $html='';
 	$html .= "$riga1";
 	$html .= $riga2."";
@@ -269,4 +332,5 @@
     $html .="<div>";
     if($genere==0){ //se e' referendum
+	if ($xls!='1' && $pdf!='1' && $csv!='1'){
         #'Pagina precedente' e 'Pagina Successiva'
 	    $cur=$num_ref;
@@ -282,5 +346,7 @@
             $html .= "[ <b>"._NEXT_MATCH."</b> ]</a>";
         }
-    }elseif((($genere==5) or ($genere==3))){ //se vi sono raggruppamenti
+}
+}
+if($genere==5 or $genere==3){ //se vi sono raggruppamenti
 	      if($csv!=1 and $fascia>$limite){
 
@@ -298,6 +364,6 @@
 if($csv==1){
       $data=date("d-m-y G:i");
-      $html .="<br/><div style=\"margin:0px auto;text-align:center;\"><i>Stampato: $data</i></div>";
-      $html .="<br/><div style=\"text-align:center;\"><i>Eleonline by l. apolito & r. gigli - www.eleonline.it</i></div>";		
+      $html .="<br/><div><i>Stampato: $data</i></div>";
+      $html .="<br/><i>Eleonline by l. apolito & r. gigli - www.eleonline.it</i>";		
       //$html .= $html;	
       
@@ -307,8 +373,8 @@
 
 ############### stampa
-if ($xls!='1'){
+if ($xls!='1' && $pdf!='1'){
       echo "$datipdf $html";
-}else{
-	$nomefile="export.xls";
+}elseif($xls=="1"){
+	$nomefile="votanti.xls";
 	header ("Content-Type: application/vnd.ms-excel");
 	header ("Content-Disposition: inline; filename=$nomefile");
@@ -316,4 +382,13 @@
 	echo "$datipdf";
 	echo "$html \n";
+}elseif($pdf=='1'){
+		$nomefile="$descr_cons votanti.pdf";
+		
+		$stampa ="$datipdf $html";
+		
+		require_once('inc/hpdf403/html2pdf.class.php');
+		$html2pdf = new HTML2PDF('L','A4', 'it');
+		$html2pdf->WriteHTML($stampa, isset($_GET['vuehtml']));
+		$html2pdf->Output($nomefile);
 }
 
