Subversion Repositories SmartDukaan

Rev

Rev 27755 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27755 Rev 32887
Line 1... Line 1...
1
$(function() {
1
$(function() {
2
	$(document).on('click', ".promoter-info", function() {
2
	$(document).on('click', ".promoter-info", function() {
3
		loadPromotor("main-content");
3
		loadPromotor("main-content", true);
4
	});
4
	});
5
 
5
 
-
 
6
 
-
 
7
	$(document).on('click', ".inactive-promoter-info", function() {
-
 
8
		loadPromotorInactive("main-content", true);
-
 
9
	});
-
 
10
 
-
 
11
 
6
	var id = 0;
12
	var id = 0;
7
	var retailerId;
13
	var retailerId;
8
	var fofoId;
14
	var fofoId;
9
 
15
 
10
	$(document).on('click', "#promoter-info-paginated .next",
16
	$(document).on('click', "#promoter-info-paginated .next",
Line 51... Line 57...
51
				$(this).blur();
57
				$(this).blur();
52
			}
58
			}
53
		});
59
		});
54
 
60
 
55
 
61
 
-
 
62
		$(document).on('click', "#promoter-inactive-info-paginated .next",
-
 
63
        		function() {
-
 
64
 
-
 
65
        			var fofo = fofoId;
-
 
66
        			console.log(fofoId)
-
 
67
        			if ((fofoId)) {
-
 
68
 
-
 
69
        				var params = {};
-
 
70
        				params['fofoId'] = fofo;
-
 
71
        				loadPaginatedNextItems('/getPaginatedPromoterInactiveInfo', params,
-
 
72
        					'promoter-inactive-info-paginated', 'promoter-Inactive-Info-table',
-
 
73
        					'promoter-inactive-container');
-
 
74
 
-
 
75
        			} else {
-
 
76
        				loadPaginatedNextItems('/getPaginatedPromoterInactiveInfo', null,
-
 
77
        					'promoter-inactive-info-paginated', 'promoter-Inactive-Info-table',
-
 
78
        					'promoter-inactive-container');
-
 
79
 
-
 
80
        				$(this).blur();
-
 
81
        			}
-
 
82
        		});
-
 
83
 
-
 
84
 
-
 
85
        	$(document).on('click', "#promoter-inactive-info-paginated .previous",
-
 
86
        		function() {
-
 
87
        			var fofo = fofoId;
-
 
88
        			console.log(fofoId)
-
 
89
        			if ((fofoId)) {
-
 
90
 
-
 
91
        				var params = {};
-
 
92
        				params['fofoId'] = fofo;
-
 
93
        				loadPaginatedPreviousItems('/getPaginatedPromoterInactiveInfo', params,
-
 
94
        					'promoter-inactive-info-paginated', 'promoter-Inactive-Info-table',
-
 
95
        					'promoter-inactive-container');
-
 
96
 
-
 
97
        			} else {
-
 
98
 
-
 
99
        				loadPaginatedPreviousItems('/getPaginatedPromoterInactiveInfo', null,
-
 
100
        					'promoter-inactive-info-paginated', 'promoter-Inactive-Info-table',
-
 
101
        					'promoter-inactive-container');
-
 
102
 
-
 
103
        				$(this).blur();
-
 
104
        			}
-
 
105
        		});
-
 
106
 
-
 
107
 
56
	$(document).on('click', ".create-promoter",
108
	$(document).on('click', ".create-promoter",
57
		function() {
109
		function() {
58
			var name = $('#promoterName').val();
110
			var name = $('#promoterName').val();
59
			var brand = $('#tag-listing-brands').val();
111
			var brand = $('#tag-listing-brands').val();
60
			var email = $('#promoterEmail').val();
112
			var email = $('#promoterEmail').val();
Line 116... Line 168...
116
 
168
 
117
				return false;
169
				return false;
118
			}
170
			}
119
		});
171
		});
120
 
172
 
-
 
173
 
