File manager - Edit - /home/autoph/tmp/public_html/pms_v1/scorecard/employeeScoreCard.php
Back
<link rel="stylesheet" type="text/css" href="./css/sidebarmain.css?v=<?php echo time(); ?>"/> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> <?php include_once("../../../cfg/conn.php"); include ("../functions/users.php"); include_once("../functions/menuScript.php"); include ("../pages/loadergif.php"); //error_reporting(0); $roleID=0; if(isset($_GET['s'])){ $empID = $_GET['e']; $sourceID = $_GET['s']; $sem = $_GET['sm']; $nme = $_GET['n']; $rptYear = $_GET['ye']; $fN = explode(" ", $nme); $fName = $fN[0]; $lName = $fN[1]; //START OF CHECKPOINT=============================================================================== //START OF CHECKPOINT=============================================================================== //==========CHECK IF USER EXIST IN THE RECORD AND MATCH ALL INFORMATION IN THE LICNK ========= $chkUser = "SELECT * FROM `pms_employee_data` WHERE `id`='$sourceID' AND `deleted` = 0"; $qCU=mysqli_query($conn,$chkUser); $countUser = mysqli_num_rows($qCU); if($countUser == 0){ echo " <center><img src='../images/locked_out_icon.png' width='100' style='margin-top:100px'><img>"; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p></center> "; exit(); }else{ while($uow=mysqli_fetch_array($qCU)){ $uowaccStat = $uow['account_status']; $uowdeleted = $uow['deleted']; } } if($uowaccStat == 0){ echo " <center><img src='../images/locked_out_icon.png' width='100' style='margin-top:100px'><img>"; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p></center> "; exit(); } if($uowdeleted == 1){ echo " <center><img src='../images/locked_out_icon.png' width='100' style='margin-top:100px'><img>"; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p></center> "; exit(); } //==========CHECK IF EMPLOYEE EXIST IN RECORD AND MATCH ALL INFORMATION IN THE LICNK ========= $chkPoint = "SELECT `last_name`, `first_name`,`account_status`,`deleted` FROM `pms_employee_data` WHERE `id`='$empID'"; $qChk=mysqli_query($conn,$chkPoint); $ckhRow = mysqli_num_rows($qChk); If($ckhRow > 0){ while($row=mysqli_fetch_array($qChk)){ $lastName = $row['last_name']; $firstName = $row['first_name']; $accStat = $row['account_status']; $deleted = $row['deleted']; } }else{ echo " <center><img src='../images/locked_out_icon.png' width='100' style='margin-top:100px'><img>"; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p></center> "; exit(); } if($lName != $lastName){ echo " <center><img src='../images/locked_out_icon.png' width='100' style='margin-top:100px'><img>"; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p></center> "; exit(); } if($fName != $firstName){ echo " <center><img src='../images/locked_out_icon.png' width='100' style='margin-top:100px'><img>"; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p></center> "; exit(); } //END OF CHECKPOINT=============================================================================== //END OF CHECKPOINT=============================================================================== ?> <center> <div class='col text-left' style='margin-top:80px;width:80%'> <img src='../images/ahg_logo.png',10,5, 25,10></img> <h5 class='text-dark pb-4 mt-3'>SCORECARD - <?php echo getEmployeeEmpInformationB($empID)[3]. " " .getEmployeeEmpInformationB($empID)[2];?></h5> </div> <table style="width:80%;border-collapse:collapse"> <tbody> <thead> <th class="border p-2 bg-dark text-light">KRA DESCIPRTION</th> <th class="border p-2 bg-dark text-light text-center">WEIGHT</th> <th class="border p-2 bg-dark text-light">KPI DESCRIPTION</th> <th class="border p-2 bg-dark text-light text-center">TARGET</th> <th class="border p-2 bg-dark text-light text-center">ACTUAL</th> <th class="border p-2 bg-dark text-light text-center">A. RATE</th> <th class="border p-2 bg-dark text-light text-center">AVG. SCORE</th> <th class="border p-2 bg-dark text-light text-center">W.POINT</th> </thead> <?php $weightedPointsTotal=0; $emp ="SELECT pcp_headers.`id`, pcp_headers.`employee_id`, pcp_headers.`year`, pcp_headers.`deleted`, pcp_employee_data.`pcp_header_id`, pcp_employee_data.`pcp_kra_id`, pcp_employee_data.`pcp_kpi_id`, pcp_employee_data.`pcp_weight`, pcp_employee_data.`pcp_target`, pcp_employee_data.`deleted` FROM pcp_employee_data JOIN pcp_headers ON pcp_headers.`id`=pcp_employee_data.`pcp_header_id` WHERE pcp_headers.`deleted`=0 AND pcp_employee_data.`deleted`=0 AND pcp_headers.`employee_id`='$empID' GROUP BY pcp_employee_data.`pcp_kra_id`"; $qEmp = mysqli_query($conn,$emp); while($row = mysqli_fetch_array($qEmp)){ $As=0; $Bs=0; $weightedPoints=0; $wp=0; $wpoint=0; $kraID = $row['pcp_kra_id']; echo "<tr>"; echo "<td class='p-2 border align-top'>".getEmpKRAName($kraID)[0]."</td>"; echo "<td class='p-2 border align-top text-center'>"; $wpoint = $row['pcp_weight']; echo $wpoint; echo "</td>"; echo "<td class='p-0 align-top'>"; echo "<table class='w-100'>"; $getKPI = "SELECT * FROM kpi_employee WHERE kra_id ='$kraID' AND `emp_id`='$empID' AND `deleted`=0 ORDER BY `id` ASC"; $qKpi = mysqli_query($conn,$getKPI); while($kRow = mysqli_fetch_array($qKpi)){ echo "<tr>"; echo "<td class='p-2 border align-top'>".$kRow['kpi_name']."</td>"; echo "</tr>"; } echo "</table>"; echo "</td>"; echo "<td class='p-0 align-top'>"; echo "<table class='w-100'>"; $getKPIt = "SELECT * FROM kpi_employee WHERE kra_id ='$kraID' AND `emp_id`='$empID' AND `deleted`=0 ORDER BY `id` ASC"; $qKpit = mysqli_query($conn,$getKPIt); while($tRow = mysqli_fetch_array($qKpit)){ echo "<tr>"; echo "<td class='p-2 border align-top text-center'>".$tRow['kpi_target']."</td>"; echo "</tr>"; } echo "</table>"; echo "</td>"; echo "<td class='p-0 align-top'>"; echo "<table class='w-100'>"; $getKPIt = "SELECT * FROM kpi_employee WHERE kra_id ='$kraID' AND `emp_id`='$empID' AND `deleted`=0 ORDER BY `id` ASC"; $qKpit = mysqli_query($conn,$getKPIt); while($aRow = mysqli_fetch_array($qKpit)){ $kpiID=$aRow['id']; if($sem == 0){ $getActual ="SELECT AVG(`mar_actual`) AS 'myActual' FROM `mar_emp_data` WHERE `emp_rec_id`='$empID' AND `deleted`=0 AND `kpi_id`='$kpiID' AND `mar_year_data`='$rptYear'"; }else{ $getActual ="SELECT AVG(`mar_actual`) AS 'myActual' FROM `mar_emp_data` WHERE `emp_rec_id`='$empID' AND `deleted`=0 AND `kpi_id`='$kpiID' AND `mar_year_data`='$rptYear' AND `mar_semester_data`='$sem'"; } $qActual = mysqli_query($conn,$getActual); while($act = mysqli_fetch_array($qActual)){ echo "<tr>"; echo "<td class='p-2 border align-top text-center'>".number_format(($act['myActual']),2,'.','')."</td>"; echo "</tr>"; } } echo "</table>"; echo "</td>"; echo "<td class='p-0 align-top'>"; echo "<table class='w-100'>"; $getKPIt = "SELECT * FROM kpi_employee WHERE kra_id ='$kraID' AND `emp_id`='$empID' AND `deleted`=0 ORDER BY `id` ASC"; $qKpit = mysqli_query($conn,$getKPIt); $countSpan =0; while($aRow = mysqli_fetch_array($qKpit)){ $countSpan=$countSpan + 1; $kpiID=$aRow['id']; if($sem == 0){ $getActual ="SELECT AVG(`my_score`) AS 'myScore' FROM `mar_emp_data` WHERE `emp_rec_id`='$empID' AND `deleted`=0 AND `kpi_id`='$kpiID' AND `mar_year_data`='$rptYear'"; }else{ $getActual ="SELECT AVG(`my_score`) AS 'myScore' FROM `mar_emp_data` WHERE `emp_rec_id`='$empID' AND `deleted`=0 AND `kpi_id`='$kpiID' AND `mar_year_data`='$rptYear' AND `mar_semester_data`='$sem'"; } $qActual = mysqli_query($conn,$getActual); while($act = mysqli_fetch_array($qActual)){ echo "<tr>"; echo "<td class='p-2 border align-top text-center'>".number_format(($act['myScore']),2,'.','')." %</td>"; echo "</tr>"; } } echo "</table>"; echo "</td>"; echo "<td class='p-0 align-middle text-center border'>"; if($sem == 0){ $getActualVG ="SELECT AVG(`my_score`) AS 'myAVGScore' FROM `mar_emp_data` WHERE `emp_rec_id`='$empID' AND `deleted`=0 AND `kra_id`='$kraID' AND `mar_year_data`='$rptYear' LIMIT 1"; }else{ $getActualVG ="SELECT AVG(`my_score`) AS 'myAVGScore' FROM `mar_emp_data` WHERE `emp_rec_id`='$empID' AND `deleted`=0 AND `kra_id`='$kraID' AND `mar_year_data`='$rptYear' AND `mar_semester_data`='$sem' LIMIT 1"; } $qActualVG = mysqli_query($conn,$getActualVG); while($act = mysqli_fetch_array($qActualVG)){ $wp =number_format(($act['myAVGScore']),2,'.','')."%"; echo $wp; } echo "</td>"; echo "<td class='p-0 align-middle text-center border'>"; $As = str_replace("%","",$wp); $Bs = str_replace("%","",$wpoint); $weightedPoints = ($As / $Bs) ; $weightedPoints = ($As/100) / ($Bs/100); $weightedPointsTotal =$weightedPointsTotal + $weightedPoints; echo number_format($weightedPoints,3,'.') ."%"; echo "</td>"; echo "</tr>"; } ?> </tbody> </table> </center> <?php } $conn->close(); ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings