Subversion Repositories SmartDukaan

Rev

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

Rev 25638 Rev 27171
Line 19... Line 19...
19
	});
19
	});
20
	$(".retailer-info").live('click', function() {
20
	$(".retailer-info").live('click', function() {
21
		retailerInfo("main-content");
21
		retailerInfo("main-content");
22
	});
22
	});
23
 
23
 
-
 
24
	$("#retailerAddressPinCode").live(
-
 
25
			'change',
-
 
26
			function() {
-
 
27
 
-
 
28
				var pincode = $('#retailerAddressPinCode').val();
-
 
29
 
-
 
30
				if (undefined != pincode) {
-
 
31
					doGetAjaxRequestHandler(context + "/postOffice?pinCode="
-
 
32
							+ pincode,
-
 
33
							function(response) {
-
 
34
								console.log(response.response.state);
-
 
35
 
-
 
36
								$('#retailerAddressState').val(
-
 
37
										response.response.state);
-
 
38
								for(let city of response.response.cities){
-
 
39
									    var opt = $("<option>").val(city).text(city);
-
 
40
				                        $('#retailerAddressCity').append(opt);
-
 
41
							           
-
 
42
								}
-
 
43
								
-
 
44
							});
-
 
45
				}
-
 
46
			});
-
 
47
 
24
	$("#retailer-details-search-text").live("keyup", function(e) {
48
	$("#retailer-details-search-text").live("keyup", function(e) {
25
		var keyCode = e.keyCode || e.which;
49
		var keyCode = e.keyCode || e.which;
26
		if (keyCode == 13) {
50
		if (keyCode == 13) {
27
			$("#retailer-details-search-button").click();
51
			$("#retailer-details-search-button").click();
28
		}
52
		}
Line 37... Line 61...
37
 
61
 
38
	});
62
	});
39
	$(".login_as").live('click', function() {
63
	$(".login_as").live('click', function() {
40
		var fofoId = $('#partnerId').val();
64
		var fofoId = $('#partnerId').val();
41
		loginAsPartner(fofoId);
65
		loginAsPartner(fofoId);
42
		
66
 
43
	});
67
	});
44
 
68
 
45
	$(".extend-billing").live('click', function() {
69
	$(".extend-billing").live('click', function() {
46
		var fofoId = $(this).data("fofoid");
70
		var fofoId = $(this).data("fofoid");
47
		console.log(fofoId);
71
		console.log(fofoId);
48
		if (confirm("Are you sure you want to extend Billing?")) {
72
		if (confirm("Are you sure you want to extend Billing?")) {
49
			extendBilling($(this).parent(), fofoId);
73
			extendBilling($(this).parent(), fofoId);
50
		}
74
		}
51
		
-
 
52
	});
-
 
53
 
75
 
54
	$('#retailerAddressState').live('change', function() {
-
 
55
		var stateName = $(this).find('option:selected').text();
-
 
56
		loadDistrictNames(stateName);
-
 
57
	});
76
	});
-
 
77
	/*
-
 
78
	 * $('#retailerAddressState').live('change', function() { var stateName =
-
 
79
	 * $(this).find('option:selected').text(); loadDistrictNames(stateName); });
-
 
80
	 * 
-
 
81
	 */
58
 
82
 
59
	$("#location").live(
83
	$("#location").live('click', function() {
60
			'click',
-
 
61
			function() {
-
 
62
				if ($(this).is(":checked")) {
84
		if ($(this).is(":checked")) {
63
					
-
 
64
					$("#divLocation").show();	
-
 
65
 
85
 
-
 
86
			$("#divLocation").show();
-
 
87
 
66
				} else {
88
		} else {
67
					$("#divLocation").hide();
89
			$("#divLocation").hide();
68
				}
90
		}
69
			});
91
	});
70
 
92
 
