File manager - Edit - /home/autoph/public_html/pms_v1/apr/ApproverSetup.php
Back
<?php session_start(); if(isset($_SESSION['userID'])) { // echo "Session ID is '" . $_SESSION['userID']; // echo "<br>PMS Name id " . $_SESSION['userID']; $uID = $_SESSION['userID']; } include_once("../../../cfg/conn.php"); error_reporting(0); if(isset($_POST['apr'])){ //============================================================================================================== //VALIDATE ACCESS ============================================================================================== //============================================================================================================== $roleID = userProfileID($userID); include ("../functions/users.php"); $roleID = userProfileID($uID); $moduleID = 20; $add =checkViewAccessM1024($roleID, $moduleID)[1]; $edit =checkViewAccessM1024($roleID, $moduleID)[2]; $delete =checkViewAccessM1024($roleID, $moduleID)[3]; $print =checkViewAccessM1024($roleID, $moduleID)[4]; $download =checkViewAccessM1024($roleID, $moduleID)[5]; echo "<input type='hidden' id='addAccess' value='$add'>"; echo "<input type='hidden' id='editAccess' value='$edit'>"; echo "<input type='hidden' id='deleteAccess' value='$delete'>"; echo "<input type='hidden' id='printAccess' value='$print'>"; echo "<input type='hidden' id='downloadAccess' value='$download'>"; echo "<input type='hidden' id='approverEmpNumber' value='$download'>"; if($add == 1){$addButton = '';}else{$addButton='Disabled';} if($edit == 1){$editButton = '';}else{$editButton='Disabled';} if($delete == 1){$deletButton = '';}else{$deletButton='Disabled';} if($print == 1){$printButton = '';}else{$printButton='Disabled';} if($download == 1){$downloadButton = '';}else{$downloadButton='Disabled';} if(checkViewAccessM1024($roleID, $moduleID)[0] == 0){ echo " <center><img src='./images/locked_out_icon.png' width='100' style='margin-top:100px'><img></center> "; 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>"; exit(); } //============================================================================================================== //VALIDATE ACCESS ============================================================================================== //============================================================================================================== ?> <style> .menuItem{ background:none; color:black; font-size:12px; text-decoration:none; } .menuItem:hover{ background:none; color:blue; font-size:12px; text-decoration:underline; } ul, #myUL { list-style-type: none; } #myUL { margin: 0; padding: 0; } .caret { cursor: pointer; -webkit-user-select: none; /* Safari 3.1+ */ -moz-user-select: none; /* Firefox 2+ */ -ms-user-select: none; /* IE 10+ */ user-select: none; font-size:14px; font-weight:normal; } .caret:hover{ cursor: pointer; -webkit-user-select: none; /* Safari 3.1+ */ -moz-user-select: none; /* Firefox 2+ */ -ms-user-select: none; /* IE 10+ */ user-select: none; color:blue; font-size:14px; text-decoration:none; font-weight:normal; } .caret::before { content: "+"; /*"\271A";*/ color: black; display: inline-block; margin-right: 6px; font-weight:bold; font-size:22px } .caret-down::before { content: "- "; font-weight:bold; font-size:22px /*-ms-transform: rotate(90deg); IE 9 */ /*-webkit-transform: rotate(90deg); /* Safari /*transform: rotate(90deg); */ } .nested { display: none; cursor: pointer; } .active { display: block; } </style> <div class="shadow-sm mb-3 pageHeaderContainer content-justify-right pt-2 pb-2" style="padding:0px;" > <div class="pageSearchHeader bg-white p-1 pt-1" > <h4 class="ml-3 mt-1"><i class="fa fa-file-text-o" style='color:#0471AC'> Setup Approver </i></h4> </div> <div class="pageSearchHeader bg-white p-1 pt-1 "> <input class="form-control border p-3" type="search" placeholder="search" id="searchText" style="margin:0px;min-width:250px;width:75%;float:left"> <button type="button" class="btn btn-info" id="goSearchRecord" style="float:rigth;width:20%;margin-left:3px">Search</button> </div> </div> <div class="wrapper mt-3 p-0 shadow-sm float:left bg-white h-auto"> <div class="row fluid m-0 w-100 p-0 bg-white h-auto pageBodyMenu"> <div class="bg-red float:left text-left col-xs-12 col-md-4 col-lg-4 col-sm-12 p-2 h-auto" style='background:#fff;min-height:800px;border-right:1px solid lightgray'> <!--########################################################################################--> <!--########################################################################################--> <h4 class="btn btn-info w-100 text-left" >Select Unit:</h4> <div style="height:800px;overflow:auto;background:#fff"> <ul style='background:#fff;padding:10px;border:0px solid lightgray;'> <li><span class="caret">COMPANY LEVEL</span> <ul class="nested"> <?php //LOAD LIST OF COMPANY IN TABULAR FORMAT $getComp = "SELECT * FROM `vts_company` WHERE `comp_status`=1 ORDER BY `comp_name` ASC"; $getC = mysqli_query($conn,$getComp); $statRow = mysqli_num_rows($getC); if($statRow > 0){ echo "<table id='compTable'>"; while($row = mysqli_fetch_array($getC)){ ?><tr onclick="javascript:compMenuID(this);" ><?php echo "<td class='menuItem'>".$row['comp_id']."</td>"; echo "<td class='menuItem'>".$row['comp_name']."</td>"; echo "</tr>"; } echo "</table>"; } ?> </ul> </li> <!-------------------------------------------------------------------------------------------> <li><span class="caret">BRANCH LEVEL</span> <ul class="nested"> <?php //LOAD LIST OF COMPANY IN TABULAR FORMAT $getComp = "SELECT * FROM `vts_dealerships` WHERE `deal_status`=1 ORDER BY `deal_name` ASC"; $getC = mysqli_query($conn,$getComp); $statRow = mysqli_num_rows($getC); if($statRow > 0){ echo "<table id='dealTable'>"; while($row = mysqli_fetch_array($getC)){ ?><tr onclick="javascript:dealMenuID(this);" ><?php echo "<td class='menuItem'>".$row['deal_id']."</td>"; echo "<td class='menuItem'>".$row['deal_name']."</td>"; echo "</tr>"; } echo "</table>"; } ?> </ul> </li> <!-------------------------------------------------------------------------------------------> <li><span class="caret">GROUP LEVEL</span> <ul class="nested"> <?php //LOAD LIST OF COMPANY IN TABULAR FORMAT $getComp = "SELECT * FROM `pms_sub_group` WHERE `deleted`=0 ORDER BY `sub_group_name` ASC"; $getC = mysqli_query($conn,$getComp); $statRow = mysqli_num_rows($getC); if($statRow > 0){ echo "<table id='subGTable'>"; while($row = mysqli_fetch_array($getC)){ ?><tr onclick="javascript:subGroupMenuID(this);" ><?php echo "<td class='menuItem'>".$row['id']."</td>"; echo "<td class='menuItem'>".$row['sub_group_name']."</td>"; echo "</tr>"; } echo "</table>"; } ?> </ul> </li> <!-------------------------------------------------------------------------------------------> <li><span class="caret">DIVISION LEVEL</span> <ul class="nested"> <?php //LOAD LIST OF COMPANY IN TABULAR FORMAT $getComp = "SELECT * FROM `pms_division_tbl` WHERE `deleted`=0 ORDER BY `division_name` ASC"; $getC = mysqli_query($conn,$getComp); $statRow = mysqli_num_rows($getC); if($statRow > 0){ echo "<table id='divMTable'>"; while($row = mysqli_fetch_array($getC)){ ?><tr onclick="javascript:divisionMenuID(this);" ><?php echo "<td class='menuItem'>".$row['id']."</td>"; echo "<td class='menuItem'>".$row['division_name']."</td>"; echo "</tr>"; } echo "</table>"; } ?> </ul> </li> <!-------------------------------------------------------------------------------------------> <li><span class="caret">DEPARTMENT LEVEL</span> <ul class="nested"> <input class="form-control " style='padding-left:10px;text-align:left;color:blue;width:60%;border:1px solid white;border-bottom:1px solid lightgray' type="search" placeholder="Search ..." id="sDept" OnkeyUp="searchDept()"> <?php //LOAD LIST OF COMPANY IN TABULAR FORMAT $getComp = "SELECT * FROM `pms_department_tbl` WHERE `deleted`=0 ORDER BY `dept_name` ASC"; $getC = mysqli_query($conn,$getComp); $statRow = mysqli_num_rows($getC); if($statRow > 0){ echo "<table id='deptTable'>"; while($row = mysqli_fetch_array($getC)){ ?><tr onclick="javascript:deptMenuID(this);" ><?php echo "<td class='menuItem'>".$row['id']."</td>"; echo "<td class='menuItem'>".$row['dept_name']."</td>"; echo "</tr>"; } echo "</table>"; } ?> </ul> </li> <!-------------------------------------------------------------------------------------------> <li><span class="caret">SECTION LEVEL</span> <ul class="nested"> <input class="form-control " style='padding-left:10px;text-align:left;color:blue;width:60%;border:1px solid white;border-bottom:1px solid lightgray' type="search" placeholder="Search ..." id="sSect" OnkeyUp="searchSection()"> <?php //LOAD LIST OF COMPANY IN TABULAR FORMAT $getComp = "SELECT * FROM `pms_unit_tbl` WHERE `deleted`=0 ORDER BY `unit_name` ASC"; $getC = mysqli_query($conn,$getComp); $statRow = mysqli_num_rows($getC); if($statRow > 0){ echo "<table id='unitTable'>"; while($row = mysqli_fetch_array($getC)){ ?><tr onclick="javascript:sectionMenuID(this);" ><?php echo "<td class='menuItem'>".$row['id']."</td>"; echo "<td class='menuItem'>".$row['unit_name']."</td>"; echo "</tr>"; } echo "</table>"; } ?> </ul> </li> <!-------------------------------------------------------------------------------------------> <li><span class="caret">EMPLOYEE LEVEL</span> <ul class="nested"> <input class="form-control " style='padding-left:10px;text-align:left;color:blue;width:60%;border:1px solid white;border-bottom:1px solid lightgray' type="search" placeholder="Search ..." id="sEmpl" OnkeyUp="searchEMPL()"> <?php //LOAD LIST OF COMPANY IN TABULAR FORMAT $getComp = "SELECT * FROM `pms_employee_data` WHERE `deleted`=0 ORDER BY `last_name` ASC"; $getC = mysqli_query($conn,$getComp); $statRow = mysqli_num_rows($getC); if($statRow > 0){ echo "<table id='empTable'>"; while($row = mysqli_fetch_array($getC)){ ?><tr onclick="javascript:employeeMenuID(this);" ><?php echo "<td class='menuItem'>".$row['id']."</td>"; echo "<td class='menuItem'>".$row['last_name'].", ".$row['first_name']." - ".$row['emp_id']."</td>"; echo "</tr>"; } echo "</table>"; } ?> </ul> </li> <!-------------------------------------------------------------------------------------------> </ul> </div> </div> <!--########################################################################################--> <!--########################################################################################--> <div id="activeReportFrom" class="bg-red float:left text-left col-xs-12 col-xs-12 col-md-8 col-lg-8 col-xl-8 col-sm-12 p-2 h-600"> <!--########################################################################################--> <!--########################################################################################--> <input type='hidden' id='aprID' placeholder="approver ID"> <input type='hidden' id='activeUnit' placeholder="activeUnit"> <input type='hidden' id='selUnitID' placeholder="selUnitID"> <input type='hidden' id='employeeSearchID' placeholder="employeeSearchID"> <input type='hidden' id='userID' value="<?php echo $uID;?>" placeholder="user ID"> <h4 id='activeTitle' class="btn btn-info w-100 text-left" >Active Unit:</h4> <table style="width:100%;border-collapse:collapse;"> <thead> <th style="width:10%;padding-left:2px;text-align:left;border:0px solid red">REC.ID</thd> <th style="width:13%;padding-left:2px;text-align:left;border:0px solid red">EMP. ID</th> <th style="width:27%;padding-left:2px;text-align:left;border:0px solid red">FIRSTNAME</th> <th style="width:30%;padding-left:2px;text-align:left;border:0px solid red">LAST NAME</th> <th style="width:15%;padding-left:2px;text-align:left;border:0px solid red">LEVEL</th> <th colspan=2 style="width:5%;border:0px solid red;color:red;font-family:Calibri;font-size:18px;font-weight:normal"> <i data-toggle='modal' data-target='#addApproverForm' class='fa fa-plus text-center' aria-hidden='true'></i> </th> </thead> <tr> <td colspan="6" style='padding:0px;border:0px solid white;background:white'> <div id='tdDataXX' style="maring:0px;overflow:auto;min-height:200px"> <table id='tdDataTable' style='width:100%;border-collapse:collapse;'> </table> </div> </table> <div id='pefPartIIApproverForm' style="display:none;maring:0px;overflow:auto;min-height:200px"> <h4 class="btn btn-secondary w-100 text-left" >PEF Part II Evaluator</h4> <table style="width:100%;border-collapse:collapse;"> <thead> <th style="width:10%;padding-left:2px;text-align:left;border:0px solid red">REC.ID</thd> <th style="width:15%;padding-left:2px;text-align:left;border:0px solid red">EMP. ID</th> <th style="width:70%;padding-left:2px;text-align:left;border:0px solid red">LASTNAME</th> <th colspan=2 style="width:5%;border:0px solid red;color:red;font-family:Calibri;font-size:18px;font-weight:normal"> <i data-toggle='modal' data-target='#addPEFEvaluatorForm' class='fa fa-plus text-center' aria-hidden='true'></i> </th> </thead> <tr> <td colspan=4 class='bg-white'> <table id='tdPEFApprover' style='width:100%;border-collapse:collapse;'> </table> </td> </tr> </table> </div> <!--########################################################################################--> <!--########################################################################################--> </div> </div> </div> <!--MODAL FORM FOR ADD NEW GROUP--> <!-- The Modal --> <div class="modal fade " id="addApproverForm"> <div class="modal-dialog modal-md"> <div class="modal-content"> <!-- Modal Header --> <div class="modal-header"> <h5 class="modal-title" id='activeUnitName'>NEW APPROVER</h5> <button type="button" class="close" data-dismiss="modal">×</button> </div> <!-- Modal body --> <div class="modal-body"> <input type="hidden" class="form-control" id="compName" disabled > <div class="form-group"> <label for="usr">SEARCH BY NAME / EMP. ID:</label> <input class="form-control border p-4" type="search" placeholder="SEARCH BY NAME / EMP. ID" id="searchEmployee" OnkeyUp="searchMyEmployee()" style='background:yellow;border:1px solid gray' autofocus> </div> <div class="form-group" style="border:1px solid gray;boackground:lightgary;height:180px;overflow:auto"> <div id='searchData' style="width:100%;maring:0px;overflow:auto"> </div> </div> <p id='addThisName' style='padding:3px; color:red;margin:2px'></p> </div> <!-- Modal footer --> <div class="modal-footer"> <button <?php echo $addButton; ?> type="button" class="btn btn-success pl-4 pr-4" data-dismiss="modal" id="addNewApproverID"> <span class="btn-label"><i class="fa fa-save"> Add</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> </div> </div> </div> <!--PART 11 EVALUATOR SETUP--> <!-- The Modal --> <div class="modal fade " id="addPEFEvaluatorForm"> <div class="modal-dialog modal-md"> <div class="modal-content"> <!-- Modal Header --> <div class="modal-header"> <h5 class="modal-title" id='activeUnitName'>NEW PEF PART II EVALUATOR</h5> <button type="button" class="close" data-dismiss="modal">×</button> </div> <!-- Modal body --> <div class="modal-body"> <input type="hidden" class="form-control" id="compName" disabled > <div class="form-group"> <label for="usr">Search PEF Officers:</label> <input class="form-control border p-4" type="search" placeholder="SEARCH BY NAME / EMP. ID" id="pefEvaluatorID" OnkeyUp="searchMyEvaluator()" style='background:yellow;border:1px solid gray' autofocus> </div> <div class="form-group" style="border:1px solid gray;boackground:lightgary;height:180px;overflow:auto"> <div id='searchEvaluatorData' style="width:100%;maring:0px;overflow:auto"> </div> </div> <p id='addPEFApproverName' style='padding:3px; color:red;margin:2px'></p> </div> <!-- Modal footer --> <div class="modal-footer"> <button <?php echo $addButton; ?> type="button" class="btn btn-success pl-4 pr-4" data-dismiss="modal" id="addNewPEFAvaluator"> <span class="btn-label"><i class="fa fa-save"> Add</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> </div> </div> </div> <?php } ?> <script> var toggler = document.getElementsByClassName("caret"); var i; for (i = 0; i < toggler.length; i++) { toggler[i].addEventListener("click", function() { this.parentElement.querySelector(".nested").classList.toggle("active"); this.classList.toggle("caret-down"); }); } function compMenuID(row) { var x=row.cells; document.getElementById("selUnitID").value = x[0].innerHTML; document.getElementById("compName").value = x[1].innerHTML; document.getElementById("activeUnit").value = "COMPANY"; document.getElementById("activeTitle").innerHTML = x[1].innerHTML; document.getElementById("activeUnitName").innerHTML = x[1].innerHTML + " - Approver"; } function dealMenuID(row) { var x=row.cells; document.getElementById("selUnitID").value = x[0].innerHTML; document.getElementById("compName").value = x[1].innerHTML; document.getElementById("activeUnit").value = "DEAL"; document.getElementById("activeTitle").innerHTML = x[1].innerHTML; document.getElementById("activeUnitName").innerHTML = x[1].innerHTML + " - Approver"; } function subGroupMenuID(row) { var x=row.cells; document.getElementById("selUnitID").value = x[0].innerHTML; document.getElementById("compName").value = x[1].innerHTML; document.getElementById("activeUnit").value = "SUBG"; document.getElementById("activeTitle").innerHTML = x[1].innerHTML; document.getElementById("activeUnitName").innerHTML = x[1].innerHTML + " - Approver"; } function divisionMenuID(row) { var x=row.cells; document.getElementById("selUnitID").value = x[0].innerHTML; document.getElementById("compName").value = x[1].innerHTML; document.getElementById("activeUnit").value = "DIVM"; document.getElementById("activeTitle").innerHTML = x[1].innerHTML; document.getElementById("activeUnitName").innerHTML = x[1].innerHTML + " - Approver"; } function deptMenuID(row) { var x=row.cells; document.getElementById("selUnitID").value = x[0].innerHTML; document.getElementById("compName").value = x[1].innerHTML; document.getElementById("activeUnit").value = "DEPT"; document.getElementById("activeTitle").innerHTML = x[1].innerHTML; document.getElementById("activeUnitName").innerHTML = x[1].innerHTML + " - Approver"; } function sectionMenuID(row) { var x=row.cells; document.getElementById("selUnitID").value = x[0].innerHTML; document.getElementById("compName").value = x[1].innerHTML; document.getElementById("activeUnit").value = "SECT"; document.getElementById("activeTitle").innerHTML = x[1].innerHTML; document.getElementById("activeUnitName").innerHTML = x[1].innerHTML + " - Approver"; } function employeeMenuID(row) { var x=row.cells; document.getElementById("selUnitID").value = x[0].innerHTML; document.getElementById("compName").value = x[1].innerHTML; document.getElementById("activeUnit").value = "EMPL"; document.getElementById("activeTitle").innerHTML = x[1].innerHTML; document.getElementById("activeUnitName").innerHTML = x[1].innerHTML + " - Approver"; } function aprData(row) { var x=row.cells; document.getElementById("aprID").value = x[0].innerHTML; } function aprDataDeal(row) { var x=row.cells; document.getElementById("aprID").value = x[0].innerHTML; document.getElementById("approverEmpNumber").value = x[1].innerHTML; } function getSearchEmpID(row) { var x=row.cells; document.getElementById("employeeSearchID").value = x[0].innerHTML; document.getElementById("addThisName").innerHTML = "Selected: " + x[2].innerHTML; } function getPEFApproverID(row) { var x=row.cells; document.getElementById("employeeSearchID").value = x[0].innerHTML; document.getElementById("addPEFApproverName").innerHTML = "Selected: " + x[2].innerHTML; } $('#compTable').on("click","tr td",function(){ var data = $(this).text(); var dCell = $(this).index(); var selUnitID = $("#selUnitID").val(); ShowUploadBar(); $.ajax({ url: "./apr/loadCompanyApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "lcomp": "1", "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); document.getElementById("pefPartIIApproverForm").style.display = "none"; } }); loadPEFApprover(); }); $('#dealTable').on("click","tr td",function(){ var data = $(this).text(); var dCell = $(this).index(); var selUnitID = $("#selUnitID").val(); ShowUploadBar(); $.ajax({ url: "./apr/loadBranchApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "ldeal": "1", "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); document.getElementById("pefPartIIApproverForm").style.display = "none"; } }); loadPEFApprover(); }); $('#subGTable').on("click","tr td",function(){ var data = $(this).text(); var dCell = $(this).index(); var selUnitID = $("#selUnitID").val(); ShowUploadBar(); $.ajax({ url: "./apr/loadSubGroupApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "sbGrp": "1", "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); document.getElementById("pefPartIIApproverForm").style.display = "none"; } }); loadPEFApprover(); }); $('#divMTable').on("click","tr td",function(){ var data = $(this).text(); var dCell = $(this).index(); var selUnitID = $("#selUnitID").val(); ShowUploadBar(); $.ajax({ url: "./apr/loaddivMTableApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "divM": "1", "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); document.getElementById("pefPartIIApproverForm").style.display = "none"; } }); loadPEFApprover(); }); $('#deptTable').on("click","tr td",function(){ var data = $(this).text(); var dCell = $(this).index(); var selUnitID = $("#selUnitID").val(); ShowUploadBar(); $.ajax({ url: "./apr/loadDeptTableApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "dept": "1", "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); document.getElementById("pefPartIIApproverForm").style.display = "none"; } }); loadPEFApprover(); }); $('#unitTable').on("click","tr td",function(){ var data = $(this).text(); var dCell = $(this).index(); var selUnitID = $("#selUnitID").val(); ShowUploadBar(); $.ajax({ url: "./apr/loadUnitTableApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "sect": "1", "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); document.getElementById("pefPartIIApproverForm").style.display = "none"; } }); loadPEFApprover(); }); $('#empTable').on("click","tr td",function(){ var data = $(this).text(); var dCell = $(this).index(); var selUnitID = $("#selUnitID").val(); ShowUploadBar(); $.ajax({ url: "./apr/loadEmpTableApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "empl": "1", "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); document.getElementById("pefPartIIApproverForm").style.display = "block"; } }); loadPEFApprover(); }); function loadPEFApprover(){ var userID = $("#userID").val(); var selUnitID = $("#selUnitID").val(); //Employee record id //alert(selUnitID); ShowUploadBar(); $.ajax({ url: "./apr/addPEFEvaluator.php", type: "POST", async: true, data: { "selUnitID":selUnitID, "userID":userID, "pefe":"1"//add new approver }, success: function(dx){ $("#tdPEFApprover").html(dx); $("#searchEvaluatorData").val(""); ShowUploadBar(); } }) } $('#tdPEFApprover').on("click","tr td",function(){ var data = $(this).text(); var dCell = $(this).index(); var aprID = $("#aprID").val(); var deleteAccess = $("#deleteAccess").val(); if(dCell == 3){ //alert(deleteAccess); if(deleteAccess == 0){ Swal.fire({ icon: 'error', title: 'Access Denied', text: 'You are not allowed to delete record from this page...', footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) return false; } $.ajax({ url: "./apr/addPEFEvaluator.php", type: "POST", async: true, data: { "selUnitID":0, "employeeSearchID":0, "userID":0, "aprID":aprID, "pefe":"3"//delete evaluator }, success: function(dx){ $("#tdPEFApprover").html(dx); ShowUploadBar(); } }) } }); $('#tdDataTable').on("click","tr td",function(){ var data = $(this).text(); var dCell = $(this).index(); if(dCell == 5){ var userID = $("#userID").val(); var selUnitID = $("#selUnitID").val(); var aprID = $("#aprID").val(); var activeUnit = $("#activeUnit").val(); var deleteAccess = $("#deleteAccess").val(); //alert(deleteAccess); if(deleteAccess == 0){ Swal.fire({ icon: 'error', title: 'Access Denied', text: 'You are not allowed to delete record from this page...', footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) return false; } Swal.fire({ title: 'Deleting Record', text: "Are you sure you want to delete this record? You won't be able to revert this!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!' }).then((result) => { if (result.isConfirmed) { ShowUploadBar(); if(activeUnit === "COMPANY"){ $.ajax({ url: "./apr/loadCompanyApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "lcomp": "3", "aprID":aprID, "userID":userID, "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); } }); } if(activeUnit === "DEAL"){ $.ajax({ url: "./apr/loadBranchApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "ldeal": "3", "aprID":aprID, "userID":userID, "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); } }); } if(activeUnit === "SUBG"){ $.ajax({ url: "./apr/loadSubGroupApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "sbGrp": "3", "aprID":aprID, "userID":userID, "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); } }); } if(activeUnit === "DIVM"){ $.ajax({ url: "./apr/loaddivMTableApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "divM": "3", "aprID":aprID, "userID":userID, "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); } }); } if(activeUnit === "DEPT"){ $.ajax({ url: "./apr/loadDeptTableApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "dept": "3", "aprID":aprID, "userID":userID, "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); } }); } if(activeUnit === "SECT"){ $.ajax({ url: "./apr/loaduNITTableApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "sect": "3", "aprID":aprID, "userID":userID, "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); } }); } if(activeUnit === "EMPL"){ $.ajax({ url: "./apr/loadEmpTableApprovers.php", method: 'POST', dataType: 'text', async:true, data: { "empl": "3", "aprID":aprID, "userID":userID, "selUnitID": selUnitID }, success: function(d){ $("#tdDataTable").html(d); ShowUploadBar(); } }); } } }) } }); function searchMyEmployee(){ var searchEmployee = $("#searchEmployee").val(); var selUnitID = $("#selUnitID").val(); var compName = $("#compName").val(); var len = searchEmployee.length; if(len > 0){ if(compName===""){ Swal.fire({ icon: 'error', title: 'Invalid Entry', text: 'No active company has been selected.' //footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) return false; } $.ajax({ url: "./apr/searchEmpByCompany.php", method: 'POST', dataType: 'text', async:true, data: { iSearch: 104, "searchEmployee": searchEmployee, "selUnitID": selUnitID }, success: function(d){ $("#searchData").html(d); } }); } //$('#marScore').val(myTotalScore.toFixed(2)); //$('#myVarianceNo').val(myVariance.toFixed(2)); } function searchMyEvaluator(){ var searchEmployee = $("#pefEvaluatorID").val(); var selUnitID = $("#selUnitID").val(); var compName = $("#compName").val(); var len = searchEmployee.length; if(len > 0){ if(compName===""){ Swal.fire({ icon: 'error', title: 'Invalid Entry', text: 'No active company has been selected.' //footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) return false; } $.ajax({ url: "./apr/searchEmpPEFApprover.php", method: 'POST', dataType: 'text', async:true, data: { iSearch: 104, "searchEmployee": searchEmployee, "selUnitID": selUnitID }, success: function(d){ $("#searchEvaluatorData").html(d); } }); } //$('#marScore').val(myTotalScore.toFixed(2)); //$('#myVarianceNo').val(myVariance.toFixed(2)); } function searchDept(){ var sDept = $("#sDept").val(); var sec = sDept.length; //if(sec > 0){ $.ajax({ url: "./apr/searchDepartment.php", method: 'POST', dataType: 'text', async:true, data: { iSearch: 104, "sDept": sDept }, success: function(d){ $("#deptTable").html(d); } }); // } //$('#marScore').val(myTotalScore.toFixed(2)); //$('#myVarianceNo').val(myVariance.toFixed(2)); } function searchSection(){ var sSect = $("#sSect").val(); //var sec = sSect.length; //if(sec > 0){ $.ajax({ url: "./apr/searchSection.php", method: 'POST', dataType: 'text', async:true, data: { iSearch: 104, "sSect": sSect }, success: function(d){ $("#unitTable").html(d); } }); // } //$('#marScore').val(myTotalScore.toFixed(2)); //$('#myVarianceNo').val(myVariance.toFixed(2)); } function searchEMPL(){ var sEmpl = $("#sEmpl").val(); var emp = sEmpl.length; //alert(sEmpl); if(emp > 0){ $.ajax({ url: "./apr/searchEmployee.php", method: 'POST', dataType: 'text', async:true, data: { iSearch: 104, "sEmpl": sEmpl }, success: function(d){ $("#empTable").html(d); } }); } //$('#marScore').val(myTotalScore.toFixed(2)); //$('#myVarianceNo').val(myVariance.toFixed(2)); } $("#addNewApproverID").click(function(){ var aprID = $("#aprID").val(); var activeUnit = $("#activeUnit").val(); var selUnitID = $("#selUnitID").val(); var employeeSearchID = $("#employeeSearchID").val(); var userID = $("#userID").val(); var addAccess = $("#addAccess").val(); if(addAccess == 0){ Swal.fire({ icon: 'error', title: 'Access Denied', text: 'You are not allowed to add new record...', footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) return false; } if(employeeSearchID===''){ Swal.fire({ icon: 'error', title: 'Invalid Entry', text: 'Please select employee to continue...' //footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) return false; } ShowUploadBar(); if(activeUnit === "COMPANY"){ $.ajax({ url: "./apr/loadCompanyApprovers.php", type: "POST", async: true, data: { "aprID":aprID, "activeUnit":activeUnit, "selUnitID":selUnitID, "employeeSearchID":employeeSearchID, "userID":userID, "lcomp":"2"//save company approver }, success: function(dx){ $("#tdDataTable").html(dx); $("#searchEmployee").val(""); ShowUploadBar(); } }) } if(activeUnit === "DEAL"){ $.ajax({ url: "./apr/loadBranchApprovers.php", type: "POST", async: true, data: { "aprID":aprID, "activeUnit":activeUnit, "selUnitID":selUnitID, "employeeSearchID":employeeSearchID, "userID":userID, "ldeal":"2"//save company approver }, success: function(dx){ $("#tdDataTable").html(dx); $("#searchEmployee").val(""); ShowUploadBar(); } }) } if(activeUnit === "SUBG"){ $.ajax({ url: "./apr/loadSubGroupApprovers.php", type: "POST", async: true, data: { "aprID":aprID, "activeUnit":activeUnit, "selUnitID":selUnitID, "employeeSearchID":employeeSearchID, "userID":userID, "sbGrp":"2"//save company approver }, success: function(dx){ $("#tdDataTable").html(dx); $("#searchEmployee").val(""); ShowUploadBar(); } }) } if(activeUnit === "DIVM"){ $.ajax({ url: "./apr/loaddivMTableApprovers.php", type: "POST", async: true, data: { "aprID":aprID, "activeUnit":activeUnit, "selUnitID":selUnitID, "employeeSearchID":employeeSearchID, "userID":userID, "divM":"2"//save company approver }, success: function(dx){ $("#tdDataTable").html(dx); $("#searchEmployee").val(""); ShowUploadBar(); } }) } if(activeUnit === "DEPT"){ $.ajax({ url: "./apr/loadDeptTableApprovers.php", type: "POST", async: true, data: { "aprID":aprID, "activeUnit":activeUnit, "selUnitID":selUnitID, "employeeSearchID":employeeSearchID, "userID":userID, "dept":"2"//save company approver }, success: function(dx){ $("#tdDataTable").html(dx); $("#searchEmployee").val(""); ShowUploadBar(); } }) } if(activeUnit === "SECT"){ $.ajax({ url: "./apr/loadUnitTableApprovers.php", type: "POST", async: true, data: { "aprID":aprID, "activeUnit":activeUnit, "selUnitID":selUnitID, "employeeSearchID":employeeSearchID, "userID":userID, "sect":"2"//save company approver }, success: function(dx){ $("#tdDataTable").html(dx); $("#searchEmployee").val(""); ShowUploadBar(); } }) } if(activeUnit === "EMPL"){ $.ajax({ url: "./apr/loadEmpTableApprovers.php", type: "POST", async: true, data: { "aprID":aprID, "activeUnit":activeUnit, "selUnitID":selUnitID, "employeeSearchID":employeeSearchID, "userID":userID, "empl":"2"//save company approver }, success: function(dx){ $("#tdDataTable").html(dx); $("#searchEmployee").val(""); ShowUploadBar(); } }) } }); $("#addNewPEFAvaluator").click(function(){ var selUnitID = $("#selUnitID").val(); //employee id needs approvers var employeeSearchID = $("#employeeSearchID").val(); var userID = $("#userID").val(); var addAccess = $("#addAccess").val(); var activeUnit = $("#activeUnit").val(); if(addAccess == 0){ Swal.fire({ icon: 'error', title: 'Access Denied', text: 'You are not allowed to add new record...', footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) return false; } if(employeeSearchID===''){ Swal.fire({ icon: 'error', title: 'Invalid Entry', text: 'Please select employee to continue...' //footer: '<a href="user-guide.php?code=new-area">Why do I have this issue?</a>' }) return false; } ShowUploadBar(); if(activeUnit === "EMPL"){ $.ajax({ url: "./apr/addPEFEvaluator.php", type: "POST", async: true, data: { "selUnitID":selUnitID, "employeeSearchID":employeeSearchID, "userID":userID, "pefe":"2"//add new approver }, success: function(dx){ $("#tdPEFApprover").html(dx); $("#searchEvaluatorData").val(""); ShowUploadBar(); } }) } }); </script>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0.04 |
proxy
|
phpinfo
|
Settings