Subversion Repositories SmartDukaan

Rev

Rev 30599 | Rev 32299 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
31762 tejbeer 1
$(function() {
2
	$(document).on('click', ".create-scheme", function() {
23343 ashik.ali 3
		loadScheme("main-content");
4
	});
31762 tejbeer 5
	$(document).on('click', ".scheme-details", function() {
23343 ashik.ali 6
		var schemeId = $(this).attr('data');
23752 govind 7
		console.log("schemeId = " + schemeId);
23343 ashik.ali 8
		loadSchemeDetails(schemeId, "scheme-details-container");
9
	});
31762 tejbeer 10
	$(document).on('click', ".active-scheme", function() {
23343 ashik.ali 11
		var schemeId = $(this).attr('data');
23752 govind 12
		console.log("active-scheme id : " + schemeId);
13
		var start = $("#schemes-paginated .start").text();
14
		// var end = $( "#schemes-paginated .end" ).text();
23343 ashik.ali 15
		var offset = start - 1;
30122 amit.gupta 16
		if (confirm("Are you sure you want to Active Scheme!")) {
23343 ashik.ali 17
			activeScheme(schemeId, offset, "schemes-table");
18
		}
19
	});
23752 govind 20
 
31762 tejbeer 21
 
22
	$(document).on('click', ".scheme-imei-history", function() {
23
		loadImeiWiseScheme("main-content");
24
	});
25
 
26
	$(document).on('click', ".expire-scheme", function() {
23343 ashik.ali 27
		var schemeId = $(this).attr('data');
30599 amit.gupta 28
		var expireDate = getDatesFromPicker('input[name="expireSchemeById"]').endDate;
30122 amit.gupta 29
		if (confirm("Are you sure you want to Expire Scheme!")) {
30599 amit.gupta 30
			expireScheme(schemeId, expireDate, "schemes-table");
23343 ashik.ali 31
		}
32
	});
27755 amit.gupta 33
	$(document).on('click', "#extendDatetime-button",
31762 tejbeer 34
		function() {
28134 tejbeer 35
			console.log("extendAll button click");
30599 amit.gupta 36
			var extendDatetime = getDatesFromPicker('input[name="extendDatetime"]')
37
				.endDate;
28134 tejbeer 38
			console.log("extendDatetime : " + extendDatetime);
39
			if (extendDatetime) {
30122 amit.gupta 40
				if (confirm("Are you sure you want to Extend expireDateTime for All Scheme!")) {
30599 amit.gupta 41
					extendAllScheme(extendDatetime);
28134 tejbeer 42
				}
43
			} else {
44
				alert("feild can't be blank");
45
			}
46
		});
27755 amit.gupta 47
	$(document).on('click', "#extendScheme-button",
31762 tejbeer 48
		function() {
28134 tejbeer 49
			console.log("extend button click");
30599 amit.gupta 50
			var extendDatetime = getDatesFromPicker('input[name="extendSchemeById"]').endDate;
28134 tejbeer 51
			var schemeId = $('#schemeId').val()
52
			console.log("extendDatetime : " + extendDatetime);
53
			console.log(schemeId);
54
			if (extendDatetime) {
55
				if (confirm("Are you sure you want to Extend expireDateTime for Scheme!") == true) {
30599 amit.gupta 56
					extendSchemeById(extendDatetime, schemeId);
28134 tejbeer 57
				}
58
			} else {
30054 manish 59
				alert("field can't be blank");
30122 amit.gupta 60
			}
28134 tejbeer 61
		});
30122 amit.gupta 62
 
63
 
29586 manish 64
	$(document).on('click', ".monthy-investment",
31762 tejbeer 65
		function() {
30122 amit.gupta 66
			console.log("hello evaluateActualInvestmentPayout");
67
			window.location.href = context + "/evaluateActualInvestmentPayout";
68
 
69
		});
70
 
31762 tejbeer 71
	$(document).on('click', ".process-investment", function() {
29759 amit.gupta 72
		if (confirm("Are you sure you want to Process Investment")) {
29761 amit.gupta 73
			processInvestment();
29759 amit.gupta 74
		}
75
	});
76
 
30122 amit.gupta 77
 
29586 manish 78
	$(document).on('click', ".processInvestmentDryRun",
31762 tejbeer 79
		function() {
30122 amit.gupta 80
			console.log("processInvestmentDryRun");
81
			window.location.href = context + "/processInvestmentDryRun";
82
 
83
		});
84
 
30054 manish 85
	$(document).on('click', ".brand-wise-income",
31762 tejbeer 86
		function() {
30122 amit.gupta 87
			var brand = $(this).data('brand');
88
 
89
			var status = $(this).data('status');
90
			var month = $(this).data('month');
91
 
92
			brandWiseIncome(brand, month, status);
93
 
94
		});
95
 
30054 manish 96
	$(document).on('click', ".imei_wise_income",
31762 tejbeer 97
		function() {
23752 govind 98
 
30122 amit.gupta 99
 
100
			var catalogItemId = $(this).data('catalogitemid');
101
			var month = $(this).data('month');
102
 
103
			console.log(catalogItemId);
104
			imeiWiseIncome(catalogItemId, month);
105
 
106
		});
107
 
31762 tejbeer 108
	$(document).on('change', "#month-wise-income", function() {
30122 amit.gupta 109
		var month = $(this).val();
110
 
111
		monthWiseIncome(month, "main-content");
112
	});
113
 
114
 
31762 tejbeer 115
	$(document).on('click', ".schemes", function() {
30122 amit.gupta 116
		schemes("main-content");
23347 ashik.ali 117
		console.log("Active Schemes Button Clicked...")
28134 tejbeer 118
 
30122 amit.gupta 119
		/*bootbox.confirm({
28134 tejbeer 120
			message: "<div class = 'disclosurehindata'> <img src='resources/images/disclosure.png' style='width:100%'> </div>"
121
			,
122
			buttons: {
123
				confirm: {
124
					label: 'I agree',
125
					className: 'btn-success'
126
				},
127
				cancel: {
128
					label: 'I disagree',
129
					className: 'btn-danger'
130
				}
131
			},
30122 amit.gupta 132
			callback: function (result) {
28134 tejbeer 133
				if (result == true) {
134
				}
135
			}
30122 amit.gupta 136
		});*/
28134 tejbeer 137
 
23347 ashik.ali 138
	});
23752 govind 139
 
31762 tejbeer 140
	$(document).on('click', ".margin-calculator", function() {
27648 tejbeer 141
		console.log("Active Schemes Button Clicked...")
28134 tejbeer 142
		marginCalculator("main-content");
27648 tejbeer 143
	});
144
 
31762 tejbeer 145
	$(document).on('click', ".schemes-download-page", function() {
23347 ashik.ali 146
		console.log("Schemes Download Clicked...")
147
		loadSchemesDownloadPage("main-content");
22860 ashik.ali 148
	});
23752 govind 149
 
31762 tejbeer 150
	$(document).on('click', ".schemes-update", function() {
23556 amit.gupta 151
		loadSchemeUpdatePage("main-content");
152
	});
23557 amit.gupta 153
 
31762 tejbeer 154
	$(document).on('click', ".add-item", function() {
23928 govind 155
 
156
		schemeIds = $("#schemeids").val();
30122 amit.gupta 157
		itemIds = $("#catalogids").val();
158
		if (confirm("Are you sure you want to Add Model to Scheme!") == true) {
159
			if (catalogIds.trim().length === 0 || schemeIds.trim().length === 0) {
26763 tejbeer 160
				alert("fields shouldn't be blank");
161
				return;
162
			}
30122 amit.gupta 163
			updateSingleScheme(schemeIds, catalogIds);
23928 govind 164
		}
165
	});
31762 tejbeer 166
	$(document).on('click', ".add-schemes", function() {
23752 govind 167
 
30122 amit.gupta 168
		let schemeIds = $("#schemeids").val();
169
		let catalogIds = $("#catalogids").val();
170
 
23914 govind 171
		if (confirm("Are you sure you want to Add Item to Scheme!") == true) {
30122 amit.gupta 172
			if (catalogIds.trim().length === 0 || schemeIds.trim().length === 0) {
26763 tejbeer 173
				alert("fields shouldn't be blank");
174
				return;
175
			}
30122 amit.gupta 176
			updateSchemes(schemeIds, catalogIds);
23557 amit.gupta 177
		}
178
	});
31762 tejbeer 179
	$(document).on('click', ".delete-schemes", function() {
30122 amit.gupta 180
		if (confirm("Delete model from Scheme?") == true) {
23914 govind 181
			schemeId = $(this).data('schemeid');
30122 amit.gupta 182
			catalogId = $(this).data('catalogid');
183
			deleteScheme(schemeId, catalogId);
23715 govind 184
		}
23752 govind 185
	});
186
 
27755 amit.gupta 187
	$(document).on('click', "#scheme-search-button",
31762 tejbeer 188
		function() {
28134 tejbeer 189
			var searchText = $("#scheme-search-text").val();
190
			if (typeof (searchText) == "undefined" || !searchText) {
191
				searchText = "";
192
			}
30122 amit.gupta 193
			doGetAjaxRequestHandler(context + "/getSchemes?searchScheme="
31762 tejbeer 194
				+ searchText, function(response) {
195
					$('#' + "main-content").html(response);
196
				});
28134 tejbeer 197
		});
26802 tejbeer 198
 
31762 tejbeer 199
	$(document).on("keyup", "#scheme-search-text", function(e) {
23752 govind 200
		var keyCode = e.keyCode || e.which;
201
		if (keyCode == 13) {
202
			$("#scheme-search-button").click();
203
		}
204
	});
31762 tejbeer 205
	$(document).on('click', "#scheme-item-search-button", function() {
23752 govind 206
		var searchText = $("#scheme-item-search-text").val();
27875 amit.gupta 207
		var date = $(".schemes-date").val();
23752 govind 208
		if (typeof (searchText) == "undefined" || !searchText) {
209
			searchText = "";
26497 amit.gupta 210
			alert("please select item");
211
			return;
23752 govind 212
		}
27094 tejbeer 213
		if (typeof currentItem != "undefined") {
214
			console.log(currentItem);
27875 amit.gupta 215
			loadSchemeItemSearchInfo(currentItem, date);
27094 tejbeer 216
		} else {
217
			console.log("reeffff")
218
			alert("Data No Found")
219
		}
23752 govind 220
	});
221
 
28795 tejbeer 222
 
31762 tejbeer 223
	$(document).on('click', "#scheme-imei-search-button", function() {
28795 tejbeer 224
		var searchText = $("#scheme-imei-search-text").val();
225
		var date = $(".schemes-date").val();
226
		if (typeof (searchText) == "undefined" || !searchText) {
227
			searchText = "";
228
			alert("please select imei");
229
			return;
230
		}
231
		if (typeof imei != "undefined") {
232
			console.log(imei);
233
			loadSchemeImeiSearchInfo(imei, date);
234
		} else {
235
			console.log("reeffff")
236
			alert("Data No Found")
237
		}
238
	});
31762 tejbeer 239
 
240
 
241
	$(document).on('click', "#scheme-imei-wise-search-button", function() {
242
		var searchText = $("#scheme-imei-wise-search-text").val();
243
		var date = $(".schemes-date").val();
244
		if (typeof (searchText) == "undefined" || !searchText) {
245
			searchText = "";
246
			alert("please select imei");
247
			return;
248
		}
249
		if (typeof imei != "undefined") {
250
			console.log(imei);
251
			var searchText = $("#scheme-imei-wise-search-text").val();
252
 
253
			if ((searchText)) {
254
				doGetAjaxRequestHandler(`${context}/getSchemesByImei?searchImei=${searchText}`, function(response) {
255
					$('#' +  "main-content").html(response);
256
					$('#scheme-imei-search-text').val(searchText);
257
 
258
				});
259
			}
260
		} else {
261
			console.log("reeffff")
262
			alert("Data No Found")
263
		}
264
	});
27755 amit.gupta 265
	$(document).on('click', ".categoryWiseSchemeHistory",
31762 tejbeer 266
		function() {
28134 tejbeer 267
			var category = $('#partner-category').val();
268
			console.log(category);
26763 tejbeer 269
 
28134 tejbeer 270
			doGetAjaxRequestHandler(context + "/getSchemes?partnerType="
31762 tejbeer 271
				+ category, function(response) {
272
					$('#' + "main-content").html(response);
273
					$('#partner-category').val(category);
274
					window.dispatchEvent(new Event('resize'));
275
				});
26763 tejbeer 276
 
28134 tejbeer 277
		});
26763 tejbeer 278
 
31762 tejbeer 279
	$(document).on("keyup", "#scheme-item-search-text", function(e) {
23752 govind 280
		var keyCode = e.keyCode || e.which;
281
		if (keyCode == 13) {
282
			$("#scheme-item-search-button").click();
283
		}
284
	});
22860 ashik.ali 285
});
286
 
