";
$strQ = " SELECT * FROM teacher_type_tb Where Flag ='Y' ";
$res = $dbObj->execQuery($strQ);
$c = mysql_num_rows($res);
while( $rs0 = $dbObj->fetchArray($res) ) {
$dc = $rs0['Ttype_code'];
if ($dc !=0 ){
$sql = " SELECT COUNT(Teacher_code) AS num FROM personal_tb pt, teacher_type_tb tt WHERE pt.Teacher_type=$dc and pt.Teacher_type=tt.Ttype_code and tt.Flag='Y' and pt.StatusId='1' ";
$result = $dbObj->execQuery($sql);
$rs = $dbObj->fetchArray($result);
$sql2 = " SELECT COUNT(Teacher_code) AS sum FROM personal_tb pt, teacher_type_tb tt WHERE pt.Teacher_type=tt.Ttype_code and tt.Flag='Y' and pt.StatusId='1' ";
$result2 = $dbObj->execQuery($sql2);
$rs2 = $dbObj->fetchArray($result2);
$per = ( $rs['num'] * 100 ) / $rs2['sum'];
$p = number_format($per,2,'.','.');
$strXML .= "";
}
}
//Finally, close element
$strXML .= "";
//Create the chart - Pie 3D Chart with data from strXML
echo renderChart("../charts/Column3D.swf", "", $strXML, "",600, 375, false, false);
?> |