71
	$(".addlocationbutton").live(
93
	$(".addlocationbutton").live(
72
			'click',
94
			'click',
73
			function() {
95
			function() {
74
				var userId = $('#retailerId').text();
96
				var userId = $('#retailerId').text();
Line 142... Line 164...
142
 
164
 
143
function getRetailerDetailsByEmailIdOrMobileNumber(domId, emailIdOrMobileNumber) {
165
function getRetailerDetailsByEmailIdOrMobileNumber(domId, emailIdOrMobileNumber) {
144
	doGetAjaxRequestHandler(context + "/retailerDetails?emailIdOrMobileNumber="
166
	doGetAjaxRequestHandler(context + "/retailerDetails?emailIdOrMobileNumber="
145
			+ emailIdOrMobileNumber, function(response) {
167
			+ emailIdOrMobileNumber, function(response) {
146
		$('#' + domId).html(response);
168
		$('#' + domId).html(response);
147
		if ($("#location").is(":checked")){ 
169
		if ($("#location").is(":checked")) {
148
			
170
 
149
			$("#divLocation").show();
171
			$("#divLocation").show();
150
		}
172
		}
151
	});
173
	});
152
}
174
}
153
 
175
 
Line 215... Line 237...
215
	doGetAjaxRequestHandler(context + "/getAllStores", function(response) {
237
	doGetAjaxRequestHandler(context + "/getAllStores", function(response) {
216
		$('#' + domId).html(response);
238
		$('#' + domId).html(response);
217
	});
239
	});
218
}
240
}
219
function inactiveStoreInfo(domId) {
241
function inactiveStoreInfo(domId) {
220
	doGetAjaxRequestHandler(context + "/getAllInactiveStores", function(response) {
242
	doGetAjaxRequestHandler(context + "/getAllInactiveStores", function(
-
 
243
			response) {
221
		$('#' + domId).html(response);
244
		$('#' + domId).html(response);
222
	});
245
	});
223
}
246
}
224
function deactivateStore(domId, fofoId) {
247
function deactivateStore(domId, fofoId) {
225
	doPostAjaxRequestHandler(context + "/deactivateStore?fofoId=" + fofoId,
248
	doPostAjaxRequestHandler(context + "/deactivateStore?fofoId=" + fofoId,
Line 230... Line 253...
230
				}
253
				}
231
 
254
 
232
			});
255
			});
233
}
256
}
234
function loginAsPartner(fofoId) {
257
function loginAsPartner(fofoId) {
235
	doGetAjaxRequestHandler(context + "/login-as-partner?fofoId=" + fofoId, function(response) {
258
	doGetAjaxRequestHandler(context + "/login-as-partner?fofoId=" + fofoId,
-
 
259
			function(response) {
-
 
260
				window.create({
236
		window.create({"url": "/dashboard", "incognito": true});
261
					"url" : "/dashboard",
-
 
262
					"incognito" : true
-
 
263
				});
237
	});
264
			});
238
}
265
}
239
function extendBilling(container, fofoId) {
266
function extendBilling(container, fofoId) {
240
	doPostAjaxRequestHandler(context + "/extendBilling?fofoId=" + fofoId,
267
	doPostAjaxRequestHandler(context + "/extendBilling?fofoId=" + fofoId,
241
			function(response) {
268
			function(response) {
242
			if (isFinite(response)) {
269
				if (isFinite(response)) {
243
				alert("successfully deactivated!");
270
					alert("successfully deactivated!");
-
 
271
					container.html("Billing extended upto "
244
				container.html("Billing extended upto " + moment().add(1,'day').format("DD-MM-YY") + " Grace count(" + response + ")");
272
							+ moment().add(1, 'day').format("DD-MM-YY")
-
 
273
							+ " Grace count(" + response + ")");
245
			}
274
				}
246
	});
275
			});
247
}
276
}
248
 
277
 
249
function updateLocationButton(id) {
278
function updateLocationButton(id) {
250
 
279
 
251
	var userId = id;
280
	var userId = id;