getConnection();
// Check admin permission
$usr = new user($db);
$adminpermission = $usr->check_admin_permission($_SESSION["user"]);
// initialize object
$off = new office($db);
// read office will be here
// query office
$stmt = $off->off_read();
$num = $stmt->rowCount();
$emp = new employee($db);
$totalEmp = $emp->count_all_empid();
$stmt_tg = $emp->at_all_read();
$tnum = $stmt_tg->rowCount();
// Initialize variables to avoid undefined warnings
$sambalpur_num = 0;
$assembly_num = 0;
if($tnum>0){
while ($row = $stmt_tg->fetch(PDO::FETCH_ASSOC)){
if($row["ts_brid"] == 25){
$sambalpur_num = $sambalpur_num + 1;
} else {
$assembly_num = $assembly_num +1;
}
}
}
$sambalpur_percent = ($sambalpur_num * 100) / $tnum;
$assembly_percent = ($assembly_num * 100) / $tnum;
$dataPoints = array(
array("label"=>"Jajpur", "y"=>$sambalpur_percent),
array("label"=>"Abhiram", "y"=>$assembly_percent),
)
?>
STATS
0){
$i=1;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){
if($i%2 != 0 ){ echo ''; }
echo "". $row["brch_name"] . " | ";
echo "";
echo " | ". $row["brch_id"] . " | ";
if($i%2 != 0 ){ echo '
'; }
$i++;
}
}
?>