Subversion Repositories SmartDukaan

Rev

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

Rev 29898 Rev 30492
Line 1... Line 1...
1
$(function() {
1
$(function () {
2
	$(document).on('click', ".create-service", function() {
2
	$(document).on('click', ".create-service", function () {
3
		loadService("main-content");
3
		loadService("main-content");
4
	});
4
	});
5
	
5
 
6
	$(document).on('click', ".add-brand", function() {
6
	$(document).on('click', ".add-brand", function () {
7
		loadaddBrandToService("main-content");
7
		loadaddBrandToService("main-content");
8
	});
8
	});
9
 
9
 
10
	$(document).on('click', ".notApplicableBrandService",
10
	$(document).on('click', ".notApplicableBrandService",
11
			function() {
11
		function () {
12
				naCommentService = $(this).data('nacommentservice');
12
			naCommentService = $(this).data('nacommentservice');
13
				console.log(naCommentService);
13
			console.log(naCommentService);
14
				var dialog = bootbox.dialog({
14
			var dialog = bootbox.dialog({
15
					message : "<h4 style='color:red'>NOTAPPLICABLE</h4><p>"
15
				message: "<h4 style='color:red'>NOTAPPLICABLE</h4><p>"
16
							+ naCommentService + "</p>",
16
					+ naCommentService + "</p>",
17
					closeButton : true
17
				closeButton: true
18
				});
-
 
19
				dialog.modal('show');
-
 
20
 
-
 
21
			});
18
			});
-
 
19
			dialog.modal('show');
-
 
20
 
-
 
21
		});
22
	$(document).on('click', ".add-brand", function() {
22
	$(document).on('click', ".add-brand", function () {
23
		loadaddBrandToService("main-content");
23
		loadaddBrandToService("main-content");
24
	});
24
	});
25
	$(document).on('click', ".activate-brand-service-modal", function() {
25
	$(document).on('click', ".activate-brand-service-modal", function () {
26
		console.log("activate-brand-service-modal clicked");
26
		console.log("activate-brand-service-modal clicked");
27
		serviceId = $(this).data('serviceid');
27
		serviceId = $(this).data('serviceid');
28
		fofoId = $("#partnerName").val();
28
		fofoId = $("#partnerName").val();
29
		serviceBrandId = $(this).data('servicebrandid');
29
		serviceBrandId = $(this).data('servicebrandid');
30
		console.log(fofoId);
30
		console.log(fofoId);
31
		console.log(serviceId);
31
		console.log(serviceId);
32
		console.log(serviceBrandId);
32
		console.log(serviceBrandId);
33
		var params = {
33
		var params = {
34
				"serviceId" : serviceId,
34
			"serviceId": serviceId,
35
				"fofoId" : fofoId,
35
			"fofoId": fofoId,
36
				"serviceBrandId" : serviceBrandId
36
			"serviceBrandId": serviceBrandId
-
 
37
 
-
 
38
		}
-
 
39
		doPostAjaxRequestWithParamsHandler(context
-
 
40
			+ "/activatePartnerbrandServiceModal", params, function (response) {
-
 
41
 
-
 
42
			$('#myServiceActivateBrand').html(response);
-
 
43
 
-
 
44
		});
37
 
45
 
38
			}
-
 
39
			doPostAjaxRequestWithParamsHandler(context
-
 
40
			+ "/activatePartnerbrandServiceModal", params, function(response) {
-
 
41
				
-
 
42
				$('#myServiceActivateBrand').html(response);
-
 
43
		
-
 
44
			});
-
 
45
		
-
 
46
 
46
 
47
	});
47
	});
48
	
48
 
49
$(document).on('click', ".submit-brand-not-available", function() {
49
	$(document).on('click', ".submit-brand-not-available", function () {
50
		
50
 
51
	console.log("submit-brand-not-available");
51
		console.log("submit-brand-not-available");
52
	serviceId = $(this).data('serviceid');
52
		serviceId = $(this).data('serviceid');
53
	   fofoId = $("#partnerName").val();
53
		fofoId = $("#partnerName").val();
54
	  serviceBrandId = $(this).data('servicebrandid');
54
		serviceBrandId = $(this).data('servicebrandid');
55
	  na_comment = $('input[name="reasonBrandNotAvailable"]').val();
55
		na_comment = $('input[name="reasonBrandNotAvailable"]').val();
56
	   active=false;
56
		active = false;
57
	   partnerStatus="NOTWORKING";
57
		partnerStatus = "NOTWORKING";
58
	   applicableType="NO";
58
		applicableType = "NO";
59
	   
59
 
60
	   if (na_comment == "" || na_comment == undefined) {
60
		if (na_comment == "" || na_comment == undefined) {
61
			alert("Na_comment can't be empty");
61
			alert("Na_comment can't be empty");
62
			return;
62
			return;
63
		}
63
		}
64
	  
64
 
65
		addPartnerServiceBrandDetails(fofoId, serviceId,
65
		addPartnerServiceBrandDetails(fofoId, serviceId,
66
				serviceBrandId, applicableType, active,
66
			serviceBrandId, applicableType, active,
67
				partnerStatus, na_comment);
67
			partnerStatus, na_comment);
68
		$('#myServiceActivateBrand').modal('hide');
68
		$('#myServiceActivateBrand').modal('hide');
69
		$('.modal-backdrop').remove();
69
		$('.modal-backdrop').remove();
70
	
70
 
71
	});
71
	});
72
	
72
 
73
   $(document).on('click', ".reason-brand-service-not-activates", function() {
73
	$(document).on('click', ".reason-brand-service-not-activates", function () {
74
		
74
 
75
		console.log("reason-brand-service-not-activates clicked");
75
		console.log("reason-brand-service-not-activates clicked");
76
		serviceId = $(this).data('serviceid');
76
		serviceId = $(this).data('serviceid');
77
		fofoId = $("#partnerName").val();
77
		fofoId = $("#partnerName").val();
78
		serviceBrandId = $(this).data('servicebrandid');
78
		serviceBrandId = $(this).data('servicebrandid');
79
	  var serviceBrandComment = $('input[name="reasonBrandServiceNotActivate"]').val();
79
		var serviceBrandComment = $('input[name="reasonBrandServiceNotActivate"]').val();
80
		console.log(fofoId);
80
		console.log(fofoId);
81
		console.log(serviceId);
81
		console.log(serviceId);
82
		console.log(serviceBrandId);
82
		console.log(serviceBrandId);
83
		console.log(serviceBrandComment);
83
		console.log(serviceBrandComment);
84
		reasonPartnerbrandServiceNotActivate(fofoId, serviceId, serviceBrandId,serviceBrandComment);
84
		reasonPartnerbrandServiceNotActivate(fofoId, serviceId, serviceBrandId, serviceBrandComment);
85
	
85
 
86
	});
86
	});
87
   
-
 
88
   
87
 
89
   
88
 
90
   $(document).on('click', ".service-comment", function() {
89
	$(document).on('click', ".service-comment", function () {
91
		serviceId = $(this).data('serviceid');
90
		serviceId = $(this).data('serviceid');
92
		fofoId =  $(this).data('fofoid');
91
		fofoId = $(this).data('fofoid');
93
		var row = $(this).closest("tr");
92
		var row = $(this).closest("tr");
94
		
93
 
95
		bootbox.dialog({
94
		bootbox.dialog({
96
			title : "Comment!",
95
			title: "Comment!",
97
			message : "<div class=form-inline'>"
96
			message: "<div class=form-inline'>"
98
					+ "<label for='code'>comment :</label>"
97
				+ "<label for='code'>comment :</label>"
99
					+ "<input class='form-control' type='text' id='naTextComment'/>"
98
				+ "<input class='form-control' type='text' id='naTextComment'/>"
100
					+ "</div>",
99
				+ "</div>",
101
			buttons : {
100
			buttons: {
102
				cancel : {
101
				cancel: {
103
					label : "CANCEL",
102
					label: "CANCEL",
104
					className : 'btn-danger',
103
					className: 'btn-danger',
105
					callback : function() {
104
					callback: function () {
106
						return;
105
						return;
107
					}
106
					}
108
				},
107
				},
109
				ok : {
108
				ok: {
110
					label : "OK",
109
					label: "OK",
111
					className : 'btn-info',
110
					className: 'btn-info',
112
					callback : function() {
111
					callback: function () {
113
						naText = $('#naTextComment').val();
112
						naText = $('#naTextComment').val();
114
						if(naText==""||naText==undefined||naText==null){
113
						if (naText == "" || naText == undefined || naText == null) {
115
								alert("Comment text can't be empty");
114
							alert("Comment text can't be empty");
116
								return;
115
							return;
117
							}
116
						}
118
						var params = {
117
						var params = {
119
								"serviceId" : serviceId,
118
							"serviceId": serviceId,
120
								"fofoId" : fofoId,
119
							"fofoId": fofoId,
121
								"naText":naText
120
							"naText": naText
122
							}
121
						}
123
							doPostAjaxRequestWithJsonHandler(context + "/addPartnerServiceGenComment",
122
						doPostAjaxRequestWithJsonHandler(context + "/addPartnerServiceGenComment",
124
									JSON.stringify(params), function(response) {
123
							JSON.stringify(params), function (response) {
125
										alert("Successfully Submitted");
124
								alert("Successfully Submitted");
126
										row.html(response);
125
								row.html(response);
127
										
126
 
128
									});
127
							});
129
					}
128
					}
130
				}
129
				}
131
			}
130
			}
132
		});
131
		});
133
	});
132
	});
134
   
133
 
135
   
134
 
136
   $(document).on('click', ".follow-up-date", function() {
135
	$(document).on('click', ".follow-up-date", function () {
137
		serviceId = $(this).data('serviceid');
136
		serviceId = $(this).data('serviceid');
138
		fofoId =  $(this).data('fofoid');
137
		fofoId = $(this).data('fofoid');
139
		gencomment =  $(this).data('gencomment');
138
		gencomment = $(this).data('gencomment');
140
		console.log("fofoId"+fofoId);
139
		console.log("fofoId" + fofoId);
141
		var row = $(this).closest("tr");
140
		var row = $(this).closest("tr");
142
		
141
 
143
		bootbox.dialog({
142
		bootbox.dialog({
144
			title : "Follow Up Date",
143
			title: "Follow Up Date",
145
			message : "<div class=form-inline'>"
144
			message: "<div class=form-inline'>"
146
					+ "<label for='followUpDate'>Follow Up Date:</label>"
145
				+ "<label for='followUpDate'>Follow Up Date:</label>"
147
					+ "<input class='form-control' type='date' id='followUpDate'/>"
146
				+ "<input class='form-control' type='date' id='followUpDate'/>"
148
					+ "</div>",
147
				+ "</div>",
149
			buttons : {
148
			buttons: {
150
				cancel : {
149
				cancel: {
151
					label : "CANCEL",
150
					label: "CANCEL",
152
					className : 'btn-danger',
151
					className: 'btn-danger',
153
					callback : function() {
152
					callback: function () {
154
						return;
153
						return;
155
					}
154
					}
156
				},
155
				},
157
				ok : {
156
				ok: {
158
					label : "OK",
157
					label: "OK",
159
					className : 'btn-info',
158
					className: 'btn-info',
160
					callback : function() {
159
					callback: function () {
161
						followUpDate = $('#followUpDate').val();
160
						followUpDate = $('#followUpDate').val();
162
						
161
 
163
 
162
 
164
						var params = {
163
						var params = {
165
								"serviceId" : serviceId,
164
							"serviceId": serviceId,
166
								"fofoId" : fofoId,
165
							"fofoId": fofoId,
167
								"naText": gencomment,
166
							"naText": gencomment,
168
								"followUpDate": followUpDate
167
							"followUpDate": followUpDate
169
								
168
 
170
							}
169
						}
171
						
170
 
172
						
171
 
173
							doPostAjaxRequestWithJsonHandler(context + "/addPartnerServiceFollowupDate",
172
						doPostAjaxRequestWithJsonHandler(context + "/addPartnerServiceFollowupDate",
174
									JSON.stringify(params), function(response) {
173
							JSON.stringify(params), function (response) {
175
										alert("Successfully Submit");
174
								alert("Successfully Submit");
176
										row.html(response);
175
								row.html(response);
177
										
176
 
178
									});
177
							});
179
					}
178
					}
180
				}
179
				}
181
			}
180
			}
182
		});
181
		});
183
	});
182
	});
184
	
183
 
185
   $(document).on('click', ".service-mark-not-active", function() {
184
	$(document).on('click', ".service-mark-not-active", function () {
186
		serviceId = $(this).data('serviceid');
185
		serviceId = $(this).data('serviceid');
187
		fofoId =  $(this).data('fofoid');
186
		fofoId = $(this).data('fofoid');
188
		var row = $(this).closest("tr");
187
		var row = $(this).closest("tr");
189
		
188
 
190
		bootbox.dialog({
189
		bootbox.dialog({
191
			title : "Mark Not Applicable!",
190
			title: "Mark Not Applicable!",
192
			message : "<div class=form-inline'>"
191
			message: "<div class=form-inline'>"
193
					+ "<label for='code'>Not Applicable Reason:</label>"
192
				+ "<label for='code'>Not Applicable Reason:</label>"
194
					+ "<input class='form-control' type='text' id='naText'/>"
193
				+ "<input class='form-control' type='text' id='naText'/>"
195
					+ "</div>",
194
				+ "</div>",
196
			buttons : {
195
			buttons: {
197
				cancel : {
196
				cancel: {
198
					label : "CANCEL",
197
					label: "CANCEL",
199
					className : 'btn-danger',
198
					className: 'btn-danger',
200
					callback : function() {
199
					callback: function () {
201
						return;
200
						return;
202
					}
201
					}
203
				},
202
				},
204
				ok : {
203
				ok: {
205
					label : "OK",
204
					label: "OK",
206
					className : 'btn-info',
205
					className: 'btn-info',
207
					callback : function() {
206
					callback: function () {
208
						naText = $('#naText').val();
207
						naText = $('#naText').val();
209
						if(naText==""||naText==undefined||naText==null){
208
						if (naText == "" || naText == undefined || naText == null) {
210
								alert("NA text can't be empty");
209
							alert("NA text can't be empty");
211
								return;
210
							return;
212
							}
211
						}
213
						var params = {
212
						var params = {
214
								"serviceId" : serviceId,
213
							"serviceId": serviceId,
215
								"fofoId" : fofoId,
214
							"fofoId": fofoId,
216
								"naText":naText
215
							"naText": naText
217
							}
216
						}
218
							doPostAjaxRequestWithJsonHandler(context + "/addPartnerServiceNotavailable",
217
						doPostAjaxRequestWithJsonHandler(context + "/addPartnerServiceNotavailable",
219
									JSON.stringify(params), function(response) {
218
							JSON.stringify(params), function (response) {
220
										alert("Successfully Marked NA");
219
								alert("Successfully Marked NA");
221
										row.html(response);
220
								row.html(response);
222
										
221
 
223
									});
222
							});
224
					}
223
					}
225
				}
224
				}
226
			}
225
			}
227
		});
226
		});
228
	});
227
	});
229
	
228
 
230
	$(document).on('click', ".markNA", function() {
229
	$(document).on('click', ".markNA", function () {
231
		let fofoId = $('#partnerName').val();
230
		let fofoId = $('#partnerName').val();
232
		let serviceId = $(this).data("serviceid");
231
		let serviceId = $(this).data("serviceid");
233
		bootbox.dialog({
232
		bootbox.dialog({
234
			title : "Mark Not Applicable!",
233
			title: "Mark Not Applicable!",
235
			message : "<div class=form-inline'>"
234
			message: "<div class=form-inline'>"
236
					+ "<label for='code'>Not Applicable Reason:</label>"
235
				+ "<label for='code'>Not Applicable Reason:</label>"
237
					+ "<input class='form-control' type='text' id='naText'/>"
236
				+ "<input class='form-control' type='text' id='naText'/>"
238
					+ "</div>",
237
				+ "</div>",
239
			buttons : {
238
			buttons: {
240
				cancel : {
239
				cancel: {
241
					label : "CANCEL",
240
					label: "CANCEL",
242
					className : 'btn-danger',
241
					className: 'btn-danger',
243
					callback : function() {
242
					callback: function () {
244
						return;
243
						return;
245
					}
244
					}
246
				},
245
				},
247
				ok : {
246
				ok: {
248
					label : "OK",
247
					label: "OK",
249
					className : 'btn-info',
248
					className: 'btn-info',
250
					callback : function() {
249
					callback: function () {
251
						naText = $('#naText').val();
250
						naText = $('#naText').val();
252
						if(naText==""||naText==undefined||naText==null){
251
						if (naText == "" || naText == undefined || naText == null) {
253
								alert("NA text can't be empty");
252
							alert("NA text can't be empty");
254
								return;
253
							return;
255
							}
254
						}
256
						var params = {
255
						var params = {
257
								"serviceId" : serviceId,
256
							"serviceId": serviceId,
258
								"fofoId" : fofoId,
257
							"fofoId": fofoId,
259
								"naText":naText
258
							"naText": naText
260
							}
259
						}
261
							doPostAjaxRequestWithJsonHandler(context + "/partnerservice/applicable",
260
						doPostAjaxRequestWithJsonHandler(context + "/partnerservice/applicable",
262
									JSON.stringify(params), function(response) {
261
							JSON.stringify(params), function (response) {
263
										alert("Successfully Marked NA");
262
								alert("Successfully Marked NA");
264
										loadAdminPartnerService("main-content", fofoId);
263
								loadAdminPartnerService("main-content", fofoId);
265
									});
264
							});
266
					}
265
					}
267
				}
266
				}
268
			}
267
			}
269
		});
268
		});
270
	});
269
	});
271
	$(document).on('click', ".markApplicable", function() {
270
	$(document).on('click', ".markApplicable", function () {
272
		let serviceId = $(this).data("serviceid");
271
		let serviceId = $(this).data("serviceid");
273
		if(confirm("Confirm?")) {
272
		if (confirm("Confirm?")) {
274
		let fofoId = $('#partnerName').val();
273
			let fofoId = $('#partnerName').val();
275
			var params = {
274
			var params = {
276
				"serviceId" : serviceId,
275
				"serviceId": serviceId,
277
				"fofoId" : fofoId,
276
				"fofoId": fofoId,
278
				"naText":null
277
				"naText": null
279
			}
278
			}
280
			doPostAjaxRequestWithJsonHandler(context + "/partnerservice/applicable", JSON.stringify(params), function(response) {
279
			doPostAjaxRequestWithJsonHandler(context + "/partnerservice/applicable", JSON.stringify(params), function (response) {
281
				alert("successfully Marked Applicable");
280
				alert("successfully Marked Applicable");
282
				loadAdminPartnerService("main-content", fofoId);
281
				loadAdminPartnerService("main-content", fofoId);
283
			});
282
			});
284
			
283
 
285
		}
284
		}
286
	});
285
	});
287
	
286
 
288
	$(document).on('click', ".add-service-details-for-partner",
287
	$(document).on('click', ".add-service-details-for-partner",
289
			function() {
288
		function () {
290
				fofoId = $("#partnerName").val();
289
			fofoId = $("#partnerName").val();
291
				serviceId = $("#serviceName").val();
290
			serviceId = $("#serviceName").val();
292
				applicableType = $("#applicableService").val();
291
			applicableType = $("#applicableService").val();
293
				code = $("#code").val();
292
			code = $("#code").val();
294
				partnerStatus = $("#partnerStatusTypeServices").val();
293
			partnerStatus = $("#partnerStatusTypeServices").val();
295
				na_comment = $("#na_comment_services").val();
294
			na_comment = $("#na_comment_services").val();
296
				partnerCommentStatus = $("#partner_comment_status").val();
295
			partnerCommentStatus = $("#partner_comment_status").val();
297
				 if (applicableType == "" || applicableType == null
296
			if (applicableType == "" || applicableType == null
298
							|| applicableType == undefined) {
297
				|| applicableType == undefined) {
299
						alert("select appropriate applicableType");
298
				alert("select appropriate applicableType");
300
				 }
-
 
301
				 else if (applicableType == 'NO') {
299
			} else if (applicableType == 'NO') {
302
					if (na_comment == "" || na_comment == undefined) {
300
				if (na_comment == "" || na_comment == undefined) {
303
						alert("Na_comment can't be empty");
301
					alert("Na_comment can't be empty");
304
						return;
-
 
305
					}
-
 
306
					if (fofoId == "" || fofoId == null || fofoId == undefined) {
-
 
307
						alert("select appropriate partnerName");
-
 
308
						return;
302
					return;
309
					}
-
 
310
					 if (serviceId == "" || serviceId == null
-
 
311
								|| serviceId == undefined) {
-
 
312
							alert("select appropriate serviceName");
-
 
313
							return;
-
 
314
					 }
-
 
315
				}
303
				}
316
				 else
-
 
317
					 {
-
 
318
						if (fofoId == "" || fofoId == null || fofoId == undefined) {
304
				if (fofoId == "" || fofoId == null || fofoId == undefined) {
319
							alert("select appropriate partnerName");
305
					alert("select appropriate partnerName");
320
							return;
-
 
321
						}
-
 
322
						 if (serviceId == "" || serviceId == null
-
 
323
									|| serviceId == undefined) {
-
 
324
								alert("select appropriate serviceName");
-
 
325
								return;
-
 
326
						 }
-
 
327
				 if (code == "" || code == null
-
 
328
						|| code == undefined) {
-
 
329
					alert("enter appropriate code")
-
 
330
					return;
306
					return;
331
				} 
307
				}
332
					 }
-
 
333
				 console.log(fofoId, serviceId, applicableType, code,
-
 
334
							partnerStatus);
-
 
335
					addPartnerServiceDetails(fofoId, serviceId, applicableType,
-
 
336
							code, partnerStatus, na_comment,
-
 
337
							partnerCommentStatus);
-
 
338
				
-
 
339
			});
-
 
340
	$(document).on('click', ".add-brand-service-details-for-partner",
-
 
341
			function() {
-
 
342
				fofoId = $("#partnerName").val();
-
 
343
				serviceId = $("#serviceName").val();
308
				if (serviceId == "" || serviceId == null
344
				serviceBrandId = $("#serviceBrandName").val();
-
 
345
				applicableType = $("#applicableService").val();
-
 
346
				active = $("#activeServiceBrand").val();
-
 
347
				partnerStatus = $("#partnerStatusTypeServices").val();
-
 
348
				na_comment = $("#na_comment_services").val();
-
 
349
				partnerCommentStatus = $("#partner_comment_status").val();
-
 
350
				if (applicableType == "NO") {
-
 
351
					if (na_comment == "" || na_comment == undefined) {
309
					|| serviceId == undefined) {
352
						alert("Na_comment can't be empty");
310
					alert("select appropriate serviceName");
353
						return;
311
					return;
354
					}
312
				}
355
				} 
313
			} else {
356
				if (fofoId == "" || fofoId == null || fofoId == undefined) {
314
				if (fofoId == "" || fofoId == null || fofoId == undefined) {
357
					alert("select appropriate partnerName");
315
					alert("select appropriate partnerName");
358
					return;
316
					return;
-
 
317
				}
359
				} else if (serviceBrandId == "" || serviceBrandId == null
318
				if (serviceId == "" || serviceId == null
360
						|| serviceBrandId == undefined) {
319
					|| serviceId == undefined) {
361
					alert("select appropriate serviceBrandId");
320
					alert("select appropriate serviceName");
362
					return;
321
					return;
363
				} else if (applicableType == "" || applicableType == null
-
 
364
						|| applicableType == undefined) {
-
 
365
					alert("select appropriate applicableType");
-
 
366
				} else if (active == "" || active == null
-
 
367
						|| active == undefined) {
-
 
368
					alert("select appropriate active")
-
 
369
				} else if (partnerStatus == "" || partnerStatus == null
-
 
370
						|| partnerStatus == undefined) {
-
 
371
					alert("select appropriate partnerStatus");
-
 
372
				} else {
-
 
373
					console.log(fofoId, serviceBrandId, applicableType, active,
-
 
374
							partnerStatus);
-
 
375
					addPartnerServiceBrandDetails(fofoId, serviceId,
-
 
376
							serviceBrandId, applicableType, active,
-
 
377
							partnerStatus, na_comment, partnerCommentStatus);
-
 
378
				}
322
				}
-
 
323
				if (code == "" || code == null
-
 
324
					|| code == undefined) {
-
 
325
					alert("enter appropriate code")
-
 
326
					return;
-
 
327
				}
-
 
328
			}
-
 
329
			console.log(fofoId, serviceId, applicableType, code,
-
 
330
				partnerStatus);
-
 
331
			addPartnerServiceDetails(fofoId, serviceId, applicableType,
-
 
332
				code, partnerStatus, na_comment,
-
 
333
				partnerCommentStatus);
-
 
334
 
-
 
335
		});
-
 
336
	$(document).on('click', ".add-brand-service-details-for-partner",
-
 
337
		function () {
-
 
338
			fofoId = $("#partnerName").val();
-
 
339
			serviceId = $("#serviceName").val();
-
 
340
			serviceBrandId = $("#serviceBrandName").val();
-
 
341
			applicableType = $("#applicableService").val();
-
 
342
			active = $("#activeServiceBrand").val();
-
 
343
			partnerStatus = $("#partnerStatusTypeServices").val();
-
 
344
			na_comment = $("#na_comment_services").val();
-
 
345
			partnerCommentStatus = $("#partner_comment_status").val();
-
 
346
			if (applicableType == "NO") {
-
 
347
				if (na_comment == "" || na_comment == undefined) {
-
 
348
					alert("Na_comment can't be empty");
-
 
349
					return;
-
 
350
				}
-
 
351
			}
-
 
352
			if (fofoId == "" || fofoId == null || fofoId == undefined) {
-
 
353
				alert("select appropriate partnerName");
-
 
354
				return;
-
 
355
			} else if (serviceBrandId == "" || serviceBrandId == null
-
 
356
				|| serviceBrandId == undefined) {
-
 
357
				alert("select appropriate serviceBrandId");
-
 
358
				return;
-
 
359
			} else if (applicableType == "" || applicableType == null
-
 
360
				|| applicableType == undefined) {
-
 
361
				alert("select appropriate applicableType");
-
 
362
			} else if (active == "" || active == null
-
 
363
				|| active == undefined) {
-
 
364
				alert("select appropriate active")
-
 
365
			} else if (partnerStatus == "" || partnerStatus == null
-
 
366
				|| partnerStatus == undefined) {
-
 
367
				alert("select appropriate partnerStatus");
-
 
368
			} else {
-
 
369
				console.log(fofoId, serviceBrandId, applicableType, active,
-
 
370
					partnerStatus);
-
 
371
				addPartnerServiceBrandDetails(fofoId, serviceId,
-
 
372
					serviceBrandId, applicableType, active,
-
 
373
					partnerStatus, na_comment, partnerCommentStatus);
-
 
374
			}
379
			});
375
		});
380
	$(document).on('click', ".partner-service", function() {
376
	$(document).on('click', ".partner-service", function () {
381
		loadpartnerService("main-content");
377
		loadpartnerService("main-content");
382
	});
378
	});
383
	$(document).on('click', ".admin-partner-service", function() {
379
	$(document).on('click', ".admin-partner-service", function () {
384
		loadAdminPartnerService("main-content", 0);
380
		loadAdminPartnerService("main-content", 0);
385
	});
381
	});
386
	
382
 
387
	$(document).on('click', ".partner-finance-services", function(){
383
	$(document).on('click', ".partner-finance-services", function () {
388
	  showFinanceServices("main-content");
384
		showFinanceServices("main-content");
389
		
385
 
390
	});
386
	});
391
	
387
 
392
	$(document).on('click', ".add-partner-service-details", function() {
388
	$(document).on('click', ".add-partner-service-details", function () {
393
		loadaddPartnerServiceDetails("main-content");
389
		loadaddPartnerServiceDetails("main-content");
394
	});
390
	});
395
	$(document).on('click', ".add-partner-brand-service-details", function() {
391
	$(document).on('click', ".add-partner-brand-service-details", function () {
396
		loadaddPartnerBrandServiceDetails("main-content");
392
		loadaddPartnerBrandServiceDetails("main-content");
397
	});
393
	});
398
	$(document).on('click', ".service-mark-active", function() {
394
	$(document).on('click', ".service-mark-active", function () {
399
		serviceId = $(this).data('serviceid');
395
		serviceId = $(this).data('serviceid');
400
		fofoId =  $(this).data('fofoid');
396
		fofoId = $(this).data('fofoid');
401
		var row = $(this).closest("tr");
397
		var row = $(this).closest("tr");
402
		console.log(fofoId);
398
		console.log(fofoId);
403
		console.log(serviceId);
399
		console.log(serviceId);
404
		console.log(row);
400
		console.log(row);
405
		activateFinanceServices(fofoId, serviceId,row);
401
		activateFinanceServices(fofoId, serviceId, row);
406
	});
402
	});
407
	
403
 
408
	
404
 
409
	$(document).on('click', ".activate-service", function() {
405
	$(document).on('click', ".activate-service", function () {
410
		serviceId = $(this).data('serviceid');
406
		serviceId = $(this).data('serviceid');
411
		fofoId = $("#partnerName").val();
407
		fofoId = $("#partnerName").val();
412
		console.log(fofoId);
408
		console.log(fofoId);
413
		console.log(serviceId);
409
		console.log(serviceId);
414
		activatePartnerService(fofoId, serviceId);
410
		activatePartnerService(fofoId, serviceId);
415
	});
411
	});
416
	$(document).on('click', ".deactivate-service", function() {
412
	$(document).on('click', ".deactivate-service", function () {
417
		serviceId = $(this).data('serviceid');
413
		serviceId = $(this).data('serviceid');
418
		fofoId = $("#partnerName").val();
414
		fofoId = $("#partnerName").val();
419
		console.log(fofoId);
415
		console.log(fofoId);
420
		console.log(serviceId);
416
		console.log(serviceId);
421
		deActivatePartnerService(fofoId, serviceId);
417
		deActivatePartnerService(fofoId, serviceId);
422
	});
418
	});
423
	$(document).on('click', ".activate-brand-service", function() {
419
	$(document).on('click', ".activate-brand-service", function () {
424
		console.log("activate-brand-servicel clicked");
420
		console.log("activate-brand-servicel clicked");
425
		serviceId = $(this).data('serviceid');
421
		serviceId = $(this).data('serviceid');
426
		fofoId = $("#partnerName").val();
422
		fofoId = $("#partnerName").val();
427
		serviceBrandId = $(this).data('servicebrandid');
423
		serviceBrandId = $(this).data('servicebrandid');
428
		console.log(fofoId);
424
		console.log(fofoId);
429
		console.log(serviceId);
425
		console.log(serviceId);
430
		console.log(serviceBrandId);
426
		console.log(serviceBrandId);
431
		activatePartnerBrandService(fofoId, serviceId, serviceBrandId);
427
		activatePartnerBrandService(fofoId, serviceId, serviceBrandId);
432
 
428
 
433
	});
429
	});
434
	$(document).on('click', ".deactivate-brand-service", function() {
430
	$(document).on('click', ".deactivate-brand-service", function () {
435
		console.log("activate-brand-service clicked");
431
		console.log("activate-brand-service clicked");
436
		serviceId = $(this).data('serviceid');
432
		serviceId = $(this).data('serviceid');
437
		fofoId = $("#partnerName").val();
433
		fofoId = $("#partnerName").val();
438
		 var serviceBrandComment = $('input[name="reasonBrandServiceNotActivate"]').val();
434
		var serviceBrandComment = $('input[name="reasonBrandServiceNotActivate"]').val();
439
		serviceBrandId = $(this).data('servicebrandid');
435
		serviceBrandId = $(this).data('servicebrandid');
440
		console.log(fofoId);
436
		console.log(fofoId);
441
		console.log(serviceId);
437
		console.log(serviceId);
442
		console.log(serviceBrandId);
438
		console.log(serviceBrandId);
443
		console.log(serviceBrandComment);
439
		console.log(serviceBrandComment);
444
		deActivatePartnerBrandService(fofoId, serviceId, serviceBrandId,serviceBrandComment);
440
		deActivatePartnerBrandService(fofoId, serviceId, serviceBrandId, serviceBrandComment);
445
 
441
 
446
	});
442
	});
447
	$(document).on('click', ".partner-not-interested-service", function() {
443
	$(document).on('click', ".partner-not-interested-service", function () {
448
		
444
 
449
		serviceId = $(this).data('serviceid');
445
		serviceId = $(this).data('serviceid');
450
		fofoId = $("#partnerName").val();
446
		fofoId = $("#partnerName").val();
451
		 var partnerNotInterestedComment = $('input[name="reasonPartnerNotInterested"]').val();
447
		var partnerNotInterestedComment = $('input[name="reasonPartnerNotInterested"]').val();
452
		
448
 
453
		console.log(fofoId);
449
		console.log(fofoId);
454
		console.log(serviceId);
450
		console.log(serviceId);
455
		console.log(partnerNotInterestedComment);
451
		console.log(partnerNotInterestedComment);
456
		
452
 
457
		if (partnerNotInterestedComment == "" || partnerNotInterestedComment == undefined) {
453
		if (partnerNotInterestedComment == "" || partnerNotInterestedComment == undefined) {
458
			alert("Comment Should Be Filled");
454
			alert("Comment Should Be Filled");
459
			return;
455
			return;
460
		}
456
		}
461
		
457
 
462
		
458
 
463
		deActivatePartnerServiceByPartner(fofoId, serviceId,partnerNotInterestedComment);
459
		deActivatePartnerServiceByPartner(fofoId, serviceId, partnerNotInterestedComment);
464
 
460
 
465
	});
461
	});
466
	
-
 
467
	
462
 
468
	
463
 
469
$(document).on('click', ".service-mark-pni", function() {
464
	$(document).on('click', ".service-mark-pni", function () {
470
		
465
 
471
		serviceId = $(this).data('serviceid');
466
		serviceId = $(this).data('serviceid');
472
		fofoId = $(this).data('fofoid');
467
		fofoId = $(this).data('fofoid');
473
		 var partnerNotInterestedComment = "Partner Not Interested"
468
		var partnerNotInterestedComment = "Partner Not Interested"
474
			 var row = $(this).closest("tr");
469
		var row = $(this).closest("tr");
475
		console.log(fofoId);
470
		console.log(fofoId);
476
		console.log(serviceId);
471
		console.log(serviceId);
477
		console.log(row);
472
		console.log(row);
478
		
-
 
479
		
473
 
480
		
474
 
481
		deActivateFinanceServicePartnerNotInterested(fofoId, serviceId,partnerNotInterestedComment,row);
475
		deActivateFinanceServicePartnerNotInterested(fofoId, serviceId, partnerNotInterestedComment, row);
482
 
476
 
483
	});
477
	});
484
	
-
 
485
$(document).on('click', ".action-on-brand", function() {
-
 
486
	serviceId = $(this).data('serviceid');
-
 
487
	fofoId = $(this).data('fofoid');
-
 
488
	brandid = $(this).data('brandid');
-
 
489
	 var row = $(this).closest("tr");
-
 
490
	
-
 
491
	console.log(fofoId);
-
 
492
	console.log(serviceId);
-
 
493
	console.log(brandid);
-
 
494
	actionFinanceBrandService(fofoId, serviceId, brandid,row);
-
 
495
 
478
 
-
 
479
	$(document).on('click', ".action-on-brand", function () {
-
 
480
		serviceId = $(this).data('serviceid');
-
 
481
		fofoId = $(this).data('fofoid');
-
 
482
		brandid = $(this).data('brandid');
-
 
483
		var row = $(this).closest("tr");
496
});
484
 
-
 
485
		console.log(fofoId);
-
 
486
		console.log(serviceId);
-
 
487
		console.log(brandid);
-
 
488
		actionFinanceBrandService(fofoId, serviceId, brandid, row);
497
	
489
 
-
 
490
	});
498
	
491
 
499
	
492
 
500
	$(document).on('click', ".deactivate-brand-service-modal", function() {
493
	$(document).on('click', ".deactivate-brand-service-modal", function () {
501
		console.log("activate-brand-service clicked");
494
		console.log("activate-brand-service clicked");
502
		serviceId = $(this).data('serviceid');
495
		serviceId = $(this).data('serviceid');
503
		fofoId = $("#partnerName").val();
496
		fofoId = $("#partnerName").val();
504
		serviceBrandId = $(this).data('servicebrandid');
497
		serviceBrandId = $(this).data('servicebrandid');
505
		console.log(fofoId);
498
		console.log(fofoId);
506
		console.log(serviceId);
499
		console.log(serviceId);
507
		console.log(serviceBrandId);
500
		console.log(serviceBrandId);
508
		var params = {
501
		var params = {
509
				"serviceId" : serviceId,
502
			"serviceId": serviceId,
510
				"fofoId" : fofoId,
503
			"fofoId": fofoId,
511
				"serviceBrandId" : serviceBrandId
504
			"serviceBrandId": serviceBrandId
512
 
505
 
513
			}
506
		}
514
			doPostAjaxRequestWithParamsHandler(context
507
		doPostAjaxRequestWithParamsHandler(context
515
			+ "/deactivatePartnerbrandServiceModal", params, function(response) {
508
			+ "/deactivatePartnerbrandServiceModal", params, function (response) {
516
				
509
 
517
				$('#myServiceDeActivateBrand').html(response);
510
			$('#myServiceDeActivateBrand').html(response);
518
		
511
 
519
			});
512
		});
520
	});
513
	});
521
	
514
 
522
	$(document).on('click', ".notApplicableByPartner", function() {
515
	$(document).on('click', ".notApplicableByPartner", function () {
523
		console.log("notApplicableByPartner");
516
		console.log("notApplicableByPartner");
524
		
517
 
525
		serviceId = $(this).data('serviceid');
518
		serviceId = $(this).data('serviceid');
526
		fofoId = $("#partnerName").val();
519
		fofoId = $("#partnerName").val();
527
		
520
 
528
		console.log(fofoId);
521
		console.log(fofoId);
529
		console.log(serviceId);
522
		console.log(serviceId);
530
		
523
 
531
		var params = {
524
		var params = {
532
				"serviceId" : serviceId,
525
			"serviceId": serviceId,
533
				"fofoId" : fofoId,
526
			"fofoId": fofoId,
534
 
527
 
535
			}
528
		}
536
			doPostAjaxRequestWithParamsHandler(context
529
		doPostAjaxRequestWithParamsHandler(context
537
			+ "/deactivatePartnerbrandServiceModal", params, function(response) {
530
			+ "/deactivatePartnerbrandServiceModal", params, function (response) {
538
				
531
 
539
				$('#serviceDeactivateByPartnerModal').html(response);
532
			$('#serviceDeactivateByPartnerModal').html(response);
540
		
533
 
541
			});
534
		});
542
	});
535
	});
543
 
536
 
544
 
537
 
545
	$(document).on('click', ".create-service-button",
538
	$(document).on('click', ".create-service-button",
546
					function() {
539
		function () {
547
						console.log("create-service-button clicked");
540
			console.log("create-service-button clicked");
548
						var serviceName = $('#createserviceName').val();
541
			var serviceName = $('#createserviceName').val();
549
						if (serviceName === "" || serviceName === undefined
542
			if (serviceName === "" || serviceName === undefined
550
								|| serviceName == null) {
543
				|| serviceName == null) {
551
							alert("Input field can't be empty");
544
				alert("Input field can't be empty");
552
							return;
545
				return;
553
						}
546
			}
554
						if (confirm("Are you sure you want to create Service!") == true) {
547
			if (confirm("Are you sure you want to create Service!") == true) {
555
							createService("main-content", serviceName);
548
				createService("main-content", serviceName);
556
						}
549
			}
557
					});
550
		});
558
	$(document).on('click', ".partner-service-search-button",
551
	$(document).on('click', ".partner-service-search-button",
559
			function() {
552
		function () {
560
				var fofoId = $('#partnerName').val();
553
			var fofoId = $('#partnerName').val();
561
				if (fofoId === "" || fofoId === undefined || fofoId == null) {
554
			if (fofoId === "" || fofoId === undefined || fofoId == null) {
562
					alert("select appropriate partner");
555
				alert("select appropriate partner");
563
					return;
556
				return;
564
				}
557
			}
565
				doGetAjaxRequestHandler(context + "/getPartnerServices?fofoId="
558
			doGetAjaxRequestHandler(context + "/getPartnerServices?fofoId="
566
						+ fofoId, function(response) {
559
				+ fofoId, function (response) {
567
					$('#' + "partnerServicesByID").html(response);
560
				$('#' + "partnerServicesByID").html(response);
568
				});
-
 
569
			});
561
			});
-
 
562
		});
570
	$(document).on('click', "#remove-added-brand-button",
563
	$(document).on('click', "#remove-added-brand-button",
571
					function() {
564
		function () {
572
						var serviceId = $(this).data('id');
565
			var serviceId = $(this).data('id');
573
						var brand = $(this).data('brand');
566
			var brand = $(this).data('brand');
574
						console.log(serviceId);
567
			console.log(serviceId);
575
						console.log(brand)
568
			console.log(brand)
576
						if (confirm("Are you sure you want to remove brand from Service!") == true) {
569
			if (confirm("Are you sure you want to remove brand from Service!") == true) {
577
							removeBrandFromService("main-content", serviceId,
570
				removeBrandFromService("main-content", serviceId,
578
									brand);
571
					brand);
579
						}
572
			}
580
					});
573
		});
581
	$(document).on('click', ".service-brand-button", function() {
574
	$(document).on('click', ".service-brand-button", function () {
582
		var brands = $('#tag-listing-brands').val();
575
		var brands = $('#tag-listing-brands').val();
583
		var serviceId = $('#serviceName').val();
576
		var serviceId = $('#serviceName').val();
584
		console.log(brands);
577
		console.log(brands);
585
		console.log(serviceId);
578
		console.log(serviceId);
586
		if (serviceId === "" || serviceId === undefined) {
579
		if (serviceId === "" || serviceId === undefined) {
Line 593... Line 586...
593
		}
586
		}
594
		if (confirm("Are you sure you want to add brand!") == true) {
587
		if (confirm("Are you sure you want to add brand!") == true) {
595
			addBrandToService("main-content", brands, serviceId);
588
			addBrandToService("main-content", brands, serviceId);
596
		}
589
		}
597
	});
590
	});
598
	$(document).on('change', '#serviceName', function() {
591
	$(document).on('change', '#serviceName', function () {
599
		// $('#tag-listing-brand-value').text($(this).text());
592
		// $('#tag-listing-brand-value').text($(this).text());
600
		loadBrandsByServiceId("service-container", $(this).val());
593
		loadBrandsByServiceId("service-container", $(this).val());
601
		loadaddedBrandsbyserviceId("added-brand-to-service", $(this).val())
594
		loadaddedBrandsbyserviceId("added-brand-to-service", $(this).val())
602
	});
595
	});
603
});
596
});
604
 
