File manager - Edit - /home/autoph/public_html/pms_v1/mar/viewMARData.php
Back
<?php include_once("../../../cfg/conn.php"); //error_reporting(0); if(isset($_POST['marData'])){ $groupByKRA = 0; $count = 0; $kpiCount = 0; $viewConfirmButton="none"; $rateeNotes=""; $myNumericalRating=0; $totalWeightMainKRA=0; $approverTargetDate = ""; $approveSaveButton = "none"; $approverChkBox = "DISABLED"; $employeePostButton = "block"; $approverButton="hidden"; $LockNotes="none"; $confirmRadioButton="DISABLED"; $marTag=""; $rateeValue = ""; $marData = $_POST['marData']; $rateeValue =""; if($marData == 2){ //SAVE MAR DATA ENTRY $marStatus = $_POST['marStatus']; $pcpHeaderID = $_POST['pcpHeaderID']; $marActual = $_POST['marActual']; $marScore = $_POST['marScore']; $userID = $_POST['userID']; $myVarianceNo = $_POST['myVarianceNo']; $marAddVarianceDesc = $_POST['marAddVarianceDesc']; $getActiveMARKPI = $_POST['getActiveMARKPI']; $marHeaderID = $_POST['marHeaderID']; $myTarget =$_POST['myTarget']; $GetMARYear = $_POST['GetMARYear']; $GetMARSemester = $_POST['GetMARSemester']; $getMARMonth = $_POST['getMARMonth']; $SelectedEmployeeID = $_POST['SelectedEmployeeID']; // Employee Company ID $SelectedRecordID = $_POST['SelectedRecordID'];// Employee record ID //get unit ID record to be inserted to MAR Data for later unit report use $gtUnitID = "SELECT * FROM `pms_employee_data` WHERE `id`='$SelectedRecordID' LIMIT 1"; $qUnit = mysqli_query($conn,$gtUnitID); while($row=mysqli_fetch_array($qUnit)){ $positionID = $row['position']; $SectionID = $row['unit_id']; $DepartmentID = $row['department_id']; $DivisionID = $row['division_id']; $GroupID = $row['sub_group_id']; $BranchID = $row['branch_id']; $CompanyID = $row['comp_id']; } $gKRAID = "SELECT * FROM `pcp_employee_data` WHERE `pcp_kpi_id` ='$getActiveMARKPI' AND `deleted`=0 LIMIT 1"; $getKRAW = mysqli_query($conn,$gKRAID); while($kKra = mysqli_fetch_array($getKRAW)){ $activeKRAIDByKPI = $kKra['pcp_kra_id']; // EMPLOYEE KRA $pcpKPIWeight = $kKra['pcp_weight']; // EMPLOYEE KRA WEIGHT $qType = $kKra=['q_type']; } if($qType==="QTY"){ $gNM = "SELECT * FROM `gps_quantity` WHERE $marScore BETWEEN from_percentage AND to_percentage"; }else{ $gNM = "SELECT * FROM `gps_quantity` WHERE $marScore BETWEEN from_percentage AND to_percentage"; } $getNM = mysqli_query($conn,$gNM); while($nm = mysqli_fetch_array($getNM)){ $myNumericalRating = $nm['to_numeric']; } //CHECK IF RECORD EXIST. IF YES, EXECUTE DATA EDITING. IF NOT EXECUTE DATA INSERTION //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ $ckhEntry = "SELECT * FROM `mar_emp_data` WHERE `emp_rec_id` ='$SelectedEmployeeID' AND `pcp_id`='$pcpHeaderID' AND `mar_header_id`='$marHeaderID' AND `kpi_id`='$getActiveMARKPI' AND deleted=0"; $ckEntry = mysqli_query($conn,$ckhEntry); $chkIfExist = mysqli_num_rows($ckEntry); if($chkIfExist > 0){ //echo "<script>alert('Arnel' + $chkIfExist)</script>"; $updateMARD = "UPDATE `mar_emp_data` SET `mar_actual` = '$marActual', `my_score` ='$marScore', `mar_variance_no` = '$myVarianceNo', `mar_variance_desc` = '$marAddVarianceDesc', `mar_numerical_rating` = '$myNumericalRating', `mar_modified_by` = '$userID', `mar_date_modified` = '$myTimeStamp' WHERE `emp_rec_id` ='$SelectedEmployeeID' AND `pcp_id`='$pcpHeaderID' AND `mar_header_id`='$marHeaderID' AND `kra_id`='$activeKRAIDByKPI' AND `kpi_id`='$getActiveMARKPI'"; if ($conn->query($updateMARD) === TRUE) { //echo "New record created successfully"; } else { //echo "Error: " . $sql . "<br>" . $conn->error; } }else{ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ $sql = "INSERT INTO mar_emp_data ( `id`, `emp_rec_id`, `emp_id`, `pcp_id`, `mar_header_id`, `kra_id`, `kpi_id`, `mar_weight`, `mar_target`, `mar_actual`, `my_score`, `mar_variance_no`, `mar_variance_desc`, `mar_numerical_rating`, `mar_year_data`, `mar_month_data`, `mar_semester_data`, `mar_created_by`, `mar_date_created`, `position`, `unit_id`, `department_id`, `division_id`, `sub_group_id`, `branch_id`, `comp_id`) VALUES ( '', '$SelectedRecordID', '$SelectedEmployeeID', '$pcpHeaderID', '$marHeaderID', '$activeKRAIDByKPI', '$getActiveMARKPI', '$pcpKPIWeight', '$myTarget', '$marActual', '$marScore', '$myVarianceNo', '$marAddVarianceDesc', '$myNumericalRating', '$GetMARYear', '$getMARMonth', '$GetMARSemester', '$userID', '$myTimeStamp', '$positionID', '$SectionID', '$DepartmentID', '$DivisionID', '$GroupID', '$BranchID', '$CompanyID')"; if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } } }else{ $marStatus = $_POST['marStatus']; $SelectedRecordID = $_POST['SelectedRecordID']; $marHeaderID = $_POST['marHeaderID']; $pcpHeaderID = $_POST['groupKRAid']; $GetMARYear = $_POST['GetMARYear']; $GetMARSemester = $_POST['GetMARSemester']; $getMARMonth = $_POST['getMARMonth']; $userID = $_POST['userID']; } //$marStatus="POSTED"; // check if mar is posted or not if($marStatus === "POSTED"){ }else{ } //Check if posted and not yet approved and confirmed $chkConfirmButton = "SELECT * FROM `mar_emp_header` WHERE `id` ='$marHeaderID' AND `deleted`=0 AND `mar_posted`=0 AND `mar_approved`=0 AND `ratee_agreement`=0 LIMIT 1"; $isButConfirmed = mysqli_query($conn,$chkConfirmButton); $conButtonYesNo = mysqli_num_rows($isButConfirmed); if($conButtonYesNo > 0){ $employeePostButton = "block"; $approverChkBox = "DISABLED"; $approverTargetDate = ""; $approveSaveButton = "none"; $approverButton="hidden"; $confirmRadioButton="DISABLED"; $confirmTextArea="DISABLED"; $viewConfirmButton="none"; } //Check if Approved or note $chkConfirmButton = "SELECT * FROM `mar_emp_header` WHERE `id` ='$marHeaderID' AND `deleted`=0 AND `mar_posted`=1 AND `mar_approved`=0 AND `ratee_agreement`=0 LIMIT 1"; $isButConfirmed = mysqli_query($conn,$chkConfirmButton); $conButtonYesNo = mysqli_num_rows($isButConfirmed); if($conButtonYesNo > 0){ $employeePostButton = "none"; $approverChkBox = ""; $approverTargetDate = "contenteditable"; $approveSaveButton = "block"; $approverButton="visible"; $LockNotes="block"; $confirmRadioButton="DISABLED"; $confirmTextArea="DISABLED"; $viewConfirmButton="none"; $marTag="Posted: Routed for Head Approval"; } //Check if confirmed or not $chkConfirmButton = "SELECT * FROM `mar_emp_header` WHERE `id` ='$marHeaderID' AND `deleted`=0 AND `mar_posted`=1 AND `mar_approved`=1 AND `ratee_agreement`=0 LIMIT 1"; $isButConfirmed = mysqli_query($conn,$chkConfirmButton); $conButtonYesNo = mysqli_num_rows($isButConfirmed); if($conButtonYesNo > 0){ while($not = mysqli_fetch_array($isButConfirmed)){ $rateeNotes= $not['ratee_notes']; $rateeValue = $not['ratee_actionValue']; } $employeePostButton = "none"; $approverChkBox = "DISABLED"; $approverTargetDate = ""; $approveSaveButton = "none"; $approverButton="hidden"; $LockNotes="block"; $confirmRadioButton=""; $confirmTextArea=""; $viewConfirmButton="Block"; $marTag="Approved: Routed for user confirmation"; } //Check if confirmed or not $chkConfirmButton = "SELECT * FROM `mar_emp_header` WHERE `id` ='$marHeaderID' AND `deleted`=0 AND `mar_posted`=1 AND `mar_approved`=1 AND `ratee_agreement`=1 LIMIT 1"; $isButConfirmed = mysqli_query($conn,$chkConfirmButton); $conButtonYesNo = mysqli_num_rows($isButConfirmed); if($conButtonYesNo > 0){ while($not = mysqli_fetch_array($isButConfirmed)){ $rateeNotes= $not['ratee_notes']; $rateeValue = $not['ratee_actionValue']; } $employeePostButton = "none"; $approverChkBox = "DISABLED"; $approverTargetDate = ""; $approveSaveButton = "none"; $approverButton="hidden"; $LockNotes="block"; $confirmRadioButton="DISABLED"; $confirmTextArea="DISABLED"; $viewConfirmButton="none"; $marTag="Approval complete: This record has been locked."; } //LOAD DATA $getKRAList = "SELECT * FROM `pcp_employee_data` WHERE `deleted`=0 AND `pcp_header_id` ='$pcpHeaderID' GROUP BY `pcp_kra_id` ASC"; //$getAreaList = "SELECT * FROM `pms_area_tbl` WHERE deleted ='0'"; $getKRA = mysqli_query($conn,$getKRAList); $statRow = mysqli_num_rows($getKRA); if($statRow > 0){ while($row = mysqli_fetch_array($getKRA)){ $nmCount = 0; $nmValue = 0; $nmValueR = 0; $count= $count + 1; $kraID = $row['pcp_kra_id']; $bgColor="#F7F7FA"; $bgColorB="#FBFBFB"; $border ="white"; $think= "0px"; $fontColor='gray'; //============================================================================================= ?><tr onclick="javascript:getKRARow(this);"><?php echo "<td style='width:5%;color:$fontColor;background:$bgColor;padding:10px;text-align:center;font-weight:bold;border:$think solid $border'>".$row['pcp_kra_id']."</td>"; echo "<td style='width:35%;color:$fontColor;background:$bgColor;padding:10px;font-weight:bold;font-size:16px;border:$think solid $border'>"; $getKRAWeight = "SELECT * FROM `kra_employee_tbl` WHERE `id` ='$kraID'"; $qKRAW = mysqli_query($conn,$getKRAWeight); while($kra = mysqli_fetch_array($qKRAW)){ echo $kra['kra_name']; $kraWeight = $kra['weight']; } echo "</td>"; echo "<td colspan='5' style='width:50%;color:$fontColor;background:$bgColor;padding:10px;font-weight:bold;font-size:16px;border:$think solid $border'>"; echo $kraWeight ; echo "</td>"; echo "<td style='width:5%;color:$fontColor;background:$bgColor;padding:0px;padding:10px;font-weight:bold;font-size:16px;border:$think solid $border'>"; $gtNMAverage = "SELECT * FROM `mar_emp_data` WHERE `kra_id` ='$kraID' AND `deleted`=0"; $nmAve = mysqli_query($conn,$gtNMAverage); $nmAveRow = mysqli_num_rows($nmAve); if($nmAveRow > 0){ while($nAve = mysqli_fetch_array($nmAve)){ $nmCount = $nmCount + 1; $nmValue = $nmValue + $nAve['mar_numerical_rating']; } $nmValueR = number_format(($nmValue / $nmCount),2,'.',''); echo $nmValueR; } echo "</td>"; echo "<td style='width:5%;color:$fontColor;background:$bgColor;padding:0px;padding:10px;font-weight:bold;font-size:16px;border:$think solid $border'>"; $weightMainKRA = (int)$kraWeight * $nmValueR; echo number_format(($weightMainKRA / 100),3,'.',''); $totalWeightMainKRA = $totalWeightMainKRA + number_format(($weightMainKRA / 100),3,'.',''); echo "</td>"; echo "</tr>"; //========================================================================================================================================== //========================================================================================================================================== echo "<tr>"; echo "<td style='width:5%;background:white;padding:0px'>".$kra['id']."</td>"; echo "<td colspan='8' style='width:60%;background:white;padding:0px;border:$think solid $border'>"; $getKPIByKRA = "SELECT * FROM `pcp_employee_data` WHERE `deleted`=0 AND `pcp_kra_id` ='$kraID'AND `pcp_header_id` ='$pcpHeaderID' GROUP BY `pcp_kpi_id`"; $getKPI = mysqli_query($conn,$getKPIByKRA); $statRow = mysqli_num_rows($getKPI); if($statRow > 0){ while($rowK = mysqli_fetch_array($getKPI)){ $marScore = ""; $martarget = ""; $marActual = ""; $varianceNo =""; $varianceDesc =""; $marNumericalRating =""; $marWeightedPoints =""; $pcpKPIID = $rowK['pcp_kpi_id']; ?><tr onclick="javascript:getKPIRow(this);" data-toggle="modal" data-target="#marOutputForm" ><?php $kpiCount = $kpiCount + 1; echo "<td style='width:5%;color:white;padding-left:15px;border:0px;background:white'>".$rowK['pcp_kpi_id']."</td>"; echo "<td style='width:30%;color:$fontColor;padding-left:25px;border:0px;background:white;font-size:14px;'>"; $getKRAWeight = "SELECT * FROM `kpi_employee` WHERE `id` ='".$rowK['pcp_kpi_id']."'"; $qKRAW = mysqli_query($conn,$getKRAWeight); while($kra = mysqli_fetch_array($qKRAW)){ echo $kra['kpi_name']; $pcpKPITarget = $kra['kpi_target']; } echo "</td>"; echo "<td style='width:5%;padding-left:15px;;border:$think solid $border;background:$bgColorB'></td>"; echo "<td style='width:5%;padding-left:15px;;border:$think solid $border;background:white;font-weigth:bold;color:red;font-size:14px'>"; echo $pcpKPITarget; $getMARData = "SELECT * FROM `mar_emp_data` WHERE `mar_header_id` ='$marHeaderID' AND `kra_id`='$kraID' AND `kpi_id`='$pcpKPIID' AND `emp_rec_id`='$SelectedRecordID'"; $mrData = mysqli_query($conn,$getMARData); while($mar = mysqli_fetch_array($mrData)){ $marScore = $mar['my_score']; $martarget = $mar['mar_target']; $marActual = $mar['mar_actual']; $varianceNo =$mar['mar_variance_no']; $varianceDesc =$mar['mar_variance_desc']; $marNumericalRating =$mar['mar_numerical_rating']; $marWeightedPoints =$mar['mar_weighted_points']; } echo "</td>"; //contenteditable echo "<td style='width:5%;padding-left:15px;;border:$think solid $border;background:$bgColorB;text-deecoraton:underline;color:blue;font-size:14px;'>"; echo $marActual; echo "</td>"; echo "<td style='width:5%;padding-left:15px;;border:$think solid $border;background:$bgColorB;font-size:14px;'>"; echo $marScore; echo "</td>"; //contenteditable echo "<td style='width:30%;padding-left:15px;;border:$think solid $border;background:white;font-size:14px;'>"; echo $varianceNo ." ".$varianceDesc; echo "</td>"; echo "<td style='width:5%;padding-left:15px;;border:$think solid $border;background:$bgColorB;font-size:14px;'>"; echo $marNumericalRating; echo "</td>"; echo "<td style='width:5%;padding-left:15px;;border:$think solid $border;background:$bgColorB;font-size:14px;'>"; echo "</td>"; echo "</tr>"; } } echo "</td>"; echo "</tr>"; //========================================================================================================================================== //========================================================================================================================================== } echo "<tr>"; echo "<td colspan=7 style='background:#F1F1EF;padding:8px;font-weight:bold;font-size:18px;color:#5A5957;text-align:right;border-top:1px solid gray;padding-top:30px'>PERFORMANCE RATING (sum of weighted points)</td>"; echo "<td colspan=2 style='background:#F1F1EF;padding:8px;font-weight:bold;font-size:18px;color:#5A5957;text-align:center;border-top:1px solid gray;padding-top:30px'>". $totalWeightMainKRA ."</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=7 style='background:#F1F1EF;padding:8px;font-weight:bold;font-size:18px;color:#5A5957;text-align:right '>PERCENTILE EQUIVALENT</td>"; echo "<td colspan=2 style='background:#F1F1EF;padding:8px;font-weight:bold;font-size:18px;color:#5A5957;text-align:center; '>"; $perCentile = 0; $perCentile = (($totalWeightMainKRA/5)*0.5) + 0.5; echo $perCentile * 100 . "%"; $adjEq = $perCentile * 100; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=7 style='background:#F1F1EF;padding:8px;font-weight:bold;font-size:18px;color:#5A5957;text-align:right;padding-bottom:30px'>ADJECTIVAL EQUIVALENT</td>"; echo "<td colspan=2 style='background:#F1F1EF;padding:8px;font-weight:bold;font-size:18px;color:#5A5957;text-align:center;;padding-bottom:30px'>"; $adjE = "SELECT * FROM `gps_adjectival_eq` WHERE $adjEq BETWEEN eq_percentage_from AND eq_percentage_to"; $getAdj = mysqli_query($conn,$adjE); while($nm = mysqli_fetch_array($getAdj)){ $eqAdjectival = $nm['eq_adjectival']; echo strtoupper($eqAdjectival); } echo "</td>"; echo "</tr>"; //========================================================================================================================================== echo "<tr>"; echo "<td colspan=9 style='background:gray;padding:8px;font-weight:bold;font-size:18px;color:white;text-align:center;border:1px solid gray'>OVERALL MONTHLY ASSESSMENT / ACTION TO BE TAKEN </td>"; echo "</tr>"; //========================================================================================================================================== //$marHeaderID echo "<tr>"; echo "<td colspan=6 style='vertical-align:top;background:white;padding:8px;font-weight:bold;font-size:12px;text-align:right;border:1px solid gray'>"; echo "<table style='width:100%' id='saveAction'>"; echo "<thead>"; echo "<th>A.</td>"; echo "<th colspan=2>ACTION / MEASURES TO BE TAKEN</td>"; echo "<th>TARGET DATE</td>"; echo "<th>RESPONSIBILITY</td>"; echo "<th>-</th>"; echo "</thead>"; $act = "SELECT * FROM `mar_actions` WHERE deleted=0 ORDER BY id ASC"; $actGet = mysqli_query($conn,$act); while($chk = mysqli_fetch_array($actGet)){ $isCheck = ""; $marTargetDate=""; $marPerson=""; $chkName = $chk['chkName']; $txtName = $chk['chkName']."-".$chk['id']; $actID = $chk['id']; //========================================= //check if this action is present in employees MAR record $chkAct = "SELECT * FROM `mar_actions_data` WHERE `emp_record_id`='$SelectedRecordID' AND `mar_header_id`='$marHeaderID' AND deleted=0 AND `action_id`='$actID'"; $chkAction = mysqli_query($conn,$chkAct); $chkActPresent = mysqli_num_rows($chkAction); if($chkActPresent > 0){ $isCheck="checked"; while($gMRD = mysqli_fetch_array($chkAction)){ $marTargetDate = $gMRD['action_date']; $marPerson = $gMRD['action_person']; } } //======================================================= ?><tr onclick="javascript:getActionData(this);"><?php echo "<td>".$chk['id']."</td>"; echo "<td><input $approverChkBox name=$chkName id=$chkName type='checkbox' $isCheck> </td>"; echo "<td > <span for='$chkName'>".$chk['action_item']."</span></td>"; echo "<td $approverTargetDate style='border-bottom:1px solid gray'>"; echo $marTargetDate; echo "</td>"; echo "<td $approverTargetDate $approverChkBox style='border-bottom:1px solid gray'>",$marPerson,"</td>"; echo "<td style='border-bottom:1px solid gray'><i class='fa fa-floppy-o' aria-hidden='true' style='display:$approveSaveButton'></i></td>"; echo "</tr>"; } echo "</table>"; if($approverButton ==="visible"){ echo "<div class='modal-footer' style='display:$approveSaveButton'>"; echo "<button data-dismiss='modal' class='btn btn-danger pl-2 pr-2 m-0 border-radius=0' id='approvedMAR' style='border-radius:0px'> <span class='btn-label'><i class='fa fa-flag-checkered'> APPROVE MAR (Dept. Head) </i></button>"; echo "<button data-dismiss='modal' class='btn btn-info pl-2 pr-2 m-0 border-radius=0' id='returnMAR' style='border-radius:0px'> <span class='btn-label'><i class='fa fa-flag-checkered'> Return (with Correction) </i></button>"; echo "</div>"; } echo "</td>"; echo "<td colspan=3 style='vertical-align:top;background:white;padding:8px;font-weight:bold;font-size:12px;text-align:center;border:1px solid gray'>"; echo "<table style='width:100%;height:100%' id='saveAction'>"; echo "<thead>"; echo "<th>B.</td>"; echo "<th colspan=2>COMMENTS BY THE EMPLOYEE- RATEE: </td>"; echo "</thead>"; //======================================================= ?><tr onclick="javascript:getRateeAction(this);"> <td style="background:white"></td> <td style="background:white"> <?php if($rateeValue =="Agree"){ $Agree="checked"; $PAgree=""; $DAgree=""; }else if($rateeValue==="Partially Agree"){ $Agree=""; $PAgree="checked"; $DAgree=""; }else if($rateeValue==="Disagree"){ $Agree=""; $PAgree=""; $DAgree="checked"; }else{ $Agree=""; $PAgree=""; $DAgree=""; } ?> <div class="radio-inline" style="padding:10px;background:white;height:100%;"> <input <?php echo $confirmRadioButton;?> id="RateeAgree" type="radio" name="rateAction" <?php echo $Agree;?>/> <label <?php echo $confirmRadioButton;?> class="radio-label" for="RateeAgree" > Agree</label> <br> <input <?php echo $confirmRadioButton;?> id="TotallyAgree" type="radio" name="rateAction"<?php echo $PAgree;?>/> <label <?php echo $confirmRadioButton;?> class="radio-label" for="TotallyAgree" > Partially Agree</label> <br> <input <?php echo $confirmRadioButton;?> id="DisAgree" type="radio" name="rateAction"<?php echo $DAgree;?>/> <label <?php echo $confirmRadioButton;?> class="radio-label" for="DisAgree" > Disagree</label> <div class="form-outline mb-2"><br> <label <?php echo $confirmRadioButton;?> class="form-label">Reason's for the Comment:</label> <textarea <?php echo $confirmRadioButton;?> class="form-control" id="txtComment" rows=4 style="min-height:100px;width:90%"><?php echo $rateeNotes; ?></textarea> </div> </div> </td> </tr> <?php echo "</table>"; echo "<div class='modal-footer' style='display:$viewConfirmButton;padding:20px;padding-top:80px'>"; echo "<button data-dismiss='modal' class='btn btn-danger pl-2 pr-2 m-0 border-radius=0' id='ConfirmApproval' style='border-radius:0px;align:center'> <span class='btn-label'><i class='fa fa-flag-checkered'> CONFIRM MAR </i></button>"; echo "</div>"; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=9 style='background:white;padding:8px;font-weight:bold;font-size:12px;text-align:center;border:1px solid gray'>"; echo "<input type='hidden' id='selActionID'>"; echo "<input type='hidden' id='selActionDate'>"; echo "<input type='hidden' id='selActionPerson'>"; echo "<input type='hidden' id='getMarHeader' value='".$marHeaderID."'>"; // echo "<input type='hidden' id='getEmpRecordID' value='".$SelectedRecordID."'>"; echo "<input type='hidden' id='appButton' value='".$approverButton."'>"; ?> <!-- Modal footer --> <div class="modal-footer"> <button data-toggle="collapse" data-dismiss="modal" class="btn btn-danger pl-2 pr-2 m-0 border-radius=0" id="postEmpPCPData" style="border-radius:0px;display:<?php echo $employeePostButton;?>"> <span class="btn-label"><i class="fa fa-flag-checkered"> POST & SUBMIT (Emp. Level) </i></button> <button class="btn btn-danger pageUpperRightMenu" onClick="window.open('./pdfViewer/mar_employeeview.php?pcpIDpdf=<?php echo $pcpHeaderID; ?>&source=<?php echo $userID;?>')"><span class="btn-label"><i class="fa fa-print"> Print</i></button> <button type="button" class="btn btn-secondary m-0" data-dismiss="modal" style="border-radius:0px;"> <span class="btn-label"><i class="fa fa-close"> Close </i></button> </div> <?php echo "<h5 style='display:$LockNotes;padding:5px;background:white;text-align:center;color:red'>".$marTag."</h5>"; echo "</td>"; echo "</tr>"; } $conn->close(); } ?> <script type="text/javascript"> //============================================================================================================================================ //============================================================================================================================================ //============================================================================================================================================ $("#btnApproval").click(function(){ var userID = $("#userID").val(); // //alert(userID); ShowUploadBar(); // return false; $.ajax({ url: "./mar/loadPendingApproval.php", type: "POST", async: true, data: { "userID":userID, "code":1 }, success: function(dx){ $("#pendingMARTable").html(dx); ShowUploadBar(); } }) }); $('#saveAction').on("click","tr td",function(row){ var data = $(this).text(); //get clicked column value var dCell = $(this).index(); //get clicked column value var appButton = $("#appButton").val(); var x = row.cells; if(appButton ==="hidden"){ return false; } //if(dCell == 5){ //===================================================== var selActionID = $("#selActionID").val(); var userID = $("#userID").val(); var selActionDate = $("#selActionDate").val(); var selActionPerson = $("#selActionPerson").val(); var getMarHeader = $("#getMarHeader").val(); var getEmpRecordID = $("#getEmpRecordID").val(); //alert(getEmpRecordID); ShowUploadBar(); $.ajax({ url: "./mar/saveActionData.php", method: 'POST', dataType: 'text', async:true, data: { "saveAction": 1,//view data only "selActionID":selActionID, "userID":userID, "selActionDate":selActionDate, "selActionPerson":selActionPerson, "getMarHeader": getMarHeader, "getEmpRecordID": getEmpRecordID }, success: function(d){ //$("#saveAction").html(d); //countRow(); ShowUploadBar(); } }); // } }); $("#approvedMAR").click(function(){ //===================================================== var userID = $("#userID").val(); var getMarHeader = $("#getMarHeader").val(); var getEmpRecordID = $("#getEmpRecordID").val(); Swal.fire({ title: 'APPROVE MAR', text: "Are you sure you want approve this MAR? You won't be able to revert this!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, Approve MAR!' }).then((result) => { if (result.isConfirmed) { ShowUploadBar(); $.ajax({ url: "./mar/approveMAR.php", method: 'POST', dataType: 'text', async:true, data: { "approveMAR": 1,//view data only "userID":userID, "getMarHeader": getMarHeader, "getEmpRecordID": getEmpRecordID }, success: function(d){ ShowUploadBar(); Swal.fire('MAR has been approved', '', 'info'); } }); } }) }); $("#returnMAR").click(function(){ //===================================================== var userID = $("#userID").val(); var getMarHeader = $("#getMarHeader").val(); var getEmpRecordID = $("#getEmpRecordID").val(); //alert(getMarHeader); Swal.fire({ title: 'RETURN MAR', text: "Are you sure you want to return this MAR to employee? You won't be able to revert this!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, Return MAR!' }).then((result) => { if (result.isConfirmed) { //PROCEED ACTION ShowUploadBar(); $.ajax({ url: "./mar/returnMAR.php", method: 'POST', dataType: 'text', async:true, data: { "approveMAR": 1,//view data only "userID":userID, "getMarHeader": getMarHeader, "getEmpRecordID": getEmpRecordID }, success: function(d){ ShowUploadBar(); Swal.fire('MAR has been approved', '', 'info'); } }); } }) }); </script> <script type="text/javascript"> //============================================================================================================================================ //============================================================================================================================================ //============================================================================================================================================ //============================================================================================================================================ $("#postEmpPCPData").click(function(){ var userID = $("#userID").val(); var getMarHeader = $("#getMarHeader").val(); var getEmpRecordID = $("#getEmpRecordID").val(); Swal.fire({ title: 'POST MY MAR?', text: "Are you sure you want POST this MAR and forward it to your next higher heads. You won't be able to revert this!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, POST it!' }).then((result) => { if (result.isConfirmed) { ShowUploadBar(); $.ajax({ url: "./mar/postMAR.php", type: "POST", async: true, data: { "userID":userID, "getMarHeader":getMarHeader, "getEmpRecordID":getEmpRecordID, "postMAR":1 }, success: function(dx){ ShowUploadBar(); Swal.fire('MAR has been posted', '', 'info'); } }) } }) }); $("#ConfirmApproval").click(function(){ var userID = $("#userID").val(); var getMarHeader = $("#getMarHeader").val(); var getEmpRecordID = $("#getEmpRecordID").val(); var txtComment = $("#txtComment").val(); if(document.getElementById('RateeAgree').checked) { var rateeActionValue ="Agree"; var isCheck=1; }else if(document.getElementById('TotallyAgree').checked) { var rateeActionValue ="Partially Agree"; } else{ var rateeActionValue ="Disagree"; } if(rateeActionValue === ""){ Swal.fire({ icon: 'error', title: 'Invalid', text: 'User action is required.', footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) return false; } Swal.fire({ title: 'CONFIRM MAR ', text: "Are you sure you want to confirm your MAR? You won't be able to revert this!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, POST it!' }).then((result) => { if (result.isConfirmed) { ShowUploadBar(); // return false; $.ajax({ url: "./mar/confirmMAR.php", type: "POST", async: true, data: { "userID":userID, "getMarHeader":getMarHeader, "getEmpRecordID":getEmpRecordID, "rateeActionValue":rateeActionValue, "txtComment":txtComment, "confirmMAR":1 }, success: function(dx){ ShowUploadBar(); Swal.fire('MAR has been posted', '', 'info'); } }) } }) }); </script>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings