Changeset 287 for trunk/client/class
- Timestamp:
- Apr 23, 2019, 10:08:03 PM (6 years ago)
- Location:
- trunk/client/class
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/class/charts.php
r267 r287 1 1 <?php 2 // charts.php v4. 52 // charts.php v4.7 3 3 // ------------------------------------------------------------------------ 4 // Copyright (c) 2003-200 6, maani.us4 // Copyright (c) 2003-2007, maani.us 5 5 // ------------------------------------------------------------------------ 6 6 // This file is part of "PHP/SWF Charts" … … 11 11 12 12 //==================================== 13 function InsertChart( $flash_file, $library_path, $php_source, $width=470, $height=350, $bg_color="ffffff", $transparent=false, $license=null 14 13 function InsertChart( $flash_file, $library_path, $php_source, $width=470, $height=350, $bg_color="ffffff", $transparent=false, $license=null ){ 14 15 15 $php_source=urlencode($php_source); 16 16 $library_path=urlencode($library_path); 17 if(isset($_SERVER['HTTPS'])) $protocol = (strtolower($_SERVER['HTTPS']) != 'on')? 'http': 'https'; 18 else $protocol='http'; 17 19 $x=$_SESSION['max']; 18 20 $u=(strpos ($flash_file,"?")==false)? "?" : ((substr($flash_file, -1)=="&")? "":"&"); 19 21 20 21 $html="<div style=\"text-align: right;\">"; 22 if (strstr($_SERVER['HTTP_USER_AGENT'],"MSIE")){ 23 $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' "; 24 $html.="width='".$width."' height='".$height."' id='charts$x'>"; 25 $u=(strpos ($flash_file,"?")==false)? "?" : ((substr($flash_file, -1)=="&")? "":"&"); 26 $html.="<param name='movie' value='".$flash_file.$u."library_path=".$library_path."&php_source=".$php_source; 27 if($license!=null){$html.="&license=".$license;} 28 $html.="'/> <param name='quality' value='high'/> <param name='bgcolor' value='#".$bg_color."'/> "; 29 if($transparent){$html.="<param name='wmode' value='transparent'/> ";} 30 $html.="</object>"; 31 }else{ 32 $html.="<embed src=\"".$flash_file.$u."library_path=".$library_path."&php_source=".$php_source; 33 if($license!=null){$html.="&license=".$license;} 34 $html.="\" quality=high bgcolor=#".$bg_color." width=".$width." height=".$height." name='charts' align='right' swLiveConnect='true' "; 35 if($transparent){$html.="wmode=transparent ";} 36 $html.="type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>"; 37 } 38 $html.="</div>"; 39 22 $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' "; 23 $html.="width='".$width."' height='".$height."' id='charts$x' />"; 24 $u=(strpos ($flash_file,"?")===false)? "?" : ((substr($flash_file, -1)==="&")? "":"&"); 25 $html.="<PARAM NAME='movie' VALUE='".$flash_file.$u."library_path=".$library_path."&stage_width=".$width."&stage_height=".$height."&php_source=".$php_source; 26 if($license!=null){$html.="&license=".$license;} 27 $html.="' /> <PARAM NAME='quality' VALUE='high' /><param name='allowScriptAccess' value='sameDomain' /><PARAM NAME='bgcolor' VALUE='#".$bg_color."' /> "; 28 if($transparent){$html.="<PARAM NAME='wmode' VALUE='transparent' /> ";} 29 $html.="<EMBED src='".$flash_file.$u."library_path=".$library_path."&stage_width=".$width."&stage_height=".$height."&php_source=".$php_source; 30 if($license!=null){$html.="&license=".$license;} 31 $html.="' quality='high' bgcolor='#".$bg_color."' width='".$width."' height='".$height."' NAME='charts' allowScriptAccess='sameDomain' swLiveConnect='true' "; 32 if($transparent){$html.="wmode=transparent ";} //use wmode=opaque to prevent printing on black 33 $html.="TYPE='application/x-shockwave-flash' PLUGINSPAGE='".$protocol."://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>"; 40 34 return $html; 41 42 35 43 36 } … … 45 38 //==================================== 46 39 function SendChartData( $chart=array() ){ 47 40 41 //header("Content-Type: text/xml"); 42 //header("Cache-Control: cache, must-revalidate"); 43 //header("Pragma: public"); 48 44 49 45 $xml="<chart>\r\n"; … … 61 57 for($i3=0;$i3<count($Keys3);$i3++){ 62 58 switch(true){ 63 case ($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]== null):59 case ($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]===null): 64 60 $xml.="\t\t\t<null/>\r\n"; 65 61 break; … … 81 77 $count=0; 82 78 for($i3=0;$i3<count($Keys3);$i3++){ 83 if($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]== null){$xml.="\t\t\t<null/>\r\n";}79 if($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]===null){$xml.="\t\t\t<null/>\r\n";} 84 80 else{$xml.="\t\t\t<string>".$chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]."</string>\r\n";} 85 81 } … … 91 87 $count=0; 92 88 for($i3=0;$i3<count($Keys3);$i3++){ 93 if($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]== null){$xml.="\t\t\t<null/>\r\n";}89 if($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]===null){$xml.="\t\t\t<null/>\r\n";} 94 90 else{$xml.="\t\t\t<string>".$chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]."</string>\r\n";} 95 91 } … … 111 107 112 108 113 default: //link, etc.109 default: //link, etc. 114 110 $xml.="\t\t<value"; 115 111 for($i3=0;$i3<count($Keys3);$i3++){ … … 125 121 $xml.="\t<".$Keys1[$i1].">\r\n"; 126 122 for($i2=0;$i2<count($Keys2);$i2++){ 127 if($chart[$Keys1[$i1]][$Keys2[$i2]]== null){$xml.="\t\t<null/>\r\n";}123 if($chart[$Keys1[$i1]][$Keys2[$i2]]===null){$xml.="\t\t<null/>\r\n";} 128 124 else{$xml.="\t\t<value>".$chart[$Keys1[$i1]][$Keys2[$i2]]."</value>\r\n";} 129 125 } … … 142 138 } 143 139 $xml.="</chart>\r\n"; 144 /* // stampa su file by Linuxap 145 mt_srand ((double)microtime()*1000000); 146 $maxran = 1000000; 147 $random_num = mt_rand(0, $maxran); 148 $fileout="./temp/$random_num"; 149 $fp = fopen($fileout,"w"); 150 fwrite($fp,$xml); 151 fclose($fp); 152 */ 153 //echo $xml; 154 //MODIFICHE PER TOGLIERE FILETEMP 155 return $xml; //return $fileout; 140 // echo $xml; 141 return $xml; 156 142 } 157 143 //====================================
Note:
See TracChangeset
for help on using the changeset viewer.