597
 
605
function addPartnerServiceDetails(fofoId, serviceId, applicableType, code,
598
function addPartnerServiceDetails(fofoId, serviceId, applicableType, code,
606
		partnerStatus, na_comment, partnerCommentStatus) {
599
								  partnerStatus, na_comment, partnerCommentStatus) {
607
	if (confirm("Are you sure you want to add services details!") == true) {
600
	if (confirm("Are you sure you want to add services details!") == true) {
608
		var params = {
601
		var params = {
609
			"serviceId" : serviceId,
602
			"serviceId": serviceId,
610
			"fofoId" : fofoId,
603
			"fofoId": fofoId,
611
			"applicableType" : applicableType,
604
			"applicableType": applicableType,
612
			"partnerStatus" : partnerStatus,
605
			"partnerStatus": partnerStatus,
613
			"na_comment" : na_comment,
606
			"na_comment": na_comment,
614
			"partnerCommentStatus" : partnerCommentStatus,
607
			"partnerCommentStatus": partnerCommentStatus,
615
			"code" : code
608
			"code": code
616
		}
609
		}
617
		doPostAjaxRequestWithParamsHandler(context
610
		doPostAjaxRequestWithParamsHandler(context
618
				+ "/addPartnerServicesDetails", params, function(response) {
611
			+ "/addPartnerServicesDetails", params, function (response) {
619
			if (response == "true") {
612
			if (response == "true") {
620
				alert("successfully added partner Service Details");
613
				alert("successfully added partner Service Details");
621
				loadaddPartnerServiceDetails("main-content");
614
				loadaddPartnerServiceDetails("main-content");
622
			}
615
			}
623
		});
616
		});
624
	}
617
	}
625
}
618
}
626
 
