File manager - Edit - /home/autoph/public_html/pms_v1/pdfViewer/viewPEFForm.php
Back
<?php include_once("../../../cfg/conn.php"); include ("../functions/users.php"); //error_reporting(0); if(isset($_POST['pefView'])){ $userID =$_POST['userID']; $empRecordID=$_POST['empRecordID']; $pcpStatus=$_POST['pcpStatus']; //$SelectedEmployeeID=$_POST['SelectedEmployeeID']; $GetPCPYear=$_POST['GetPCPYear']; $GetPCPSemester=$_POST['GetPCPSemester']; $pcpID=$_POST['pcpID']; //GET RATER COUNT $raterCount = "SELECT * FROM `pef_parttwo_evaluator` WHERE `emp_id`= '$empRecordID' AND `type`='PEF' AND `deleted`=0"; $qRater = mysqli_query($conn,$raterCount); $qRows = mysqli_num_rows($qRater); $qRow = 0; if($qRows > 1){ $flo='s'; while($apr = mysqli_fetch_array($qRater)){ $qRow = $qRow + 1; } }else{ $flo=''; } //GET RATER ENTRY COUNT and COMPARE IT TO TOTAL RATER COUNT $qeRow=0; $raterEntryCount = "SELECT * FROM `pef_evaluation_behavioral` WHERE `pcp_id` ='$pcpID' AND `emp_record_id` = '$empRecordID' AND `deleted`=0 GROUP BY `evaluator_id`"; $qERate = mysqli_query($conn,$raterEntryCount); $lockMyview = 'Enable'; while($lck = mysqli_fetch_array($qERate)){ if($lck['evaluator_id']== $userID){ $lockMyview = 'Disabled'; } $qeRow =$qeRow + 1; } if($qeRow == $qRow){ $partTwoEvalutionButton = ''; }else{ $partTwoEvalutionButton = ''; } echo "<input type='hidden' id='pefApproverCount' value='$qRow'>"; echo "<input type='hidden' id='pefApproverEntry' value='$qeRow'>"; echo "<input type='hidden' id='empRecordID' value='$empRecordID'>"; //Get PCP Period $divisorCount = 6; $pcpPeriod="SELECT `period_count` AS 'pcpPeriodCount' FROM `pcp_headers` WHERE `id`='$pcpID'"; $qpcp = mysqli_query($conn,$pcpPeriod); while($nr = mysqli_fetch_array($qpcp)){ $divisorCount =$nr['pcpPeriodCount']; } $totaNGSumOfWeight = 0; $pefKraWPointF=0; $totaPtwoWeight = 0; $perCentilePTwo = 0; $adjPTow = 0; $plusFactorPTS=0; $multiplierPTS=0; $kraCount = 0; $weightedPointsTotal =0; $approvalButton = ""; $rateeAgreeID =""; $nextHeadID =""; $nextHeadButton=""; $approvedID =""; $confirnData=""; $potentialNotes =""; $suitabilityNotes=""; $competencyNotes=""; $competency =""; $suitability=""; $potential=""; $strength=""; $improvement=""; $tNR=0; $tPercent=""; $tadj=""; $tWP=""; $tOverAll =""; $tOverAdj=""; $confirmNotes=""; $nextHeadNotes =""; $bWeight=""; $inputValue=""; $Notes=""; $weightedPoints=""; $lockNotes=""; $rateeAgreeButton =""; $nextHeadButton = ""; $nextHeadIDButton = ""; //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']; $nrMaxCount = $row['nr_max_count']; } //check if PEF has been created and approved $sql ="SELECT * FROM `pef_evaluation_data` WHERE `pcp_id`='$pcpID' AND `deleted`=0 AND `emp_record_id`='$empRecordID'"; $sqlQ = mysqli_query($conn,$sql); $statRow = mysqli_num_rows($sqlQ); if($statRow > 0){ $chkIfMyIDExist = "SELECT * FROM `pef_evaluation_behavioral` WHERE `pcp_id`='$pcpID' AND `deleted`=0 AND `emp_record_id`='$empRecordID' AND `evaluator_id`='$userID'"; $qExist = mysqli_query($conn,$chkIfMyIDExist); $qExCount = mysqli_num_rows($qExist); if($qExCount > 0){ $approvedID = $empRecordID; while($row = mysqli_fetch_array($sqlQ)){ $rateeAgreeID =$row['emp_confirm_by']; $nextHeadID =$row['next_head_approval_id']; $approvedID =$row['evaluated_by']; } } }else{ $rateeAgreeID =0; $nextHeadID =0; $approvedID =0; } if($approvedID == 0 && $nextHeadID == 0 && $rateeAgreeID == 0 ){ if($lockMyview ==='Enable'){ $approvalButton = "ENABLE"; }else{ $approvalButton = "DISABLED"; } $rateeAgreeButton = "DISABLED"; $nextHeadIDButton = "DISABLED"; $lockNotes = "block"; $msg= $qeRow ." / " . $qRow . " Approver".$flo." submitted their assessment"; } //echo $qExCount; //echo $nextHeadID; //echo $rateeAgreeID; if($approvedID != 0 && $nextHeadID == 0 && $rateeAgreeID == 0 ){ $approvalButton = "DISABLED"; $rateeAgreeButton = "ENABLE"; $nextHeadIDButton = "DISABLED"; $lockNotes = "block"; if($qeRow == $qRow){ $msg="Waiting for employee confirmation"; }else{ $msg= $qeRow ." / " . $qRow . " Approver".$flo." submitted their evaluation."; } } if($approvedID != 0 && $nextHeadID == 0 && $rateeAgreeID != 0 ){ $approvalButton = "DISABLED"; $rateeAgreeButton = "DISABLED"; $nextHeadIDButton = "ENABLE"; $lockNotes = "block"; $msg="Waiting for Next Higher Head Approval."; } if($approvedID != 0 && $nextHeadID != 0 && $rateeAgreeID != 0 ){ $approvalButton = "DISABLED"; $rateeAgreeButton = "DISABLED"; $nextHeadIDButton = "DISABLED"; $lockNotes = "block"; $msg="Closed PEF Record"; } ?> <!--<table style='width:100%;margin:0px' class='form-control' data-toggle="modal" data-target="#viewMARDataEntryForm"> <table id="pefDataView" data-toggle="modal" data-target="#viewMARDataEntryForm" style="width:100%"> onclick="javascript:updateInbox(this);" --> <table style="width:100%"> <thead><th colspan=11> <p class="btn btn-dark m-0" style="width:100%" > PART I - OUTPUT / ACCOMPLISHMENT (70%)</P></th</thead> <thead> <th style='width:5%;border:0px solid red'>NO.</th> <th style='width:40%;border:0px solid red'>KRA's / KPI's</th> <th style='width:5%;border:0px solid red'>WEIGHT</th> <?php if($GetPCPSemester==="1ST"){?> <th style='width:5%;border:0px solid red;padding:0px;text-align:center'>JAN.</th> <th style='width:5%;border:0px solid red;padding:0px;text-align:center'>FEB.</th> <th style='width:5%;border:0px solid red;padding:0px;text-align:center'>MAR.</th> <th style='width:5%;border:0px solid red;padding:0px;text-align:center'>APR.</th> <th style='width:5%;border:0px solid red;padding:0px;text-align:center'>MAY</th> <th style='width:5%;border:0px solid red;padding:0px;text-align:center'>JUN.</th> <?php }else{?> <th style='width:5%;border:0px solid red;padding:0px;text-align:center'>JUL.</th> <th style='width:5%;border:0px solid red;padding:0px;text-align:center'>AUG.</th> <th style='width:5%;border:0px solid red;padding:0px;text-align:center'>SEP.</th> <th style='width:5%;border:0px solid red;padding:0px;text-align:center'>OCT.</th> <th style='width:5%;border:0px solid red;padding:0px;text-align:center'>NOV.</th> <th style='width:5%;border:0px solid red;padding:0px;text-align:center'>DEC.</th> <?php }?> <th style='width:10%;border:0px solid red;text-align:center'>Numerical Rating</th> <th style='width:10%;border:0px solid red;text-align:center'>Weighted Points</th> </thead> <?php $kraView = "SELECT * FROM `pcp_employee_data` WHERE `pcp_header_id`='$pcpID' AND `deleted`=0 GROUP BY `pcp_kra_id` ORDER BY id ASC"; $kra = mysqli_query($conn,$kraView); while($row=mysqli_fetch_array($kra)){ $pefVal=0; $pefKraWPoint=0; $pefKraNR=0; $aveData=0; $kraWP=0; $pefjVal=0; $peffVal=0; $pefmVal=0; $pefaVal=0; $pefmyVal=0; $pefjnVal=0; $kraCount = $kraCount + 1; $pefKraWPointF=0; $kraID = $row['pcp_kra_id']; ?><tr onclick="javascript:getMARinfo(this);" ><?php echo "<td>$kraID</td>"; echo "<td>"; // $kraName = "SELECT * FROM `kra_employee_tbl` WHERE `id`='$kraID' AND `emp_id`='$userID'"; // $kraN = mysqli_query($conn,$kraName); // while($kna=mysqli_fetch_array($kraN)){ // echo $kna['kra_name']; // $weight = $kna['weight']; // } echo getEmployeeKRAName($kraID)[0]; $weight =getEmployeeKRAName($kraID)[1]; echo "</td>"; echo "<td style='text-align:center'>$weight</td>"; //================================================================= //================================================================= if($GetPCPSemester==="1ST"){ echo "<td style='text-align:center'>"; $jMar = "SELECT AVG(mar_numerical_rating) AS average_value FROM `mar_emp_data` WHERE `kra_id`='$kraID' AND `emp_rec_id`='$empRecordID' AND `pcp_id`='$pcpID' AND `mar_semester_data`='$GetPCPSemester' AND `mar_month_data`=1"; $gMarD = mysqli_query($conn,$jMar); while($jRow = mysqli_fetch_array($gMarD)){ $aveDataJan = $jRow['average_value']; } $pefKraNR = $pefKraNR + $aveDataJan; echo number_format($aveDataJan,3,'.');; echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $fMar = "SELECT AVG(mar_numerical_rating) AS average_value FROM `mar_emp_data` WHERE `kra_id`='$kraID' AND `emp_rec_id`='$empRecordID' AND `pcp_id`='$pcpID' AND `mar_semester_data`='$GetPCPSemester' AND `mar_month_data`=2"; $fMarD = mysqli_query($conn,$fMar); while($fRow = mysqli_fetch_array($fMarD)){ $aveDataFeb = $fRow['average_value']; } $pefKraNR = $pefKraNR + $aveDataFeb; echo number_format($aveDataFeb,3,'.'); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $fMar = "SELECT AVG(mar_numerical_rating) AS average_value FROM `mar_emp_data` WHERE `kra_id`='$kraID' AND `emp_rec_id`='$empRecordID' AND `pcp_id`='$pcpID' AND `mar_semester_data`='$GetPCPSemester' AND `mar_month_data`=3"; $fMarD = mysqli_query($conn,$fMar); while($fRow = mysqli_fetch_array($fMarD)){ $aveDataMar = $fRow['average_value']; } $pefKraNR = $pefKraNR + $aveDataMar; echo number_format($aveDataMar,3,'.'); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $fMar = "SELECT AVG(mar_numerical_rating) AS average_value FROM `mar_emp_data` WHERE `kra_id`='$kraID' AND `emp_rec_id`='$empRecordID' AND `pcp_id`='$pcpID' AND `mar_semester_data`='$GetPCPSemester' AND `mar_month_data`=4"; $fMarD = mysqli_query($conn,$fMar); while($fRow = mysqli_fetch_array($fMarD)){ $aveDataApr = $fRow['average_value']; } $pefKraNR = $pefKraNR + $aveDataApr; echo number_format($aveDataApr,3,'.'); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $fMar = "SELECT AVG(mar_numerical_rating) AS average_value FROM `mar_emp_data` WHERE `kra_id`='$kraID' AND `emp_rec_id`='$empRecordID' AND `pcp_id`='$pcpID' AND `mar_semester_data`='$GetPCPSemester' AND `mar_month_data`=5"; $fMarD = mysqli_query($conn,$fMar); while($fRow = mysqli_fetch_array($fMarD)){ $aveDataMay = $fRow['average_value']; } $pefKraNR = $pefKraNR + $aveDataMay; echo number_format($aveDataMay,3,'.'); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $fMar = "SELECT AVG(mar_numerical_rating) AS average_value FROM `mar_emp_data` WHERE `kra_id`='$kraID' AND `emp_rec_id`='$empRecordID' AND `pcp_id`='$pcpID' AND `mar_semester_data`='$GetPCPSemester' AND `mar_month_data`=6"; $fMarD = mysqli_query($conn,$fMar); while($fRow = mysqli_fetch_array($fMarD)){ $aveDataJun = $fRow['average_value']; } $pefKraNR = $pefKraNR + $aveDataJun; echo number_format($aveDataJun,3,'.'); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $kNR = ($pefKraNR / $divisorCount); //$divisorCount==number of period to or months applicable echo number_format($kNR,3,'.',''); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $kraWeight = intval($weight) / 100; $pefKraWPointF= $kNR * $kraWeight; $totaNGSumOfWeight = $totaNGSumOfWeight + $pefKraWPointF; echo number_format($pefKraWPointF,3,'.',''); echo "</td>"; //================================================================= }else{ echo "<td style='text-align:center'>"; $jMar = "SELECT AVG(mar_numerical_rating) AS average_value FROM `mar_emp_data` WHERE `kra_id`='$kraID' AND `emp_rec_id`='$empRecordID' AND `pcp_id`='$pcpID' AND `mar_semester_data`='$GetPCPSemester' AND `mar_month_data`=7"; $gMarD = mysqli_query($conn,$jMar); while($jRow = mysqli_fetch_array($gMarD)){ $aveDataJul = $jRow['average_value']; } $pefKraNR = $pefKraNR + $aveDataJul; echo number_format($aveDataJul,3,'.'); //echo number_format(($pefjVal / 100),3,'.',''); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $fMar = "SELECT AVG(mar_numerical_rating) AS average_value FROM `mar_emp_data` WHERE `kra_id`='$kraID' AND `emp_rec_id`='$empRecordID' AND `pcp_id`='$pcpID' AND `mar_semester_data`='$GetPCPSemester' AND `mar_month_data`=8"; $fMarD = mysqli_query($conn,$fMar); while($fRow = mysqli_fetch_array($fMarD)){ $aveDataAug = $fRow['average_value']; } $pefKraNR = $pefKraNR + $aveDataAug; echo number_format($aveDataAug,3,'.'); //echo number_format(($peffVal / 100),3,'.',''); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $fMar = "SELECT AVG(mar_numerical_rating) AS average_value FROM `mar_emp_data` WHERE `kra_id`='$kraID' AND `emp_rec_id`='$empRecordID' AND `pcp_id`='$pcpID' AND `mar_semester_data`='$GetPCPSemester' AND `mar_month_data`=9"; $fMarD = mysqli_query($conn,$fMar); while($fRow = mysqli_fetch_array($fMarD)){ $aveDataSep = $fRow['average_value']; } $pefKraNR = $pefKraNR + $aveDataSep; echo number_format($aveDataSep,3,'.'); //echo number_format(($pefmVal / 100),3,'.',''); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $fMar = "SELECT AVG(mar_numerical_rating) AS average_value FROM `mar_emp_data` WHERE `kra_id`='$kraID' AND `emp_rec_id`='$empRecordID' AND `pcp_id`='$pcpID' AND `mar_semester_data`='$GetPCPSemester' AND `mar_month_data`=10"; $fMarD = mysqli_query($conn,$fMar); while($fRow = mysqli_fetch_array($fMarD)){ $aveDataOct = $fRow['average_value']; } $pefKraNR = $pefKraNR + $aveDataOct; echo number_format($aveDataOct,3,'.'); //echo number_format(($pefaVal / 100),3,'.',''); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $fMar = "SELECT AVG(mar_numerical_rating) AS average_value FROM `mar_emp_data` WHERE `kra_id`='$kraID' AND `emp_rec_id`='$empRecordID' AND `pcp_id`='$pcpID' AND `mar_semester_data`='$GetPCPSemester' AND `mar_month_data`=11"; $fMarD = mysqli_query($conn,$fMar); while($fRow = mysqli_fetch_array($fMarD)){ $aveDataNov = $fRow['average_value']; } $pefKraNR = $pefKraNR + $aveDataNov; echo number_format($aveDataNov,3,'.'); //echo number_format(($pefmyVal / 100),3,'.',''); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $fMar = "SELECT AVG(mar_numerical_rating) AS average_value FROM `mar_emp_data` WHERE `kra_id`='$kraID' AND `emp_rec_id`='$empRecordID' AND `pcp_id`='$pcpID' AND `mar_semester_data`='$GetPCPSemester' AND `mar_month_data`=12"; $fMarD = mysqli_query($conn,$fMar); while($fRow = mysqli_fetch_array($fMarD)){ $aveDataDec = $fRow['average_value']; } $pefKraNR = $pefKraNR + $aveDataDec; echo number_format($aveDataDec,3,'.'); //echo number_format(($pefjnVal / 100),3,'.',''); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $kNR = $pefKraNR / $divisorCount; echo number_format($kNR,3,'.',''); echo "</td>"; echo "<td style='width:5%;text-align:center'>"; $kraWeight = intval($weight) / 100; $pefKraWPointF= $kNR * $kraWeight; //echo number_format($pefKraWPointF,3,'.',''); $totaNGSumOfWeight = $totaNGSumOfWeight + $pefKraWPointF; echo number_format($pefKraWPointF,3,'.',''); echo "</td>"; } //================================================================= //================================================================= echo "</tr>"; } echo "<tr>"; echo "<td colspan=9 class='partOneTwoTitle'>"; echo "NUMERICAL RATING (Sum of weighted points)"; echo "</td>"; echo "<td colspan=2 class='partOneTwoTitle'>"; $wpPartOneVal = number_format($totaNGSumOfWeight,3,'.',''); echo "<input type='text' id='wpPartOne' value =".$wpPartOneVal." disabled class='partOneTwoTotal'>"; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=9 class='partOneTwoTitle'>"; echo "PERCENTILE EQUIVALENT"; echo "</td>"; echo "<td colspan=2 class='partOneTwoTitle'>"; $perCentile = ((($totaNGSumOfWeight / $nrMaxCount ) * $multiplierPTS) + $plusFactorPTS) * 100; $perCentileVal= number_format($perCentile,2,'.','') ."%"; echo "<input type='text' id='wpPartOnePercentile' value =".$perCentileVal." disabled class='partOneTwoTotal'>"; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=9 class='partOneTwoTitle'>"; echo "ADJECTIVAL RATING"; echo "</td>"; echo "<td colspan=2 class='partOneTwoTitle'>"; $gP = "SELECT * FROM `gps_adjectival_eq` WHERE $perCentile BETWEEN eq_percentage_from AND eq_percentage_to LIMIT 1"; $gpA = mysqli_query($conn,$gP); while($row=mysqli_fetch_array($gpA)){ $partOneAdju= TRIM($row['eq_adjectival']); } echo "<input type='text' id='wpPartOneAdjectival' value ='$partOneAdju' disabled class='partOneTwoTotal text-left' style='width:100%'>"; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=9 class='partOneTwoTitle'>"; echo "WEIGHTED RATING FOR PART I (PR X .70)"; echo "</td>"; echo "<td colspan=2 class='partOneTwoTitle'>"; $wpPartI = $perCentile * 0.7; $partOneWP = number_format($wpPartI,2,'.','')."%"; echo "<input type='text' id='wpPartOneWP' value =".$partOneWP." disabled class='partOneTwoTotal'>"; echo "</td>"; echo "</tr>"; ?> <tr> <td colspan=11 style='background:white;border:0px solid white'> <!--=================================================================================================================--> <!--=================================================================================================================--> <!--=================================================================================================================--> <!--=================================================================================================================--> <p class="btn btn-dark w-100 m-0" style="width:100%"> PART II - BEHAVIORAL / COMPETENCY AREAS (30%)</P> <table style="width:100%"> <thead> <th colspan=2 style='width:10%;border:0px solid red;padding:10px'>RATING SCALE:</th> </thead> <?php $qGuide = "SELECT * FROM `rating_scale` WHERE deleted=0 ORDER BY order_id ASC"; $qG = mysqli_query($conn,$qGuide); while($q = mysqli_fetch_array($qG)){ echo "<tr>"; echo "<td style='padding:10px;padding-left:10px;min-width:50px;font-family:calibri;background:#F8F7F4;text-align:right'>".$q['rate_s']."</td>"; echo "<td style='padding:10px;padding-right:100px;font-family:calibri;background:#F8F7F4'>".$q['rate_desc']."</td>"; echo "</tr>"; } echo "<tr><td colspan=2 style='padding:10px;padding-right:100px;font-family:calibri;background:#F8F7F4'></td>"; echo "</tr>"; ?> </table> <h6 class='text-right text-danger' data-toggle="modal" data-target="#viewEvaluatorsData" onclick="loadEvaluatorsData(this);" style='text-decoration:underline'> <?php echo $msg;?></h6> <table id ='pefPerformanceFactors' style="width:100%"> <thead> <th style='width:5%;border:0px solid red;padding:10px;background:#E8E7E3'>NO</th> <th style='width:40%;border:0px solid red;padding:10px;background:#E8E7E3'>PERFORMANCE FACTORS</th> <th style='width:5%;border:0px solid red;padding:10px;background:#E8E7E3;text-align:center'>WEIGHT</th> <th style='width:5%;border:0px solid red;padding:10px;background:#E8E7E3;text-align:center'>N.Rating</th> <th style='width:5%;border:0px solid red;padding:10px;background:#E8E7E3;text-align:center'>AVG. W.Points</th> <th style='width:40%;border:0px solid red;padding:10px;background:#E8E7E3'>REMARKS</th> </thead> <?php $getPEFDBHead = "SELECT * FROM `pef_evaluation_data` WHERE `pcp_id`='$pcpID'"; $qGet = mysqli_query($conn,$getPEFDBHead); $ckhRow = mysqli_num_rows($qGet); if($ckhRow > 0){ while($db = mysqli_fetch_array($qGet)){ $tNR = $db['part_two_nr']; $tPercent = $db['part_two_percent']; $tadj = $db['part_two_adj']; $tWP = $db['part_two_wp']; $tOverAll = $db['per_overall_wp']; $tOverAdj = $db['per_overall_adj']; if($qeRow == $qRow){ $strength = $db['part_three_strength']; $improvement = $db['part_three_improvement']; $competencyX = $db['part_three_competency']; switch($competencyX){ case '1': $competency ="NONE"; break; case '2': $competency="A Particular competencies only (specify in the comment box)"; break; case '3': $competency="Two or more competency (specify in the comment box)"; break; } $competencyNotes = $db['part_three_competency_notes']; $suitabilityX = $db['part_three_suitability']; switch($suitabilityX){ case '1': $suitability ="Very Suitable"; break; case '2': $suitability="Suitable"; break; case '3': $suitability="Not Suitable"; break; } $suitabilityNotes = $db['part_three_suitability_notes']; $potentialX = $db['part_three_potential']; switch($potentialX){ case '1': $potential ="Just right for the present position"; break; case '2': $potential="Moderate Potential"; break; case '3': $potential="High Potential / ready for promotion"; break; } $potentialNotes = $db['part_three_potential_notes']; $confirm = $db['emp_confirm_agreement']; switch($confirm){ case '1': $confirnData ="AGREE"; break; case '2': $confirnData="AGREE WITH RESERVATION"; break; case '3': $confirnData="DISAGREE"; break; } $confirmNotes = $db['emp_confirm_notes']; $nextHeadNotes = $db['next_head_notes']; } } //if($tNR==""){$tNR=0;} } $getFac = "SELECT * FROM `performance_factors` WHERE deleted = 0 ORDER BY `factors_order` ASC"; $qFac = mysqli_query($conn,$getFac); while($row=mysqli_fetch_array($qFac)){ $code = $row['code_name']; //get existing behavioral data if available $bWeight = $row['factors_wp']; $numWeight = explode("%",$bWeight); $floatWeight = $numWeight[0]; if($qeRow == $qRow){ $getDB = "SELECT AVG(`assigned_score`) AS 'assignedScore', assigned_wp,notes FROM `pef_evaluation_behavioral` WHERE `pcp_id`='$pcpID' AND `factor_code_name`='$code' ORDER BY id ASC"; $qDB = mysqli_query($conn,$getDB); $chBPRow = mysqli_num_rows($qDB); if($chBPRow > 0){ while($qD = mysqli_fetch_array($qDB)){ $inputValue = $qD['assignedScore']; //$weightedPoints = $qD['assigned_wp']; $weightedPoints = $inputValue * ($floatWeight/100); $weightedPoints = number_format($weightedPoints,3,'.',''); $Notes = $qD['notes']; $weightedPointsTotal = $weightedPointsTotal + $weightedPoints; } } }else{ $getDB = "SELECT AVG(`assigned_score`) AS 'assignedScore', assigned_wp,notes FROM `pef_evaluation_behavioral` WHERE `pcp_id`='$pcpID' AND `factor_code_name`='$code' AND `evaluator_id`='$userID' ORDER BY id ASC"; $qDB = mysqli_query($conn,$getDB); $chBPRow = mysqli_num_rows($qDB); if($chBPRow > 0){ while($qD = mysqli_fetch_array($qDB)){ $inputValue = $qD['assignedScore']; $weightedPoints = $qD['assigned_wp']; $Notes = $qD['notes']; $weightedPointsTotal = $weightedPointsTotal + $weightedPoints; } } } $weightedPointsTotal = number_format($weightedPointsTotal,3,'.',''); //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ?><tr onclick="javascript:computWP(this);" style="width:100%"><?php echo "<td style='padding:3px;width:5%;background:white'>".$row['id']."</td>"; echo "<td style='padding:3px;width:40%;background:white'>".$row['factors_name']."</td>"; echo "<td style='padding:3px;width:5%';background:white'>"; echo "<input disabled value='$bWeight' type='text' disabled id='".$row['w_code']."' style='margin:0px;padding:5px;text-align:center;width:100px'>"; echo "</td>"; echo "<td style='padding:3px;width:5%;background:white'>"; echo "<input maxlength=4 min=0 max=5 value='$inputValue' type='number' id='".$row['code_name']."' $approvalButton style='width:100px;margin:0px;padding:5px;text-align:center'>"; echo "</td>"; echo "<td style='padding:3px;width:5%;background:white'>"; echo "<input disabled type='text' value='$weightedPoints' id='".$row['n_code']."' style='margin:0px;padding:5px;text-align:center;width:100px'>"; echo "</td>"; echo "<td style='padding:3px;width:40%;background:white'>"; echo "<input type='text' id='".$row['comment_code']."' value='$Notes' $approvalButton style='margin:0px;padding:5px;text-align:left;width:100%;'>"; echo "</td>"; echo "</tr>"; } //================================================================================\ //================================================================================\ echo "<tr>"; echo "<td colspan=5 class='partOneTwoTitle'>"; echo "NUMERICAL RATING (Sum of weighted points)"; echo "</td>"; echo "<td class='partOneTwoTitle'>"; //echo number_format($totaPtwoWeight,3,'.',''); echo "<input type='text' id='partTwoNR' value='$weightedPointsTotal' disabled class='partOneTwoTotal'>"; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=5 style='text-align:right;font-family:Calibri;font-weight:bold;background:lightgray;'>"; echo "PERCENTILE EQUIVALENT"; echo "</td>"; echo "<td class='partOneTwoTitle'>"; $tPercentRaw = ((($weightedPointsTotal / $nrMaxCount ) * $multiplierPTS) + $plusFactorPTS) * 100; $tPercentXXX= number_format($tPercentRaw,2,'.','') ."%"; echo "<input type='text' id='perCentilePTwo' value='$tPercentXXX' disabled class='partOneTwoTotal'>"; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=5 class='partOneTwoTitle'>"; echo "ADJECTIVAL RATING"; echo "</td>"; echo "<td class='partOneTwoTitle'>"; $gPII = "SELECT * FROM `gps_adjectival_eq` WHERE $tPercentRaw BETWEEN eq_percentage_from AND eq_percentage_to "; $gpB = mysqli_query($conn,$gPII); while($row=mysqli_fetch_array($gpB)){ $tadjXXX= $row['eq_adjectival']; } echo "<input type='text' id='adjPTow' value='$tadjXXX' disabled class='partOneTwoTotal'>"; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=5 class='partOneTwoTitle'>"; echo "WEIGHTED RATING FOR PART II (PR X .30)"; echo "</td>"; echo "<td class='partOneTwoTitle'>"; $wpPartII = $tPercentRaw * 0.3; $tWPxxx = number_format($wpPartII,2,'.','')."%"; echo "<input type='text' id='wpPartTwo' value='$tWPxxx' disabled class='partOneTwoTotal'>"; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=5 class='partOneTwoTitle'>"; echo "OVERALL PERFORMANCE RATING (<i>Part I + Part II Weighted Points</i>)"; echo "</td>"; echo "<td class='partOneTwoTitle'>"; //wpPartOneTwoWP = wpPartOneWP + wpPartTwo $tOverAllRaw = $wpPartII + $wpPartI; $tOverAllxxx = number_format($tOverAllRaw,2,'.','')."%"; echo "<input type='text' value='$tOverAllxxx' id='wpPartOneTwoWP' disabled class='partOneTwoTotal'>"; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=5 class='partOneTwoTitle'>"; echo "ADJECTIVAL EQUIVALENT"; echo "</td>"; echo "<td class='partOneTwoTitle'>"; $gPIIB = "SELECT * FROM `gps_adjectival_eq` WHERE $tOverAllRaw BETWEEN eq_percentage_from AND eq_percentage_to "; $gpB = mysqli_query($conn,$gPIIB); while($row=mysqli_fetch_array($gpB)){ $tOverAdjXXX= $row['eq_adjectival']; } echo "<input type='text' value='$tOverAdjXXX' id='wpPartTwoAdj' disabled class='partOneTwoTotal'>"; echo "</td>"; echo "</tr>"; //================================================================================\ //================================================================================\ //================================================================================\ //================================================================================\ ?> </table> <p class="btn btn-dark w-100 m-0">PART III - COMMENTS AND RECOMMENDATIONS</P> <br><br><b> A. BY THE RATER</b> <table class="table"> <tr> <td class="col-lg-6 p-3" style="width:50%;background:white""> <div class="form-group"> <label for="FempCompany">1. Ratee's Strength / Significant Contributions:</label> <br> <textarea approvalButton type="text" class="form-control h-25 " <?php echo $approvalButton;?> id="rateeStrength" name="rateeStrength" rows=3><?php echo $strength;?></textarea> </div> </td> <td class="col-lg-6 p-3" style="width:50%;background:white""> <div class="form-group"> <label for="rateeImprovement">2. Areas for Improvement/Development Needs</label> <br> <textarea approvalButton type="text" class="form-control h-25 " <?php echo $approvalButton;?> id="rateeImprovement" name="rateeImprovement" rows=3><?php echo $improvement;?></textarea> </div> </td> </tr> <tr> <td colspan=2 style="width:100%;background:white"> <table style='width:100%'> <tr> <td style="width:33%"" > <div class="form-group"> <label for="rateeCompetencies">3. Competencies not utilized or maximized in present job:</label> <br> <select name='rateeCompetencies' <?php echo $approvalButton;?> id='rateeCompetencies' class="form-select form-select-lg p-2 w-100 rounded-sm selectBG"> <option value="" selected><?php echo $competency;?></option> <option value="1">None</option> <option value="2">A Particular competencies only (specify in the comment box)</option> <option value="3">Two or more competency (specify in the comment box)</option> </select> <textarea type="text" <?php echo $approvalButton;?> class="form-control h-25 " id="rateeCompetenciesNotes" name="rateeCompetenciesNotes" rows=2><?php echo $competencyNotes;?></textarea> </div> </td> <td style="width:33%"> <div class="form-group"> <label for="rateeSuitability">4. Suitability to present position:</label> <br> <select name='rateeSuitability' <?php echo $approvalButton;?> id='rateeSuitability' class="form-select form-select-lg p-2 w-100 rounded-sm selectBG"> <option value="" selected><?php echo $suitability;?></option> <option value="1">Very Suitable</option> <option value="2">Suitable</option> <option value="3">Not Suitable</option> </select> <textarea type="text" <?php echo $approvalButton;?> class="form-control h-25 " id="rateeSuitabilityNotes" name="rateeSuitabilityNotes" rows=2><?php echo $suitabilityNotes;?></textarea> </div> </td> <td style="width:33%"> <div class="form-group"> <label for="rateePotential">5. Potential of the ratee to assume higher position:</label> <br> <select name='rateePotential' <?php echo $approvalButton;?> id='rateePotential' class="form-select form-select-lg p-2 w-100 rounded-sm selectBG" <?php echo $approvalButton;?>> <option value="" selected><?php echo $potential;?></option> <option value="1">Just right for the present position</option> <option value="2">Moderate Potential</option> <option value="3">High Potential / ready for promotion</option> </select> <textarea type="text" <?php echo $approvalButton;?> class="form-control h-25 " id="rateePotentialNotes" name="rateePotentialNotes" rows=2><?php echo $potentialNotes;?></textarea> </div> </td> </tr> </table> <!-- data-dismiss="modal" --> <?php if($approvalButton==="DISABLED"){ $viewButton='none'; }else{ $viewButton='block'; }?> <div class="modal-footer" style='display:<?php echo $viewButton;?>;float:right'> <button type="button" class="btn btn-info pl-4 pr-4" id="updatePartII" data-dismiss="modal" <?php echo $approvalButton;?> > <span class="btn-label"><i class="fa fa-save"> SUBMIT EVALUATION</i></button> <button type="button" class="btn btn-danger" data-dismiss="modal"> <span class="btn-label"><i class="fa fa-close"> CLOSE</i></button> </div> <br><br><br> </td> </tr> <tr> <td colspan=2 style='background:white'> <b> B. BY THE RATEE</b><br><br> <select name='raterAgree' <?php echo $rateeAgreeButton;?> id='raterAgree' class="form-select form-select-lg p-2 w-25 mb-2 rounded-sm selectBG"> <option value="" selected><?php echo $confirnData;?></option> <option value="1">AGREE</option> <option value="2">AGREE WITH RESERVATION</option> <option value="3">DISAGREE</option> </select> <textarea type="text" <?php echo $rateeAgreeButton;?> class="form-control h-25 " id="raterAgreeNotes" name="raterAgreeNotes" rows=2><?php echo $confirmNotes;?></textarea> <?php if($rateeAgreeButton==="DISABLED"){ $viewButton='none'; }else{ if($qRow == $qeRow){ $viewButton='block'; }else{ $viewButton='none'; } }?> <div class="modal-footer" style="display:<?php echo $viewButton;?>;float:right"> <button type="button" <?php echo $rateeAgreeButton;?> class="btn btn-warning pl-4 pr-4" id="raterConfirm" data-dismiss="modal"> <span class="btn-label"><i class="fa fa-check"> AGREE & SUBMIT</i></button> <button type="button" <?php echo $rateeAgreeButton;?> class="btn btn-danger" data-dismiss="modal"> <span class="btn-label"><i class="fa fa-close"> CLOSE</i></button> </div><br><br> </td> </tr> <tr> <td colspan=2 style='background:white;border:1px solid white'> <b> C. BY THE NEXT HIGHER HEAD</b><br><br> <textarea <?php echo $nextHeadIDButton ;?> type="text" class="form-control h-25 " id="raterConfirmationNotes" name="raterConfirmationNotes" rows=2><?php echo $nextHeadNotes;?></textarea> <?php if($nextHeadIDButton==="DISABLED"){ $viewButton='none'; }else{ $viewButton='block'; }?> <form action='pdfViewer/pep_pdfEmployeeview.php' method='GET' target='_Blank' style='margin:0px;padding:0px;padding-top:40px;float:right;border:1px solid white'> <input type='hidden' id='pcpIDpdf' name='pcpIDpdf' value='<?php echo $pcpID;?>'> <input type='hidden' id='source' name='source' value='<?php echo $userID;?>'> <input type='hidden' id='sme' name='sme' value='<?php echo $GetPCPSemester;?>'> <div class="modal-footer" style="display:block;float:right"> <button class="btn btn-dark text-white pl-2 pr-2 m-0" style="border-radius:0px"> <span class="btn-label"><i class="fa fa-print"> PRINT / SHARE Report</i></button> <button style='display:<?php echo $viewButton;?>' <?php echo $nextHeadIDButton ;?> type="button" <?php echo $nextHeadIDButton;?> class="btn btn-success pl-4 pr-4" id="headApprove" data-dismiss="modal"> <span class="btn-label"><i class="fa fa-save"> CONFIRM & SUBMIT</i></button> <button type="button" class="btn btn-danger" data-dismiss="modal"> <span class="btn-label"><i class="fa fa-close"> CLOSE</i></button> </div> </form> </td> </tr> </table> <!--=================================================================================================================--> <!--=================================================================================================================--> <!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--> <?php if($lockNotes ==="block"){ echo "<h5 style='font-family:Calibri;color:red;text-align:center;padding:5px;'> ".$msg." </h5>"; } ?> </td> </tr> </table> <p id="messageNote"></p> <?php $conn->close(); } ?> <!--########################## ############################################--> <script type="text/javascript"> $("#headApprove").click(function(){ var raterConfirmationNotes = $("#raterConfirmationNotes").val(); var pcpID = $("#pcpID").val(); var userID = $("#userID").val(); var empRecordID = $("#SelectedRecordID").val(); //var SelectedEmployeeID = $("#SelectedEmployeeID").val(); var GetPCPYear = $("#GetPCPYear").val(); var GetPCPSemester = $("#GetPCPSemester").val(); if(raterConfirmationNotes ==""){ Swal.fire({ icon: 'error', title: 'Invald Entry', text: 'Please type something in the comment box.' //footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) return false; } ShowUploadBar(); $.ajax({ url: "./pef/nextHigherHeadApproval.php", type: "POST", async: true, data: { "nextH":2, "raterConfirmationNotes":raterConfirmationNotes, "pcpID": pcpID, "userID": userID, "empRecordID": empRecordID, //"SelectedEmployeeID": SelectedEmployeeID, "GetPCPYear": GetPCPYear, "GetPCPSemester": GetPCPSemester }, success: function(x){ ShowUploadBar(); Swal.fire({ icon: 'success', title: 'PEF Confirmed', text: 'Your PEF has been confirmed and routed to your next higher head for final approval.' //footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) updateInbox(); } }) }); $("#raterConfirm").click(function(){ var raterAgree = $("#raterAgree").val(); var raterAgreeNotes = $("#raterAgreeNotes").val(); var pcpID = $("#pcpID").val(); var userID = $("#userID").val(); var empRecordID = $("#SelectedRecordID").val(); var GetPCPYear = $("#GetPCPYear").val(); var GetPCPSemester = $("#GetPCPSemester").val(); if(raterAgree ==""){ Swal.fire({ icon: 'error', title: 'Invald Entry', text: 'Please select from the list to continue.' //footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) return false; } ShowUploadBar(); $.ajax({ url: "./pef/confirmPEFByEmployee.php", type: "POST", async: true, data: { "empCon":1, "raterAgree":raterAgree, "raterAgreeNotes":raterAgreeNotes, "pcpID": pcpID, "userID": userID, "empRecordID": empRecordID, "GetPCPYear": GetPCPYear, "GetPCPSemester": GetPCPSemester }, success: function(x){ ShowUploadBar(); Swal.fire({ icon: 'success', title: 'PEF Confirmed', text: 'Your PEF has been confirmed and routed to your next higher head for final approval.' //footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) } }) }); $("#updatePartII").click(function(){ var wpPartOne = $('#wpPartOne').val(); var wpPartOnePercentile = $('#wpPartOnePercentile').val(); var wpPartOneAdjectival = $('#wpPartOneAdjectival').val(); var wpPartOneWP = $('#wpPartOneWP').val(); var partTwoNR = $('#partTwoNR').val(); var perCentilePTwo = $('#perCentilePTwo').val(); var adjPTow = $('#adjPTow').val(); var wpPartTwo = $('#wpPartTwo').val(); var wpPartOneTwoWP = $('#wpPartOneTwoWP').val(); var wpPartTwoAdj = $('#wpPartTwoAdj').val(); var pefApproverCount = $("#pefApproverCount").val(); var pefApprover = $("#pefApproverEntry").val(); var pefApproverEntry = eval(pefApprover) + 1; var facA = $('#facA').val(); var facB = $('#facB').val(); var facC = $('#facC').val(); var facD = $('#facD').val(); var facE = $('#facE').val(); var facF = $('#facF').val(); var facG = $('#facG').val(); var facH = $('#facH').val(); var facI = $('#facI').val(); var facJ = $('#facJ').val(); var facK = $('#facK').val(); if(facA== "" || facB== "" || facC== "" || facD== "" || facE== "" || facF== "" || facG== "" || facH== "" || facI== "" || facJ== "" || facK== "" ){ Swal.fire({ icon: 'error', title: 'Invald Entry', text: 'All fields are required. Please check your entry and try again.' //footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) return false; } var wCodeA = $('#wCodeA').val(); var wCodeB = $('#wCodeB').val(); var wCodeC = $('#wCodeC').val(); var wCodeD = $('#wCodeD').val(); var wCodeE = $('#wCodeE').val(); var wCodeF = $('#wCodeF').val(); var wCodeG = $('#wCodeG').val(); var wCodeH = $('#wCodeH').val(); var wCodeI = $('#wCodeI').val(); var wCodeJ = $('#wCodeJ').val(); var wCodeK = $('#wCodeK').val(); var nCodeA = $('#nCodeA').val(); var nCodeB = $('#nCodeB').val(); var nCodeC = $('#nCodeC').val(); var nCodeD = $('#nCodeD').val(); var nCodeE = $('#nCodeE').val(); var nCodeF = $('#nCodeF').val(); var nCodeG = $('#nCodeG').val(); var nCodeH = $('#nCodeH').val(); var nCodeI = $('#nCodeI').val(); var nCodeJ = $('#nCodeJ').val(); var nCodeK = $('#nCodeK').val(); var ncNoteA = $('#ncNoteA').val(); var ncNoteB = $('#ncNoteB').val(); var ncNoteC = $('#ncNoteC').val(); var ncNoteD = $('#ncNoteD').val(); var ncNoteE = $('#ncNoteE').val(); var ncNoteF = $('#ncNoteF').val(); var ncNoteG = $('#ncNoteG').val(); var ncNoteH = $('#ncNoteH').val(); var ncNoteI = $('#ncNoteI').val(); var ncNoteJ = $('#ncNoteJ').val(); var ncNoteK = $('#ncNoteK').val(); var rateeStrength = $('#rateeStrength').val(); var rateeImprovement = $('#rateeImprovement').val(); var rateeCompetenciesNotes = $('#rateeCompetenciesNotes').val(); var rateeCompetencies = $('#rateeCompetencies').val(); var rateeSuitability = $('#rateeSuitability').val(); var rateeSuitabilityNotes = $('#rateeSuitabilityNotes').val(); var rateePotential = $('#rateePotential').val(); var rateePotentialNotes = $('#rateePotentialNotes').val(); var pcpID = $("#pcpID").val(); var userID = $("#userID").val(); var empRecordID = $("#SelectedRecordID").val(); //var SelectedEmployeeID = $("#SelectedEmployeeID").val(); var GetPCPYear = $("#GetPCPYear").val(); var GetPCPSemester = $("#GetPCPSemester").val(); Swal.fire({ title: 'Are you sure you want to submit this PEF evaluation?', text: "You won't be able to revert this!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, Post & Submit' }).then((result) => { if (result.isConfirmed) { if(pefApproverCount == pefApproverEntry){ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ShowUploadBar(); $.ajax({ url: "./pef/saveEmployeeApprovedPEFinal.php", type: "POST", async: true, data: { "rateeCompetencies": rateeCompetencies, "rateeCompetenciesNotes": rateeCompetenciesNotes, "rateeSuitability": rateeSuitability, "rateeSuitabilityNotes": rateeSuitabilityNotes, "rateePotential":rateePotential, "rateePotentialNotes":rateePotentialNotes, "rateeImprovement":rateeImprovement, "rateeStrength":rateeStrength, "pcpID": pcpID, "userID": userID, "empRecordID": empRecordID, //"SelectedEmployeeID": SelectedEmployeeID, "GetPCPYear": GetPCPYear, "GetPCPSemester": GetPCPSemester, "wpPartOne":wpPartOne, "wpPartOnePercentile":wpPartOnePercentile, "wpPartOneAdjectival":wpPartOneAdjectival, "wpPartOneWP":wpPartOneWP, "partTwoNR": partTwoNR, "perCentilePTwo": perCentilePTwo, "adjPTow": adjPTow, "wpPartTwo": wpPartTwo, "wpPartOneTwoWP": wpPartOneTwoWP, "wpPartTwoAdj": wpPartTwoAdj, "facA": facA, "facB": facB, "facC": facC, "facD": facD, "facE": facE, "facF": facF, "facG": facG, "facH": facH, "facI": facI, "facJ": facJ, "facK": facK, "nCodeA": nCodeA, "nCodeB": nCodeB, "nCodeC": nCodeC, "nCodeD": nCodeD, "nCodeE": nCodeE, "nCodeF": nCodeF, "nCodeG": nCodeG, "nCodeH": nCodeH, "nCodeI": nCodeI, "nCodeJ": nCodeJ, "nCodeK": nCodeK, "wCodeA": wCodeA, "wCodeB": wCodeB, "wCodeC": wCodeC, "wCodeD": wCodeD, "wCodeE": wCodeE, "wCodeF": wCodeF, "wCodeG": wCodeG, "wCodeH": wCodeH, "wCodeI": wCodeI, "wCodeJ": wCodeJ, "wCodeK": wCodeK, "ncNoteA": ncNoteA, "ncNoteB": ncNoteB, "ncNoteC": ncNoteC, "ncNoteD": ncNoteD, "ncNoteE": ncNoteE, "ncNoteF": ncNoteF, "ncNoteG": ncNoteG, "ncNoteH": ncNoteH, "ncNoteI": ncNoteI, "ncNoteJ": ncNoteJ, "ncNoteK": ncNoteK, "pefApproverCount":pefApproverCount, "pefApproverEntry":pefApproverEntry, "savePEF": 1 }, success: function(x){ $("#messageNote").html(x); Swal.fire({ icon: 'success', title: 'Approved PEF', text: 'PEF has been approved and return to employee for confirmation.' //footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) updateInbox(); ShowUploadBar(); } }) //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ }else{ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ShowUploadBar(); $.ajax({ url: "./pef/saveEmployeeApprovedPEF.php", type: "POST", async: true, data: { "rateeCompetencies": rateeCompetencies, "rateeCompetenciesNotes": rateeCompetenciesNotes, "rateeSuitability": rateeSuitability, "rateeSuitabilityNotes": rateeSuitabilityNotes, "rateePotential":rateePotential, "rateePotentialNotes":rateePotentialNotes, "rateeImprovement":rateeImprovement, "rateeStrength":rateeStrength, "pcpID": pcpID, "userID": userID, "empRecordID": empRecordID, //"SelectedEmployeeID": SelectedEmployeeID, "GetPCPYear": GetPCPYear, "GetPCPSemester": GetPCPSemester, "wpPartOne":wpPartOne, "wpPartOnePercentile":wpPartOnePercentile, "wpPartOneAdjectival":wpPartOneAdjectival, "wpPartOneWP":wpPartOneWP, "partTwoNR": partTwoNR, "perCentilePTwo": perCentilePTwo, "adjPTow": adjPTow, "wpPartTwo": wpPartTwo, "wpPartOneTwoWP": wpPartOneTwoWP, "wpPartTwoAdj": wpPartTwoAdj, "facA": facA, "facB": facB, "facC": facC, "facD": facD, "facE": facE, "facF": facF, "facG": facG, "facH": facH, "facI": facI, "facJ": facJ, "facK": facK, "nCodeA": nCodeA, "nCodeB": nCodeB, "nCodeC": nCodeC, "nCodeD": nCodeD, "nCodeE": nCodeE, "nCodeF": nCodeF, "nCodeG": nCodeG, "nCodeH": nCodeH, "nCodeI": nCodeI, "nCodeJ": nCodeJ, "nCodeK": nCodeK, "wCodeA": wCodeA, "wCodeB": wCodeB, "wCodeC": wCodeC, "wCodeD": wCodeD, "wCodeE": wCodeE, "wCodeF": wCodeF, "wCodeG": wCodeG, "wCodeH": wCodeH, "wCodeI": wCodeI, "wCodeJ": wCodeJ, "wCodeK": wCodeK, "ncNoteA": ncNoteA, "ncNoteB": ncNoteB, "ncNoteC": ncNoteC, "ncNoteD": ncNoteD, "ncNoteE": ncNoteE, "ncNoteF": ncNoteF, "ncNoteG": ncNoteG, "ncNoteH": ncNoteH, "ncNoteI": ncNoteI, "ncNoteJ": ncNoteJ, "ncNoteK": ncNoteK, "pefApproverCount":pefApproverCount, "pefApproverEntry":pefApproverEntry, "savePEF": 1 }, success: function(x){ $("#messageNote").html(x); Swal.fire({ icon: 'success', title: 'Approved PEF', text: 'PEF has been approved and return to employee for confirmation.' //footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) updateInbox(); ShowUploadBar(); } }) //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ } } }) }); $('#pefPerformanceFactors').on("click", "tr td", function(){ var data = $(this).text(); var dCell =$(this).index(); if(dCell == 4){ //alert('saving all the best'); } }); function computWP(row){ //alert('text'); var x=row.cells; document.getElementById("factorID").value = x[0].innerHTML; } </script> <script> function updateInbox(){ var userID = $("#userID").val(); var getEmpRecordID = $("#SelectedRecordID").val(); var myMessage ="PERFORMANCE EVALUATION FORM Updates has been posted for your review and approval."; var mySubject="PEF UPDATES"; ShowUploadBar(); $.ajax({ url: "./pef/updateInbox.php", type: "POST", async: true, data :{ "inbox":1, "userID":userID, "getEmpRecordID":getEmpRecordID, "myMessage":myMessage, "mySubject":mySubject }, success: function(){ ShowUploadBar(); } }) } function updatePercentage(){ var perCentilePTwoX = $('#perCentilePTwo').val(); perCentilePTwo = perCentilePTwoX.replace("%", ""); if(perCentilePTwo > 0 && perCentilePTwo < 50){ $("#adjPTow").val("POOR"); }else if(perCentilePTwo > 50.995 && perCentilePTwo < 75){ $("#adjPTow").val("BELOW SATISFACTORY"); }else if(perCentilePTwo > 74.995 && perCentilePTwo < 80){ $("#adjPTow").val("LOW SATISFACTORY"); }else if(perCentilePTwo > 79.995 && perCentilePTwo < 85){ $("#adjPTow").val("HIGH SATISFACTORY"); }else if(perCentilePTwo > 84.995 && perCentilePTwo < 90){ $("#adjPTow").val("VERY SATISFACTORY"); }else{ $("#adjPTow").val("EXCELLENT"); } var wpPartTwo = eval(perCentilePTwo) * 0.3; var wpPartTwoP = wpPartTwo.toFixed(2) + "%"; $("#wpPartTwo").val(wpPartTwoP); //$wpPartTwo = $perCentilePTwo * 0.3; wpPartTwo //wpPartOneWP wpPartOneTwoWP wpPartTwoAdj var wpPartOneWP = $('#wpPartOneWP').val(); var wpPartTwo = $('#wpPartTwo').val(); var PA = wpPartOneWP.replace("%",""); var PB = wpPartTwo.replace("%",""); var POneTwoTotal = eval(PA) + eval(PB); var POneTwoTotalG = POneTwoTotal.toFixed(2) + "%"; $("#wpPartOneTwoWP").val(POneTwoTotalG); if(POneTwoTotal > 0 && POneTwoTotal < 50){ $("#wpPartTwoAdj").val("POOR"); }else if(POneTwoTotal > 50.995 && POneTwoTotal < 75){ $("#wpPartTwoAdj").val("BELOW SATISFACTORY"); }else if(POneTwoTotal > 74.995 && POneTwoTotal < 80){ $("#wpPartTwoAdj").val("LOW SATISFACTORY"); }else if(POneTwoTotal > 79.995 && POneTwoTotal < 85){ $("#wpPartTwoAdj").val("HIGH SATISFACTORY"); }else if(POneTwoTotal > 84.995 && POneTwoTotal < 90){ $("#wpPartTwoAdj").val("VERY SATISFACTORY"); }else{ $("#wpPartTwoAdj").val("EXCELLENT"); } } document.getElementById("facA").addEventListener("keyup", facA); function facA() { var uInput = $("#facA").val(); var uWeight = $("#wCodeA").val(); var totaPtwoWeightX = $("#partTwoNR").val(); var oldVal = $("#nCodeA").val(); if(isNaN(uInput)){ return false; } if(oldVal > 0){ var totaPtwoWeight = eval(totaPtwoWeightX) - eval(oldVal); }else{ var totaPtwoWeight = eval(totaPtwoWeightX); } if(uInput >5){ $("#facA").val('0'); return false; } var percentage = uWeight.replace("%", ""); var weighInPercent = percentage / 100; uValue = uInput * weighInPercent; tValue = eval(uValue) + eval(totaPtwoWeight); $("#nCodeA").val(uValue.toFixed(3)); $("#partTwoNR").val(tValue.toFixed(3)); perCentile = (((tValue/5)*0.5) + 0.5)*100; perCentileX = perCentile.toFixed(2) + "%" $("#perCentilePTwo").val(perCentileX); updatePercentage(); } document.getElementById("facB").addEventListener("keyup", facB); function facB() { var uInput = $("#facB").val(); var uWeight = $("#wCodeB").val(); if(isNaN(uInput)){ return false; } var totaPtwoWeightX = $("#partTwoNR").val(); var oldVal = $("#nCodeB").val(); if(oldVal > 0){ var totaPtwoWeight = eval(totaPtwoWeightX) - eval(oldVal); }else{ var totaPtwoWeight = eval(totaPtwoWeightX); } var percentage = uWeight.replace("%", ""); var weighInPercent = percentage / 100; if(uInput >5){ $("#facB").val('0'); return false; } uValue = uInput * weighInPercent; tValue = eval(uValue) + eval(totaPtwoWeight); $("#nCodeB").val(uValue.toFixed(3)); $("#partTwoNR").val(tValue.toFixed(3)); perCentile = (((tValue/5)*0.5) + 0.5)*100; perCentileX = perCentile.toFixed(2) + "%" $("#perCentilePTwo").val(perCentileX); updatePercentage(); } document.getElementById("facC").addEventListener("keyup", facC); function facC() { var uInput = $("#facC").val(); var uWeight = $("#wCodeC").val(); if(isNaN(uInput)){ return false; } var totaPtwoWeightX = $("#partTwoNR").val(); var oldVal = $("#nCodeC").val(); if(oldVal > 0){ var totaPtwoWeight = eval(totaPtwoWeightX) - eval(oldVal); }else{ var totaPtwoWeight = eval(totaPtwoWeightX); } var percentage = uWeight.replace("%", ""); var weighInPercent = percentage / 100; if(uInput >5){ $("#facC").val('0'); return false; } uValue = uInput * weighInPercent; tValue = eval(uValue) + eval(totaPtwoWeight); $("#nCodeC").val(uValue.toFixed(3)); $("#partTwoNR").val(tValue.toFixed(3)); perCentile = (((tValue/5)*0.5) + 0.5)*100; perCentileX = perCentile.toFixed(2) + "%" $("#perCentilePTwo").val(perCentileX); updatePercentage(); } document.getElementById("facD").addEventListener("keyup", facD); function facD() { var uInput = $("#facD").val(); var uWeight = $("#wCodeD").val(); if(isNaN(uInput)){ return false; } var totaPtwoWeightX = $("#partTwoNR").val(); var oldVal = $("#nCodeD").val(); if(oldVal > 0){ var totaPtwoWeight = eval(totaPtwoWeightX) - eval(oldVal); }else{ var totaPtwoWeight = eval(totaPtwoWeightX); } var percentage = uWeight.replace("%", ""); var weighInPercent = percentage / 100; if(uInput >5){ $("#facD").val('0'); return false; } uValue = uInput * weighInPercent; tValue = eval(uValue) + eval(totaPtwoWeight); $("#nCodeD").val(uValue.toFixed(3)); $("#partTwoNR").val(tValue.toFixed(3)); perCentile = (((tValue/5)*0.5) + 0.5)*100; perCentileX = perCentile.toFixed(2) + "%" $("#perCentilePTwo").val(perCentileX); updatePercentage(); } document.getElementById("facE").addEventListener("keyup", facE); function facE() { var uInput = $("#facE").val(); var uWeight = $("#wCodeE").val(); if(isNaN(uInput)){ return false; } var totaPtwoWeightX = $("#partTwoNR").val(); var oldVal = $("#nCodeE").val(); if(oldVal > 0){ var totaPtwoWeight = eval(totaPtwoWeightX) - eval(oldVal); }else{ var totaPtwoWeight = eval(totaPtwoWeightX); } var percentage = uWeight.replace("%", ""); var weighInPercent = percentage / 100; if(uInput >5){ $("#facE").val('0'); return false; } uValue = uInput * weighInPercent; tValue = eval(uValue) + eval(totaPtwoWeight); $("#nCodeE").val(uValue.toFixed(3)); $("#partTwoNR").val(tValue.toFixed(3)); perCentile = (((tValue/5)*0.5) + 0.5)*100; perCentileX = perCentile.toFixed(2) + "%" $("#perCentilePTwo").val(perCentileX); updatePercentage(); } document.getElementById("facF").addEventListener("keyup", facF); function facF() { var uInput = $("#facF").val(); var uWeight = $("#wCodeF").val(); if(isNaN(uInput)){ return false; } var totaPtwoWeightX = $("#partTwoNR").val(); var oldVal = $("#nCodeF").val(); if(oldVal > 0){ var totaPtwoWeight = eval(totaPtwoWeightX) - eval(oldVal); }else{ var totaPtwoWeight = eval(totaPtwoWeightX); } var percentage = uWeight.replace("%", ""); var weighInPercent = percentage / 100; if(uInput >5){ $("#facF").val('0'); return false; } uValue = uInput * weighInPercent; tValue = eval(uValue) + eval(totaPtwoWeight); $("#nCodeF").val(uValue.toFixed(3)); $("#partTwoNR").val(tValue.toFixed(3)); perCentile = (((tValue/5)*0.5) + 0.5)*100; perCentileX = perCentile.toFixed(2) + "%" $("#perCentilePTwo").val(perCentileX); updatePercentage(); } document.getElementById("facG").addEventListener("keyup", facG); function facG() { var uInput = $("#facG").val(); var uWeight = $("#wCodeG").val(); if(isNaN(uInput)){ return false; } var totaPtwoWeightX = $("#partTwoNR").val(); var oldVal = $("#nCodeG").val(); if(oldVal > 0){ var totaPtwoWeight = eval(totaPtwoWeightX) - eval(oldVal); }else{ var totaPtwoWeight = eval(totaPtwoWeightX); } var percentage = uWeight.replace("%", ""); var weighInPercent = percentage / 100; if(uInput >5){ $("#facG").val('0'); return false; } uValue = uInput * weighInPercent; tValue = eval(uValue) + eval(totaPtwoWeight); $("#nCodeG").val(uValue.toFixed(3)); $("#partTwoNR").val(tValue.toFixed(3)); perCentile = (((tValue/5)*0.5) + 0.5)*100; perCentileX = perCentile.toFixed(2) + "%" $("#perCentilePTwo").val(perCentileX); updatePercentage(); } document.getElementById("facH").addEventListener("keyup", facH); function facH() { var uInput = $("#facH").val(); var uWeight = $("#wCodeH").val(); if(isNaN(uInput)){ return false; } var totaPtwoWeightX = $("#partTwoNR").val(); var oldVal = $("#nCodeH").val(); if(oldVal > 0){ var totaPtwoWeight = eval(totaPtwoWeightX) - eval(oldVal); }else{ var totaPtwoWeight = eval(totaPtwoWeightX); } var uInput = $("#facH").val(); var uWeight = $("#wCodeH").val(); var percentage = uWeight.replace("%", ""); var weighInPercent = percentage / 100; if(uInput >5){ $("#facH").val('0'); return false; } uValue = uInput * weighInPercent; tValue = eval(uValue) + eval(totaPtwoWeight); $("#nCodeH").val(uValue.toFixed(3)); $("#partTwoNR").val(tValue.toFixed(3)); perCentile = (((tValue/5)*0.5) + 0.5)*100; perCentileX = perCentile.toFixed(2) + "%" $("#perCentilePTwo").val(perCentileX); updatePercentage(); } document.getElementById("facI").addEventListener("keyup", facI); function facI() { var uInput = $("#facI").val(); var uWeight = $("#wCodeI").val(); if(isNaN(uInput)){ return false; } var totaPtwoWeightX = $("#partTwoNR").val(); var oldVal = $("#nCodeI").val(); if(oldVal > 0){ var totaPtwoWeight = eval(totaPtwoWeightX) - eval(oldVal); }else{ var totaPtwoWeight = eval(totaPtwoWeightX); } var percentage = uWeight.replace("%", ""); var weighInPercent = percentage / 100; if(uInput >5){ $("#facI").val('0'); return false; } uValue = uInput * weighInPercent; tValue = eval(uValue) + eval(totaPtwoWeight); $("#nCodeI").val(uValue.toFixed(3)); $("#partTwoNR").val(tValue.toFixed(3)); perCentile = (((tValue/5)*0.5) + 0.5)*100; perCentileX = perCentile.toFixed(2) + "%" $("#perCentilePTwo").val(perCentileX); updatePercentage(); } document.getElementById("facJ").addEventListener("keyup", facJ); function facJ() { var uInput = $("#facJ").val(); var uWeight = $("#wCodeJ").val(); if(isNaN(uInput)){ return false; } var totaPtwoWeightX = $("#partTwoNR").val(); var oldVal = $("#nCodeJ").val(); if(oldVal > 0){ var totaPtwoWeight = eval(totaPtwoWeightX) - eval(oldVal); }else{ var totaPtwoWeight = eval(totaPtwoWeightX); } var percentage = uWeight.replace("%", ""); var weighInPercent = percentage / 100; if(uInput >5){ $("#facJ").val('0'); return false; } uValue = uInput * weighInPercent; tValue = eval(uValue) + eval(totaPtwoWeight); $("#nCodeJ").val(uValue.toFixed(3)); $("#partTwoNR").val(tValue.toFixed(3)); perCentile = (((tValue/5)*0.5) + 0.5)*100; perCentileX = perCentile.toFixed(2) + "%" $("#perCentilePTwo").val(perCentileX); updatePercentage(); } document.getElementById("facK").addEventListener("keyup", facK); function facK() { var uInput = $("#facK").val(); var uWeight = $("#wCodeK").val(); if(isNaN(uInput)){ return false; } var totaPtwoWeightX = $("#partTwoNR").val(); var oldVal = $("#nCodeK").val(); if(oldVal > 0){ var totaPtwoWeight = eval(totaPtwoWeightX) - eval(oldVal); }else{ var totaPtwoWeight = eval(totaPtwoWeightX); } var percentage = uWeight.replace("%", ""); var weighInPercent = percentage / 100; if(uInput >5){ $("#facK").val('0'); return false; } uValue = uInput * weighInPercent; tValue = eval(uValue) + eval(totaPtwoWeight); $("#nCodeK").val(uValue.toFixed(3)); $("#partTwoNR").val(tValue.toFixed(3)); perCentile = (((tValue/5)*0.5) + 0.5)*100; perCentileX = perCentile.toFixed(2) + "%" $("#perCentilePTwo").val(perCentileX); updatePercentage(); } </script>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings