| Line 1... |
Line 1... |
| 1 |
$(function() {
|
1 |
$(function() {
|
| 2 |
|
2 |
|
| - |
|
3 |
$(".create-mobile-recharge-commission").live('click', function() {
|
| - |
|
4 |
console.log("Create Mobile Recharge Commission Button Clicked...");
|
| - |
|
5 |
loadCreateRechargeCommission("main-content", "MOBILE");
|
| - |
|
6 |
});
|
| - |
|
7 |
|
| - |
|
8 |
$(".create-dth-recharge-commission").live('click', function() {
|
| - |
|
9 |
console.log("Create Dth Recharge Commission Button Clicked...");
|
| - |
|
10 |
loadCreateRechargeCommission("main-content", "DTH");
|
| - |
|
11 |
});
|
| - |
|
12 |
|
| 3 |
$(".create-mobile-recharge").live('click', function() {
|
13 |
$(".create-mobile-recharge").live('click', function() {
|
| 4 |
console.log("Create Mobile Recharge Button Clicked...");
|
14 |
console.log("Create Mobile Recharge Button Clicked...");
|
| 5 |
loadCreateRecharge("main-content", "MOBILE");
|
15 |
loadCreateRecharge("main-content", "MOBILE");
|
| 6 |
});
|
16 |
});
|
| 7 |
|
17 |
|
| Line 88... |
Line 98... |
| 88 |
var start = $( "#dth-recharges-paginated .start" ).text();
|
98 |
var start = $( "#dth-recharges-paginated .start" ).text();
|
| 89 |
var offset = start - 1;
|
99 |
var offset = start - 1;
|
| 90 |
rechargeCheckStatus("dth-recharge-table", requestId, "DTH", offset);
|
100 |
rechargeCheckStatus("dth-recharge-table", requestId, "DTH", offset);
|
| 91 |
});
|
101 |
});
|
| 92 |
|
102 |
|
| 93 |
$("#operatorType").live('change',function() {
|
103 |
$("#rechargeOperatorType").live('change',function() {
|
| 94 |
console.log("Operator Type Clicked...");
|
104 |
console.log("Operator Type Clicked...");
|
| 95 |
loadOperatorsByOperatorType("rechargeOperator", $(this).val());
|
105 |
loadRechargeOperatorsByOperatorType("rechargeOperator", $(this).val());
|
| - |
|
106 |
});
|
| - |
|
107 |
|
| - |
|
108 |
$("#rechargeCommissionOperatorType").live('change',function() {
|
| - |
|
109 |
console.log("Operator Type Clicked...");
|
| - |
|
110 |
loadRechargeCommissionOperatorsByOperatorType("rechargeCommissionOperator", $(this).val());
|
| - |
|
111 |
});
|
| - |
|
112 |
|
| - |
|
113 |
$(".recharge-commissions").live('click', function() {
|
| - |
|
114 |
console.log("Recharge Commissions Button Clicked...");
|
| - |
|
115 |
loadRechargeCommissions("main-content", "MOBILE");
|
| - |
|
116 |
});
|
| - |
|
117 |
|
| - |
|
118 |
$("#recharge-commissions-paginated .next").live('click', function() {
|
| - |
|
119 |
var start = $( "#recharge-commissions-paginated .start" ).text();
|
| - |
|
120 |
var end = $( "#recharge-commissions-paginated .end" ).text();
|
| - |
|
121 |
getRechargeCommissionsNextItems(start, end);
|
| - |
|
122 |
$("#recharge-commissions-paginated .next").blur();
|
| - |
|
123 |
});
|
| - |
|
124 |
|
| - |
|
125 |
$("#recharge-commissions-paginated .previous").live('click', function() {
|
| - |
|
126 |
var start = $( "#recharge-commissions-paginated .start" ).text();
|
| - |
|
127 |
var end = $( "#recharge-commissions-paginated .end" ).text();
|
| - |
|
128 |
var size = $("#recharge-commissions-paginated .size").text();
|
| - |
|
129 |
if(parseInt(end) == parseInt(size)){
|
| - |
|
130 |
var mod = parseInt(end) % 10;
|
| - |
|
131 |
end = parseInt(end) + (10 - mod);
|
| - |
|
132 |
}
|
| - |
|
133 |
var pre = end - 20;
|
| - |
|
134 |
getRechargeCommissionsPreviousItems(start, end, pre);
|
| - |
|
135 |
$("#recharge-commissions-paginated .previous").blur();
|
| - |
|
136 |
});
|
| - |
|
137 |
|
| - |
|
138 |
$(".recharge-commission-details").live('click',function(){
|
| - |
|
139 |
var operatorId = $(this).attr('data');
|
| - |
|
140 |
console.log("operatorId = "+operatorId);
|
| - |
|
141 |
loadRechargeCommissionDetails("recharge-commission-details-container", operatorId);
|
| - |
|
142 |
});
|
| - |
|
143 |
|
| - |
|
144 |
$(".recharge-commission-update-details").live('click',function(){
|
| - |
|
145 |
var operatorId = $(this).attr('data');
|
| - |
|
146 |
console.log("operatorId : "+operatorId);
|
| - |
|
147 |
var amountType = $('#amountType option:selected').val();
|
| - |
|
148 |
console.log("amountType : "+amountType);
|
| - |
|
149 |
var amount = $('#amount').val();
|
| - |
|
150 |
console.log("amount : "+amount);
|
| - |
|
151 |
var start = $( "#recharge-commissions-paginated .start" ).text();
|
| - |
|
152 |
//var end = $( "#schemes-paginated .end" ).text();
|
| - |
|
153 |
var offset = start - 1;
|
| - |
|
154 |
if(confirm("Are you sure you want to update Recharge Commission details!") == true){
|
| - |
|
155 |
updateRechargeCommissionDetails(operatorId, amountType, amount, offset, "recharge-commissions-table");
|
| - |
|
156 |
}
|
| 96 |
});
|
157 |
});
|
| 97 |
|
158 |
|
| 98 |
});
|
159 |
});
|
| 99 |
|
160 |
|
| 100 |
function loadCreateRecharge(domId, rechargeType){
|
161 |
function loadCreateRecharge(domId, rechargeType){
|
| 101 |
doGetAjaxRequestHandler(context+"/createRecharge?rechargeType="+rechargeType, function(response){
|
162 |
doGetAjaxRequestHandler(context+"/createRecharge?rechargeType="+rechargeType, function(response){
|
| 102 |
$('#' + domId).html(response);
|
163 |
$('#' + domId).html(response);
|
| 103 |
});
|
164 |
});
|
| 104 |
}
|
165 |
}
|
| 105 |
|
166 |
|
| - |
|
167 |
function loadCreateRechargeCommission(domId, rechargeType){
|
| - |
|
168 |
doGetAjaxRequestHandler(context+"/createRechargeCommission?rechargeType="+rechargeType, function(response){
|
| - |
|
169 |
$('#' + domId).html(response);
|
| - |
|
170 |
});
|
| - |
|
171 |
}
|
| - |
|
172 |
|
| 106 |
function loadOperatorsByOperatorType(domId, operatorType){
|
173 |
function loadRechargeOperatorsByOperatorType(domId, operatorType){
|
| 107 |
doGetAjaxRequestHandler(context+"/getOperators?operatorType="+operatorType, function(response){
|
174 |
doGetAjaxRequestHandler(context+"/getRechargeOperators?operatorType="+operatorType, function(response){
|
| - |
|
175 |
$('#' + domId).html(response);
|
| - |
|
176 |
});
|
| - |
|
177 |
}
|
| - |
|
178 |
|
| - |
|
179 |
function loadRechargeCommissionOperatorsByOperatorType(domId, operatorType){
|
| - |
|
180 |
doGetAjaxRequestHandler(context+"/getRechargeCommissionOperators?operatorType="+operatorType, function(response){
|
| 108 |
$('#' + domId).html(response);
|
181 |
$('#' + domId).html(response);
|
| 109 |
});
|
182 |
});
|
| 110 |
}
|
183 |
}
|
| 111 |
|
184 |
|
| 112 |
function loadRecharges(domId, rechargeType){
|
185 |
function loadRecharges(domId, rechargeType){
|
| 113 |
doGetAjaxRequestHandler(context+"/getRecharges?rechargeType="+rechargeType, function(response){
|
186 |
doGetAjaxRequestHandler(context+"/getRecharges?rechargeType="+rechargeType, function(response){
|
| 114 |
$('#' + domId).html(response);
|
187 |
$('#' + domId).html(response);
|
| 115 |
});
|
188 |
});
|
| 116 |
}
|
189 |
}
|
| 117 |
|
190 |
|
| - |
|
191 |
function loadRechargeCommissions(domId, rechargeType){
|
| - |
|
192 |
doGetAjaxRequestHandler(context+"/getRechargeCommissions", function(response){
|
| - |
|
193 |
$('#' + domId).html(response);
|
| - |
|
194 |
});
|
| - |
|
195 |
}
|
| - |
|
196 |
|
| 118 |
function getRechargesNextItems(rechargeType, start, end){
|
197 |
function getRechargesNextItems(rechargeType, start, end){
|
| 119 |
console.log(start);
|
198 |
console.log(start);
|
| 120 |
console.log(end);
|
199 |
console.log(end);
|
| 121 |
console.log(+end + +10);
|
200 |
console.log(+end + +10);
|
| 122 |
console.log(+start + +10);
|
201 |
console.log(+start + +10);
|
| Line 179... |
Line 258... |
| 179 |
$(paginatedRechargeIdentifier + ".next").prop('disabled', false);
|
258 |
$(paginatedRechargeIdentifier + ".next").prop('disabled', false);
|
| 180 |
if (parseInt(pre)==0){
|
259 |
if (parseInt(pre)==0){
|
| 181 |
$(paginatedRechargeIdentifier + ".previous").prop('disabled', true);
|
260 |
$(paginatedRechargeIdentifier + ".previous").prop('disabled', true);
|
| 182 |
}
|
261 |
}
|
| 183 |
});
|
262 |
});
|
| 184 |
|
- |
|
| 185 |
|
- |
|
| 186 |
}
|
263 |
}
|
| 187 |
|
264 |
|
| - |
|
265 |
|
| - |
|
266 |
function getRechargeCommissionsNextItems(start, end){
|
| - |
|
267 |
console.log(start);
|
| - |
|
268 |
console.log(end);
|
| - |
|
269 |
console.log(+end + +10);
|
| - |
|
270 |
console.log(+start + +10);
|
| - |
|
271 |
doGetAjaxRequestHandler(context+"/getPaginatedRechargeCommissions?offset="+end, function(response){
|
| - |
|
272 |
var size = $("#recharge-commissions-paginated .size").text();
|
| - |
|
273 |
if((parseInt(end) + 10) > parseInt(size)){
|
| - |
|
274 |
console.log("(end + 10) > size == true");
|
| - |
|
275 |
$( "#recharge-commissions-paginated .end" ).text(size);
|
| - |
|
276 |
}else{
|
| - |
|
277 |
console.log("(end + 10) > size == false");
|
| - |
|
278 |
$( "#recharge-commissions-paginated .end" ).text(+end + +10);
|
| - |
|
279 |
}
|
| - |
|
280 |
$( "#recharge-commissions-paginated .start" ).text(+start + +10);
|
| - |
|
281 |
var last = $( "#recharge-commissions-paginated .end" ).text();
|
| - |
|
282 |
var temp = $( "#recharge-commissions-paginated .size" ).text();
|
| - |
|
283 |
if (parseInt(last) >= parseInt(temp)){
|
| - |
|
284 |
$("#recharge-commissions-paginated .next").prop('disabled', true);
|
| - |
|
285 |
//$( "#good-inventory-paginated .end" ).text(temp);
|
| - |
|
286 |
}
|
| - |
|
287 |
$('#recharge-commissions-table').html(response);
|
| - |
|
288 |
$('#recharge-commission-details-container').html('');
|
| - |
|
289 |
$("#recharge-commissions-paginated .previous").prop('disabled', false);
|
| - |
|
290 |
});
|
| - |
|
291 |
|
| - |
|
292 |
}
|
| - |
|
293 |
|
| - |
|
294 |
|
| - |
|
295 |
function getRechargeCommissionsPreviousItems(start, end, pre){
|
| - |
|
296 |
doGetAjaxRequestHandler(context+"/getPaginatedRechargeCommissions/?offset="+pre, function(response){
|
| - |
|
297 |
$("#recharge-commissions-paginated .end" ).text(+end - +10);
|
| - |
|
298 |
$("#recharge-commissions-paginated .start" ).text(+start - +10);
|
| - |
|
299 |
$('#recharge-commissions-table').html(response);
|
| - |
|
300 |
$('#recharge-commission-details-container').html('');
|
| - |
|
301 |
$("#recharge-commissions-paginated .next").prop('disabled', false);
|
| - |
|
302 |
if (parseInt(pre)==0){
|
| - |
|
303 |
$("#recharge-commissions-paginated .previous").prop('disabled', true);
|
| - |
|
304 |
}
|
| - |
|
305 |
});
|
| - |
|
306 |
}
|
| - |
|
307 |
|
| - |
|
308 |
|
| 188 |
function loadRechargeDetails(domId, rechargeTransactionId){
|
309 |
function loadRechargeDetails(domId, rechargeTransactionId){
|
| 189 |
doGetAjaxRequestHandler(context+"/getRechargeById?rechargeTransactionId="+rechargeTransactionId, function(response){
|
310 |
doGetAjaxRequestHandler(context+"/getRechargeById?rechargeTransactionId="+rechargeTransactionId, function(response){
|
| 190 |
$('#' + domId).html(response);
|
311 |
$('#' + domId).html(response);
|
| 191 |
});
|
312 |
});
|
| 192 |
}
|
313 |
}
|
| 193 |
|
314 |
|
| - |
|
315 |
function loadRechargeCommissionDetails(domId, operatorId){
|
| - |
|
316 |
doGetAjaxRequestHandler(context+"/getRechargeCommissionByOperatorId?operatorId="+operatorId, function(response){
|
| - |
|
317 |
$('#' + domId).html(response);
|
| - |
|
318 |
});
|
| - |
|
319 |
}
|
| - |
|
320 |
|
| - |
|
321 |
function updateRechargeCommissionDetails(operatorId, amountType, amount, offset, domId){
|
| - |
|
322 |
doPutAjaxRequestHandler(context+"/updateRechargeCommission?operatorId="+operatorId
|
| - |
|
323 |
+"&amountType="+amountType+"&amount="+amount
|
| - |
|
324 |
+"&offset="+offset, function(response){
|
| - |
|
325 |
$('#' + domId).html(response);
|
| - |
|
326 |
$('#recharge-commission-details-container').html('');
|
| - |
|
327 |
alert("Recharge Commission details have been updated successfully")
|
| - |
|
328 |
});
|
| - |
|
329 |
|
| - |
|
330 |
}
|
| - |
|
331 |
|
| 194 |
function rechargeCheckStatus(domId, requestId, rechargeType, offset){
|
332 |
function rechargeCheckStatus(domId, requestId, rechargeType, offset){
|
| 195 |
doGetAjaxRequestHandler(context+"/checkStatus?requestId="+requestId+"&rechargeType="+rechargeType+"&offset="+offset, function(response){
|
333 |
doGetAjaxRequestHandler(context+"/checkStatus?requestId="+requestId+"&rechargeType="+rechargeType+"&offset="+offset, function(response){
|
| 196 |
$('#' + domId).html(response);
|
334 |
$('#' + domId).html(response);
|
| 197 |
});
|
335 |
});
|
| 198 |
}
|
336 |
}
|