23752 govind 287
function configureTagListingItemsDescriptionDropDown() {
30148 amit.gupta 288
	$('.catalogItemsDescription').multiselect({
28134 tejbeer 289
		includeSelectAllOption: true,
290
		maxHeight: 200,
291
		buttonWidth: '180px',
292
		numberDisplayed: 1,
30148 amit.gupta 293
		nonSelectedText: 'Models',
294
		nSelectedText: ' - Models Selected',
295
		allSelectedText: 'All Models Selected',
28134 tejbeer 296
		enableFiltering: true,
297
		enableCaseInsensitiveFiltering: true
23752 govind 298
	});
23343 ashik.ali 299
}
300
 
23752 govind 301
function schemesDownload() {
30599 amit.gupta 302
	let pickerData = getDatesFromPicker('input[name="startEndDateTime"]')
303
	doAjaxGetDownload(context + "/schemes/download?" +
304
		"startDateTime=" + pickerData.startDate
305
		+ "&endDateTime=" + pickerData.endDate,
28134 tejbeer 306
		"SchemesReport.xlsx");
23343 ashik.ali 307
}
30122 amit.gupta 308
 
30501 amit.gupta 309
function selectedbrand(categoryId) {
23914 govind 310
	var brands = $('#tag-listing-brands').val();
311
	if (brands) {
30148 amit.gupta 312
		loadCatalogDescriptionByBrands(
30501 amit.gupta 313
			"tag-listing-items-description-container", categoryId, brands);
23914 govind 314
	}
315
}
30122 amit.gupta 316
 