619
 
627
function reasonPartnerbrandServiceNotActivate(fofoId, serviceId, serviceBrandId,serviceBrandComment) {
620
function reasonPartnerbrandServiceNotActivate(fofoId, serviceId, serviceBrandId, serviceBrandComment) {
628
	if (confirm("Are you sure you want to activate brand service!") == true) {
621
	if (confirm("Are you sure you want to activate brand service!") == true) {
629
		var params = {
622
		var params = {
630
			"serviceId" : serviceId,
623
			"serviceId": serviceId,
631
			"fofoId" : fofoId,
624
			"fofoId": fofoId,
632
			"serviceBrandId" : serviceBrandId,
625
			"serviceBrandId": serviceBrandId,
633
			"serviceBrandComment" : serviceBrandComment
626
			"serviceBrandComment": serviceBrandComment
634
 
627
 
635
		}
628
		}
636
		doPostAjaxRequestWithParamsHandler(context
629
		doPostAjaxRequestWithParamsHandler(context
637
				+ "/reasonPartnerbrandServiceNotActivate", params, function(response) {
630
			+ "/reasonPartnerbrandServiceNotActivate", params, function (response) {
638
			if (response == "true") {
631
			if (response == "true") {
639
				alert("successfully set your Comment for brand service not activated");
632
				alert("successfully set your Comment for brand service not activated");
640
				$('#myServiceActivateBrand').modal('hide');
633
				$('#myServiceActivateBrand').modal('hide');
641
				$('.modal-backdrop').remove();
634
				$('.modal-backdrop').remove();
642
				loadAdminPartnerService("main-content", fofoId);
635
				loadAdminPartnerService("main-content", fofoId);
643
			}
636
			}
644
		});
637
		});
645
	}
638
	}
646
}
639
}
-
 
