文件操作 - Approval.js
返回文件管理
返回主菜单
删除本文件
文件: E:\HostingSpaces\kimblycr\howell.kimbly.in\wwwroot\js\Approval.js
编辑文件内容
function GetApprovalCountByOwner(eid) { console.log('In GetApprovalCountByOwner'); var ApprovalType = ""; var cnt = "0"; document.getElementById('bdgTravel').innerHTML = "0"; document.getElementById('bdgHotel').innerHTML = "0"; document.getElementById('bdgPurchase').innerHTML = "0"; document.getElementById('bdgSunday').innerHTML = "0"; document.getElementById('bdgExpense').innerHTML = "0"; document.getElementById('bdgLeave').innerHTML = "0"; document.getElementById('bdgMisc').innerHTML = "0"; document.getElementById('bdgExpense').innerHTML = "0"; $.ajax({ type: "POST", url: "Default.aspx/GetApprovalCountByOwner", data: "{'OwnerID': '" + eid + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { if (data.d != null) { $.each(data.d, function (key, val) { ApprovalType = val.StepType.trim(); cnt = val.count; if (ApprovalType == "Travel") { document.getElementById('bdgTravel').innerHTML = cnt; } else if (ApprovalType == "Hotel") { document.getElementById('bdgHotel').innerHTML = cnt; } else if (ApprovalType == "Purchase") { document.getElementById('bdgPurchase').innerHTML = cnt; } else if (ApprovalType == "Sunday") { document.getElementById('bdgSunday').innerHTML = cnt; } else if (ApprovalType == "Expense") { document.getElementById('bdgExpense').innerHTML = cnt; } else if (ApprovalType == "Leave") { document.getElementById('bdgLeave').innerHTML = cnt; } else if (ApprovalType == "Advance") { document.getElementById('bdgAdvance').innerHTML = cnt; } else if (ApprovalType == "Misc") { document.getElementById('bdgMisc').innerHTML = cnt; } else if (ApprovalType == "Conv") { document.getElementById('bdgConveyance').innerHTML = cnt; } else if (ApprovalType == "Expense") { document.getElementById('bdgExpense').innerHTML = cnt; } else if (ApprovalType == "LeaveCancel") { document.getElementById('bdgLeaveCancel').innerHTML = cnt; } else if (ApprovalType == "Food") { document.getElementById('bdgFood').innerHTML = cnt; } else if (ApprovalType == "Rental") { document.getElementById('bdgRental').innerHTML = cnt; } }) } } }); } function GetTravelSummary() { console.log('In GetTravelSummary'); var eid = sessionStorage.getItem("LoggedInEmpID"); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetTravelSummary", data: "{'OwnerID': '" + eid + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>EmployeeID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Amount</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); document.getElementById('ApprovalTitle').innerHTML = "Summary Travel Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnApprovedTravel(CardNo) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewUnApprovedTravelByEmpID", data: "{'EmpID': '" + CardNo + "'}", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>Name</b></td><td><b>Site</b></td><td style='width: 10%;'><b>From</b></td><td><b>To</b></td><td><b>Amount</b></td><td><b>Remarks</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewTravel(id) { console.log('View Travel'); document.getElementById("lblApprove").innerHTML = "Approve"; document.getElementById("lblApproveType").innerHTML = "Travel"; document.getElementById("BtnApprove").style.display = 'block'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'none'; document.getElementById("BtnPaid").style.display = 'none'; document.getElementById("txtApproveAmount").style.display = 'block'; document.getElementById("lblApproveAmount").style.display = 'block'; document.getElementById("txtPaymentAmount").style.display = 'none'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetTravelImages", data: "{'ID': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; if (i == 0) { document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $("#ConvImage").attr("src", hdr); } if ((hdr.toLowerCase().indexOf(".jpg") > -1) || (hdr.toLowerCase().indexOf(".png") > -1) || (hdr.toLowerCase().indexOf(".gif") > -1) || (hdr.toLowerCase().indexOf(".tif") > -1)) { addImage(hdr); } else { addHyperlink(hdr); } } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewTravelByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#grdConveyanceImages").empty(); var str = "<thead><tr><td>ID</td><td>Name</td><td>Site</td><td>From Place</td><td>To Place</td><td>Amount</td><td>Approved Amount</td><td>Remarks</td><td>ApproverRemarks</td><td>Finance Remarks</td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grdConveyanceImages").append(str); $("#grdConveyanceImages").append("</tbody>"); $("#grdConveyanceImages").show(); $("#dvGrdConveyanceImages").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function GetHotelSummary() { console.log('In GetHotelSummary'); var eid = sessionStorage.getItem("LoggedInEmpID"); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetHotelSummary", data: "{'OwnerID': '" + eid + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>EmployeeID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Amount</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); document.getElementById('ApprovalTitle').innerHTML = "Summary Hotel Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnApprovedHotel(CardNo) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewUnApprovedHotelByEmpID", data: "{'EmpID': '" + CardNo + "'}", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>Name</b></td><td><b>Site</b></td><td style='width: 10%;'><b>Start Date</b></td><td><b>End Date</b></td><td><b>Amount</b></td><td><b>Remarks</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewHotel(id) { console.log('View Hotel'); document.getElementById("lblApprove").innerHTML = "Approve"; document.getElementById("lblApproveType").innerHTML = "Hotel"; document.getElementById("BtnApprove").style.display = 'block'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'none'; document.getElementById("BtnPaid").style.display = 'none'; document.getElementById("txtApproveAmount").style.display = 'block'; document.getElementById("lblApproveAmount").style.display = 'block'; document.getElementById("txtPaymentAmount").style.display = 'none'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetHotelImages", data: "{'ID': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; if (i == 0) { document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $("#ConvImage").attr("src", hdr); } if ((hdr.toLowerCase().indexOf(".jpg") > -1) || (hdr.toLowerCase().indexOf(".png") > -1) || (hdr.toLowerCase().indexOf(".gif") > -1) || (hdr.toLowerCase().indexOf(".tif") > -1)) { addImage(hdr); } else { addHyperlink(hdr); } } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewHotelByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#grdConveyanceImages").empty(); var str = "<thead><tr><td>ID</td><td>Name</td><td>Site</td><td>Start Date</td><td>End Date</td><td>Amount</td><td>Approved Amount</td><td>Remarks</td><td>ApproverRemarks</td><td>Finance Remarks</td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grdConveyanceImages").append(str); $("#grdConveyanceImages").append("</tbody>"); $("#grdConveyanceImages").show(); $("#dvGrdConveyanceImages").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function GetPurchaseSummary() { console.log('In GetPurchaseSummary'); var eid = sessionStorage.getItem("LoggedInEmpID"); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetPurchaseSummary", data: "{'OwnerID': '" + eid + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>EmployeeID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Amount</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); document.getElementById('ApprovalTitle').innerHTML = "Summary Purchase Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnApprovedPurchase(CardNo) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewUnApprovedPurchaseByEmpID", data: "{'EmpID': '" + CardNo + "'}", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:600px' class='table'><thead><tr><td><b>Name</b></td><td><b>Site</b></td><td><b>Amount</b></td><td><b>Remarks</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); } document.getElementById('ApprovalTitle').innerHTML = "Employee Purchase Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnApprovedExpense(CardNo) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewUnApprovedExpenseByEmpID", data: "{'EmpID': '" + CardNo + "'}", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:600px' class='table'><thead><tr><td><b>Name</b></td><td><b>Amount</b></td><td><b>Month</b></td><td><b>Year</b></td><td><b>Remarks</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); } document.getElementById('ApprovalTitle').innerHTML = "Employee Expense Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewPurchase(id) { console.log('View Purchase'); document.getElementById("lblApprove").innerHTML = "Approve"; document.getElementById("lblApproveType").innerHTML = "Purchase"; document.getElementById("BtnApprove").style.display = 'block'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'none'; document.getElementById("BtnPaid").style.display = 'none'; document.getElementById("txtApproveAmount").style.display = 'block'; document.getElementById("lblApproveAmount").style.display = 'block'; document.getElementById("txtPaymentAmount").style.display = 'none'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetPurchaseImages", data: "{'ID': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; if (i == 0) { document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $("#ConvImage").attr("src", hdr); } if ((hdr.toLowerCase().indexOf(".jpg") > -1) || (hdr.toLowerCase().indexOf(".png") > -1) || (hdr.toLowerCase().indexOf(".gif") > -1) || (hdr.toLowerCase().indexOf(".tif") > -1)) { addImage(hdr); } else { addHyperlink(hdr); } } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewPurchaseByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#grdConveyanceImages").empty(); var str = "<thead><tr><td>ID</td><td>Name</td><td>Site</td><td>Amount</td><td>Approved Amount</td><td>Advance Amount</td><td>Remarks</td><td>Approver Remarks</td><td>Finance Remarks</td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grdConveyanceImages").append(str); $("#grdConveyanceImages").append("</tbody>"); $("#grdConveyanceImages").show(); $("#dvGrdConveyanceImages").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function GetSundays() { console.log('In GetSundays'); var eid = sessionStorage.getItem("LoggedInEmpID"); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetSundays", data: "{'OwnerID': '" + eid + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>ID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Date</b></td><td><b>Site</b></td><td><b>Remarks</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); document.getElementById('ApprovalTitle').innerHTML = "Sundays Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewSunday(id) { console.log('View Sunday'); document.getElementById("lblApprove").innerHTML = "Approve"; document.getElementById("lblApproveType").innerHTML = "Sunday"; document.getElementById("BtnApprove").style.display = 'block'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'none'; document.getElementById("BtnPaid").style.display = 'none'; document.getElementById("txtApproveAmount").style.display = 'none'; document.getElementById("lblApproveAmount").style.display = 'none'; document.getElementById("txtPaymentAmount").style.display = 'none'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewSundayByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#grdConveyanceImages").empty(); var str = "<thead><tr><td><b>ID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Site</b></td><td><b>Date</b></td><td><b>Remarks</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grdConveyanceImages").append(str); $("#grdConveyanceImages").append("</tbody>"); $("#grdConveyanceImages").show(); $("#dvGrdConveyanceImages").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function GetLeave() { console.log('In GetLeave'); var eid = sessionStorage.getItem("LoggedInEmpID"); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetLeaves", data: "{'OwnerID': '" + eid + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>ID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Start Date</b></td><td><b>End Date</b></td><td><b>Type</b></td><td><b>Remarks</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); document.getElementById('ApprovalTitle').innerHTML = "Leave Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewLeave(id) { console.log('View Leave'); document.getElementById("lblApprove").innerHTML = "Approve"; document.getElementById("lblApproveType").innerHTML = "Leave"; document.getElementById("BtnApprove").style.display = 'block'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'none'; document.getElementById("BtnPaid").style.display = 'none'; document.getElementById("txtApproveAmount").style.display = 'none'; document.getElementById("lblApproveAmount").style.display = 'none'; document.getElementById("txtPaymentAmount").style.display = 'none'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewLeaveByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#grdConveyanceImages").empty(); var str = "<thead><tr><td><b>ID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Start Date</b></td><td><b>End Date</b></td><td><b>Type</b></td><td><b>Remarks</b></td><td><b>Resume Date</b></td><td><b>Day Type</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grdConveyanceImages").append(str); $("#grdConveyanceImages").append("</tbody>"); $("#grdConveyanceImages").show(); $("#dvGrdConveyanceImages").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function GetAdvanceSummary() { console.log('In AdvanceSummary'); var eid = sessionStorage.getItem("LoggedInEmpID"); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetAdvanceSummary", data: "{'OwnerID': '" + eid + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>EmployeeID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Amount</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); document.getElementById('ApprovalTitle').innerHTML = "Summary Advance Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnApprovedAdvance(CardNo) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewUnApprovedAdvanceByEmpID", data: "{'EmpID': '" + CardNo + "'}", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:600px' class='table'><thead><tr><td><b>Name</b></td><td><b>Site</b></td><td><b>Amount</b></td><td><b>Remarks</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); } document.getElementById('ApprovalTitle').innerHTML = "Employee Advance Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewAdvance(id) { console.log('View Advance'); document.getElementById("lblApprove").innerHTML = "Approve"; document.getElementById("lblApproveType").innerHTML = "Advance"; document.getElementById("BtnApprove").style.display = 'block'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'none'; document.getElementById("BtnPaid").style.display = 'none'; document.getElementById("txtApproveAmount").style.display = 'block'; document.getElementById("lblApproveAmount").style.display = 'block'; document.getElementById("txtPaymentAmount").style.display = 'none'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewAdvanceByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#grdConveyanceImages").empty(); var str = "<thead><tr><td>ID</td><td>Name</td><td>Site</td><td>Amount</td><td>Approved Amount</td><td>Remarks</td><td>Approver Remarks</td><td>Finance Remarks</td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grdConveyanceImages").append(str); $("#grdConveyanceImages").append("</tbody>"); $("#grdConveyanceImages").show(); $("#dvGrdConveyanceImages").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function GetMiscSummary() { console.log('In GetMiscSummary'); var eid = sessionStorage.getItem("LoggedInEmpID"); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetMiscSummary", data: "{'OwnerID': '" + eid + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>EmployeeID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Amount</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); document.getElementById('ApprovalTitle').innerHTML = "Summary Miscellaneous Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function GetFoodSummary() { console.log('In GetFoodSummary'); var eid = sessionStorage.getItem("LoggedInEmpID"); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetFoodSummary", data: "{'OwnerID': '" + eid + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>EmployeeID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Amount</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); document.getElementById('ApprovalTitle').innerHTML = "Summary Food Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function GetRentalSummary() { console.log('In Get RentalSummary'); var eid = sessionStorage.getItem("LoggedInEmpID"); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetRentalSummary", data: "{'OwnerID': '" + eid + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>EmployeeID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Amount</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); document.getElementById('ApprovalTitle').innerHTML = "Summary Rental Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnApprovedMisc(CardNo) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewUnApprovedMiscByEmpID", data: "{'EmpID': '" + CardNo + "'}", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:600px' class='table'><thead><tr><td><b>Name</b></td><td><b>Site</b></td><td><b>Amount</b></td><td><b>Remarks</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); } document.getElementById('ApprovalTitle').innerHTML = "Miscellaneous Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnApprovedFood(CardNo) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewUnApprovedFoodByEmpID", data: "{'EmpID': '" + CardNo + "'}", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:600px' class='table'><thead><tr><td><b>Name</b></td><td><b>Site</b></td><td><b>Amount</b></td><td><b>Remarks</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); } document.getElementById('ApprovalTitle').innerHTML = "Food Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnApprovedRental(CardNo) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewUnApprovedRentalByEmpID", data: "{'EmpID': '" + CardNo + "'}", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:600px' class='table'><thead><tr><td><b>Name</b></td><td><b>Site</b></td><td><b>Amount</b></td><td><b>Remarks</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); } document.getElementById('ApprovalTitle').innerHTML = "Rental Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewMisc(id) { console.log(' ViewMisc'); document.getElementById("lblApprove").innerHTML = "Approve"; document.getElementById("lblApproveType").innerHTML = "Misc"; document.getElementById("BtnApprove").style.display = 'block'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'none'; document.getElementById("BtnPaid").style.display = 'none'; document.getElementById("txtApproveAmount").style.display = 'block'; document.getElementById("lblApproveAmount").style.display = 'block'; document.getElementById("txtPaymentAmount").style.display = 'none'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewMiscByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#grdConveyanceImages").empty(); var str = "<thead><tr><td>ID</td><td>Name</td><td>Site</td><td>Amount</td><td>Approved Amount</td><td>Remarks</td><td>Approver Remarks</td><td>Finance Remarks</td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grdConveyanceImages").append(str); $("#grdConveyanceImages").append("</tbody>"); $("#grdConveyanceImages").show(); $("#dvGrdConveyanceImages").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewFood(id) { console.log(' ViewFood'); document.getElementById("lblApprove").innerHTML = "Approve"; document.getElementById("lblApproveType").innerHTML = "Food"; document.getElementById("BtnApprove").style.display = 'block'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'none'; document.getElementById("BtnPaid").style.display = 'none'; document.getElementById("txtApproveAmount").style.display = 'block'; document.getElementById("lblApproveAmount").style.display = 'block'; document.getElementById("txtPaymentAmount").style.display = 'none'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewFoodByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#grdConveyanceImages").empty(); var str = "<thead><tr><td>ID</td><td>Name</td><td>Site</td><td>Amount</td><td>Start Date</td><td>End Date</td><td>Approved Amount</td><td>Remarks</td><td>Approver Remarks</td><td>Finance Remarks</td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grdConveyanceImages").append(str); $("#grdConveyanceImages").append("</tbody>"); $("#grdConveyanceImages").show(); $("#dvGrdConveyanceImages").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewRental(id) { console.log(' ViewRental'); document.getElementById("lblApprove").innerHTML = "Approve"; document.getElementById("lblApproveType").innerHTML = "Rental"; document.getElementById("BtnApprove").style.display = 'block'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'none'; document.getElementById("BtnPaid").style.display = 'none'; document.getElementById("txtApproveAmount").style.display = 'block'; document.getElementById("lblApproveAmount").style.display = 'block'; document.getElementById("txtPaymentAmount").style.display = 'none'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewRentalByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#grdConveyanceImages").empty(); var str = "<thead><tr><td>ID</td><td>Name</td><td>Site</td><td>Amount</td><td>Start Date</td><td>End Date</td><td>Approved Amount</td><td>Remarks</td><td>Approver Remarks</td><td>Finance Remarks</td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grdConveyanceImages").append(str); $("#grdConveyanceImages").append("</tbody>"); $("#grdConveyanceImages").show(); $("#dvGrdConveyanceImages").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function GetExpenseSummary() { console.log('In GetExpenseSummary'); var eid = sessionStorage.getItem("LoggedInEmpID"); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetExpenseSummary", data: "{'OwnerID': '" + eid + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>EmployeeID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Amount</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); document.getElementById('ApprovalTitle').innerHTML = "Summary Expense Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewExpense(id) { console.log('View Expense'); document.getElementById("lblApprove").innerHTML = "Approve"; document.getElementById("lblApproveType").innerHTML = "Expense"; document.getElementById("BtnApprove").style.display = 'block'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'none'; document.getElementById("BtnPaid").style.display = 'none'; document.getElementById("txtApproveAmount").style.display = 'block'; document.getElementById("lblApproveAmount").style.display = 'block'; document.getElementById("txtPaymentAmount").style.display = 'none'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetExpenseImages", data: "{'ID': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; if (i == 0) { document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $("#ConvImage").attr("src", hdr); } if ((hdr.toLowerCase().indexOf(".jpg") > -1) || (hdr.toLowerCase().indexOf(".png") > -1) || (hdr.toLowerCase().indexOf(".gif") > -1) || (hdr.toLowerCase().indexOf(".tif") > -1)) { addImage(hdr); } else { addHyperlink(hdr); } } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewExpenseByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#grdConveyanceImages").empty(); var str = "<thead><tr><td>ID</td><td>Name</td><td>Amount</td><td>Approved Amount</td><td>Advance</td><td>Month</td><td>Year</td><td>Remarks</td><td>Approver Remarks</td><td>Finance Remarks</td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grdConveyanceImages").append(str); $("#grdConveyanceImages").append("</tbody>"); $("#grdConveyanceImages").show(); $("#dvGrdConveyanceImages").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ResetAmount() { document.getElementById("txtApproveAmount").value = ""; } function GetLeaveForCancel() { var eid = sessionStorage.getItem("LoggedInEmpID"); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetLeaveForCancel", data: "{'OwnerID': '" + eid + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:100%' class='table'><thead><tr><td><b>ID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Start Date</b></td><td><b>End Date</b></td><td><b>Type</b></td><td><b>Remarks</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#dvGrdReportApprovals").append(str); $("#dvGrdReportApprovals").append("</tbody></table>"); $("#dvGrdReportApprovals").show(); document.getElementById('ApprovalTitle').innerHTML = "Leave For Cancellation"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewLeaveForCancel(id) { console.log('ViewLeaveForCancel'); document.getElementById("lblApprove").innerHTML = "Approve"; document.getElementById("lblApproveType").innerHTML = "Leave Cancelation"; document.getElementById("BtnApprove").style.display = 'block'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'none'; document.getElementById("BtnPaid").style.display = 'none'; document.getElementById("txtApproveAmount").style.display = 'none'; document.getElementById("lblApproveAmount").style.display = 'none'; document.getElementById("txtPaymentAmount").style.display = 'none'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ViewLeaveByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#grdConveyanceImages").empty(); var str = "<thead><tr><td><b>ID</b></td><td><b>Name</b></td><td style='width: 10%;'><b>Start Date</b></td><td><b>End Date</b></td><td><b>Type</b></td><td><b>Remarks</b></td><td><b>Resume Date</b></td><td><b>Day Type</b></td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grdConveyanceImages").append(str); $("#grdConveyanceImages").append("</tbody>"); $("#grdConveyanceImages").show(); $("#dvGrdConveyanceImages").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件