30492 amit.gupta 317
function categoryChanged() {
318
	let categoryId = $('#category-list').val();
319
	if (categoryId) {
320
		loadBrandsByCategory(
321
			"brand-list", categoryId);
322
	}
323
}
324
 
23752 govind 325
function loadSchemeDetails(schemeId, domId) {
326
	doGetAjaxRequestHandler(context + "/getSchemeById?schemeId=" + schemeId,
31762 tejbeer 327
		function(response) {
28134 tejbeer 328
			$('#' + domId).html(response);
329
			window.dispatchEvent(new Event('resize'));
330
		});
23343 ashik.ali 331
}
332
 
23752 govind 333
function activeScheme(schemeId, offset, domId) {
334
	doPutAjaxRequestHandler(context + "/activeSchemeById?schemeId=" + schemeId
31762 tejbeer 335
		+ "&offset=" + offset, function(response) {
336
			$('#' + domId).html(response);
337
			$('#scheme-details-container').html('');
338
		});
23752 govind 339
 
23343 ashik.ali 340
}
341
 
30599 amit.gupta 342
function expireScheme(schemeId, expireDate, domId) {
23752 govind 343
	doPutAjaxRequestHandler(context + "/expireSchemeById?schemeId=" + schemeId
31762 tejbeer 344
		+ "&expireTimestamp=" + expireDate, function(
345
			response) {
26763 tejbeer 346
		alert("Scheme - " + schemeId + " marked for expiry successfully!");
23343 ashik.ali 347
		$('#' + domId).html(response);
348
		$('#scheme-details-container').html('');
349
	});
350
}
30122 amit.gupta 351
 
