Rev 24089 | Rev 24951 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
$(function() {$(".add-wallet-request").live('click', function() {loadWalletRequest("main-content");});$(".add-wallet-approve").live('click', function() {loadWalletApproveRequest("main-content");});$(".add-wallet-rejected").live('click', function() {loadWalletRejectedRequest("main-content");});$("#add-wallet-request-paginated .next").live('click',function() {var url=$('#url').val();walletRequestid=$(this).data('requestid');console.log(url);if(url=="/getPaginatedWalletRequest"){loadPaginatedNextItems('/getPaginatedWalletRequest', null,'add-wallet-request-paginated', 'add-wallet-request-table','add-wallet-request-container');}else if(url=="/getPaginatedWalletApproved"){loadPaginatedNextItems('/getPaginatedWalletApproved', null,'add-wallet-request-paginated', 'add-wallet-request-table','add-wallet-request-container');}else{loadPaginatedNextItems('/getPaginatedWalletRequestRejected', null,'add-wallet-request-paginated', 'add-wallet-request-table','add-wallet-request-container');}$(this).blur();});$("#add-wallet-request-paginated .previous").live('click',function() {var url=$('#url').val();if(url=="/getPaginatedWalletRequest"){loadPaginatedPreviousItems('/getPaginatedWalletRequest', null,'add-wallet-request-paginated', 'add-wallet-request-table','add-wallet-request-container');}else if(url=="/getPaginatedWalletApproved"){loadPaginatedPreviousItems('/getPaginatedWalletApproved', null,'add-wallet-request-paginated', 'add-wallet-request-table','add-wallet-request-container');}else {loadPaginatedPreviousItems('/getPaginatedWalletRequestRejected', null,'add-wallet-request-paginated', 'add-wallet-request-table','add-wallet-request-container');}$(this).blur();});$(".check").live('click',function(){amount=$(this).data('amount');walletRequestid=$(this).data('requestid');console.log(amount);doGetAjaxRequestHandler(context+ "/getUnsettledPaymentsByAmount?amount="+amount, function(response){$('#unsettle-payment-modal').html(response);console.log(response)});});$(".rejected").live('click',function(){if (confirm("Are you sure you want to Reject the request") == true) {id=$(this).data('requestid');console.log(id);walletRequestRejected(id);}});$(".approved").live('click',function(){if (confirm("Are you sure you want to Approve the request") == true) {id=$(this).data('id');walletRequestApprove(id,walletRequestid);}});$(".approve").live('click',function(){if (confirm("Are you sure you want to Approve the request") == true) {console.log(walletRequestid)walletRequestApprove(0,walletRequestid);}});$(".cancel").live('click',function(){loadWalletRequest("main-content");});$(".confirm").live('click',function(){console.log(walletRequestid)walletRequestApprove(0,walletRequestid);});});function walletRequestApprove(id , walletRequestid) {doPutAjaxRequestHandler(context + "/addAmountToWallet?id="+id+"&walletRequestid=" +walletRequestid,function(response) {if (response == 'true') {alert("successfully Approved");loadWalletRequest("main-content");}});}function walletRequestRejected(id) {doPutAjaxRequestHandler(context + "/addAmountToWalletRequestRejected?id="+id,function(response) {if (response == 'true') {alert("successfully Rejected");loadWalletRequest("main-content");}});}function loadWalletRequest(domId){doGetAjaxRequestHandler(context+ "/getAddWalletRequest", function(response){$('#' + domId).html(response);});}function loadWalletApproveRequest(domId){doGetAjaxRequestHandler(context+ "/getAddWalletApproved", function(response){$('#' + domId).html(response);});}function loadWalletRejectedRequest(domId){doGetAjaxRequestHandler(context+ "/getAddWalletRequestRejected", function(response){$('#' + domId).html(response);});}