Changeset 287 for trunk


Ignore:
Timestamp:
Apr 23, 2019, 10:08:03 PM (5 years ago)
Author:
roby
Message:
 
Location:
trunk/client
Files:
21 edited

Legend:

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

    r267 r287  
    11<?php
    2 // charts.php v4.5
     2// charts.php v4.7
    33// ------------------------------------------------------------------------
    4 // Copyright (c) 2003-2006, maani.us
     4// Copyright (c) 2003-2007, maani.us
    55// ------------------------------------------------------------------------
    66// This file is part of "PHP/SWF Charts"
     
    1111
    1212//====================================
    13 function InsertChart( $flash_file, $library_path, $php_source, $width=470, $height=350, $bg_color="ffffff", $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        if(isset($_SERVER['HTTPS'])) $protocol = (strtolower($_SERVER['HTTPS']) != 'on')? 'http': 'https';
     18        else $protocol='http';
    1719        $x=$_SESSION['max'];
    1820        $u=(strpos ($flash_file,"?")==false)? "?" : ((substr($flash_file, -1)=="&")? "":"&");
    1921
    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 
     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>";
    4034        return $html;
    41        
    4235       
    4336}
     
    4538//====================================
    4639function SendChartData( $chart=array() ){
    47        
     40
     41        //header("Content-Type: text/xml");
     42        //header("Cache-Control: cache, must-revalidate");
     43        //header("Pragma: public");
    4844       
    4945        $xml="<chart>\r\n";
     
    6157                                                for($i3=0;$i3<count($Keys3);$i3++){
    6258                                                        switch(true){
    63                                                                 case ($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]==null):
     59                                                                case ($chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]===null):
    6460                                                                $xml.="\t\t\t<null/>\r\n";
    6561                                                                break;
     
    8177                                                $count=0;
    8278                                                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";}
    8480                                                        else{$xml.="\t\t\t<string>".$chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]."</string>\r\n";}
    8581                                                }
     
    9187                                                $count=0;
    9288                                                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";}
    9490                                                        else{$xml.="\t\t\t<string>".$chart[$Keys1[$i1]][$Keys2[$i2]][$Keys3[$i3]]."</string>\r\n";}
    9591                                                }
     
    111107                                               
    112108                                               
    113                                                 default://link, etc.
     109                                                default: //link, etc.
    114110                                                $xml.="\t\t<value";
    115111                                                for($i3=0;$i3<count($Keys3);$i3++){
     
    125121                                        $xml.="\t<".$Keys1[$i1].">\r\n";
    126122                                        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";}
    128124                                                else{$xml.="\t\t<value>".$chart[$Keys1[$i1]][$Keys2[$i2]]."</value>\r\n";}
    129125                                        }
     
    142138        }
    143139        $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;
     141return $xml;
    156142}
    157143//====================================
  • trunk/client/modules/Elezioni/grafici.php

    r284 r287  
    429429
    430430
    431         if ($numero>0){
     431        if ($numero>0 ){
    432432                echo "<center><h2>";
    433433                if ($genere!=4 and !$visgralista){
     
    793793}
    794794
     795
     796
    795797function flash_torta($gruppos,$pre,$y,$x){
    796798//if (!defined('FLASH')) die();
Note: See TracChangeset for help on using the changeset viewer.