640
 
647
function addPartnerServiceBrandDetails(fofoId, serviceId, serviceBrandId,
641
function addPartnerServiceBrandDetails(fofoId, serviceId, serviceBrandId,
648
		applicableType, active, partnerStatus, na_comment,
642
									   applicableType, active, partnerStatus, na_comment,
649
		partnerCommentStatus, code) {
643
									   partnerCommentStatus, code) {
650
	if (confirm("Are you sure you want to add service brand details!") == true) {
644
	if (confirm("Are you sure you want to add service brand details!") == true) {
651
		var params = {
645
		var params = {
652
			"serviceId" : serviceId,
646
			"serviceId": serviceId,
653
			"serviceBrandId" : serviceBrandId,
647
			"serviceBrandId": serviceBrandId,
654
			"fofoId" : fofoId,
648
			"fofoId": fofoId,
655
			"applicableType" : applicableType,
649
			"applicableType": applicableType,
656
			"active" : active,
650
			"active": active,
657
			"partnerStatus" : partnerStatus,
651
			"partnerStatus": partnerStatus,
658
			"na_comment" : na_comment,
652
			"na_comment": na_comment,
659
			"partnerCommentStatus" : partnerCommentStatus,
653
			"partnerCommentStatus": partnerCommentStatus,
660
			
654
 
661
		}
655
		}
662
		console.log("params"+params);
656
		console.log("params" + params);
663
		doPostAjaxRequestWithParamsHandler(context
657
		doPostAjaxRequestWithParamsHandler(context
664
				+ "/addPartnerServiceBrandDetails", params, function(response) {
658
			+ "/addPartnerServiceBrandDetails", params, function (response) {
665
			if (response == "true") {
659
			if (response == "true") {
666
				alert("successfully added partner Service Brand Details");
660
				alert("successfully added partner Service Brand Details");
667
				loadaddPartnerBrandServiceDetails("main-content");
661
				loadaddPartnerBrandServiceDetails("main-content");
668
			}
662
			}
669
		});
663
		});
670
	}
664
	}
671
}
665
}
-
 
