Subversion Repositories SmartDukaan

Rev

Rev 31932 | Rev 32089 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31932 Rev 32044
Line 140... Line 140...
140
	$(document).on('click', ".login_as", function() {
140
	$(document).on('click', ".login_as", function() {
141
		var fofoId = $('#partnerId').val();
141
		var fofoId = $('#partnerId').val();
142
		loginAsPartner(fofoId);
142
		loginAsPartner(fofoId);
143
 
143
 
144
	});
144
	});
145
	$(document).on('click', ".partner-performance-access", function() {
-
 
146
 
-
 
147
 
-
 
148
		doGetAjaxRequestHandler(context + "/getPartnersForPerformance", function(response) {
-
 
149
			$('#' + "main-content").html(response);
-
 
150
		});
-
 
151
	});
-
 
152
 
-
 
153
	$(document).on('click', ".partnerPerformance", function() {
-
 
154
		var fofoId = $('#fofo-users').val();
-
 
155
 
-
 
156
		//var url = context + "/partnerPerformance?fofoId=" + fofoId;
-
 
157
 
-
 
158
 
-
 
159
		//$('.partner-performance-container').html(`<iframe class="wrapper" src="${url}" style="width:100%;height:100vh"> </iframe>`); 
-
 
160
 
-
 
161
		doGetAjaxRequestHandler(context + "/partnerPerformance?fofoId=" + fofoId, function(response) {
-
 
162
			$('.partner-performance-container').html(response);
-
 
163
		});
-
 
164
 
-
 
165
	});
-
 
166
 
-
 
167
 
145
 
168
 
146
 
169
	$('#partnerSecondary').on('click', '.brandFocusedStock', function() {
147
	$('#partnerSecondary').on('click', '.brandFocusedStock', function() {
170
		var fofoId = $(this).data('fofoid');
148
		var fofoId = $(this).data('fofoid');
171
		var brand = $(this).data('brand');
149
		var brand = $(this).data('brand');
Line 323... Line 301...
323
 
301
 
324
				return false;
302
				return false;
325
			}
303
			}
326
		});
304
		});
327
 
305
 
-
 
306
 
-
 
307
 
-
 
308
	//Performance
-
 
309
	$(document).on('click', ".partner-performance-access", function() {
-
 
310
		doGetAjaxRequestHandler(context + "/getPartnersForPerformance", function(response) {
-
 
311
			$('#' + "main-content").html(response);
-
 
312
		});
-
 
313
	});
-
 
314
 
-
 
315
	$(document).on('click', ".partnerPerformance", function() {
-
 
316
		var fofoId = $('#fofo-users').val();
-
 
317
		var url = context + "/partnerPerformance?fofoId=" + fofoId;
-
 
318
		//$('.partner-performance-container').html(`<iframe class="wrapper" src="${url}" style="width:100%;height:100vh"> </iframe>`); 
-
 
319
		doGetAjaxRequestHandler(context + "/partnerPerformance?fofoId=" + fofoId, function(response) {
-
 
320
			$('.partner-performance-container').html(response);
-
 
321
		});
-
 
322
	});
-
 
323
 
-
 
324
	$(document).on('click', ".retailer-filter", function() {
-
 
325
		doGetAjaxRequestHandler(context + "/getFilters", function(response) {
-
 
326
			$('#' + "main-content").html(response);
-
 
327
		});
-
 
328
	});
-
 
329
 
-
 
330
 
-
 
