souren

Members
  • Content count

    1
  • Joined

  • Last visited

About souren

  • Rank
    Forum Newbie
  1. Hi all, I'm new in this forum. I' using fusion chart v3.2 evaluation demo in php. My code is working fine in Chrome and IE. But, it is not working perfectly in mozila. When the first time page is loading in mozila, the chart is showing for some sometimes. After that it si being disappeared and showing a message "error in loading data". My code is below: function report1(){ $current_time = date("H:i:s",time()); $content .='<div id="chartContainer">FusionCharts will load here</div>'; $content .='<script type="text/javascript">'; $content .=' var myChart = new FusionCharts( "Charts/Column3D.swf?noCache=" + new Date().getMilliseconds(),"myChartId", "600", "300","0","1");'; $content .=' myChart.setXMLUrl( "get-data.php?current_time='.$current_time.'" );'; $content .=' myChart.render( "chartContainer" );'; $content .=' </script>'; return $content; } get-data.php:- <?php include ('../settings/local_settings.php'); include ($_SERVER['DOCUMENT_ROOT'].'/modules/common.php'); include ($_SERVER['DOCUMENT_ROOT']. '/modules/utils/cls_utils.php'); $cls_utils=new utils(); include ($_SERVER['DOCUMENT_ROOT'].'/modules/users/cls_users.php'); $cls_users=new Users(); //Sanitizing the input //$Type = $_GET['type']; $current_time = intval($_GET['current_time']); //$current_time = date("H:i:s",time()); $current_date =date("Y-m-d",time()); //$Month = intval($_GET['month']); //$Day = intval($_GET['day']); //Months Names $sql="Select * from tbl_box order by box_id"; $result=mysql_query($sql); $box .='null'; $count=0; while($row=mysql_fetch_array($result)){ $box .=','; $box .=$row['box_name']; $count++; } $BoxNames=array(); $BoxNames = explode(",",$box); //Prepare variables according to type-of-chart $Query = "SELECT box_id AS Value, COUNT( * ) AS Total FROM tbl_app WHERE TIME( app_start ) > '$current_time' and TIME( app_stop ) < '$current_time' AND DATE( app_start ) = '$current_date' GROUP BY Value"; $ResultArray = array_fill(1, $count, 0); // fill the Result array with 0 values for each month $ChartHeading = 'Number of appointments for: '.$current_date.':'.$current_time; $XaxisName = 'Boxes'; //Query the database $QueryResult = mysql_query($Query); //Fetch results in the Result Array while($Row = mysql_fetch_assoc($QueryResult)) $ResultArray[$Row['Value']]=$Row['Total']; //Generate Chart XML: Head Part $Output = '<chart caption="'.$ChartHeading.'" xAxisName="'.$XaxisName.'" yAxisName="No. Of Appointments" showNames="1" bgColor="E6E6E6,F0F0F0" bgAlpha="100,50" bgRatio="50,100" bgAngle="270" showBorder="1" borderColor="AAAAAA" baseFontSize="12">'; //Generate Chart XML: Main Body foreach($ResultArray as $MonthNumber => $value) // MonthNumber is month number (1-12) $Output .= '<set value="'.$value.'" name="'.$BoxNames[$MonthNumber].'" />'; //Generate Chart XML: Last Part $Output .= '</chart>'; //Set the output header to XML header('Content-type: text/xml'); //Send output echo $Output; ?> Please help me out. Thanks, Souren