666
 
672
function configureBrandsDropDown() {
667
function configureBrandsDropDown() {
673
	$(document).ready(function() {
-
 
674
		$('#tag-listing-brands').multiselect({
668
	$('#tag-listing-brands').multiselect({
675
			includeSelectAllOption : true,
669
		includeSelectAllOption: true,
676
			multiple : true,
670
		multiple: true,
677
			maxHeight : 200,
671
		maxHeight: 200,
678
			buttonWidth : '180px',
672
		buttonWidth: '180px',
679
			numberDisplayed : 1,
673
		numberDisplayed: 1,
680
			nonSelectedText : 'Brands',
674
		nonSelectedText: 'Brands',
681
			nSelectedText : ' - Brands Selected',
675
		nSelectedText: ' - Brands Selected',
682
			allSelectedText : 'All Brands Selected',
676
		allSelectedText: 'All Brands Selected',
683
			enableFiltering : true,
677
		enableFiltering: true,
684
			enableCaseInsensitiveFiltering : true
678
		enableCaseInsensitiveFiltering: true
685
		});
-
 
686
	});
679
	});
687
}
680
}
688
 
681
 
689
function loadService(domId) {
682
function loadService(domId) {
690
	doGetAjaxRequestHandler(context + "/getcreateService", function(response) {
683
	doGetAjaxRequestHandler(context + "/getcreateService", function (response) {
691
		$('#' + domId).html(response);
684
		$('#' + domId).html(response);
692
	});
685
	});
693
}
686
}
-
 
687
 
694
function loadaddedBrandsbyserviceId(domId, serviceId) {
688
function loadaddedBrandsbyserviceId(domId, serviceId) {
695
	doGetAjaxRequestHandler(context + "/getAddedbrands?serviceId=" + serviceId,
689
	doGetAjaxRequestHandler(context + "/getAddedbrands?serviceId=" + serviceId,
696
			function(response) {
690
		function (response) {
697
				$('#' + domId).html(response);
691
			$('#' + domId).html(response);
698
			});
692
		});
699
}
693
}
-
 
694
 
700
function loadBrandsByServiceId(domId, serviceId) {
695
function loadBrandsByServiceId(domId, serviceId) {
701
	doGetAjaxRequestHandler(context + "/getbrands?serviceId=" + serviceId,
696
	doGetAjaxRequestHandler(context + "/getbrands?serviceId=" + serviceId,
702
			function(response) {
697
		function (response) {
703
				$('#' + domId).html(response);
698
			$('#' + domId).html(response);
704
				configureBrandsDropDown();
699
			configureBrandsDropDown();
705
			});
700
		});
706
 
701
 
707
}
702
}
-
 
703
 
708
function createService(domId, serviceName) {
704
function createService(domId, serviceName) {
709
	console.log(serviceName);
705
	console.log(serviceName);
710
	doPostAjaxRequestHandler(context + "/createService?serviceName="
706
	doPostAjaxRequestHandler(context + "/createService?serviceName="
711
			+ serviceName, function(response) {
707
		+ serviceName, function (response) {
712
		alert("Service Successfully Created");
708
		alert("Service Successfully Created");
713
		$('#' + domId).html(response);
709
		$('#' + domId).html(response);
714
	});
710
	});
715
}
711
}
-
 
712
 
