Subversion Repositories SmartDukaan

Rev

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