";
// Fetch all factory records
$strQuery = "SELECT Budget_Year FROM project_type_tb Where codeId !=0 GROUP BY $myTablePK";
$result1 = mysql_query($strQuery);
//Iterate through each factory
if( $result1 ) {
$strXML .= "";
while( $rs1 = mysql_fetch_array($result1) ) {
$Budget_Year = $rs1['Budget_Year'];
$strXML .= "";
} # while
$strXML .= "";
}# if
mysql_free_result($result1);
// Fetch all factory records
$strQuery = "SELECT Budget_Year FROM project_type_tb Where codeId !=0 GROUP BY $myTablePK";
$result1 = mysql_query($strQuery);
//Iterate through each factory
if( $result1 ) {
$strXML .= "";
while( $rs1 = mysql_fetch_array($result1) ) {
$Budget_Year = $rs1['Budget_Year'];
$strQuery2 = "SELECT SUM(Budget_total) AS SumB1 FROM project_type_tb WHERE Budget_Year='$Budget_Year' and codeId ='1''";
$result2 = mysql_query($strQuery2);
$rs2 = mysql_fetch_array($result2);
mysql_free_result($result2);
$strXML .= "";
} # while
$strXML .= "";
} # if
mysql_free_result($result1);
// Fetch all factory records
$strQuery = "SELECT Budget_Year FROM project_type_tb Where codeId !=0 GROUP BY $myTablePK";
$result1 = mysql_query($strQuery);
//Iterate through each factory
if( $result1 ) {
$strXML .= "";
while( $rs1 = mysql_fetch_array($result1) ) {
$Budget_Year = $rs1['Budget_Year'];
$strQuery3 = " SELECT SUM(Budget_total) AS SumB2 FROM project_type_tb WHERE Budget_Year='$Budget_Year' and codeId='2' ";
$result3 = mysql_query($strQuery3);
$rs3 = mysql_fetch_array($result3);
$numAmt3 = mysql_num_rows($result3);
mysql_free_result($result3);
$strXML .= "";
} # while
$strXML .= "";
} # if
mysql_free_result($result1);
//Finally, close element
$strXML .= "";
//Create the Multi-series Line Chart with data from strXML
echo renderChart("./charts/MSLine.swf", "", $strXML, "", 750, 375, false, false);
?> |
|