* Time: 1:59 PM */ // Connect to the DB require '../classes/aardb_conn.php'; header('Content-Type: Text/xml'); include "../Charts/JSClass/FusionCharts.php"; include "../Charts/JSClass/FC_Colors.php"; include "../Charts/JSClass/FusionCharts_Gen.php"; // SQL query for category labels $start = date("d/M/Y", strtotime('-14 days')); $today = date("d/M/Y"); $sql = "SELECT NAVS.NAV_ID, NAVS.NAV_DATE as NAV_DATE, NAVS.SECURITY_CODE, NAVS.AMOUNT as AMOUNT, SECURITIES.DESCRIPT as DESCRIPTION\r FROM NAVS INNER JOIN SECURITIES ON NAVS.SECURITY_CODE = SECURITIES.SECURITY_CODE\r WHERE NAVS.CONFIRMD = 1 AND NAVS.NAV_DATE BETWEEN '{$start}' AND '{$today}' ORDER BY NAVS.NAV_DATE ASC"; $result = oci_parse($conn, $sql) or die(""); oci_execute($result); //$strXML will be used to store the entire XML document generated //Generate the chart element $strXML = "<chart legendPostion='' caption='Factory Output report' subCaption='By Quantity' xAxisName='Factory' yAxisName='Units' showValues='0' formatNumberScale='0' rotateValues='1' animation='1'>"; // Build category XML $strXML .= buildCategories($result, "DESCRIPTION"); // Build datasets XML $strXML .= buildDatasets($result, "NAV_DATE", "AMOUNT"); //Finally, close <chart> element $strXML .= "</chart>"; //Create the chart - Pie 3D Chart with data from strXML //echo renderChart("../../FusionCharts/MSLine.swf", "", $strXML, "Rates", 700, 400, false, true); // Free database resource /*mysql_free_result($resultCategories); mysql_free_result($resultData); mysql_close($link);*/ /*********************************************************************************************** * Function to build XML for categories
$resultData = mysql_query($strQueryData) or die(mysql_error()); //We also keep a flag to specify whether we've to animate the chart or not. //If the user is viewing the detailed chart and comes back to this page, he shouldn't //see the animation again. $animateChart = @$_GET['animate']; //Set default value of 1 if ($animateChart == "") { $animateChart = "1"; } //$strXML will be used to store the entire XML document generated //Generate the chart element $strXML = "<chart legendPostion='' caption='Factory Output report' subCaption='By Quantity' xAxisName='Factory' yAxisName='Units' showValues='0' formatNumberScale='0' rotateValues='1' animation=' " . $animateChart . "'>"; // Build category XML $strXML .= buildCategories($resultCategories, "DatePro"); // Build datasets XML $strXML .= buildDatasets($resultData, "Quantity", "FactoryName"); //Finally, close <chart> element $strXML .= "</chart>"; //Create the chart - Pie 3D Chart with data from strXML echo renderChart("../../FusionCharts/MSLine.swf", "", $strXML, "FactorySum", 700, 400, false, false); // Free database resource mysql_free_result($resultCategories); mysql_free_result($resultData); mysql_close($link); /*********************************************************************************************** * Function to build XML for categories * @param $result Database resource * @param $labelField Field name as String that contains value for chart category labels * * @return categories XML node */
$resultData = mysql_query($strQueryData) or die(mysql_error()); //We also keep a flag to specify whether we've to animate the chart or not. //If the user is viewing the detailed chart and comes back to this page, he shouldn't //see the animation again. $animateChart = @$_GET['animate']; //Set default value of 1 if ($animateChart == "") { $animateChart = "1"; } //$strXML will be used to store the entire XML document generated //Generate the chart element $strXML = "<chart legendPostion='' caption='ปิรามิดประชากร ปี พ.ศ." . $sto . "' subCaption='" . $hosp . "' xAxisName='' yAxisName='ร้อยละ' showValues='1' formatNumberScale='0' rotateValues='1' animation=' " . $animateChart . "'>"; // Build category XML $strXML .= buildCategories($resultCategories, "detail"); // Build datasets XML $strXML .= buildDatasets($resultData, "gender", "sex"); //Finally, close <chart> element $strXML .= "</chart>"; //Create the chart - Pie 3D Chart with data from strXML echo renderChart("FusionCharts/StackedBar2D.swf", "", $strXML, "FactorySum", 750, 450, false, false); // Free database resource mysql_free_result($resultCategories); mysql_free_result($resultData); mysql_close($link); /*********************************************************************************************** * Function to build XML for categories * @param $result Database resource * @param $labelField Field name as String that contains value for chart category labels * * @return categories XML node */
$resultData = mysql_query($strQueryData) or die(mysql_error()); //We also keep a flag to specify whether we've to animate the chart or not. //If the user is viewing the detailed chart and comes back to this page, he shouldn't //see the animation again. $animateChart = @$_GET['animate']; //Set default value of 1 if ($animateChart == "") { $animateChart = "1"; } //$strXML will be used to store the entire XML document generated //Generate the chart element $strXML = "<chart legendPostion='' caption='ประชาชน" . $gagename . "ที่ได้รับการตรวจหาไข่พยาธิในอุจจาระ ข้อมูลระหว่างวันที่ " . $_GET[str] . " ถึง " . $_GET[sto] . " " . $mu . " " . $live_type_name . "' subCaption='" . $hosp . "' xAxisName='' yAxisName='คน' showValues='1' formatNumberScale='0' rotateValues='1' animation=' " . $animateChart . "'>"; // Build category XML $strXML .= buildCategories($resultCategories, "villname"); // Build datasets XML $strXML .= buildDatasets($resultData, "per", "mark"); //Finally, close <chart> element $strXML .= "</chart>"; //Create the chart - Pie 3D Chart with data from strXML echo renderChart("FusionCharts/MSColumn2D.swf", "", $strXML, "FactorySum", 750, 450, false, false); // Free database resource mysql_free_result($resultCategories); mysql_free_result($resultData); mysql_close($link); /*********************************************************************************************** * Function to build XML for categories * @param $result Database resource * @param $labelField Field name as String that contains value for chart category labels * * @return categories XML node */