0){
while($prow = mysqli_fetch_array($qPCP)){
$pcpID = $prow['id'];
}
//get Formula for later use
$pi = "SELECT * FROM `pms_formula` WHERE deleted = 0 LIMIT 1";
$qPi = mysqli_query($conn,$pi);
while($row = mysqli_fetch_array($qPi)){
$multiplierPTS = $row['multiplier_pts'];
$plusFactorPTS = $row['plus_factor_pts'];
}
}else{
exit();
}
}
// echo "
". $searchID;
// echo "
". $unitID;
// echo "
". $rptYear;
// echo "
". $rptSemester;
// echo "
". $empName;
// echo "
". $empPosition;
?>
EMPLOYEE NAME | "; echo "POSITION | "; echo "TARGET | "; echo "AVG. ACTUAL | "; echo "AVG. SCORE | "; echo "VARIANCE | "; echo "AVE. NR | "; echo ""; $empData = "SELECT * FROM `pms_employee_data` WHERE `unit_id` = $searchID AND deleted = 0 ORDER BY last_name ASC"; $qEmpData = mysqli_query($conn,$empData); while($erow = mysqli_fetch_array($qEmpData)){ $activeempID = $erow['id']; $activeempUnit = $erow['unit_id']; $position = $erow['position']; echo "
---|---|---|---|---|---|---|
".$erow['last_name'].", ".$erow['first_name']." | "; $qEmp ="SELECT AVG(mar_emp_data.my_score) AS myKPIScore, AVG(mar_emp_data.mar_actual) AS myKPImarActual, AVG(mar_emp_data.mar_numerical_rating) AS myKPINumerical, AVG(mar_emp_data.mar_variance_no) AS myKPIVarianceNO, AVG(REPLACE(mar_emp_data.mar_target, '%', '')) AS marTarget, pms_employee_data.id AS employeeID, pms_employee_data.unit_id AS empUnitID, pms_employee_data.first_name, pms_employee_data.last_name, pms_employee_data.position, pms_positions_tbl.position_name, pms_positions_tbl.id as posID, mar_emp_data.emp_rec_id, mar_emp_data.unit_id AS marUnitID, mar_emp_data.kra_id, mar_emp_data.kpi_id, mar_emp_data.mar_weight AS markpiWeight, mar_emp_data.mar_actual, mar_emp_data.my_score, mar_emp_data.mar_variance_no, mar_emp_data.mar_numerical_rating, mar_emp_data.mar_year_data, mar_emp_data.mar_semester_data, mar_emp_data.deleted, kra_employee_tbl.emp_id, kra_employee_tbl.weight AS kraWeight, kra_employee_tbl.kra_name, kra_employee_tbl.id, kpi_employee.emp_id, kpi_employee.kpi_name, kpi_employee.kra_id, kpi_employee.kpi_weight AS kpiWeight, kpi_employee.kpi_target AS kpiTarget, kpi_employee.id AS empKPID FROM pms_employee_data JOIN mar_emp_data ON mar_emp_data.unit_id = pms_employee_data.unit_id JOIN kra_employee_tbl ON kra_employee_tbl.id = mar_emp_data.kra_id JOIN kpi_employee ON kpi_employee.id = mar_emp_data.kpi_id JOIN pms_positions_tbl ON pms_positions_tbl.id = $position WHERE mar_emp_data.mar_year_data = $rptYear AND mar_emp_data.deleted = 0 AND mar_emp_data.unit_id = $searchID AND mar_emp_data.emp_rec_id=$activeempID AND mar_emp_data.unit_id = $activeempUnit"; $uOut = mysqli_query($conn,$qEmp); $rChk = mysqli_num_rows($uOut); if($rChk > 0){ while($qRow = mysqli_fetch_array($uOut)){ if($qRow['myKPIVarianceNO'] <= 0){ $txtColor = 'text-danger'; }else{ $txtColor = 'text-primary'; } if($qRow['myKPImarActual'] < $qRow['marTarget'] || $qRow['myKPImarActual'] <=0){ $txtColorT = 'text-danger'; }else{ $txtColorT = 'text-primary'; } echo "".$qRow['position_name']." | "; echo "".number_format($qRow['marTarget'],3,'.','')." | "; echo "".number_format($qRow['myKPImarActual'],3,'.','')." | "; echo "".number_format($qRow['myKPIScore'],3,'.','')." | "; echo "".number_format($qRow['myKPIVarianceNO'],3,'.','')." | "; echo "".number_format($qRow['myKPINumerical'],3,'.','')." | "; } } echo "