121
	$(document).on('click', ".updatePromoterdetail", function() {
174
	$(document).on('click', ".updatePromoterdetail", function() {
122
		id = $(this).data('requestid');
175
		id = $(this).data('requestid');
123
		name = $(this).data('name');
176
		name = $(this).data('name');
124
		brand = $(this).data('brand');
177
		brand = $(this).data('brand');
125
		partner = $(this).data('partner');
178
		partner = $(this).data('partner');
Line 143... Line 196...
143
		$('#promoterMobile').attr('readonly', true);*/
196
		$('#promoterMobile').attr('readonly', true);*/
144
		$('#partnerFofoId').attr('disabled', true);
197
		$('#partnerFofoId').attr('disabled', true);
145
		$('#tag-listing-brands').attr('disabled', true);
198
		$('#tag-listing-brands').attr('disabled', true);
146
 
199
 
147
	});
200
	});
-
 
201
 
148
	$(document).on('click', ".removePromoter",
202
	$(document).on('click', ".removePromoter",
149
			function() {
203
			function() {
150
				id = $(this).data('requestid');
204
				id = $(this).data('requestid');
151
				if (confirm("Are you sure you want to remove Promoter Partner Store!") == true) {
205
				if (confirm("Are you sure you want to remove Promoter Partner Store!") == true) {
152
					doPostAjaxRequestHandler(context
206
					doPostAjaxRequestHandler(context
Line 162... Line 216...
162
 
216
 
163
					return false;
217
					return false;
164
				}
218
				}
165
 
219
 
166
			});
220
			});
-
 
221
			$(document).on('click', ".inactivePromoter", function () {
-
 
222
                        console.log('this is working or noyt')
-
 
223
                        var id = $(this).data('requestid');
-
 
224
                        if (confirm("Are you sure you want to  InActive this Promoter")) {
-
 
225
 
-
 
226
                            doPostAjaxRequestHandler(context + "/getPromoterInactive?id=" + id,
-
 
227
                                function (response) {
-
 
228
                                    if (response === "true") {
-
 
229
                                    alert("successfully moved to active promoter");
-
 
230
                                        loadPromoter("main-content");
-
 
231
                                    }
-
 
232
                                });
-
 
233
                        }
-
 
234
 
-
 
235
                    });
-
 
236
                    $(document).on('click', ".activePromoter",  function () {
-
 
237
 
-
 
238
                                            var id = $(this).data('requestid');
-
 
239
                                            if (confirm("Are you sure you want to  Active this Promoter")) {
-
 
240
 
-
 
241
                                                doPostAjaxRequestHandler(context + "/activePromoterfromPartnerStore?id=" + id,
-
 
242
                                                    function (response) {
-
 
243
                                                        if (response === "true") {
-
 
244
                                                        alert("successfully moved to active promoter");
-
 
245
                                                           // loadPromoter("main-content");
-
 
246
                                                           id = 0;
-
 
247
                                                        }
-
 
248
                                                    });
-
 
249
                                            }
-
 
250
 
-
 
251
                                        });
167
 
252
 
168
	$(document).on('click', "#promoter-fofo-search", function() {
253
	$(document).on('click', "#promoter-fofo-search", function() {
169
 
254
 
170
		fofoId = partnerId;
255
		fofoId = partnerId;
171
		doGetAjaxRequestHandler(context + "/getPromoterInfo?fofoId=" + fofoId, function(response) {
256
		doGetAjaxRequestHandler(context + "/getPromoterInfo?fofoId=" + fofoId, function(response) {
172
			$('#' + "main-content").html(response);
257
			$('#' + "main-content").html(response);
173
		});
258
		});
174
	});
259
	});
-
 
260
	$(document).on('click', "#inactive-promoter-fofo-search", function() {
-
 
261
 
-
 
262
    		fofoId = partnerId;
-
 
263
    		doGetAjaxRequestHandler(context + "/getPromoterInactive?fofoId=" + fofoId, function(response) {
-
 
264
    			$('#' + "main-content").html(response);
-
 
265
    		});
-
 
266
    	});
175
});
267
});
176
 
268
 
177
function loadPromotor(domId) {
269
function loadPromotor(domId, active) {
178
	doGetAjaxRequestHandler(context + "/getPromoterInfo", function(response) {
270
	doGetAjaxRequestHandler(context + "/getPromoterInfo?active=true", function(response) {
-
 
271
		$('#' + domId).html(response);
-
 
272
	});
-
 
273
}
-
 
274
function loadPromotorInactive(domId, inactive) {
-
 
275
	doGetAjaxRequestHandler(context + "/getPromoterInactive?active=false", function(response) {
179
		$('#' + domId).html(response);
276
		$('#' + domId).html(response);
180
	});
277
	});
181
}
278
}
182
279