Changeset 267 for trunk/client/class
- Timestamp:
- Apr 14, 2019, 2:31:40 PM (6 years ago)
- Location:
- trunk/client/class
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/class/charts.php
r265 r267 1 1 <?php 2 // charts.php v4. 72 // charts.php v4.5 3 3 // ------------------------------------------------------------------------ 4 // Copyright (c) 2003-200 7, maani.us4 // Copyright (c) 2003-2006, 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=4 00, $height=250, $bg_color="666666", $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 $protocol = (strtolower($_SERVER['HTTPS']) != 'on')? 'http': 'https'; 17 $x=$_SESSION['max']; 18 $u=(strpos ($flash_file,"?")==false)? "?" : ((substr($flash_file, -1)=="&")? "":"&"); 18 19 19 $html="<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='".$protocol."://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' "; 20 $html.="width='".$width."' height='".$height."' id='charts' />"; 21 $u=(strpos ($flash_file,"?")===false)? "?" : ((substr($flash_file, -1)==="&")? "":"&"); 22 $html.="<PARAM NAME='movie' VALUE='".$flash_file.$u."library_path=".$library_path."&stage_width=".$width."&stage_height=".$height."&php_source=".$php_source; 23 if($license!=null){$html.="&license=".$license;} 24 $html.="' /> <PARAM NAME='quality' VALUE='high' /><param name='allowScriptAccess' value='sameDomain' /><PARAM NAME='bgcolor' VALUE='#".$bg_color."' /> "; 25 if($transparent){$html.="<PARAM NAME='wmode' VALUE='transparent' /> ";} 26 $html.="<EMBED src='".$flash_file.$u."library_path=".$library_path."&stage_width=".$width."&stage_height=".$height."&php_source=".$php_source; 27 if($license!=null){$html.="&license=".$license;} 28 $html.="' quality='high' bgcolor='#".$bg_color."' width='".$width."' height='".$height."' NAME='charts' allowScriptAccess='sameDomain' swLiveConnect='true' "; 29 if($transparent){$html.="wmode=transparent ";} //use wmode=opaque to prevent printing on black 30 $html.="TYPE='application/x-shockwave-flash' PLUGINSPAGE='".$protocol."://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>"; 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 31 40 return $html; 41 32 42 33 43 } … … 35 45 //==================================== 36 46 function SendChartData( $chart=array() ){ 37 38 //header("Content-Type: text/xml"); 39 //header("Cache-Control: cache, must-revalidate"); 40 //header("Pragma: public"); 47 41 48 42 49 $xml="<chart>\r\n"; … … 54 61 for($i3=0;$i3<count($Keys3);$i3++){ 55 62 switch(true){ 56 case ($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]== =null):63 case ($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]==null): 57 64 $xml.="\t\t\t<null/>\r\n"; 58 65 break; … … 74 81 $count=0; 75 82 for($i3=0;$i3<count($Keys3);$i3++){ 76 if($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]== =null){$xml.="\t\t\t<null/>\r\n";}83 if($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]==null){$xml.="\t\t\t<null/>\r\n";} 77 84 else{$xml.="\t\t\t<string>".$chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]."</string>\r\n";} 78 85 } … … 84 91 $count=0; 85 92 for($i3=0;$i3<count($Keys3);$i3++){ 86 if($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]== =null){$xml.="\t\t\t<null/>\r\n";}93 if($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]==null){$xml.="\t\t\t<null/>\r\n";} 87 94 else{$xml.="\t\t\t<string>".$chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]."</string>\r\n";} 88 95 } … … 118 125 $xml.="\t<".$Keys1[$i1].">\r\n"; 119 126 for($i2=0;$i2<count($Keys2);$i2++){ 120 if($chart[$Keys1[$i1]][$Keys2[$i2]]== =null){$xml.="\t\t<null/>\r\n";}127 if($chart[$Keys1[$i1]][$Keys2[$i2]]==null){$xml.="\t\t<null/>\r\n";} 121 128 else{$xml.="\t\t<value>".$chart[$Keys1[$i1]][$Keys2[$i2]]."</value>\r\n";} 122 129 } … … 135 142 } 136 143 $xml.="</chart>\r\n"; 137 echo $xml; 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; 138 156 } 139 157 //====================================
Note:
See TracChangeset
for help on using the changeset viewer.