30599 amit.gupta 352
function extendAllScheme(extendDate) {
26763 tejbeer 353
	doPostAjaxRequestWithJsonHandler(context + "/extendAllSchemes", JSON
31762 tejbeer 354
		.stringify(extendDate), function(response) {
355
			if (response == 'true') {
356
				alert("Scheme All Extended successfully");
357
				schemes("main-content");
358
			} else {
359
				alert("No scheme Activated Currently");
360
				schemes("main-content");
361
			}
362
		});
23343 ashik.ali 363
 
23914 govind 364
}
30122 amit.gupta 365
 
30599 amit.gupta 366
function extendSchemeById(extendDate, schemeId) {
26763 tejbeer 367
	doPostAjaxRequestWithJsonHandler(context + "/extendSchemeById?schemeId="
31762 tejbeer 368
		+ schemeId, JSON.stringify(extendDate), function(response) {
369
			if (response == 'true') {
370
				alert("Scheme extended successfully");
371
				schemes("main-content");
372
			} else {
373
				alert("Scheme already Expired");
374
				schemes("main-content");
375
			}
376
		});
23914 govind 377
}
30122 amit.gupta 378
 
29761 amit.gupta 379
function processInvestment() {
31762 tejbeer 380
	doPostAjaxRequestWithJsonHandler(context + "/payMonthlyInvestment", function(response) {
29759 amit.gupta 381
		alert("InvestmentPayout processed successfully");
382
	});
383
}
23914 govind 384
 
