Subversion Repositories SmartDukaan

Rev

Rev 9436 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9065 manish.sha 1
$(function() {
2
	$('#addOpRadio').live('click', function() {
9231 manish.sha 3
		$('#addUpdateRecordSubmit').attr('disabled', 'true');
9065 manish.sha 4
		$('div#addRecordDataDiv').show();
5
		$('div#updateRecordDataDiv').hide();
9436 manish.sha 6
 
9231 manish.sha 7
		$('div#updateCampaignDiv').hide();
8
		$('div#updateKeywordDiv').hide();
9
		$('div#updateAdgroupDiv').hide();
9436 manish.sha 10
 
9231 manish.sha 11
		$('#campaignRdoUpdate').attr("checked",false);
12
		$('#adgroupRdoUpdate').attr("checked",false);
13
		$('#keywordRdoUpdate').attr("checked",false);
9436 manish.sha 14
		$('#campaignListUpdate1').val('-1');
15
		$('#campaignNameUpdate').val('');
16
		$('#campaignStatusUpdate').val('2');
17
 
18
		$('#campaignListUpdate2').val('-1');
19
		$('#adgroupListUpdate1').find("option").remove();
20
		$('#adgroupListUpdate1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
21
		$('#adgroupNameUpdate').val('');
22
		$('#adgroupStatusUpdate').val('2');
23
		$('#catalogItemIdUpdate').val('');
24
		$('#bidAmountUpdate').val('');
9463 manish.sha 25
		$('#stockLinkedUpdate').attr("checked",false);
9436 manish.sha 26
 
27
		$('#campaignListUpdate3').val('-1');
28
		$('#adgroupListUpdate2').find("option").remove();
29
		$('#adgroupListUpdate2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
30
		$('#keywordListUpdate1').find("option").remove();
31
		$('#keywordListUpdate1').append($("<option></option>").val('-1').html('---Select Keyword---'));
32
		$('#keywordUpdate').val('');
33
		$('#bidUpdate').val('');
34
		$('#matchTypeUpdate').val('2'); 	
35
 
9065 manish.sha 36
	});
9436 manish.sha 37
 
9065 manish.sha 38
	$('#updateOpRadio').live('click', function() {
39
		$('div#addRecordDataDiv').hide();
40
		$('div#updateRecordDataDiv').show();
9231 manish.sha 41
		$('#addUpdateRecordSubmit').attr('disabled', 'true');
9436 manish.sha 42
 
9065 manish.sha 43
		$("#campaignRdo").attr("checked", false);
9436 manish.sha 44
		$("#adgroupRdo").attr("checked", false);
45
		$("#textAdRdo").attr("checked", false);
46
		$("#keywordRdo").attr("checked", false);
47
		$('div#addCampaignDiv').hide();
9065 manish.sha 48
		$('div#addAdgroupDiv').hide();
49
		$('div#addAdgroupAdDiv').hide();
50
		$('div#addKeywordDiv').hide();
9436 manish.sha 51
		$('#campaignName').val('');
52
		$("#campaignStatus").val('2');
53
		$('#startDate').val('');
54
		$('#endDate').val('');
55
		$("#googleSearchNetwork").attr("checked", false);
56
		$("#displayNetwork").attr("checked", false);
57
		$("#partnerSearchNetwork").attr("checked", false);
58
		$("#campaignAmount").val('');
59
		$("#adgroupList1").find("option").remove();
60
		$('#adgroupList1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
61
		$("#adgroupList2").find("option").remove();
62
		$('#adgroupList2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
63
		$("#campaignList1").val('-1');
64
		$('#adgroupName').val('');
65
		$('#adgroupStatus').val('2');
66
		$('#bidAmount').val('');
67
		$('#catalogItemId').val('');
68
		$("#campaignList2").val('-1');
69
		$("#adgroupList1").val('-1');
70
		$("#headline").val('');
71
		$("#description1").val('');
72
		$("#description2").val('');
73
		$("#url").val('');
74
		$("#displayUrl").val('');
75
		$("#campaignList3").val('-1');
76
		$("#adgroupList2").val('-1');
77
		$("#keyword1").val('');
78
		$("#keyword2").val('');
79
		$("#keyword3").val('');
80
		$("#keyword4").val('');
81
		$("#keyword5").val('');
82
		$("#bid1").val('');
83
		$("#bid2").val('');
84
		$("#bid3").val('');
85
		$("#bid4").val('');
86
		$("#bid5").val('');
87
		$("#matchType1").val('3');
88
		$("#matchType2").val('3');
89
		$("#matchType3").val('3');
90
		$("#matchType4").val('3');
91
		$("#matchType5").val('3');
9065 manish.sha 92
	});
9436 manish.sha 93
 
9065 manish.sha 94
	$('#campaignRdo').live('click', function() {
95
		$('div#addCampaignDiv').show();
96
		$('div#addAdgroupDiv').hide();
97
		$('div#addAdgroupAdDiv').hide();
98
		$('div#addKeywordDiv').hide();
9436 manish.sha 99
 
9065 manish.sha 100
		$("#adgroupList1").find("option").remove();
9436 manish.sha 101
		$('#adgroupList1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
102
		$("#adgroupList2").find("option").remove();
103
		$('#adgroupList2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
9231 manish.sha 104
		$('#addUpdateRecordSubmit').removeAttr('disabled');
9065 manish.sha 105
		$("#campaignList1").val('-1');
9436 manish.sha 106
		$('#adgroupName').val('');
107
		$('#adgroupStatus').val('2');
108
		$('#bidAmount').val('');
109
		$('#catalogItemId').val('');
110
		$("#campaignList2").val('-1');
111
		$("#adgroupList1").val('-1');
112
		$("#headline").val('');
113
		$("#description1").val('');
114
		$("#description2").val('');
115
		$("#url").val('');
116
		$("#displayUrl").val('');
117
		$("#campaignList3").val('-1');
118
		$("#adgroupList2").val('-1');
119
		$("#keyword1").val('');
120
		$("#keyword2").val('');
121
		$("#keyword3").val('');
122
		$("#keyword4").val('');
123
		$("#keyword5").val('');
124
		$("#bid1").val('');
125
		$("#bid2").val('');
126
		$("#bid3").val('');
127
		$("#bid4").val('');
128
		$("#bid5").val('');
129
		$("#matchType1").val('3');
130
		$("#matchType2").val('3');
131
		$("#matchType3").val('3');
132
		$("#matchType4").val('3');
133
		$("#matchType5").val('3');
134
		$('#campaignName').val('');
135
		$("#campaignStatus").val('2');
136
		$('#startDate').val('');
137
		$('#endDate').val('');
138
		$("#googleSearchNetwork").attr("checked", false);
139
		$("#displayNetwork").attr("checked", false);
140
		$("#partnerSearchNetwork").attr("checked", false);
141
		$("#campaignAmount").val('');
9065 manish.sha 142
	});
9436 manish.sha 143
 
9065 manish.sha 144
	$('#adgroupRdo').live('click', function() {
145
		$('div#addCampaignDiv').hide();
146
		$('div#addAdgroupDiv').show();
147
		$('div#addAdgroupAdDiv').hide();
148
		$('div#addKeywordDiv').hide();
149
		$("#adgroupList1").find("option").remove();
9436 manish.sha 150
		$('#adgroupList1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
151
		$("#adgroupList2").find("option").remove();
152
		$('#adgroupList2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
9231 manish.sha 153
		$('#addUpdateRecordSubmit').removeAttr('disabled');
9436 manish.sha 154
 
155
		$("#campaignList1").find("option:gt(0)").remove();
156
		$.ajax({
157
			type      : 'GET',
158
			url       : '/Support/google-adwords!getCampaigns',
159
			dataType  : 'json',
160
			success   : function(reply) {
161
				$("#campaignList1").find("option").remove();
162
				$('#campaignList1').append($("<option></option>").val('-1').html('---Select Campaign---'));
163
				$.each(reply.CampaignData, function(i,obj) {
164
					$('#campaignList1').append($("<option></option>").val(obj.CampaignId).html(obj.Name));
165
				});
166
			}
167
		});
168
 
9065 manish.sha 169
		$("#campaignList1").val('-1');
9436 manish.sha 170
		$('#adgroupName').val('');
171
		$('#adgroupStatus').val('2');
172
		$('#bidAmount').val('');
173
		$('#catalogItemId').val('');
174
		$("#campaignList2").val('-1');
175
		$("#adgroupList1").val('-1');
176
		$("#headline").val('');
177
		$("#description1").val('');
178
		$("#description2").val('');
179
		$("#url").val('');
180
		$("#displayUrl").val('');
181
		$("#campaignList3").val('-1');
182
		$("#adgroupList2").val('-1');
183
		$("#keyword1").val('');
184
		$("#keyword2").val('');
185
		$("#keyword3").val('');
186
		$("#keyword4").val('');
187
		$("#keyword5").val('');
188
		$("#bid1").val('');
189
		$("#bid2").val('');
190
		$("#bid3").val('');
191
		$("#bid4").val('');
192
		$("#bid5").val('');
193
		$("#matchType1").val('3');
194
		$("#matchType2").val('3');
195
		$("#matchType3").val('3');
196
		$("#matchType4").val('3');
197
		$("#matchType5").val('3');
198
		$('#campaignName').val('');
199
		$("#campaignStatus").val('2');
200
		$('#startDate').val('');
201
		$('#endDate').val('');
202
		$("#googleSearchNetwork").attr("checked", false);
203
		$("#displayNetwork").attr("checked", false);
204
		$("#partnerSearchNetwork").attr("checked", false);
205
		$("#campaignAmount").val('');
9065 manish.sha 206
	});
9436 manish.sha 207
 
9065 manish.sha 208
	$('#textAdRdo').live('click', function() {
209
		$('div#addCampaignDiv').hide();
210
		$('div#addAdgroupDiv').hide();
211
		$('div#addAdgroupAdDiv').show();
212
		$('div#addKeywordDiv').hide();
213
		$("#adgroupList1").find("option").remove();
9436 manish.sha 214
		$('#adgroupList1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
215
		$("#adgroupList2").find("option").remove();
216
		$('#adgroupList2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
9231 manish.sha 217
		$('#addUpdateRecordSubmit').removeAttr('disabled');
9065 manish.sha 218
		$("#campaignList1").val('-1');
9436 manish.sha 219
		$('#adgroupName').val('');
220
		$('#adgroupStatus').val('2');
221
		$('#bidAmount').val('');
222
		$('#catalogItemId').val('');
223
		$("#campaignList2").find("option:gt(0)").remove();
224
		$.ajax({
225
			type      : 'GET',
226
			url       : '/Support/google-adwords!getCampaigns',
227
			dataType  : 'json',
228
			success   : function(reply) {
229
				$("#campaignList2").find("option").remove();
230
				$('#campaignList2').append($("<option></option>").val('-1').html('---Select Campaign---'));
231
				$.each(reply.CampaignData, function(i,obj) {
232
					$('#campaignList2').append($("<option></option>").val(obj.CampaignId).html(obj.Name));
233
				});
234
			}
235
		});
236
		$("#adgroupList1").val('-1');
237
		$("#headline").val('');
238
		$("#description1").val('');
239
		$("#description2").val('');
240
		$("#url").val('');
241
		$("#displayUrl").val('');
242
		$("#campaignList3").val('-1');
243
		$("#adgroupList2").val('-1');
244
		$("#keyword1").val('');
245
		$("#keyword2").val('');
246
		$("#keyword3").val('');
247
		$("#keyword4").val('');
248
		$("#keyword5").val('');
249
		$("#bid1").val('');
250
		$("#bid2").val('');
251
		$("#bid3").val('');
252
		$("#bid4").val('');
253
		$("#bid5").val('');
254
		$("#matchType1").val('3');
255
		$("#matchType2").val('3');
256
		$("#matchType3").val('3');
257
		$("#matchType4").val('3');
258
		$("#matchType5").val('3');
259
		$('#campaignName').val('');
260
		$("#campaignStatus").val('2');
261
		$('#startDate').val('');
262
		$('#endDate').val('');
263
		$("#googleSearchNetwork").attr("checked", false);
264
		$("#displayNetwork").attr("checked", false);
265
		$("#partnerSearchNetwork").attr("checked", false);
266
		$("#campaignAmount").val('');
9065 manish.sha 267
	});
9436 manish.sha 268
 
9065 manish.sha 269
	$('#keywordRdo').live('click', function() {
270
		$('div#addCampaignDiv').hide();
271
		$('div#addAdgroupDiv').hide();
272
		$('div#addAdgroupAdDiv').hide();
273
		$('div#addKeywordDiv').show();
274
		$("#adgroupList1").find("option").remove();
9436 manish.sha 275
		$('#adgroupList1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
276
		$("#adgroupList2").find("option").remove();
277
		$('#adgroupList2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
278
		$("#campaignList1").val('-1');
279
		$('#adgroupName').val('');
280
		$('#adgroupStatus').val('2');
281
		$('#bidAmount').val('');
282
		$('#catalogItemId').val('');
283
		$("#campaignList2").val('-1');
284
		$("#adgroupList1").val('-1');
285
		$("#headline").val('');
286
		$("#description1").val('');
287
		$("#description2").val('');
288
		$("#url").val('');
289
		$("#displayUrl").val('');
290
		$("#campaignList3").find("option:gt(0)").remove();
291
		$.ajax({
292
			type      : 'GET',
293
			url       : '/Support/google-adwords!getCampaigns',
294
			dataType  : 'json',
295
			success   : function(reply) {
296
				$("#campaignList3").find("option").remove();
297
				$('#campaignList3').append($("<option></option>").val('-1').html('---Select Campaign---'));
298
				$.each(reply.CampaignData, function(i,obj) {
299
					$('#campaignList3').append($("<option></option>").val(obj.CampaignId).html(obj.Name));
300
				});
301
			}
302
		});
303
		$("#adgroupList2").val('-1');
304
		$("#keyword1").val('');
305
		$("#keyword2").val('');
306
		$("#keyword3").val('');
307
		$("#keyword4").val('');
308
		$("#keyword5").val('');
309
		$("#bid1").val('');
310
		$("#bid2").val('');
311
		$("#bid3").val('');
312
		$("#bid4").val('');
313
		$("#bid5").val('');
314
		$("#matchType1").val('3');
315
		$("#matchType2").val('3');
316
		$("#matchType3").val('3');
317
		$("#matchType4").val('3');
318
		$("#matchType5").val('3');
9231 manish.sha 319
		$('#addUpdateRecordSubmit').removeAttr('disabled');
9065 manish.sha 320
		$('#campaignName').val('');
9436 manish.sha 321
		$("#campaignStatus").val('2');
322
		$('#startDate').val('');
323
		$('#endDate').val('');
324
		$("#googleSearchNetwork").attr("checked", false);
325
		$("#displayNetwork").attr("checked", false);
326
		$("#partnerSearchNetwork").attr("checked", false);
327
		$("#campaignAmount").val('');
9065 manish.sha 328
	});
9436 manish.sha 329
 
9231 manish.sha 330
	$('#campaignRdoUpdate').live('click', function() {
331
		$('div#updateCampaignDiv').show();
332
		$('div#updateKeywordDiv').hide();
333
		$('div#updateAdgroupDiv').hide();
9436 manish.sha 334
 
9231 manish.sha 335
		$('#addUpdateRecordSubmit').removeAttr('disabled');
9436 manish.sha 336
 
337
		$("#campaignListUpdate1").find("option:gt(0)").remove();
338
		$.ajax({
339
			type      : 'GET',
340
			url       : '/Support/google-adwords!getCampaigns',
341
			dataType  : 'json',
342
			success   : function(reply) {
343
				$("#campaignListUpdate1").find("option").remove();
344
				$('#campaignListUpdate1').append($("<option></option>").val('-1').html('---Select Campaign---'));
345
				$.each(reply.CampaignData, function(i,obj) {
346
					$('#campaignListUpdate1').append($("<option></option>").val(obj.CampaignId).html(obj.Name));
347
				});
348
			}
349
		});
350
		$('#campaignNameUpdate').val('');
351
		$('#campaignStatusUpdate').val('2');
352
		$('#campaignAmountUpdate').val('');
353
 
354
		$('#campaignListUpdate2').val('-1');
355
		$('#adgroupListUpdate1').find("option").remove();
356
		$('#adgroupListUpdate1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
357
		$('#adgroupNameUpdate').val('');
358
		$('#adgroupStatusUpdate').val('2');
359
		$('#catalogItemIdUpdate').val('');
360
		$('#bidAmountUpdate').val('');
9463 manish.sha 361
		$('#stockLinkedUpdate').attr("checked",false);
9436 manish.sha 362
 
363
		$('#campaignListUpdate3').val('-1');
364
		$('#adgroupListUpdate2').find("option").remove();
365
		$('#adgroupListUpdate2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
366
		$('#keywordListUpdate1').find("option").remove();
367
		$('#keywordListUpdate1').append($("<option></option>").val('-1').html('---Select Keyword---'));
368
		$('#keywordUpdate').val('');
369
		$('#bidUpdate').val('');
370
		$('#matchTypeUpdate').val('3'); 	
9231 manish.sha 371
	});
9436 manish.sha 372
 
9231 manish.sha 373
	$('#keywordRdoUpdate').live('click', function() {
374
		$('div#updateCampaignDiv').hide();
375
		$('div#updateKeywordDiv').show();
376
		$('div#updateAdgroupDiv').hide();
9436 manish.sha 377
 
9231 manish.sha 378
		$('#addUpdateRecordSubmit').removeAttr('disabled');
9436 manish.sha 379
 
9231 manish.sha 380
		$('#campaignListUpdate1').val('-1');
9436 manish.sha 381
		$('#campaignNameUpdate').val('');
382
		$('#campaignStatusUpdate').val('2');
383
		$('#campaignAmountUpdate').val('');
384
 
385
		$('#campaignListUpdate2').val('-1');
386
		$('#adgroupListUpdate1').find("option").remove();
387
		$('#adgroupListUpdate1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
388
		$('#adgroupNameUpdate').val('');
389
		$('#adgroupStatusUpdate').val('2');
390
		$('#catalogItemIdUpdate').val('');
391
		$('#bidAmountUpdate').val('');
9463 manish.sha 392
		$('#stockLinkedUpdate').attr("checked",false);
9436 manish.sha 393
 
394
		$("#campaignListUpdate3").find("option:gt(0)").remove();
395
		$.ajax({
396
			type      : 'GET',
397
			url       : '/Support/google-adwords!getCampaigns',
398
			dataType  : 'json',
399
			success   : function(reply) {
400
				$("#campaignListUpdate3").find("option").remove();
401
				$('#campaignListUpdate3').append($("<option></option>").val('-1').html('---Select Campaign---'));
402
				$.each(reply.CampaignData, function(i,obj) {
403
					$('#campaignListUpdate3').append($("<option></option>").val(obj.CampaignId).html(obj.Name));
404
				});
405
			}
406
		});
407
		$('#adgroupListUpdate2').find("option").remove();
408
		$('#adgroupListUpdate2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
409
		$('#keywordListUpdate1').find("option").remove();
410
		$('#keywordListUpdate1').append($("<option></option>").val('-1').html('---Select Keyword---'));
411
		$('#keywordUpdate').val('');
412
		$('#bidUpdate').val('');
413
		$('#matchTypeUpdate').val('3'); 	
9231 manish.sha 414
	});
9436 manish.sha 415
 
9231 manish.sha 416
	$('#adgroupRdoUpdate').live('click', function() {
417
		$('div#updateCampaignDiv').hide();
418
		$('div#updateKeywordDiv').hide();
419
		$('div#updateAdgroupDiv').show();
9436 manish.sha 420
 
9231 manish.sha 421
		$('#addUpdateRecordSubmit').removeAttr('disabled');
9436 manish.sha 422
 
9231 manish.sha 423
		$('#campaignListUpdate1').val('-1');
9436 manish.sha 424
		$('#campaignNameUpdate').val('');
425
		$('#campaignStatusUpdate').val('2');
426
		$('#campaignAmountUpdate').val('');
427
 
428
		$("#campaignListUpdate2").find("option:gt(0)").remove();
429
		$.ajax({
430
			type      : 'GET',
431
			url       : '/Support/google-adwords!getCampaigns',
432
			dataType  : 'json',
433
			success   : function(reply) {
434
				$("#campaignListUpdate2").find("option").remove();
435
				$('#campaignListUpdate2').append($("<option></option>").val('-1').html('---Select Campaign---'));
436
				$.each(reply.CampaignData, function(i,obj) {
437
					$('#campaignListUpdate2').append($("<option></option>").val(obj.CampaignId).html(obj.Name));
438
				});
439
			}
440
		});
441
		$('#adgroupListUpdate1').find("option").remove();
442
		$('#adgroupListUpdate1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
443
		$('#adgroupNameUpdate').val('');
444
		$('#adgroupStatusUpdate').val('2');
445
		$('#catalogItemIdUpdate').val('');
446
		$('#bidAmountUpdate').val('');
9463 manish.sha 447
		$('#stockLinkedUpdate').attr("checked",false);
9436 manish.sha 448
 
449
		$('#campaignListUpdate3').val('-1');
450
		$('#adgroupListUpdate2').find("option").remove();
451
		$('#adgroupListUpdate2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
452
		$('#keywordListUpdate1').find("option").remove();
453
		$('#keywordListUpdate1').append($("<option></option>").val('-1').html('---Select Keyword---'));
454
		$('#keywordUpdate').val('');
455
		$('#bidUpdate').val('');
456
		$('#matchTypeUpdate').val('3'); 	
9231 manish.sha 457
	});
9436 manish.sha 458
 
9231 manish.sha 459
	$('#cancelAddUpdateRecords').live('click', function() {
9065 manish.sha 460
		$("#campaignRdo").attr("checked", false);
9436 manish.sha 461
		$("#adgroupRdo").attr("checked", false);
462
		$("#textAdRdo").attr("checked", false);
463
		$("#keywordRdo").attr("checked", false);
464
		$('div#addCampaignDiv').hide();
9065 manish.sha 465
		$('div#addAdgroupDiv').hide();
466
		$('div#addAdgroupAdDiv').hide();
467
		$('div#addKeywordDiv').hide();
9436 manish.sha 468
		$('#campaignName').val('');
469
		$("#campaignStatus").val('2');
470
		$('#startDate').val('');
471
		$('#endDate').val('');
472
		$("#googleSearchNetwork").attr("checked", false);
473
		$("#displayNetwork").attr("checked", false);
474
		$("#partnerSearchNetwork").attr("checked", false);
475
		$("#campaignAmount").val('');
476
		$("#adgroupList1").find("option").remove();
477
		$('#adgroupList1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
478
		$("#adgroupList2").find("option").remove();
479
		$('#adgroupList2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
480
		$("#campaignList1").val('-1');
481
		$('#adgroupName').val('');
482
		$('#adgroupStatus').val('2');
483
		$('#bidAmount').val('');
484
		$('#catalogItemId').val('');
485
		$("#campaignList2").val('-1');
486
		$("#adgroupList1").val('-1');
487
		$("#headline").val('');
488
		$("#description1").val('');
489
		$("#description2").val('');
490
		$("#url").val('');
491
		$("#displayUrl").val('');
492
		$("#campaignList3").val('-1');
493
		$("#adgroupList2").val('-1');
494
		$("#keyword1").val('');
495
		$("#keyword2").val('');
496
		$("#keyword3").val('');
497
		$("#keyword4").val('');
498
		$("#keyword5").val('');
499
		$("#bid1").val('');
500
		$("#bid2").val('');
501
		$("#bid3").val('');
502
		$("#bid4").val('');
503
		$("#bid5").val('');
504
		$("#matchType1").val('3');
505
		$("#matchType2").val('3');
506
		$("#matchType3").val('3');
507
		$("#matchType4").val('3');
508
		$("#matchType5").val('3');
509
		$('#addUpdateRecordSubmit').attr('disabled', 'true');
510
 
511
		$('div#updateCampaignDiv').hide();
9231 manish.sha 512
		$('div#updateKeywordDiv').hide();
513
		$('div#updateAdgroupDiv').hide();
9436 manish.sha 514
		$('#campaignRdoUpdate').attr("checked",false);
9231 manish.sha 515
		$('#adgroupRdoUpdate').attr("checked",false);
516
		$('#keywordRdoUpdate').attr("checked",false);
9436 manish.sha 517
		$('#campaignListUpdate1').val('-1');
518
		$('#campaignNameUpdate').val('');
519
		$('#campaignStatusUpdate').val('2');
520
		$('#campaignAmountUpdate').val('');
521
 
522
		$('#campaignListUpdate2').val('-1');
523
		$('#adgroupListUpdate1').find("option").remove();
524
		$('#adgroupListUpdate1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
525
		$('#adgroupNameUpdate').val('');
526
		$('#adgroupStatusUpdate').val('2');
527
		$('#catalogItemIdUpdate').val('');
528
		$('#bidAmountUpdate').val('');
9463 manish.sha 529
		$('#stockLinkedUpdate').attr("checked",false);
9436 manish.sha 530
 
531
		$('#campaignListUpdate3').val('-1');
532
		$('#adgroupListUpdate2').find("option").remove();
533
		$('#adgroupListUpdate2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
534
		$('#keywordListUpdate1').find("option").remove();
535
		$('#keywordListUpdate1').append($("<option></option>").val('-1').html('---Select Keyword---'));
536
		$('#keywordUpdate').val('');
537
		$('#bidUpdate').val('');
538
		$('#matchTypeUpdate').val('3');
539
 
540
	});
9065 manish.sha 541
	$("#campaignList2").change(function () {
9436 manish.sha 542
		$("#adgroupList1").find("option:gt(0)").remove();
543
 
544
		$.ajax({
545
			type      : 'GET',
546
			url       : '/Support/google-adwords!getAdgroupList',
547
			data 	  : 'campaignId=' + $(this).val(),
548
			dataType  : 'json',
549
			success   : function(reply) {
550
				$("#adgroupList1").find("option").remove();
551
				$('#adgroupList1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
552
				$.each(reply.AdGroupData, function(i,obj) {
553
					$('#adgroupList1').append($("<option></option>").val(obj.AdgroupId).html(obj.Name));
554
				});
555
			}
556
		});
9065 manish.sha 557
	});
558
	$("#campaignList3").change(function () {
9436 manish.sha 559
		$("#adgroupList2").find("option:gt(0)").remove();
560
 
561
		$.ajax({
562
			type      : 'GET',
563
			url       : '/Support/google-adwords!getAdgroupList',
564
			data 	  : 'campaignId=' + $(this).val(),
565
			dataType  : 'json',
566
			success   : function(reply) {
567
				$("#adgroupList2").find("option").remove();
568
				$('#adgroupList2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
569
				$.each(reply.AdGroupData, function(i,obj) {
570
					$('#adgroupList2').append($("<option></option>").val(obj.AdgroupId).html(obj.Name));
571
				});
572
			}
573
		});
9065 manish.sha 574
	});
9436 manish.sha 575
 
9231 manish.sha 576
	$("#campaignListUpdate1").change(function () {
577
		$('#campaignNameUpdate').val('');
9436 manish.sha 578
		$('#campaignStatusUpdate').val('2');
579
		$('#campaignAmountUpdate').val(''); 
580
		$.ajax({
581
			type      : 'GET',
582
			url       : '/Support/google-adwords!getCampaignDetails',
583
			data 	  : 'campaignId=' + $(this).val(),
584
			dataType  : 'json',
585
			success   : function(reply) {
586
				$('#campaignNameUpdate').val(reply.Name);
587
				$('#campaignStatusUpdate').val(reply.Status);
588
				$('#campaignAmountUpdate').val(reply.BudgetAmount);
589
			}
590
		});
9231 manish.sha 591
	});
9436 manish.sha 592
 
9231 manish.sha 593
	$("#campaignListUpdate2").change(function () {
9436 manish.sha 594
		$("#adgroupListUpdate1").find("option:gt(0)").remove();
595
		$('#adgroupNameUpdate').val('');
596
		$('#adgroupStatusUpdate').val('2');
597
		$('#catalogItemIdUpdate').val('');
598
		$('#bidAmountUpdate').val('');
599
 
600
		$.ajax({
601
			type      : 'GET',
602
			url       : '/Support/google-adwords!getAdgroupList',
603
			data 	  : 'campaignId=' + $(this).val(),
604
			dataType  : 'json',
605
			success   : function(reply) {
606
				$("#adgroupListUpdate1").find("option").remove();
607
				$('#adgroupListUpdate1').append($("<option></option>").val('-1').html('---Select AdGroup---'));
608
				$.each(reply.AdGroupData, function(i,obj) {
609
					$('#adgroupListUpdate1').append($("<option></option>").val(obj.AdgroupId).html(obj.Name));
610
				});
611
			}
612
		});
9231 manish.sha 613
	});
9436 manish.sha 614
 
9231 manish.sha 615
	$("#adgroupListUpdate1").change(function () {
616
		$('#adgroupNameUpdate').val('');
9436 manish.sha 617
		$('#adgroupStatusUpdate').val('2');
618
		$('#catalogItemIdUpdate').val('');
619
		$('#bidAmountUpdate').val('');
9463 manish.sha 620
		$('#stockLinkedUpdate').attr("checked",false);
9436 manish.sha 621
		$.ajax({
622
			type      : 'GET',
623
			url       : '/Support/google-adwords!getAdGroupDetails',
624
			data 	  : 'adgroupId=' + $(this).val(),
625
			dataType  : 'json',
626
			success   : function(reply) {
627
				$('#adgroupNameUpdate').val(reply.Name);
628
				$('#adgroupStatusUpdate').val(reply.Status);
629
				$('#catalogItemIdUpdate').val(reply.CatalogItemId);
630
				$('#bidAmountUpdate').val(reply.BidAmount);
9463 manish.sha 631
				if(reply.StockLinked=='1'){
632
					$('#stockLinkedUpdate').attr("checked",true);
633
				}
9436 manish.sha 634
			}
635
		});
9231 manish.sha 636
	});
9436 manish.sha 637
 
9231 manish.sha 638
	$("#campaignListUpdate3").change(function () {
9436 manish.sha 639
		$("#adgroupListUpdate2").find("option:gt(0)").remove();
640
		$("#keywordListUpdate1").find("option:gt(0)").remove();
641
		$('#keywordUpdate').val('');
642
		$('#matchTypeUpdate').val('2');
643
		$('#bidUpdate').val('');
644
		$.ajax({
645
			type      : 'GET',
646
			url       : '/Support/google-adwords!getAdgroupList',
647
			data 	  : 'campaignId=' + $(this).val(),
648
			dataType  : 'json',
649
			success   : function(reply) {
650
				$("#adgroupListUpdate2").find("option").remove();
651
				$('#adgroupListUpdate2').append($("<option></option>").val('-1').html('---Select AdGroup---'));
652
				$.each(reply.AdGroupData, function(i,obj) {
653
					$('#adgroupListUpdate2').append($("<option></option>").val(obj.AdgroupId).html(obj.Name));
654
				});
655
			}
656
		});
9231 manish.sha 657
	});
9436 manish.sha 658
 
9231 manish.sha 659
	$("#adgroupListUpdate2").change(function () {
9436 manish.sha 660
		$("#keywordListUpdate1").find("option:gt(0)").remove();
661
		$('#keywordUpdate').val('');
662
		$('#matchTypeUpdate').val('2');
663
		$('#bidUpdate').val('');
664
		$.ajax({
665
			type      : 'GET',
666
			url       : '/Support/google-adwords!getKeywordList',
667
			data 	  : 'adgroupId=' + $(this).val(),
668
			dataType  : 'json',
669
			success   : function(reply) {
670
				$("#keywordListUpdate1").find("option").remove();
671
				$('#keywordListUpdate1').append($("<option></option>").val('-1').html('---Select Keyword---'));
672
				$.each(reply.AdKeywordData, function(i,obj) {
673
					$('#keywordListUpdate1').append($("<option></option>").val(obj.KeywordId).html(obj.Text));
674
				});
675
			}
676
		});
9231 manish.sha 677
	});
9436 manish.sha 678
 
9231 manish.sha 679
	$("#keywordListUpdate1").change(function () {
680
		$('#keywordUpdate').val('');
9436 manish.sha 681
		$('#matchTypeUpdate').val('2');
682
		$('#bidUpdate').val('');
683
		$.ajax({
684
			type      : 'GET',
685
			url       : '/Support/google-adwords!getKeywordDetails',
686
			data 	  : 'keywordId=' + $(this).val() + '&adgroupId=' + $("#adgroupListUpdate2").val(),
687
			dataType  : 'json',
688
			success   : function(reply) {
689
				$('#keywordUpdate').val(reply.Text);
690
				$('#matchTypeUpdate').val(reply.MatchType);
691
				$('#bidUpdate').val(reply.Bid);
692
 
693
			}
9352 manish.sha 694
		});
695
	});
696
 
9436 manish.sha 697
});