716
function loadaddBrandToService(domId) {
713
function loadaddBrandToService(domId) {
717
	doGetAjaxRequestHandler(context + "/addBrandsToService",
714
	doGetAjaxRequestHandler(context + "/addBrandsToService",
718
			function(response) {
715
		function (response) {
719
				$('#' + domId).html(response);
716
			$('#' + domId).html(response);
720
			});
717
		});
721
}
718
}
-
 
719
 
722
function addBrandToService(domId, brands, serviceId) {
720
function addBrandToService(domId, brands, serviceId) {
723
	doPostAjaxRequestWithJsonHandler(context + "/addBrandsService?serviceId="
721
	doPostAjaxRequestWithJsonHandler(context + "/addBrandsService?serviceId="
724
			+ serviceId, JSON.stringify(brands), function(response) {
722
		+ serviceId, JSON.stringify(brands), function (response) {
725
		alert("Brands added successfully");
723
		alert("Brands added successfully");
726
		loadBrandsByServiceId("service-container", serviceId);
724
		loadBrandsByServiceId("service-container", serviceId);
727
		loadaddedBrandsbyserviceId("added-brand-to-service", serviceId)
725
		loadaddedBrandsbyserviceId("added-brand-to-service", serviceId)
728
		$('#' + domId).html(response);
726
		$('#' + domId).html(response);
729
	});
727
	});
730
}
728
}
-
 
729
 
731
function removeBrandFromService(domId, serviceId, brand) {
730
function removeBrandFromService(domId, serviceId, brand) {
732
 
731
 
733
	doDeleteAjaxRequestHandler(context + "/removeBrandfromService?serviceId="
732
	doDeleteAjaxRequestHandler(context + "/removeBrandfromService?serviceId="
734
			+ serviceId + "&brand=" + brand, function(response) {
733
		+ serviceId + "&brand=" + brand, function (response) {
735
		alert("Brand removed from service successfully");
734
		alert("Brand removed from service successfully");
736
		loadBrandsByServiceId("service-container", serviceId);
735
		loadBrandsByServiceId("service-container", serviceId);
737
		loadaddedBrandsbyserviceId("added-brand-to-service", serviceId)
736
		loadaddedBrandsbyserviceId("added-brand-to-service", serviceId)
738
		$('#' + domId).html(response);
737
		$('#' + domId).html(response);
739
	});
738
	});
740
}
739
}
-
 
740
 
741
function showFinanceServices(domId) {
741
function showFinanceServices(domId) {
742
	doGetAjaxRequestHandler(context + "/getFinanceServicesAllPartner", function(response) {
742
	doGetAjaxRequestHandler(context + "/getFinanceServicesAllPartner", function (response) {
743
		
743
 
744
		$('#' + domId).html(response);
744
		$('#' + domId).html(response);
745
	});
745
	});
746
}
746
}
747
 
747
 
748
 
748
 
749
 
-
 
750
 
-
 
751
function changeServices(partnerServiceId) {
749
function changeServices(partnerServiceId) {
752
	var serviceId = partnerServiceId.value;
750
	var serviceId = partnerServiceId.value;
753
	var fofoId = $("#partnerName").val();
751
	var fofoId = $("#partnerName").val();
754
	console.log(fofoId);
752
	console.log(fofoId);
755
	console.log(serviceId);
753
	console.log(serviceId);
756
	if (fofoId == "" || fofoId == 0 || fofoId == undefined) {
754
	if (fofoId == "" || fofoId == 0 || fofoId == undefined) {
757
		var dialog = bootbox
755
		var dialog = bootbox
758
				.dialog({
756
			.dialog({
759
					title : "Are you sure want to change state of service!",
757
				title: "Are you sure want to change state of service!",
760
					message : "<div class=form-inline'>"
758
				message: "<div class=form-inline'>"
761
							+ "<label for='reason'>Reason:</label>"
759
					+ "<label for='reason'>Reason:</label>"
762
							+ "<textarea class='form-control' rows='1' id='reason'></textarea>"
760
					+ "<textarea class='form-control' rows='1' id='reason'></textarea>"
763
							+ "</div>",
761
					+ "</div>",
764
					buttons : {
762
				buttons: {
765
						cancel : {
763
					cancel: {
766
							label : "cancel",
764
						label: "cancel",
767
							className : 'btn-danger',
765
						className: 'btn-danger',
768
							callback : function() {
766
						callback: function () {
769
								loadpartnerService("main-content");
767
							loadpartnerService("main-content");
-
 
768
						}
-
 
769
					},
-
 
770
					ok: {
-
 
771
						label: "ok",
-
 
772
						className: 'btn-info',
-
 
773
						callback: function () {
-
 
774
							partnerStatusComment = $('#reason').val();
-
 
775
							console.log(partnerStatusComment);
-
 
776
							var params = {
-
 
777
								"serviceId": serviceId,
-
 
778
								"partnerStatusComment": partnerStatusComment
770
							}
779
							}
771
						},
-
 
772
						ok : {
-
 
773
							label : "ok",
-
 
774
							className : 'btn-info',
-
 
775
							callback : function() {
-
 
776
								partnerStatusComment = $('#reason').val();
-
 
777
								console.log(partnerStatusComment);
-
 
778
								var params = {
-
 
779
									"serviceId" : serviceId,
-
 
780
									"partnerStatusComment" : partnerStatusComment
-
 
781
								}
-
 
782
								doPostAjaxRequestWithParamsHandler(
780
							doPostAjaxRequestWithParamsHandler(
783
										context + "/changeStatePartnerService",
781
								context + "/changeStatePartnerService",
784
										params,
782
								params,
785
										function(response) {
783
								function (response) {
786
											if (response == "true") {
784
									if (response == "true") {
787
												alert("successfully changed");
785
										alert("successfully changed");
788
												loadpartnerService("main-content");
786
										loadpartnerService("main-content");
789
											}
787
									}
790
										});
788
								});
791
 
789
 
792
							}
-
 
793
						}
790
						}
794
					}
791
					}
-
 
792
				}
795
				});
793
			});
796
 
794
 
797
	} else {
795
	} else {
798
		if (confirm("Are you sure you want to change!") == true) {
796
		if (confirm("Are you sure you want to change!") == true) {
799
			var params = {
797
			var params = {
800
				"serviceId" : serviceId,
798
				"serviceId": serviceId,
801
				"fofoId" : fofoId
799
				"fofoId": fofoId
802
 
800
 
803
			}
801
			}
804
			doPostAjaxRequestWithParamsHandler(context
802
			doPostAjaxRequestWithParamsHandler(context
805
					+ "/changeStatePartnerService", params, function(response) {
803
				+ "/changeStatePartnerService", params, function (response) {
806
				if (response == "true") {
804
				if (response == "true") {
807
					alert("successfully changed");
805
					alert("successfully changed");
808
					loadAdminPartnerService("main-content", fofoId);
806
					loadAdminPartnerService("main-content", fofoId);
809
				}
807
				}
810
			});
808
			});
-
 
809
		} else {
-
 
810
			loadAdminPartnerService("main-content", fofoId);
811
		}
811
		}
812
		else
-
 
813
			{
-
 
814
			loadAdminPartnerService("main-content", fofoId);			
-
 
815
			}
-
 
816
	}
812
	}
817
}
813
}
-
 
814
 
818
function changeServiceNameForServiceBrand() {
815
function changeServiceNameForServiceBrand() {
819
 
816
 
820
	serviceId = $("#serviceName").val();
817
	serviceId = $("#serviceName").val();
821
	console.log(serviceId);
818
	console.log(serviceId);
822
	doGetAjaxRequestHandler(context + "/selectAddedbrands?serviceId="
819
	doGetAjaxRequestHandler(context + "/selectAddedbrands?serviceId="
823
			+ serviceId, function(response) {
820
		+ serviceId, function (response) {
824
		$('#' + "serviceBrandNameContainer").html(response);
821
		$('#' + "serviceBrandNameContainer").html(response);
825
	});
822
	});
826
}
823
}
-
 
824
 
827
function configureAllPartnerName() {
825
function configureAllPartnerName() {
828
	$(document).ready(function() {
826
	$(document).ready(function () {
829
		$('#partnerName').multiselect({
827
		$('#partnerName').multiselect({
830
			includeSelectAllOption : true,
828
			includeSelectAllOption: true,
831
			maxHeight : 200,
829
			maxHeight: 200,
832
			buttonWidth : '200px',
830
			buttonWidth: '200px',
833
			numberDisplayed : 1,
831
			numberDisplayed: 1,
834
			nonSelectedText : 'Partners',
832
			nonSelectedText: 'Partners',
835
			nSelectedText : ' - Partners Selected',
833
			nSelectedText: ' - Partners Selected',
836
			allSelectedText : 'All Partners Selected',
834
			allSelectedText: 'All Partners Selected',
837
			enableFiltering : true,
835
			enableFiltering: true,
838
			enableCaseInsensitiveFiltering : true
836
			enableCaseInsensitiveFiltering: true
839
 
837
 
840
		});
838
		});
841
	});
839
	});
842
}
840
}
843
 
841
 
844
 
842
 
-
 