23752 govind 385
function loadScheme(domId) {
31762 tejbeer 386
	doGetAjaxRequestHandler(context + "/createScheme", function(response) {
23343 ashik.ali 387
		$('#' + domId).html(response);
30492 amit.gupta 388
		createSchemeOnReady();
389
		categoryChanged();
30599 amit.gupta 390
		$('input[name="dateRange"]').daterangepicker(getRangedDatePicker());
23343 ashik.ali 391
	});
23752 govind 392
 
23343 ashik.ali 393
}
394
 
31762 tejbeer 395
function loadImeiWiseScheme(domId) {
396
	doGetAjaxRequestHandler(context + "/getSchemesByImei",
397
		function(response) {
398
			$('#' + domId).html(response);
399
 
400
		});
401
}
402
 
30501 amit.gupta 403
function loadCatalogDescriptionByBrands(domId, categoryId, brands) {
404
	let brandsString = brands.join(",")
405
	doGetAjaxRequestHandler(`${context}/getCatalogDescriptionByBrands?categoryId=${categoryId}&brands=${brandsString}`,
31762 tejbeer 406
		function(response) {
28134 tejbeer 407
			$('#' + domId).html(response);
408
			configureTagListingItemsDescriptionDropDown();
409
		});
23752 govind 410
 
23343 ashik.ali 411
}
412
 
30492 amit.gupta 413
function loadBrandsByCategory(domId, categoryId) {
414
	doGetAjaxRequestHandler(`${context}/getBrandsByCategory?categoryId=${categoryId}`,
31762 tejbeer 415
		function(response) {
30492 amit.gupta 416
			$('#' + domId).html(response);
417
			configureBrandsDropDown();
418
		});
419
}
420
 
