Index: trunk/client/class/charts.php
===================================================================
--- trunk/client/class/charts.php	(revision 284)
+++ trunk/client/class/charts.php	(revision 287)
@@ -1,6 +1,6 @@
 <?php
-// charts.php v4.5
+// charts.php v4.7
 // ------------------------------------------------------------------------
-// Copyright (c) 2003-2006, maani.us
+// Copyright (c) 2003-2007, maani.us
 // ------------------------------------------------------------------------
 // This file is part of "PHP/SWF Charts"
@@ -11,33 +11,26 @@
 
 //====================================
-function InsertChart( $flash_file, $library_path, $php_source, $width=470, $height=350, $bg_color="ffffff", $transparent=false, $license=null  ){
-        
+function InsertChart( $flash_file, $library_path, $php_source, $width=470, $height=350, $bg_color="ffffff", $transparent=false, $license=null ){
+	
 	$php_source=urlencode($php_source);
 	$library_path=urlencode($library_path);
+	if(isset($_SERVER['HTTPS'])) $protocol = (strtolower($_SERVER['HTTPS']) != 'on')? 'http': 'https';
+	else $protocol='http';
  	$x=$_SESSION['max'];
 	$u=(strpos ($flash_file,"?")==false)? "?" : ((substr($flash_file, -1)=="&")? "":"&");
 
-
-	$html="<div style=\"text-align: right;\">";
-	if (strstr($_SERVER['HTTP_USER_AGENT'],"MSIE")){
-		$html.="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' ";
-		$html.="width='".$width."' height='".$height."' id='charts$x'>";
-		$u=(strpos ($flash_file,"?")==false)? "?" : ((substr($flash_file, -1)=="&")? "":"&");
-		$html.="<param name='movie' value='".$flash_file.$u."library_path=".$library_path."&amp;php_source=".$php_source;
-		if($license!=null){$html.="&amp;license=".$license;}
-		$html.="'/> <param name='quality' value='high'/> <param name='bgcolor' value='#".$bg_color."'/> ";
-		if($transparent){$html.="<param name='wmode' value='transparent'/> ";}
-		$html.="</object>";
-	}else{
-		$html.="<embed src=\"".$flash_file.$u."library_path=".$library_path."&amp;php_source=".$php_source;
-        	if($license!=null){$html.="&amp;license=".$license;}
-        	$html.="\" quality=high bgcolor=#".$bg_color." width=".$width." height=".$height." name='charts' align='right' swLiveConnect='true' ";
-        	if($transparent){$html.="wmode=transparent ";}
-        	$html.="type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>";
-	}
-	$html.="</div>";
-
+	$html="<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' ";
+	$html.="width='".$width."' height='".$height."' id='charts$x' />";
+	$u=(strpos ($flash_file,"?")===false)? "?" : ((substr($flash_file, -1)==="&")? "":"&");
+	$html.="<PARAM NAME='movie' VALUE='".$flash_file.$u."library_path=".$library_path."&stage_width=".$width."&stage_height=".$height."&php_source=".$php_source;
+	if($license!=null){$html.="&license=".$license;}
+	$html.="' /> <PARAM NAME='quality' VALUE='high' /><param name='allowScriptAccess' value='sameDomain' /><PARAM NAME='bgcolor' VALUE='#".$bg_color."' /> ";
+	if($transparent){$html.="<PARAM NAME='wmode' VALUE='transparent' /> ";}
+	$html.="<EMBED src='".$flash_file.$u."library_path=".$library_path."&stage_width=".$width."&stage_height=".$height."&php_source=".$php_source;
+	if($license!=null){$html.="&license=".$license;}
+	$html.="' quality='high' bgcolor='#".$bg_color."' width='".$width."' height='".$height."' NAME='charts' allowScriptAccess='sameDomain' swLiveConnect='true' ";
+	if($transparent){$html.="wmode=transparent ";} //use wmode=opaque to prevent printing on black
+	$html.="TYPE='application/x-shockwave-flash' PLUGINSPAGE='".$protocol."://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>";
 	return $html;
-	
 	
 }
@@ -45,5 +38,8 @@
 //====================================
 function SendChartData( $chart=array() ){
-	
+
+	//header("Content-Type: text/xml");
+	//header("Cache-Control: cache, must-revalidate");
+	//header("Pragma: public");
 	
 	$xml="<chart>\r\n";
@@ -61,5 +57,5 @@
 						for($i3=0;$i3<count($Keys3);$i3++){
 							switch(true){
-								case ($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]==null):
+								case ($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]===null):
 								$xml.="\t\t\t<null/>\r\n";
 								break;
@@ -81,5 +77,5 @@
 						$count=0;
 						for($i3=0;$i3<count($Keys3);$i3++){
-							if($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]==null){$xml.="\t\t\t<null/>\r\n";}
+							if($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]===null){$xml.="\t\t\t<null/>\r\n";}
 							else{$xml.="\t\t\t<string>".$chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]."</string>\r\n";}
 						}
@@ -91,5 +87,5 @@
 						$count=0;
 						for($i3=0;$i3<count($Keys3);$i3++){
-							if($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]==null){$xml.="\t\t\t<null/>\r\n";}
+							if($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]===null){$xml.="\t\t\t<null/>\r\n";}
 							else{$xml.="\t\t\t<string>".$chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]."</string>\r\n";}
 						}
@@ -111,5 +107,5 @@
 						
 						
-						default://link, etc.
+						default: //link, etc.
 						$xml.="\t\t<value";
 						for($i3=0;$i3<count($Keys3);$i3++){
@@ -125,5 +121,5 @@
 					$xml.="\t<".$Keys1[$i1].">\r\n";
 					for($i2=0;$i2<count($Keys2);$i2++){
-						if($chart[$Keys1[$i1]][$Keys2[$i2]]==null){$xml.="\t\t<null/>\r\n";}
+						if($chart[$Keys1[$i1]][$Keys2[$i2]]===null){$xml.="\t\t<null/>\r\n";}
 						else{$xml.="\t\t<value>".$chart[$Keys1[$i1]][$Keys2[$i2]]."</value>\r\n";}
 					}
@@ -142,16 +138,6 @@
 	}
 	$xml.="</chart>\r\n";
-/*        // stampa su file by Linuxap
-        mt_srand ((double)microtime()*1000000);
-	$maxran = 1000000;
-	$random_num = mt_rand(0, $maxran);
-        $fileout="./temp/$random_num";
-        $fp = fopen($fileout,"w");
-        fwrite($fp,$xml);
-        fclose($fp);
-*/
-	//echo $xml;
-//MODIFICHE PER TOGLIERE FILETEMP
-	return $xml; //return $fileout;
+//	echo $xml;
+return $xml;
 }
 //====================================
Index: trunk/client/modules/Elezioni/grafici.php
===================================================================
--- trunk/client/modules/Elezioni/grafici.php	(revision 284)
+++ trunk/client/modules/Elezioni/grafici.php	(revision 287)
@@ -429,5 +429,5 @@
 
 
-	if ($numero>0){
+	if ($numero>0 ){
 		echo "<center><h2>";
 		if ($genere!=4 and !$visgralista){
@@ -793,4 +793,6 @@
 }
 
+
+
 function flash_torta($gruppos,$pre,$y,$x){
 //if (!defined('FLASH')) die();