843
function onChangeStateServiceBrand(partnerServiceBrandId, partnerServiceId, brand) {
845
 
844
 
846
 
845
 
847
 
-
 
848
 
-
 
849
function onChangeStateServiceBrand(partnerServiceBrandId, partnerServiceId,brand) {
-
 
850
	
-
 
851
	
-
 
852
	console.log(brand);
846
	console.log(brand);
853
 
847
 
854
	var brandServiceId = partnerServiceBrandId.value;
848
	var brandServiceId = partnerServiceBrandId.value;
855
	var fofoId = $("#partnerName").val();
849
	var fofoId = $("#partnerName").val();
856
	console.log(brandServiceId, partnerServiceId);
850
	console.log(brandServiceId, partnerServiceId);
857
	if (fofoId == "" || fofoId == 0 || fofoId == undefined) {
851
	if (fofoId == "" || fofoId == 0 || fofoId == undefined) {
858
		var dialog = bootbox
852
		var dialog = bootbox
859
				.dialog({
853
			.dialog({
860
					title : "Are you sure want to change state of service!",
854
				title: "Are you sure want to change state of service!",
861
					message : "<div class=form-inline'>"
855
				message: "<div class=form-inline'>"
862
							+ "<label for='reason'>Reason:</label>"
856
					+ "<label for='reason'>Reason:</label>"
863
							+ "<textarea class='form-control' rows='1' id='reason'></textarea>"
857
					+ "<textarea class='form-control' rows='1' id='reason'></textarea>"
864
							+ "</div>",
858
					+ "</div>",
865
					buttons : {
859
				buttons: {
866
						cancel : {
860
					cancel: {
867
							label : "cancel",
861
						label: "cancel",
868
							className : 'btn-danger',
862
						className: 'btn-danger',
869
							callback : function() {
863
						callback: function () {
870
								loadpartnerService("main-content");
864
							loadpartnerService("main-content");
-
 
865
						}
-
 
866
					},
-
 
867
					ok: {
-
 
868
						label: "ok",
-
 
869
						className: 'btn-info',
-
 
870
						callback: function () {
-
 
871
							partnerStatusComment = $('#reason').val();
-
 
872
							console.log(partnerStatusComment);
-
 
873
							var params = {
-
 
874
								"brand": brand,
-
 
875
								"brandServiceId": brandServiceId,
-
 
876
								"serviceId": partnerServiceId,
-
 
877
								"partnerStatusComment": partnerStatusComment
871
							}
878
							}
872
						},
-
 
873
						ok : {
-
 
874
							label : "ok",
-
 
875
							className : 'btn-info',
-
 
876
							callback : function() {
-
 
877
								partnerStatusComment = $('#reason').val();
-
 
878
								console.log(partnerStatusComment);
-
 
879
								var params = {
-
 
880
									"brand":brand,
-
 
881
									"brandServiceId" : brandServiceId,
-
 
882
									"serviceId" : partnerServiceId,
-
 
883
									"partnerStatusComment" : partnerStatusComment
-
 
884
								}
-
 
885
								doPostAjaxRequestWithParamsHandler(
879
							doPostAjaxRequestWithParamsHandler(
886
										context
880
								context
887
												+ "/changeStatePartnerServiceBrand",
881
								+ "/changeStatePartnerServiceBrand",
888
										params,
882
								params,
889
										function(response) {
883
								function (response) {
890
											if (response == "true") {
884
									if (response == "true") {
891
												alert("successfully changed");
885
										alert("successfully changed");
892
												loadpartnerService("main-content");
886
										loadpartnerService("main-content");
893
											}
887
									}
894
 
888
 
895
										});
889
								});
896
 
890
 
897
							}
-
 
898
						}
891
						}
899
					}
892
					}
-
 
893
				}
900
				});
894
			});
901
	} else {
895
	} else {
902
		if (confirm("Are you sure you want to change!") == true) {
896
		if (confirm("Are you sure you want to change!") == true) {
903
 
897
 
904
			var params = {
898
			var params = {
905
				"brandServiceId" : brandServiceId,
899
				"brandServiceId": brandServiceId,
906
				"brand":brand,
900
				"brand": brand,
907
				"serviceId" : partnerServiceId,
901
				"serviceId": partnerServiceId,
908
				"fofoId" : fofoId
902
				"fofoId": fofoId
909
				
903
 
910
					}
904
			}
911
			doPostAjaxRequestWithParamsHandler(context
905
			doPostAjaxRequestWithParamsHandler(context
912
					+ "/changeStatePartnerServiceBrand", params, function(
906
				+ "/changeStatePartnerServiceBrand", params, function (
913
					response) {
907
				response) {
914
				if (response == "true") {
908
				if (response == "true") {
915
					alert("successfully changed");
909
					alert("successfully changed");
916
					loadAdminPartnerService("main-content", fofoId);
910
					loadAdminPartnerService("main-content", fofoId);
917
				}
911
				}
918
			});
912
			});
919
 
913
 
920
		} else {
914
		} else {
921
			
915
 
922
			loadAdminPartnerService("main-content", fofoId);
916
			loadAdminPartnerService("main-content", fofoId);
923
		}
917
		}
924
	}
918
	}
925
}
919
}
-
 
920
 
926
function loadpartnerService(domId) {
921
function loadpartnerService(domId) {
927
	doGetAjaxRequestHandler(context + "/getPartnerServices",
922
	doGetAjaxRequestHandler(context + "/getPartnerServices",
928
			function(response) {
923
		function (response) {
929
				$('#' + domId).html(response);
924
			$('#' + domId).html(response);
930
			});
925
		});
931
 
926
 
932
}
927
}
-
 
928
 
933
function loadAdminPartnerService(domId, fofoId) {
929
function loadAdminPartnerService(domId, fofoId) {
934
	doGetAjaxRequestHandler(context
930
	doGetAjaxRequestHandler(context
935
			+ "/getAdminPanelForPartnerServices?fofoId=" + fofoId, function(
931
		+ "/getAdminPanelForPartnerServices?fofoId=" + fofoId, function (
936
			response) {
932
		response) {
937
		$('#' + domId).html(response);
933
		$('#' + domId).html(response);
938
		if (fofoId != 0 || fofoId) {
934
		if (fofoId != 0 || fofoId) {
939
			doGetAjaxRequestHandler(context + "/getPartnerServices?fofoId="
935
			doGetAjaxRequestHandler(context + "/getPartnerServices?fofoId="
940
					+ fofoId, function(response) {
936
				+ fofoId, function (response) {
941
				$('#' + "partnerServicesByID").html(response);
937
				$('#' + "partnerServicesByID").html(response);
942
			});
938
			});
943
		}
939
		}
944
 
940
 
945
	});
941
	});
946
}
942
}
-
 
943
 
947
function activatePartnerService(fofoId, serviceId) {
944
function activatePartnerService(fofoId, serviceId) {
948
	console.log(fofoId);
945
	console.log(fofoId);
949
	bootbox.dialog({
946
	bootbox.dialog({
950
		title : "Are you sure you want to activate services!",
947
		title: "Are you sure you want to activate services!",
951
		message : "<div class=form-inline'>"
948
		message: "<div class=form-inline'>"
952
				+ "<label for='code'>Code:</label>"
949
			+ "<label for='code'>Code:</label>"
953
				+ "<input class='form-control' type='text' id='code'/>"
950
			+ "<input class='form-control' type='text' id='code'/>"
954
				+ "</div>",
951
			+ "</div>",
955
		buttons : {
952
		buttons: {
956
			cancel : {
953
			cancel: {
957
				label : "cancel",
954
				label: "cancel",
958
				className : 'btn-danger',
955
				className: 'btn-danger',
959
				callback : function() {
956
				callback: function () {
960
					return;
957
					return;
961
				}
958
				}
962
			},
959
			},
963
			ok : {
960
			ok: {
964
				label : "ok",
961
				label: "ok",
965
				className : 'btn-info',
962
				className: 'btn-info',
966
				callback : function() {
963
				callback: function () {
967
					code = $('#code').val();
964
					code = $('#code').val();
968
					//console.log(partnerStatusComment);
965
					//console.log(partnerStatusComment);
969
					if(code==""||code==undefined||code==null)
966
					if (code == "" || code == undefined || code == null) {
970
						{
-
 
971
							alert("code can't be empty");
967
						alert("code can't be empty");
972
							activatePartnerService(fofoId, serviceId);
968
						activatePartnerService(fofoId, serviceId);
973
							return;
969
						return;
974
						}
970
					}
975
					var params = {
971
					var params = {
976
							"serviceId" : serviceId,
972
						"serviceId": serviceId,
977
							"fofoId" : fofoId,
973
						"fofoId": fofoId,
978
							"code":code
974
						"code": code
979
						}
975
					}
980
						doPostAjaxRequestWithParamsHandler(context + "/activatePartnerService",
976
					doPostAjaxRequestWithParamsHandler(context + "/activatePartnerService",
981
								params, function(response) {
977
						params, function (response) {
982
									if (response == "true") {
978
							if (response == "true") {
983
										alert("successfully activate");
979
								alert("successfully activate");
984
										loadAdminPartnerService("main-content", fofoId);
980
								loadAdminPartnerService("main-content", fofoId);
985
									}
981
							}
986
								});
982
						});
987
				}
983
				}
988
			}
984
			}
989
		}
985
		}
990
	});
986
	});
991
}
987
}
992
 
988
 
993
function activateFinanceServices(fofoId, serviceId,row) {
989
function activateFinanceServices(fofoId, serviceId, row) {
994
	console.log(fofoId);
990
	console.log(fofoId);
995
	
991
 
996
	console.log(row);
992
	console.log(row);
997
	bootbox.dialog({
993
	bootbox.dialog({
998
		title : "Are you sure you want to activate services!",
994
		title: "Are you sure you want to activate services!",
999
		message : "<div class=form-inline'>"
995
		message: "<div class=form-inline'>"
1000
				+ "<label for='code'>Code:</label>"
996
			+ "<label for='code'>Code:</label>"
1001
				+ "<input class='form-control' type='text' id='code'/>"
997
			+ "<input class='form-control' type='text' id='code'/>"
1002
				+ "</div>",
998
			+ "</div>",
1003
		buttons : {
999
		buttons: {
1004
			cancel : {
1000
			cancel: {
1005
				label : "cancel",
1001
				label: "cancel",
1006
				className : 'btn-danger',
1002
				className: 'btn-danger',
1007
				callback : function() {
1003
				callback: function () {
1008
					return;
1004
					return;
1009
				}
1005
				}
1010
			},
1006
			},
1011
			ok : {
1007
			ok: {
1012
				label : "ok",
1008
				label: "ok",
1013
				className : 'btn-info',
1009
				className: 'btn-info',
1014
				callback : function() {
1010
				callback: function () {
1015
					code = $('#code').val();
1011
					code = $('#code').val();
1016
					//console.log(partnerStatusComment);
1012
					//console.log(partnerStatusComment);
1017
					if(code==""||code==undefined||code==null)
1013
					if (code == "" || code == undefined || code == null) {
1018
						{
-
 
1019
							alert("code can't be empty");
1014
						alert("code can't be empty");
1020
							activatePartnerService(fofoId, serviceId);
1015
						activatePartnerService(fofoId, serviceId);
1021
							return;
1016
						return;
1022
						}
1017
					}
1023
					var params = {
1018
					var params = {
1024
							"serviceId" : serviceId,
1019
						"serviceId": serviceId,
1025
							"fofoId" : fofoId,
1020
						"fofoId": fofoId,
1026
							"code":code
1021
						"code": code
1027
						}
1022
					}
1028
						doPostAjaxRequestWithParamsHandler(context + "/activateFinanceServices",
1023
					doPostAjaxRequestWithParamsHandler(context + "/activateFinanceServices",
1029
								params, function(response) {
1024
						params, function (response) {
1030
						
-
 
1031
										row.html(response);
-
 
1032
										alert("successfully submit");
-
 
1033
 
1025
 
-
 
1026
							row.html(response);
-
 
1027
							alert("successfully submit");
-
 
1028
 
1034
								});
1029
						});
1035
				}
1030
				}
1036
			}
1031
			}
1037
		}
1032
		}
1038
	});
1033
	});
1039
}
1034
}
-
 
