文件操作 - Conveyances.js
返回文件管理
返回主菜单
删除本文件
文件: E:\HostingSpaces\kimblycr\howell.kimbly.in\wwwroot\js\Conveyances.js
编辑文件内容
function GetUnApprovedSummary() { var collection = "Approvals"; LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/GetUnApprovedSummary", data: "{'EmpID': '" + LoggedInEmpID + "'}", 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 Conveyance Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function GetUnPaidSummary() { var collection = "Conveyances"; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/GetUnPaidSummary", data: "", dataType: "json", success: function (data) { if (data.d != null) { $("#grd" + collection).empty(); var str = "<thead><tr><td>CardNo</td><td>Name</td><td>Amount</td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grd" + collection).append(str); $("#grd" + collection).append("</tbody>"); $("#grd" + collection).show(); $("#dvGrdReport" + collection).show(); $("#Payment").show(); document.getElementById('ConveyanceTitle').innerHTML = "Pending Payment"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnApprovedConveyance(CardNo) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/ViewUnApprovedConveyance", data: "{'CardNo': '" + CardNo + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#dvGrdReportApprovals").empty(); var str = "<table style='width:700px' class='table'><thead><tr><td>ID</td><td>Name</td><td>Month</td><td>Year</td><td>Amount</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('ConveyanceTitle').innerHTML = "Conveyance Pending Approval"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnPaidDetails(CardNo) { var collection = "Conveyances"; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/ViewUnPaidDetails", data: "{'CardNo': '" + CardNo + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#grd" + collection).empty(); var str = "<thead><tr><td>ID</td><td>Module</td><td>Name</td><td>Amount</td></tr></thead><tbody>"; for (i = 0; i < data.d.length; i++) { var hdr = data.d[i].RowData; str += hdr; } $("#grd" + collection).append(str); $("#grd" + collection).append("</tbody>"); $("#grd" + collection).show(); $("#dvGrdReport" + collection).show(); document.getElementById('ConveyanceTitle').innerHTML = "Pending Payment"; } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewConveyance(id) { console.log('View Conveyance'); document.getElementById("lblApprove").innerHTML = "Approve"; document.getElementById("lblApproveType").innerHTML = "Conveyance"; 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("lblID").innerHTML = id; document.getElementById("placehere").innerHTML = ''; document.getElementById("txtApproveAmount").style.display = 'block'; document.getElementById("lblApproveAmount").style.display = 'block'; document.getElementById("txtPaymentAmount").style.display = 'none'; $("#placehere").empty(); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/GetConveyanceImages", 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: "WebMethods/Conveyances.aspx/ViewConveyanceByID", 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>Month</td><td>Year</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 addHyperlink(src) { var a = document.createElement('a'); var filename = src.replace('http://myhowell.in/Images/', ''); var linkText = document.createTextNode(filename); a.appendChild(linkText); a.title = "File"; a.href = src; a.target = "_blank"; document.getElementById("placehere").appendChild(a); } function ViewUnpaidConveyanceSingle(id) { console.log(id); document.getElementById("BtnApprove").style.display = 'none'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'block'; document.getElementById("BtnPaid").style.display = 'block'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); document.getElementById("placehere").innerHTML = ''; $("#placehere").empty(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/GetConveyanceImages", 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: "WebMethods/Conveyances.aspx/ViewConveyanceByID", 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>Month</td><td>Year</td><td>Amount</td><td>Approved Amount</td><td>Remarks</td><td>Approver 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); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/ViewConveyanceWalletByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#lblWallet").empty(); $("#lblWallet").append(data.d); $("#lblWallet").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnpaidTravelSingle(id) { console.log(id); document.getElementById("BtnApprove").style.display = 'none'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'block'; document.getElementById("BtnPaid").style.display = 'block'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); $.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>Approver 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); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/ViewTravelWalletByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#lblWallet").empty(); $("#lblWallet").append(data.d); $("#lblWallet").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnpaidHotelSingle(id) { console.log(id); document.getElementById("BtnApprove").style.display = 'none'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'block'; document.getElementById("BtnPaid").style.display = 'block'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); $.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>Approver 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); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/ViewHotelWalletByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#lblWallet").empty(); $("#lblWallet").append(data.d); $("#lblWallet").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnpaidPurchaseSingle(id) { console.log(id); document.getElementById("BtnApprove").style.display = 'none'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'block'; document.getElementById("BtnPaid").style.display = 'block'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); $.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>Remarks</td><td>Approver 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); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/ViewPurchaseWalletByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#lblWallet").empty(); $("#lblWallet").append(data.d); $("#lblWallet").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnpaidAdvanceSingle(id) { document.getElementById("BtnApprove").style.display = 'none'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'block'; document.getElementById("BtnPaid").style.display = 'block'; $("#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></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); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/ViewAdvanceWalletByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#lblWallet").empty(); $("#lblWallet").append(data.d); $("#lblWallet").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnpaidMiscSingle(id) { document.getElementById("BtnApprove").style.display = 'none'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'block'; document.getElementById("BtnPaid").style.display = 'block'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); $("#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></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); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/ViewMiscWalletByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#lblWallet").empty(); $("#lblWallet").append(data.d); $("#lblWallet").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnpaidExpenseSingle(id) { console.log(id); document.getElementById("BtnApprove").style.display = 'none'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'block'; document.getElementById("BtnPaid").style.display = 'block'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); $("#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></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); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/ViewExpenseWalletByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#lblWallet").empty(); $("#lblWallet").append(data.d); $("#lblWallet").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnpaidFoodSingle(id) { document.getElementById("BtnApprove").style.display = 'none'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'block'; document.getElementById("BtnPaid").style.display = 'block'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); $("#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></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); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/ViewFoodWalletByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#lblWallet").empty(); $("#lblWallet").append(data.d); $("#lblWallet").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function ViewUnpaidRentalSingle(id) { document.getElementById("BtnApprove").style.display = 'none'; document.getElementById("BtnReject").style.display = 'block'; document.getElementById("txtPaymentMode").style.display = 'block'; document.getElementById("BtnPaid").style.display = 'block'; $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#ConveyanceImages").show(); $("#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></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); } }); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/ViewRentalWalletByID", data: "{'id': '" + id + "'}", dataType: "json", success: function (data) { if (data.d != null) { $("#lblWallet").empty(); $("#lblWallet").append(data.d); $("#lblWallet").show(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function addImage(src) { var elem = document.createElement("img"); elem.setAttribute("src", src); elem.setAttribute("height", "100"); elem.setAttribute("width", "100"); elem.setAttribute("alt", "Image Missing"); elem.setAttribute("onClick", "Zoom('" + src + "')"); elem.setAttribute("data-toggle","modal"); elem.setAttribute("data-target", "#myModal") elem.setAttribute("style", "margin-right:10px"); document.getElementById("placehere").appendChild(elem); } function Zoom(src) { console.log(src); $("#ConvImage").attr("src", src); } function Approve() { var id = document.getElementById('lblID').innerHTML; var amt = document.getElementById("txtApproveAmount").value; var remarks = document.getElementById("txtApproveComment").value; var type = document.getElementById("lblApproveType").innerHTML; if (type == 'Conveyance') { if (amt == '') { alert('Please provide amount'); return; } $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/ApproveConveyance", data: "{'ID':'" + id + "','Amount':'" + amt + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Approved'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Conveyances").show(); GetUnApprovedSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Travel') { if (amt == '') { alert('Please provide amount'); return; } $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ApproveTravel", data: "{'ID':'" + id + "','Amount':'" + amt + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Approved'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetTravelSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Hotel') { if (amt == '') { alert('Please provide amount'); return; } $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ApproveHotel", data: "{'ID':'" + id + "','Amount':'" + amt + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Approved'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetHotelSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Purchase') { if (amt == '') { alert('Please provide amount'); return; } $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ApprovePurchase", data: "{'ID':'" + id + "','Amount':'" + amt + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Approved'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetPurchaseSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Sunday') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ApproveSunday", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Approved'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetSundays(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Leave') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ApproveLeave", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Approved'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetLeave(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Advance') { if (amt == '') { alert('Please provide amount'); return; } $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ApproveAdvance", data: "{'ID':'" + id + "','Remarks':'" + remarks + "','amount':'" + amt + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Approved'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetAdvanceSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Misc') { if (amt == '') { alert('Please provide amount'); return; } $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ApproveMisc", data: "{'ID':'" + id + "','Remarks':'" + remarks + "','amount':'" + amt + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Approved'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetMiscSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Expense') { if (amt == '') { alert('Please provide amount'); return; } $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ApproveExpense", data: "{'ID':'" + id + "','Remarks':'" + remarks + "','amount':'" + amt + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Approved'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetExpenseSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Leave Cancelation') { console.log('Leave Cancellation'); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ApproveLeaveCancellation", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Approved'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetLeaveForCancel(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Food') { if (amt == '') { alert('Please provide amount'); return; } $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ApproveFood", data: "{'ID':'" + id + "','Remarks':'" + remarks + "','amount':'" + amt + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Approved'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetFoodSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Rental') { if (amt == '') { alert('Please provide amount'); return; } $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/ApproveRental", data: "{'ID':'" + id + "','Remarks':'" + remarks + "','amount':'" + amt + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Approved'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetRentalSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } } function RejectPayment() { console.log('In Reject Payment'); var id = document.getElementById('lblID').innerHTML; var remarks = document.getElementById("txtRejectComment").value; var type = document.getElementById("lblApproveType").innerHTML; console.log('type-' + type); if (type == 'Conveyance') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/RejectConveyancePayment", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Payment").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Travel') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectTravelPayment", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Payment").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Hotel') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectHotelPayment", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Payment").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Purchase') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectPurchasesPayment", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Payment").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Advance') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectAdvancePayment", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Payment").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Misc') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectMiscPayment", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Payment").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Expenses') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectExpensePayment", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Payment").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Food') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectFoodPayment", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Payment").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Rental') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectRentalPayment", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Payment").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } } function Reject() { var id = document.getElementById('lblID').innerHTML; var remarks = document.getElementById("txtRejectComment").value; var approvetype = document.getElementById("lblApprove").innerHTML; var type = document.getElementById("lblApproveType").innerHTML; if (approvetype == "Pay") { RejectPayment(); return; } console.log('In approvetype not Pay'); if (type == 'Conveyance') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/RejectConveyance", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Conveyances").show(); GetUnApprovedSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Travel') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectTravel", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetTravelSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Hotel') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectHotel", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetHotelSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Purchase') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectPurchases", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetPurchaseSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Sunday') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectSunday", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetSundays(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Leave') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectLeave", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetLeave(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Advance') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectAdvance", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetAdvanceSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Misc') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectMisc", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetMiscSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Expense') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectExpense", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetExpenseSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Leave Cancelation') { console.log('Reject Leave Cancellation'); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectLeaveCancellation", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetLeaveForCancel(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Food') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectFood", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetFoodSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (type == 'Rental') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/RejectRental", data: "{'ID':'" + id + "','Remarks':'" + remarks + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Rejected'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Approvals").show(); GetRentalSummary(); GetApprovalCountByOwner(LoggedInEmpID); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } } function SetAsPaid() { var LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); var id = document.getElementById('lblID').innerHTML; var mode = document.getElementById('txtPaymentMode').value; var module = document.getElementById('lblApproveType').innerHTML; var amount = document.getElementById('txtPaymentAmount').value; if (amount == '') { alert('Please provide amount'); return; } if (module == 'Conveyance') { console.log('module conveyance'); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/SetAsPaid", data: "{'ID':'" + id + "','PaidBy':'" + LoggedInEmpID + "','PaymentMode':'" + mode + "','amount':'" + amount + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Paid'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Conveyances").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (module == 'Travel') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/SetAsPaidTravel", data: "{'ID':'" + id + "','PaidBy':'" + LoggedInEmpID + "','PaymentMode':'" + mode + "','amount':'" + amount + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Paid'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Conveyances").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (module == 'Hotel') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/SetAsPaidHotel", data: "{'ID':'" + id + "','PaidBy':'" + LoggedInEmpID + "','PaymentMode':'" + mode + "','amount':'" + amount + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Paid'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Conveyances").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (module == 'Purchase') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/SetAsPaidPurchase", data: "{'ID':'" + id + "','PaidBy':'" + LoggedInEmpID + "','PaymentMode':'" + mode + "','amount':'" + amount + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Paid'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Conveyances").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (module == 'Advance') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/SetAsPaidAdvance", data: "{'ID':'" + id + "','PaidBy':'" + LoggedInEmpID + "','PaymentMode':'" + mode + "','amount':'" + amount + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Paid'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Conveyances").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (module == 'Misc') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/SetAsPaidMisc", data: "{'ID':'" + id + "','PaidBy':'" + LoggedInEmpID + "','PaymentMode':'" + mode + "','amount':'" + amount + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Paid'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Conveyances").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (module == 'Expenses') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/SetAsPaidExpense", data: "{'ID':'" + id + "','PaidBy':'" + LoggedInEmpID + "','PaymentMode':'" + mode + "','amount':'" + amount + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Paid'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Conveyances").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (module == 'Food') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/SetAsPaidFood", data: "{'ID':'" + id + "','PaidBy':'" + LoggedInEmpID + "','PaymentMode':'" + mode + "','amount':'" + amount + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Paid'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Conveyances").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } else if (module == 'Rental') { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebMethods/Conveyances.aspx/SetAsPaidRental", data: "{'ID':'" + id + "','PaidBy':'" + LoggedInEmpID + "','PaymentMode':'" + mode + "','amount':'" + amount + "'}", dataType: "json", success: function (data) { if (data.d != null) { alert('Paid'); $("#infoContainer").children().hide(); $("#secondScreen").show(); $("#Conveyances").show(); GetUnPaidSummary(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } } function RedirecttoMyConveyance() { var LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); if (LoggedInEmpID == null) { window.location = "Login.aspx"; } window.open('Conveyance/MyConveyances.aspx?EID=' + LoggedInEmpID, '_blank'); } function RedirectTravel() { var LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); if (LoggedInEmpID == null) { window.location = "Login.aspx"; } window.open('Conveyance/MyTravel.aspx?EID=' + LoggedInEmpID, '_blank'); } function RedirectHotel() { var LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); if (LoggedInEmpID == null) { window.location = "Login.aspx"; } window.open('Conveyance/MyHotel.aspx?EID=' + LoggedInEmpID, '_blank'); } function RedirectPurchase() { var LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); if (LoggedInEmpID == null) { window.location = "Login.aspx"; } window.open('Conveyance/MyPurchase.aspx?EID=' + LoggedInEmpID, '_blank'); } function RedirectSunday() { var LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); if (LoggedInEmpID == null) { window.location = "Login.aspx"; } window.open('Conveyance/MySunday.aspx?EID=' + LoggedInEmpID, '_blank'); } function RedirectExpense() { var LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); if (LoggedInEmpID == null) { window.location = "Login.aspx"; } window.open('Conveyance/MyExpense.aspx?EID=' + LoggedInEmpID, '_blank'); } function RedirectLeave() { var LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); if (LoggedInEmpID == null) { window.location = "Login.aspx"; } window.open('Conveyance/MyLeave.aspx?EID=' + LoggedInEmpID, '_blank'); } function RedirectAdvance() { var LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); if (LoggedInEmpID == null) { window.location = "Login.aspx"; } window.open('Conveyance/MyAdvance.aspx?EID=' + LoggedInEmpID, '_blank'); } function RedirectMisc() { var LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); if (LoggedInEmpID == null) { window.location = "Login.aspx"; } window.open('Conveyance/MyMisc.aspx?EID=' + LoggedInEmpID, '_blank'); } function RedirectFood() { var LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); if (LoggedInEmpID == null) { window.location = "Login.aspx"; } window.open('Conveyance/MyFood.aspx?EID=' + LoggedInEmpID, '_blank'); } function RedirectRental() { var LoggedInEmpID = sessionStorage.getItem("LoggedInEmpID"); if (LoggedInEmpID == null) { window.location = "Login.aspx"; } window.open('Conveyance/MyRental.aspx?EID=' + LoggedInEmpID, '_blank'); } function ViewUnpaidModuleSingle(ID, Module) { document.getElementById("lblApprove").innerHTML = "Pay"; document.getElementById("txtPaymentAmount").style.display = 'block'; document.getElementById("txtPaymentAmount").value = ""; if (Module == 'Conveyance') { document.getElementById("lblApproveType").innerHTML = "Conveyance"; ViewUnpaidConveyanceSingle(ID); } else if (Module == 'Travel') { document.getElementById("lblApproveType").innerHTML = "Travel"; ViewUnpaidTravelSingle(ID); } else if (Module == 'Hotel') { document.getElementById("lblApproveType").innerHTML = "Hotel"; ViewUnpaidHotelSingle(ID); } else if (Module == 'Purchase') { document.getElementById("lblApproveType").innerHTML = "Purchase"; ViewUnpaidPurchaseSingle(ID); } else if (Module == 'Advance') { document.getElementById("lblApproveType").innerHTML = "Advance"; ViewUnpaidAdvanceSingle(ID); } else if (Module == 'Misc') { document.getElementById("lblApproveType").innerHTML = "Misc"; ViewUnpaidMiscSingle(ID); } else if (Module == 'Expenses') { document.getElementById("lblApproveType").innerHTML = "Expenses"; ViewUnpaidExpenseSingle(ID); } else if (Module == 'Food') { document.getElementById("lblApproveType").innerHTML = "Food"; ViewUnpaidFoodSingle(ID); } else if (Module == 'Rental') { document.getElementById("lblApproveType").innerHTML = "Rental"; ViewUnpaidRentalSingle(ID); } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件