|
|
$setdata=$_POST[setdata];
$multi=$_POST[multi];
if($multi==TRUE){
if($setdata=="A"){
?>
";
// Fetch all factory records
$strQuery = "SELECT * FROM accessories_type_tb ";
$result1 = mysql_query($strQuery);
//Iterate through each factory
if ($result1) {
while( $rs1 = mysql_fetch_array($result1) ) {
$error_id = $rs1['id'];
$strQuery = " SELECT * FROM accessories_tb at, accessories_type_tb att WHERE at.Dura='Y' and at.Status='Y' and at.Acc_type_code = att.Acc_type_code and at.Acc_type_code !='0' and at.Acc_type_code='$rs1[Acc_type_code]' ";
$result2 = mysql_query($strQuery);
$numAmt = mysql_num_rows($result2);
$strXML .= "";
} # while
} # if
//Finally, close element
$strXML .= "";
//Create the chart - Pie 3D Chart with data from strXML
echo renderChart("../charts/Pie3D.swf", "", $strXML, "", 750, 375, false, false);
?>
}
if($setdata=="B"){
?>
";
// Fetch all factory records
$strQuery = "SELECT * FROM durable_tb dt, accessories_type_tb att , accessories_tb at WHERE at.Dura='Y' and at.Acc_type_code = att.Acc_type_code and dt.AccId = at.AccId and at.Acc_type_code !='0' GROUP BY dt.Acc_type_code ";
$result2= mysql_query($strQuery);
//Iterate through each factory
if ($result2) {
while( $rs2 = mysql_fetch_array($result2) ) {
$error_id = $rs2['id'];
$strQuery = "SELECT * FROM durable_tb dt, accessories_type_tb att , accessories_tb at WHERE at.Dura='Y' and at.Acc_type_code = att.Acc_type_code and dt.AccId = at.AccId and at.Acc_type_code !='0' and at.Acc_type_code='$rs2[Acc_type_code]' ";
$result3 = mysql_query($strQuery);
$numAmt = mysql_num_rows($result3);
$strXML .= "";
} # while
} # if
//Finally, close element
$strXML .= "";
//Create the chart - Pie 3D Chart with data from strXML
echo renderChart("../charts/Pie3D.swf", "", $strXML, "", 750, 375, false, false);
?>
}
if($setdata=="C"){
?>
";
// Fetch all factory records
$strQuery = " SELECT * FROM durable_type_tb ";
$result1 = mysql_query($strQuery);
//Iterate through each factory
if ($result1) {
while( $rs1 = mysql_fetch_array($result1) ) {
$error_id = $rs1['id'];
$strQuery = "Select * From durable_tb WHERE durableCode='$rs1[durableCode]' ";
$result2 = mysql_query($strQuery);
$numAmt = mysql_num_rows($result2);
$strXML .= "";
} # while
} # if
//Finally, close element
$strXML .= "";
//Create the chart - Pie 3D Chart with data from strXML
echo renderChart("../charts/Pie3D.swf", "", $strXML, "", 750, 375, false, false);
?>
}
if($setdata=="D"){
?>
";
// Fetch all factory records
$strQuery = " SELECT * FROM accessories_type_tb ";
$result1 = mysql_query($strQuery);
//Iterate through each factory
if ($result1) {
while( $rs1 = mysql_fetch_array($result1) ) {
$error_id = $rs1['id'];
$strQuery = " SELECT * FROM accessories_tb at, accessories_type_tb att WHERE Fund='หมดอายุการใช้งาน' and at.Acc_type_code = att.Acc_type_code and at.Acc_type_code !='0' and at.Acc_type_code='$rs1[Acc_type_code]' ";
$result2 = mysql_query($strQuery);
$numAmt = mysql_num_rows($result2);
$strXML .= "";
} # while
} # if
//Finally, close element
$strXML .= "";
//Create the chart - Pie 3D Chart with data from strXML
echo renderChart("../charts/Pie3D.swf", "", $strXML, "", 750, 375, false, false);
?>
}
if($setdata=="E"){
?>
";
// Fetch all factory records
$strQuery = " SELECT * FROM accessories_tb WHERE Year !=' ' and Dura='Y' GROUP BY Year ";
$result1 = mysql_query($strQuery);
//Iterate through each factory
if ($result1) {
while( $rs1 = mysql_fetch_array($result1) ) {
$error_id = $rs1['id'];
$strQuery = " SELECT SUM(Price) AS SumB1 FROM accessories_tb WHERE Year='$rs1[Year]' and Dura='Y' ";
$result3 = $dbObj->execQuery($strQuery);
$rs3 = $dbObj->fetchArray($result3);
$strXML .= "";
} # while
} # if
//Finally, close element
$strXML .= "";
//Create the chart - Pie 3D Chart with data from strXML
echo renderChart("../charts/Column2D.swf", "", $strXML, "", 750, 375, false, false);
?>
}
if($setdata=="F"){
?>
";
// Fetch all factory records
$strQuery = " SELECT * FROM accessories_tb WHERE Year !=' ' and Dura='N' GROUP BY Year ";
$result1 = mysql_query($strQuery);
//Iterate through each factory
if ($result1) {
while( $rs1 = mysql_fetch_array($result1) ) {
$error_id = $rs1['id'];
$strQuery = " SELECT SUM(Price) AS SumB1 FROM accessories_tb WHERE Year='$rs1[Year]' and Dura='N' ";
$result2 = mysql_query($strQuery);
$rs2 = $dbObj->fetchArray($result2);
$strXML .= "";
} # while
} # if
//Finally, close element
$strXML .= "";
//Create the chart - Pie 3D Chart with data from strXML
echo renderChart("../charts/Column2D.swf", "", $strXML, "", 750, 375, false, false);
?>
}
if($setdata=="G"){
?>
";
// Fetch all factory records
$strQuery = "SELECT * FROM accessories_type_tb ";
$result1 = mysql_query($strQuery);
//Iterate through each factory
if ($result1) {
while( $rs1 = mysql_fetch_array($result1) ) {
$error_id = $rs1['id'];
$strQuery = " SELECT * FROM accessories_tb at, accessories_type_tb att WHERE at.Dura='N' and at.Status='Y' and at.Acc_type_code = att.Acc_type_code and at.Acc_type_code !='0' and at.Acc_type_code='$rs1[Acc_type_code]' ";
$result2 = mysql_query($strQuery);
$numAmt = mysql_num_rows($result2);
$strXML .= "";
} # while
} # if
//Finally, close element
$strXML .= "";
//Create the chart - Pie 3D Chart with data from strXML
echo renderChart("../charts/Pie3D.swf", "", $strXML, "", 750, 375, false, false);
?>
}
}
?> |
|
|