1035
 
1040
function deActivatePartnerService(fofoId, serviceId) {
1036
function deActivatePartnerService(fofoId, serviceId) {
1041
	if (confirm("Are you sure you want to deactivate services!") == true) {
1037
	if (confirm("Are you sure you want to deactivate services!") == true) {
1042
		var params = {
1038
		var params = {
1043
			"serviceId" : serviceId,
1039
			"serviceId": serviceId,
1044
			"fofoId" : fofoId
1040
			"fofoId": fofoId
1045
 
1041
 
1046
		}
1042
		}
1047
		doPostAjaxRequestWithParamsHandler(context
1043
		doPostAjaxRequestWithParamsHandler(context
1048
				+ "/deActivatePartnerService", params, function(response) {
1044
			+ "/deActivatePartnerService", params, function (response) {
1049
			if (response == "true") {
1045
			if (response == "true") {
1050
				alert("successfully deactivate");
1046
				alert("successfully deactivate");
1051
				loadAdminPartnerService("main-content", fofoId);
1047
				loadAdminPartnerService("main-content", fofoId);
1052
			}
1048
			}
1053
		});
1049
		});
1054
	}
1050
	}
1055
}
1051
}
-
 
1052
 
1056
function activatePartnerBrandService(fofoId, serviceId, serviceBrandId) {
1053
function activatePartnerBrandService(fofoId, serviceId, serviceBrandId) {
1057
	if (confirm("Are you sure you want to activate brand service!") == true) {
1054
	if (confirm("Are you sure you want to activate brand service!") == true) {
1058
		var params = {
1055
		var params = {
1059
			"serviceId" : serviceId,
1056
			"serviceId": serviceId,
1060
			"fofoId" : fofoId,
1057
			"fofoId": fofoId,
1061
			"serviceBrandId" : serviceBrandId
1058
			"serviceBrandId": serviceBrandId
1062
 
1059
 
1063
		}
1060
		}
1064
		doPostAjaxRequestWithParamsHandler(context
1061
		doPostAjaxRequestWithParamsHandler(context
1065
				+ "/activatePartnerbrandService", params, function(response) {
1062
			+ "/activatePartnerbrandService", params, function (response) {
1066
			if (response == "true") {
1063
			if (response == "true") {
1067
				alert("successfully activate");
1064
				alert("successfully activate");
1068
				$('#myServiceActivateBrand').modal('hide');
1065
				$('#myServiceActivateBrand').modal('hide');
1069
				$('.modal-backdrop').remove();
1066
				$('.modal-backdrop').remove();
1070
				loadAdminPartnerService("main-content", fofoId);
1067
				loadAdminPartnerService("main-content", fofoId);
1071
			}
1068
			}
1072
		});
1069
		});
1073
	}
1070
	}
1074
}
1071
}
1075
 
1072
 
1076
function actionFinanceBrandService(fofoId, serviceId, brandId,row) {
1073
function actionFinanceBrandService(fofoId, serviceId, brandId, row) {
1077
	if (confirm("Are you sure you want to activate or deactivate brand service!") == true) {
1074
	if (confirm("Are you sure you want to activate or deactivate brand service!") == true) {
1078
		var params = {
1075
		var params = {
1079
			"serviceId" : serviceId,
1076
			"serviceId": serviceId,
1080
			"fofoId" : fofoId,
1077
			"fofoId": fofoId,
1081
			"serviceBrandId" : brandId
1078
			"serviceBrandId": brandId
1082
 
1079
 
1083
		}
1080
		}
1084
		doPostAjaxRequestWithParamsHandler(context
1081
		doPostAjaxRequestWithParamsHandler(context
1085
				+ "/actionFinanceBrandService", params, function(response) {
1082
			+ "/actionFinanceBrandService", params, function (response) {
1086
			
1083
 
1087
				alert("successfully activate");
1084
			alert("successfully activate");
1088
				row.html(response);
1085
			row.html(response);
1089
		});
1086
		});
1090
	}
1087
	}
1091
}
1088
}
1092
 
1089
 
1093
 
1090
 
1094
function deActivateFinanceServicePartnerNotInterested(fofoId, serviceId, partnerNotInterestedComment,row) {
1091
function deActivateFinanceServicePartnerNotInterested(fofoId, serviceId, partnerNotInterestedComment, row) {
1095
	console.log(row);
1092
	console.log(row);
1096
	if (confirm("Are you sure you want to Deactivate service!") == true) {
1093
	if (confirm("Are you sure you want to Deactivate service!") == true) {
1097
		var params = {
1094
		var params = {
1098
			"serviceId" : serviceId,
1095
			"serviceId": serviceId,
1099
			"fofoId" : fofoId,
1096
			"fofoId": fofoId,
1100
			"partnerNotInterestedComment" : partnerNotInterestedComment
1097
			"partnerNotInterestedComment": partnerNotInterestedComment
1101
 
1098
 
1102
		}
1099
		}
1103
		doPostAjaxRequestWithParamsHandler(context
1100
		doPostAjaxRequestWithParamsHandler(context
1104
				+ "/deActivateFinanceServicePartnerNotInterested", params, function(response) {
1101
			+ "/deActivateFinanceServicePartnerNotInterested", params, function (response) {
1105
		
1102
 
1106
				console.log(row);
1103
			console.log(row);
1107
				alert("successfully submit");
1104
			alert("successfully submit");
1108
				row.html(response);
1105
			row.html(response);
1109
			
1106
 
1110
		});
1107
		});
1111
   }
1108
	}
1112
}
1109
}
1113
	function deActivatePartnerServiceByPartner(fofoId, serviceId, partnerNotInterestedComment) {
-
 
1114
		if (confirm("Are you sure you want to Deactivate service!") == true) {
-
 
1115
			var params = {
-
 
1116
				"serviceId" : serviceId,
-
 
1117
				"fofoId" : fofoId,
-
 
1118
				"partnerNotInterestedComment" : partnerNotInterestedComment
-
 
1119
 
1110
 
1120
			}
-
 
1121
			doPostAjaxRequestWithParamsHandler(context
1111
function deActivatePartnerServiceByPartner(fofoId, serviceId, partnerNotInterestedComment) {
1122
					+ "/deActivatePartnerBrandServiceByPartner", params, function(response) {
1112
	if (confirm("Are you sure you want to Deactivate service!") == true) {
1123
				if (response == "true") {
1113
		var params = {
1124
					alert("successfully activate");
1114
			"serviceId": serviceId,
1125
					$('#serviceDeactivateByPartnerModal').modal('hide');
-
 
1126
					$('.modal-backdrop').remove();
1115
			"fofoId": fofoId,
1127
					loadAdminPartnerService("main-content", fofoId);
1116
			"partnerNotInterestedComment": partnerNotInterestedComment
1128
				}
1117
 
1129
			});
-
 
1130
		}
1118
		}
-
 
1119
		doPostAjaxRequestWithParamsHandler(context
-
 
1120
			+ "/deActivatePartnerBrandServiceByPartner", params, function (response) {
-
 
1121
			if (response == "true") {
-
 
1122
				alert("successfully activate");
-
 
1123
				$('#serviceDeactivateByPartnerModal').modal('hide');
-
 
1124
				$('.modal-backdrop').remove();
-
 
1125
				loadAdminPartnerService("main-content", fofoId);
-
 
1126
			}
-
 
1127
		});
-
 
1128
	}
1131
}
1129
}
1132
 
1130
 
1133
function deActivatePartnerBrandService(fofoId, serviceId, serviceBrandId,serviceBrandComment) {
1131
function deActivatePartnerBrandService(fofoId, serviceId, serviceBrandId, serviceBrandComment) {
1134
	if (confirm("Are you sure you want to deactivate brand service!") == true) {
1132
	if (confirm("Are you sure you want to deactivate brand service!") == true) {
1135
		var params = {
1133
		var params = {
1136
			"serviceId" : serviceId,
1134
			"serviceId": serviceId,
1137
			"fofoId" : fofoId,
1135
			"fofoId": fofoId,
1138
			"serviceBrandId" : serviceBrandId,
1136
			"serviceBrandId": serviceBrandId,
1139
			"serviceBrandComment":serviceBrandComment
1137
			"serviceBrandComment": serviceBrandComment
1140
		}
1138
		}
1141
		doPostAjaxRequestWithParamsHandler(context
1139
		doPostAjaxRequestWithParamsHandler(context
1142
				+ "/deActivatePartnerbrandService", params, function(response) {
1140
			+ "/deActivatePartnerbrandService", params, function (response) {
1143
			if (response == "true") {
1141
			if (response == "true") {
1144
				alert("successfully deactivate");
1142
				alert("successfully deactivate");
1145
				$('#myServiceDeActivateBrand').modal('hide');
1143
				$('#myServiceDeActivateBrand').modal('hide');
1146
				$('.modal-backdrop').remove();
1144
				$('.modal-backdrop').remove();
1147
				loadAdminPartnerService("main-content", fofoId);
1145
				loadAdminPartnerService("main-content", fofoId);
Line 1150... Line 1148...
1150
	}
1148
	}
1151
}
1149
}
1152
 
1150
 
1153
function loadaddPartnerServiceDetails(domId) {
1151
function loadaddPartnerServiceDetails(domId) {
1154
	doGetAjaxRequestHandler(context + "/getAddPartnerServicesDetails",
1152
	doGetAjaxRequestHandler(context + "/getAddPartnerServicesDetails",
1155
			function(response) {
1153
		function (response) {
1156
				$('#' + domId).html(response);
1154
			$('#' + domId).html(response);
1157
			});
1155
		});
1158
}
1156
}
-
 
1157
 
1159
function loadaddPartnerBrandServiceDetails(domId) {
1158
function loadaddPartnerBrandServiceDetails(domId) {
1160
	doGetAjaxRequestHandler(context + "/getAddPartnerBrandServiceDetails",
1159
	doGetAjaxRequestHandler(context + "/getAddPartnerBrandServiceDetails",
1161
			function(response) {
1160
		function (response) {
1162
				$('#' + domId).html(response);
1161
			$('#' + domId).html(response);
1163
			});
1162
		});
1164
}
1163
}
1165
1164