";
$sql = " SELECT COUNT(Teacher_type) AS num4 FROM personal_tb WHERE StatusId='1' AND Teacher_type=1 ";
$result4 = $dbObj->execQuery($sql);
$rs4 = $dbObj->fetchArray($result4);
$dbObj->freeresult($result4);
$per4 = ( $rs4['num4'] * 100 ) / $total;
$p4 = number_format($per4,2,'.','.');
$strXML .= "";
$sql = " SELECT COUNT(Teacher_type) AS num5 FROM personal_tb WHERE StatusId='1' AND Teacher_type=4 ";
$result5 = $dbObj->execQuery($sql);
$rs5 = $dbObj->fetchArray($result5);
$dbObj->freeresult($result5);
$per5 = ( $rs5['num5'] * 100 ) / $total;
$p5 = number_format($per5,2,'.','.');
$strXML .= "";
$sql = " SELECT COUNT(Teacher_type) AS num6 FROM personal_tb WHERE StatusId='1' AND Teacher_type=2 ";
$result6 = $dbObj->execQuery($sql);
$rs6 = $dbObj->fetchArray($result6);
$dbObj->freeresult($result6);
$per6 = ( $rs6['num6'] * 100 ) / $total;
$p6 = number_format($per6,2,'.','.');
$strXML .= "";
$sql = " SELECT COUNT(Teacher_type) AS num7 FROM personal_tb WHERE StatusId='1' AND Teacher_type=5 ";
$result7 = $dbObj->execQuery($sql);
$rs7 = $dbObj->fetchArray($result7);
$dbObj->freeresult($result7);
$per7 = ( $rs7['num7'] * 100 ) / $total;
$p7 = number_format($per7,2,'.','.');
$strXML .= "";
$sql = " SELECT COUNT(Teacher_type) AS num8 FROM personal_tb WHERE StatusId='1' AND Teacher_type=6 ";
$result8 = $dbObj->execQuery($sql);
$rs8 = $dbObj->fetchArray($result8);
$dbObj->freeresult($result8);
$per8 = ( $rs8['num8'] * 100 ) / $total;
$p8 = number_format($per8,2,'.','.');
$strXML .= "";
//Finally, close element
$strXML .= "";
//Create the chart - Pie 3D Chart with data from strXML
echo renderChart("../charts/Pie3D.swf", "", $strXML, "",600, 375, false, false);
?> |
|