23752 govind 421
function schemes(domId) {
31762 tejbeer 422
	doGetAjaxRequestHandler(context + "/getSchemes", function(response) {
23343 ashik.ali 423
		$('#' + domId).html(response);
424
	});
425
}
30122 amit.gupta 426
 
27648 tejbeer 427
function marginCalculator(domId) {
31762 tejbeer 428
	doGetAjaxRequestHandler(context + "/getMarginCalculator", function(response) {
27648 tejbeer 429
		$('#' + domId).html(response);
430
	});
431
}
23343 ashik.ali 432
 
23752 govind 433
function loadSchemesDownloadPage(domId) {
31762 tejbeer 434
	doGetAjaxRequestHandler(context + "/schemes/downloadPage", function(
28134 tejbeer 435
		response) {
23343 ashik.ali 436
		$('#' + domId).html(response);
437
	});
23556 amit.gupta 438
}
439
 
23752 govind 440
function loadSchemeUpdatePage(domId) {
31762 tejbeer 441
	doGetAjaxRequestHandler(context + "/schemes/update-schemes-page", function(
28134 tejbeer 442
		response) {
23556 amit.gupta 443
		$('#' + domId).html(response);
444
	});
23557 amit.gupta 445
}
446
 
30122 amit.gupta 447
function brandWiseIncome(brand, month, status) {
30054 manish 448
	console.log(brand);
449
	console.log(month);
30122 amit.gupta 450
 
31762 tejbeer 451
	doGetAjaxRequestHandler(context + "/brandWiseIncome?brand=" + brand + "&month=" + month + "&status=" + status, function(
30054 manish 452
		response) {
453
		$('.imei-wise-income-container').html('');
30122 amit.gupta 454
		$('.brand-wise-income-container').html(response);
30054 manish 455
	});
456
}
457
 
30122 amit.gupta 458
function monthWiseIncome(month, domId) {
30054 manish 459
	console.log(month);
31762 tejbeer 460
	doGetAjaxRequestHandler(context + "/monthWisePartnerIncome/" + month, function(response) {
30122 amit.gupta 461
		console.log(response);
462
		$('#' + domId).html(response);
463
	})
30054 manish 464
}
30122 amit.gupta 465
 
466
function imeiWiseIncome(catalogItemId, month) {
30054 manish 467
	console.log(catalogItemId);
468
	console.log(month);
30122 amit.gupta 469
 
31762 tejbeer 470
	doGetAjaxRequestHandler(context + "/getLastMonthImeiWiseIncome?catalogItemId=" + catalogItemId + "&month=" + month, function(
30054 manish 471
		response) {
30122 amit.gupta 472
		$('.imei-wise-income-container').html(response);
30054 manish 473
	});
474
}
475
 
30122 amit.gupta 476
function updateSingleScheme(shcemeIds, catalogIds) {
23928 govind 477
	doPostAjaxRequestWithJsonHandler(context + '/addItemToScheme', JSON
28134 tejbeer 478
		.stringify({
30122 amit.gupta 479
			"catalogIds": catalogIds.split(",").map(Number),
28134 tejbeer 480
			"schemeIds": schemeIds.split(",").map(Number)
31762 tejbeer 481
		}), function(response) {
482
			if (response == 'true') {
483
				alert("Item Added to scheme successfully");
484
				// $('#newItemToSchemeModal').modal('hide');
485
				loadSchemeDetails(shcemeIds, "scheme-details-container");
486
			} else {
487
				alert("Item already present");
488
				loadSchemeDetails(shcemeIds, "scheme-details-container");
489
			}
490
		});
23715 govind 491
}
30122 amit.gupta 492
 