331
	$(document).on('click', ".filters", function() {
-
 
332
 
-
 
333
		var credit = $('#credit').is(':checked');
-
 
334
		var billing = $('#billing').is(':checked');
-
 
335
		var investment = $('#investment').is(':checked');
-
 
336
		var secondary = $('#secondary').is(':checked');
-
 
337
		var tertiary = $('#tertiary').is(':checked');
-
 
338
		var mtds = $('#mtds').is(':checked');
-
 
339
		var mtdt = $('#mtdt').is(':checked');
-
 
340
 
-
 
341
		var investmentPct = $('#investmentvalue').val();
-
 
342
		var secondaryDays = $('#secondaryvalue').val();
-
 
343
		var tertiaryDays = $('#tertiaryvalue').val();
-
 
344
		var mtdsPct = $('#mtdsvalue').val();
-
 
345
		var mtdtPct = $('#mtdtvalue').val();
-
 
346
 
-
 
347
		console.log(investmentPct)
-
 
348
 
-
 
349
 
-
 
350
 
-
 
351
		var retailerFilters = {};
-
 
352
		retailerFilters['credit'] = credit;
-
 
353
		retailerFilters['billing'] = billing
-
 
354
		if (investment) {
-
 
355
			retailerFilters['investmentPct'] = investmentPct
-
 
356
		}
-
 
357
		if (secondary) {
-
 
358
			retailerFilters['secondaryDays'] = secondaryDays
-
 
359
		}
-
 
360
		if (tertiary) {
-
 
361
			retailerFilters['tertiaryDays'] = tertiaryDays
-
 
362
		}
-
 
363
 
-
 
364
		if (mtds) {
-
 
365
			retailerFilters['mtdsPct'] = mtdsPct
-
 
366
		}
-
 
367
 
-
 
368
		if (mtdt) {
-
 
369
			retailerFilters['mtdtPct'] = mtdtPct
-
 
370
		}
-
 
371
 
-
 
372
		doAjaxRequestWithJsonHandler(context + "/getFilteredRetailers", 'POST', JSON.stringify(retailerFilters), function(response) {
-
 
373
			$('.filtered-partner-performance-container').html(response);
-
 
374
 
-
 
375
		});
-
 
376
	});
-
 
377
 
-
 
378
 
-
 
379
 
-
 
380
	$(document).on('click', ".default-email-val", function() {
-
 
381
 
-
 
382
		var credit = $('#credit').is(':checked');
-
 
383
		var billing = $('#billing').is(':checked');
-
 
384
		var investment = $('#investment').is(':checked');
-
 
385
		var secondary = $('#secondary').is(':checked');
-
 
386
		var tertiary = $('#tertiary').is(':checked');
-
 
387
		var mtds = $('#mtds').is(':checked');
-
 
388
		var mtdt = $('#mtdt').is(':checked');
-
 
389
 
-
 
390
		var investmentPct = $('#investmentvalue').val();
-
 
391
		var secondaryDays = $('#secondaryvalue').val();
-
 
392
		var tertiaryDays = $('#tertiaryvalue').val();
-
 
393
		var mtdsPct = $('#mtdsvalue').val();
-
 
394
		var mtdtPct = $('#mtdtvalue').val();
-
 
395
 
-
 
396
		console.log(investmentPct)
-
 
397
 
-
 
398
 
-
 
399
 
-
 
400
		var retailerFilters = {};
-
 
401
		retailerFilters['credit'] = credit;
-
 
402
		retailerFilters['billing'] = billing
-
 
403
		retailerFilters['investmentPct'] = investmentPct
-
 
404
		retailerFilters['secondaryDays'] = secondaryDays
-
 
405
		retailerFilters['tertiaryDays'] = tertiaryDays
-
 
406
		retailerFilters['mtdsPct'] = mtdsPct
-
 
407
		retailerFilters['mtdtPct'] = mtdtPct
-
 
408
 
-
 
409
 
-
 
410
 
-
 
411
 
-
 
412
		doAjaxRequestWithJsonHandler(context + "/defaultFilterSetForEmail", 'POST', JSON.stringify(retailerFilters), function(response) {
-
 
413
			if (response == "true") {
-
 
414
				alert("Successfully Done")
-
 
415
			}
-
 
416
		});
-
 
417
	});
-
 
418
 
-
 
419
 
328
});
420
});
329
 
421
 
330
function getDistance(lat1, lon1, lat2, lon2) {
422
function getDistance(lat1, lon1, lat2, lon2) {
331
	var deg2rad = 0.017453292519943295; // === Math.PI / 180
423
	var deg2rad = 0.017453292519943295; // === Math.PI / 180
332
	var cos = Math.cos;
424
	var cos = Math.cos;