Changeset 267 for trunk/client/class


Ignore:
Timestamp:
Apr 14, 2019, 2:31:40 PM (5 years ago)
Author:
roby
Message:
 
Location:
trunk/client/class
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/class/charts.php

    r265 r267  
    11<?php
    2 // charts.php v4.7
     2// charts.php v4.5
    33// ------------------------------------------------------------------------
    4 // Copyright (c) 2003-2007, maani.us
     4// Copyright (c) 2003-2006, maani.us
    55// ------------------------------------------------------------------------
    66// This file is part of "PHP/SWF Charts"
     
    1111
    1212//====================================
    13 function InsertChart( $flash_file, $library_path, $php_source, $width=400, $height=250, $bg_color="666666", $transparent=false, $license=null ){
    14        
     13function InsertChart( $flash_file, $library_path, $php_source, $width=470, $height=350, $bg_color="ffffff", $transparent=false, $license=null ){
     14       
    1515        $php_source=urlencode($php_source);
    1616        $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)=="&")? "":"&");
    1819
    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."&amp;php_source=".$php_source;
     27                if($license!=null){$html.="&amp;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."&amp;php_source=".$php_source;
     33                if($license!=null){$html.="&amp;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
    3140        return $html;
     41       
    3242       
    3343}
     
    3545//====================================
    3646function SendChartData( $chart=array() ){
    37 
    38         //header("Content-Type: text/xml");
    39         //header("Cache-Control: cache, must-revalidate");
    40         //header("Pragma: public");
     47       
    4148       
    4249        $xml="<chart>\r\n";
     
    5461                                                for($i3=0;$i3<count($Keys3);$i3++){
    5562                                                        switch(true){
    56                                                                 case ($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]===null):
     63                                                                case ($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]==null):
    5764                                                                $xml.="\t\t\t<null/>\r\n";
    5865                                                                break;
     
    7481                                                $count=0;
    7582                                                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";}
    7784                                                        else{$xml.="\t\t\t<string>".$chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]."</string>\r\n";}
    7885                                                }
     
    8491                                                $count=0;
    8592                                                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";}
    8794                                                        else{$xml.="\t\t\t<string>".$chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]."</string>\r\n";}
    8895                                                }
     
    118125                                        $xml.="\t<".$Keys1[$i1].">\r\n";
    119126                                        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";}
    121128                                                else{$xml.="\t\t<value>".$chart[$Keys1[$i1]][$Keys2[$i2]]."</value>\r\n";}
    122129                                        }
     
    135142        }
    136143        $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;
    138156}
    139157//====================================
Note: See TracChangeset for help on using the changeset viewer.