493
function updateSchemes(schemeIds, catalogIds) {
23928 govind 494
	doPostAjaxRequestWithJsonHandler(context + '/schemes/update', JSON
28134 tejbeer 495
		.stringify({
30122 amit.gupta 496
			"catalogIds": catalogIds.split(",").map(Number),
28134 tejbeer 497
			"schemeIds": schemeIds.split(",").map(Number)
31762 tejbeer 498
		}), function(response) {
499
			if (response == 'true') {
500
				alert("Item Added to scheme successfully");
501
				// $('#newItemToSchemeModal').modal('hide');
502
				loadSchemeUpdatePage("main-content");
503
			}
504
		});
23928 govind 505
}
30122 amit.gupta 506
 
507
function deleteScheme(schemeId, catalogId) {
508
	doDeleteAjaxRequestHandler(context + "/schemes/delete?schemeId=" + schemeId
31762 tejbeer 509
		+ "&catalogId=" + catalogId, function(response) {
510
			if (response == 'true') {
511
				alert("Model Deleted successfully from Scheme");
512
				loadSchemeDetails(schemeId, "scheme-details-container");
513
			}
514
		});
23752 govind 515
}
30122 amit.gupta 516
 
517
 
518
function loadSearchItemScheme(domId, selectedModel, date) {
26802 tejbeer 519
	var searchText = $("#scheme-item-search-text").val();
520
	var category = $('#partner-category').val();
26912 tejbeer 521
 
26802 tejbeer 522
	if (typeof (searchText) == "undefined" || !searchText) {
523
		searchText = "";
524
	}
525
	if (typeof (category) == "undefined" || !category) {
526
		category = "";
527
	}
30122 amit.gupta 528
	if (searchText && category) {
31762 tejbeer 529
		doGetAjaxRequestHandler(`${context}/getSchemes?searchModel=${selectedModel}&partnerType=${category}&date=${date}`, function(response) {
26802 tejbeer 530
			$('#' + domId).html(response);
531
			$('#partner-category').val(category);
532
		});
30122 amit.gupta 533
	} else if (searchText) {
31762 tejbeer 534
		doGetAjaxRequestHandler(`${context}/getSchemes?searchModel=${selectedModel}&date=${date}`, function(response) {
26802 tejbeer 535
			$('#' + domId).html(response);
30253 amit.gupta 536
			$('#partner-category').val(category);
26802 tejbeer 537
		});
26912 tejbeer 538
 
539
	}
540
 
23752 govind 541
}
28795 tejbeer 542
 
543
function loadSearchImeiScheme(domId, selected_imei, date) {
544
	var category = $('#partner-category').val();
545
	var searchText = $("#scheme-imei-search-text").val();
546
 
547
	var category = $('#partner-category').val();
548
 
549
	console.log(category)
550
 
551
	if (typeof (searchText) == "undefined" || !searchText) {
552
		searchText = "";
553
	}
554
	if (typeof (category) == "undefined" || !category) {
555
		category = "";
556
	}
557
	if ((searchText) && (category)) {
558
		doGetAjaxRequestHandler(context + "/getSchemes?searchImei="
31762 tejbeer 559
			+ selected_imei + "&partnerType=" + category, function(
560
				response) {
28795 tejbeer 561
			$('#' + domId).html(response);
562
 
563
			$('#partner-category').val(category);
564
			$('#scheme-imei-search-text').val(selected_imei);
565
		});
566
	} else if ((searchText)) {
31762 tejbeer 567
		doGetAjaxRequestHandler(`${context}/getSchemes?searchImei=${selected_imei}&date=${date}`, function(response) {
28795 tejbeer 568
			$('#' + domId).html(response);
569
			$('#scheme-imei-search-text').val(selected_imei);
570
 
571
		});
572
	}
573
 
574
}
30122 amit.gupta 575
 
576
function loadSchemeItemSearchInfo(selectedModel, date) {
577
	loadSearchItemScheme("main-content", selectedModel, date);
23752 govind 578
}
28795 tejbeer 579
 
580
function loadSchemeImeiSearchInfo(selectedImei, date) {
581
 
582
	loadSearchImeiScheme("main-content", selectedImei, date);
583
}
584