Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
9242 kshitij.so 1
<!DOCTYPE html PUBLIC 
2
    "-//W3C//DTD XHTML 1.1 Transitional//EN"
3
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<head>
6
<link type="image/x-icon" href="/Support/images/favicon_alt.ico" rel="shortcut icon">
7
<link href="/Support/css/demo_page_amazon.css" type="text/css" rel="stylesheet">
8
<link href="/Support/css/demo_table_amazon.css" type="text/css" rel="stylesheet">
9
<script type="text/javascript" src="/Support/js/jquery-1.4.2.js"></script>
11015 kshitij.so 10
<script type="text/javascript" src="/Support/js/snapdeal-competition-analysis-events.js"></script>
11
<script type="text/javascript" src="/Support/js/snapdeal-competition-analysis-common.js"></script>
9242 kshitij.so 12
<style type="text/css">   
13
* { font-family: Verdana; font-size: 96%; }
14
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
15
p { clear: both; }
16
.submit { margin-left: 12em; }
17
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
18
ul { padding-left: 13px;}
19
td{background-color:gainsboro};
9923 kshitij.so 20
.diffColor {
21
    background: grey;
22
}
9242 kshitij.so 23
</style>
9725 kshitij.so 24
<style type="text/css">
9242 kshitij.so 25
.loading-image {
26
position: fixed;
27
top: 50%;
28
left: 50%;
29
margin-top: -50px;
30
margin-left: -100px;
31
z-index: 100;
32
}
33
</style>
34
<script type="text/javascript">
35
		$(function(){
36
jQuery.ajax({
37
        type : "GET",
38
        url : "/Support/snapdeal-list!fetchItems?searchText="+"&next=0",
39
		beforeSend: function(){
40
        $('#ajax-spinner').show();
41
        },
42
        complete: function(){
43
        $('#ajax-spinner').hide();
44
        },
45
        success : function(response) {
46
        $('#' + 'snapdeal-table').html(response);
47
		$(".previous").css("display", "none");
48
		var temp = $('.totalValue').text();
49
		$('.total').text(temp);
50
        }
51
    });  
52
});
53
</script>
54
 
55
<script type="text/javascript">
56
  $(function(){	
57
	$(".next").live('click', function() {
58
		var start = $( ".valueStart" ).text();
59
		var end = $( ".valueEnd" ).text();
60
		var searchText = $('#search_text').val();
61
		getNextItems(start,end,searchText);
62
    });
63
	$(".previous").live('click', function() {
64
		var start = $( ".valueStart" ).text();
65
		var end = $( ".valueEnd" ).text();
66
		var pre = end - 20;
67
		var searchText = $('#search_text').val();
68
		getPreviousItems(start,end,pre,searchText);
69
    });
70
	$("#search_item").live('click', function() {
71
		var searchText = $('#search_text').val();
72
		loadSearchInfo(searchText);
73
    });
9923 kshitij.so 74
	$("#search_text").keyup(function(event){
75
    	if(event.keyCode == 13){
76
        	$("#search_item").click();
77
    	}
78
	});
9242 kshitij.so 79
	$(".editItem").live('click', function() {
9923 kshitij.so 80
        $("tr").removeClass("diffColor");
81
		$("td").css("background-color","")
82
        $(this).parents("tr").addClass("diffColor");
83
		$('tr.diffColor').children('td').css('backgroundColor', '#7F98FA');
9478 kshitij.so 84
		var itemId = $(this).attr("it");
9242 kshitij.so 85
		loadItemDetails("/Support/snapdeal-list/"+ itemId +"/edit");
86
    });
87
});
88
</script>
89
<script type="text/javascript">
90
function getNextItems(start,end,searchText){
91
jQuery.ajax({
92
        type : "GET",
93
        url : "/Support/snapdeal-list!fetchItems?searchText="+searchText+"&next="+end,
94
		beforeSend: function(){
95
        $('#ajax-spinner').show();
96
        },
97
        complete: function(){
98
        $('#ajax-spinner').hide();
99
        },
100
        success : function(response) {
101
			$('.valueEnd').text(+end + +10);
102
			$('.valueStart').text(+start + +10);
103
			var last = $('.valueEnd').text();
104
			var temp = $('.total').text();
105
			if (parseInt(last) >= parseInt(temp)){
106
				$(".next").css("display", "none");
107
			}
108
            $('#' + 'snapdeal-table').html(response);
109
			$(".previous").css("display", "");
110
        },
111
		error : function() {
112
			alert("Unable to fetch items");
113
		 },
114
    });  
115
}
116
function getPreviousItems(start,end,pre,searchText){
117
jQuery.ajax({
118
        type : "GET",
119
        url : "/Support/snapdeal-list!fetchItems?searchText="+searchText+"&next="+pre,
120
		beforeSend: function(){
121
        $('#ajax-spinner').show();
122
        },
123
        complete: function(){
124
        $('#ajax-spinner').hide();
125
        },
126
        success : function(response) {
127
			$('.valueEnd').text(+end - +10);
128
			$('.valueStart').text(+start - +10);
129
            $('#' + 'snapdeal-table').html(response);
130
			$(".next").css("display", "");	
131
			if (parseInt(start)==11)
132
			{
133
			  $(".previous").css("display", "none");	
134
			}
135
 
136
        },
137
		error : function() {
138
			alert("Unable to fetch items");
139
		 },
140
    });
141
}
142
function loadSearchInfo(searchText){
143
jQuery.ajax({
144
        type : "GET",
145
        url : "/Support/snapdeal-list!fetchItems?searchText="+searchText+"&next=0",beforeSend: function(){
146
        $('#ajax-spinner').show();
147
        },
148
        complete: function(){
149
        $('#ajax-spinner').hide();
150
        },
151
		beforeSend: function(){
152
        $('#ajax-spinner').show();
153
        },
154
        complete: function(){
155
        $('#ajax-spinner').hide();
156
        },
157
        success : function(response) {
158
            $('#' + 'snapdeal-table').html(response);
9923 kshitij.so 159
			$('#' + 'snapdealitem-details').html("");
9242 kshitij.so 160
			$('.valueEnd').text(10);
161
			$('.valueStart').text(1);
162
			$(".previous").css("display", "none");
163
			$(".next").css("display", "");
164
			var temp = $('.totalValue').text();
165
			var end = $('.valueEnd').text();
166
			$('.total').text(temp);
167
			if(parseInt(temp)<=10){
168
				$(".previous").css("display", "none");
169
				$(".next").css("display", "none");
170
				$('.valueEnd').text(temp);
171
			}
172
 
173
			if(searchText==""){
174
				$(".previous").css("display", "none");
175
				$(".next").css("display", "");
176
				$('.valueEnd').text(10);
177
			}
178
 
179
        },
180
		error : function() {
181
		 	alert("Unable to search given item.Please try again.");
182
		 },
183
    });  
184
}
185
function loadItemDetails(getUrl){
186
jQuery.ajax({
187
        type : "GET",
188
        url : getUrl,
189
		beforeSend: function(){
190
        $('#ajax-spinner').show();
191
        },
192
        complete: function(){
193
        $('#ajax-spinner').hide();
194
        },
195
        success : function(response) {
196
            $('#' + 'snapdealitem-details').html(response);
197
        },
198
		error : function() {
199
		 	alert("Unable to get Item details.Please try again.");
200
		 },
201
    });  
202
}
203
</script>
204
<script type="text/javascript">
205
$(function(){	
206
$("#snapdeal-form").live('submit', function(){
9725 kshitij.so 207
	var itemWeight=$('#itemWeight').val();
208
	var transferPrice=$('#transferPrice').val();
209
	var warehouseId=$('#warehouseId').val();
210
	var itemId=$('#itemId').val();
211
	var maxNlc=$('#maxNlc').val();
212
	var minPossibleSp=$('#minPosSp').val();
213
	var sellingPrice=$('#sellingPrice').val();
214
	var otherCost=$('#otherCost').val();
9780 kshitij.so 215
	var supc_code=$('#supc').val();
216
	var sdItem=$('#sdItemCode').val();
9923 kshitij.so 217
	var maxSellingPrice=$('#maxSp').val();
218
	var websiteMrp=$('#webisteMrp').val();
11095 kshitij.so 219
	var courierCostSnapdeal=$('#courierCostMarketplace').val();
9242 kshitij.so 220
 
9780 kshitij.so 221
	if (supc_code=="" || supc_code==null){
222
		jAlert('Illegal Entry In SUPC', 'ERROR');
223
		return false;
224
	}
225
 
11095 kshitij.so 226
	if (courierCostSnapdeal=="" || courierCostSnapdeal==null){
227
		jAlert('Illegal Entry In Courier Cost Snapdeal', 'ERROR');
228
		return false;
229
	}
230
 
9780 kshitij.so 231
	if (sdItem=="" || sdItem==null){
232
		jAlert('Illegal Entry In Sku@Snapdeal', 'ERROR');
233
		return false;
234
	}
235
 
9242 kshitij.so 236
	if (warehouseId=="" || isNaN(warehouseId)){
237
		jAlert('Illegal Entry In Warehouse Id', 'ERROR');
238
		return false;
239
	}
240
 
241
	if (transferPrice==0 || transferPrice=="" || isNaN(transferPrice)){
242
		jAlert('Illegal Entry In Transfer Price', 'ERROR');
243
		return false;
244
	}
9478 kshitij.so 245
 
9725 kshitij.so 246
	if (sellingPrice==0 || sellingPrice=="" || isNaN(sellingPrice)){
247
		jAlert('Illegal Entry In Selling Price', 'ERROR');
248
		return false;
249
	}
250
 
9923 kshitij.so 251
	if (maxSellingPrice=="" || isNaN(maxSellingPrice)){
252
		jAlert('Illegal Entry In Maximum Selling Price ', 'ERROR');
253
		return false;
254
	}
255
 
256
	if (parseFloat(maxSellingPrice) > parseFloat(websiteMrp)){
257
		jAlert('Maximum Selling Price can\'t be greater than MRP ', 'ERROR');
258
		return false;
259
	}
260
 
9725 kshitij.so 261
	if (otherCost=="" || isNaN(otherCost)){
262
		jAlert('Illegal Entry In Other Cost ', 'ERROR');
263
		return false;
264
	}
265
 
9478 kshitij.so 266
	if (maxNlc==0 || maxNlc=="" || isNaN(maxNlc)){
267
		jAlert('Illegal Entry In Max NLC field', 'ERROR');
268
		return false;
269
	}
270
 
9725 kshitij.so 271
	if (parseFloat(sellingPrice) < minPossibleSp){
9734 kshitij.so 272
		if ((confirm('Selling Price is below Minimum Possible Selling Price.Do you want to update?'))){
273
			if (!(confirm('Are you sure?Selling Price is below Minimum Possible Selling Price.'))){
9725 kshitij.so 274
			return false;
9734 kshitij.so 275
			}
9725 kshitij.so 276
		}
9734 kshitij.so 277
		else{
278
			return false;
279
		}
9725 kshitij.so 280
	}
9478 kshitij.so 281
 
9725 kshitij.so 282
 
9242 kshitij.so 283
 
284
	var data = $(this).serialize() 
285
 
286
    jQuery.ajax({
287
        url: "/Support/snapdeal-list!update",
288
        type: 'POST',
289
        data: data,
290
        async: false,
291
		beforeSend: function(){
292
        $('#ajax-spinner').show();
293
        },
294
        complete: function(){
295
        $('#ajax-spinner').hide();
296
        },
297
        success: function (data) {
9734 kshitij.so 298
			if(data==0){
299
				alert("Backend validation failed");
300
				return false;
301
			}
9736 kshitij.so 302
			else{
303
				alert("Backend validation sucess");
304
			}
9242 kshitij.so 305
            alert("Changes propagated successfully");
306
        },
307
		 error : function() {
308
		 	alert("OOPS!!!Failed to do changes.Try Again.");
309
		 },
310
        cache: false,
311
        contentType: "application/x-www-form-urlencoded",
312
        processData: false
313
    });
314
 
315
    return false;
316
});
317
});
318
</script>
319
<script type="text/javascript">
320
$(function(){	
321
$("#add-new-item").live('submit', function(){
9725 kshitij.so 322
	var itemWeight=$('#itemWeight').val();
323
	var transferPrice=$('#transferPrice').val();
324
	var warehouseId=$('#warehouseId').val();
325
	var itemId=$('#itemId').val();
326
	var maxNlc=$('#maxNlc').val();
327
	var otherCost=$('#otherCost').val();
328
	var minPossibleSp=$('#minPosSp').val();
329
	var sellingPrice=$('#sellingPrice').val();
9923 kshitij.so 330
	var maxSellingPrice=$('#maxSp').val();
331
	var websiteMrp=$('#webisteMrp').val();
9780 kshitij.so 332
	var supc=$('#supc').val();
333
	var sdItem=$('#sdItemCode').val();
11095 kshitij.so 334
	var courierCostSnapdeal=$('#courierCostMarketplace').val();
9242 kshitij.so 335
 
11095 kshitij.so 336
	if (courierCostSnapdeal=="" || courierCostSnapdeal==null){
337
		jAlert('Illegal Entry In Courier Cost Snapdeal', 'ERROR');
338
		return false;
339
	}
340
 
9780 kshitij.so 341
	if (supc=="" || supc==null){
342
		jAlert('Illegal Entry In SUPC', 'ERROR');
343
		return false;
344
	}
345
 
346
	if (sdItem=="" || sdItem==null){
347
		jAlert('Illegal Entry In Sku@Snapdeal', 'ERROR');
348
		return false;
349
	}
350
 
9242 kshitij.so 351
	if (itemId==0 || itemId=="" || isNaN(itemId)){
352
		jAlert('Illegal Entry In Item Id ', 'ERROR');
353
		return false;
354
	}
355
 
356
	if (warehouseId=="" || isNaN(warehouseId)){
357
		jAlert('Illegal Entry In Warehouse Id ', 'ERROR');
358
		return false;
359
	}
360
 
9725 kshitij.so 361
	if (sellingPrice==0 || sellingPrice=="" || isNaN(sellingPrice)){
362
		jAlert('Illegal Entry In Selling Price', 'ERROR');
363
		return false;
364
	}
365
 
9242 kshitij.so 366
	if (transferPrice==0 || transferPrice=="" || isNaN(transferPrice)){
367
		jAlert('Illegal Entry In Transfer Price ', 'ERROR');
368
		return false;
369
	}
370
 
9923 kshitij.so 371
	if (maxSellingPrice=="" || isNaN(maxSellingPrice)){
372
		jAlert('Illegal Entry In Maximum Selling Price ', 'ERROR');
373
		return false;
374
	}
375
 
376
	if (parseFloat(maxSellingPrice) > parseFloat(websiteMrp)){
377
		jAlert('Maximum Selling Price can\'t be greater than MRP ', 'ERROR');
378
		return false;
379
	}
380
 
9725 kshitij.so 381
	if (otherCost=="" || isNaN(otherCost)){
382
		jAlert('Illegal Entry In Other Cost ', 'ERROR');
383
		return false;
384
	}
385
 
9478 kshitij.so 386
	if (maxNlc==0 || maxNlc=="" || isNaN(maxNlc)){
387
		jAlert('Illegal Entry In Max NLC field', 'ERROR');
388
		return false;
389
	}
390
 
9725 kshitij.so 391
	if (parseFloat(sellingPrice) < minPossibleSp){
9736 kshitij.so 392
		if ((confirm('Selling Price is below Minimum Possible Selling Price.Do you want to update?'))){
393
			if (!(confirm('Are you sure?Selling Price is below Minimum Possible Selling Price.'))){
9725 kshitij.so 394
			return false;
9736 kshitij.so 395
			}
9725 kshitij.so 396
		}
9736 kshitij.so 397
		else{
398
			return false;
399
		}
9725 kshitij.so 400
	}
401
 
9242 kshitij.so 402
    var data = $(this).serialize() 
403
 
404
    jQuery.ajax({
405
        url: "/Support/snapdeal-list!addNewItem",
406
        type: 'POST',
407
        data: data,
408
        async: false,
409
		beforeSend: function(){
410
        $('#ajax-spinner').show();
411
        },
412
        complete: function(){
413
        $('#ajax-spinner').hide();
414
        },
415
        success: function (data) {
9780 kshitij.so 416
           if(data==0){
417
				alert("Backend validation failed");
418
				return false;
419
			}
420
			else{
421
				alert("Backend validation sucess");
422
			}
9242 kshitij.so 423
            alert("Changes propagated successfully");
424
        },
425
		 error : function() {
426
		 	alert("OOPS!!!Failed to do changes.Try Again.");
427
		 },
428
        cache: false,
429
        contentType: "application/x-www-form-urlencoded",
430
        processData: false
431
    });
432
 
433
    return false;
434
});
435
});
436
</script>
437
<script type="text/javascript">
438
$('#addNewItem').live('click', function(){
439
	jQuery.ajax({
440
        type : "GET",
441
        url : "/Support/snapdeal-list!getAddNewItemForm",
442
		beforeSend: function(){
443
        $('#ajax-spinner').show();
444
        },
445
        complete: function(){
446
        $('#ajax-spinner').hide();
447
        },
448
        success : function(response) {
449
            $('#' + 'snapdealitem-details').html(response);
450
        },
451
		error : function() {
452
			alert("Unable to get add new item form.");
453
		 },
454
    });
455
});
456
</script>
9725 kshitij.so 457
<script type="text/javascript">
458
$('.changeHeld').live('click', function(){
459
	var whId = $(this).attr('warehouse_id');
460
	var item_id = $(this).attr('item_id');
461
	var held=$('#heldInventory_'+whId).val();
462
	if (held<0 || held=="" || isNaN(held)){
463
		jAlert('Illegal Entry In Held ', 'ERROR');
464
		return false;
465
	}
466
	jQuery.ajax({
467
        type : "GET",
468
        url : "/Support/snapdeal-list!changeHeldForSource?itemId="+item_id+"&warehouseId="+whId+"&held="+held,
469
		beforeSend: function(){
470
        $('#ajax-spinner').show();
471
        },
472
        complete: function(){
473
        $('#ajax-spinner').hide();
474
        },
475
        success : function(json){
476
		alert("Updated successfuly New Held="+held+" for warehouse Id "+whId);
477
        },
478
		error : function() {
479
			alert("Unable to update");
480
		 },
481
    });
482
	return false;
483
});
484
</script>
9242 kshitij.so 485
<title>SnapDeal Listed Items</title>
486
</head>
487
<body>
488
	<div style="padding: 20px 0px;">
9923 kshitij.so 489
	   <a style="padding-left: 10px;" href="/Support/snapdeal-list/snapdeal-options">Back</a>
490
	   <a style="padding-left: 10px;" href="/Support/logout">Logout</a>
9242 kshitij.so 491
	   <input type="button" style="padding-left: 5px; margin-left: 10px;width: 15%;float:right;" id="addNewItem" name="addNewItem" value="Add New Item">
492
	   <input type="submit" id="search_item" value="Search" style="float: right;width:8%;">
493
	   <input id="search_text" style="float: right;width:10%;">
494
 
495
</div>
496
<div>
497
    <div style="color:blue;">
498
    #sactionmessage()
499
    </div>
500
    <div style="color:red;">
501
    #sactionerror()
502
    </div>
503
		<div id="ajax-spinner" style="display:none;">
504
		<img src="/Support/images/ajax_loader_blue.gif" class="loading-image">
505
		</div>
506
	   <div id="snapdeal-table">
507
	   </div>
508
	<br>
509
        <div class="display" style="float: left;">
510
		Showing&nbsp;<span class="valueStart">1</span>&nbsp;to&nbsp;<span class="valueEnd">10</span>&nbsp;of&nbsp;
511
		<span class="total"></span>&nbsp;entries
512
	</div>
513
	<div class="paginate" style="float: right;">
514
		<a class="previous" href="#" style="margin: 20px;">Previous</a>
515
		<a class="next" href="#" style="margin: 0px;">Next</a>
516
	</div>
517
	<div id="snapdealitem-details" style="padding-top: 30px;">
11015 kshitij.so 518
	</div>    
9242 kshitij.so 519
</div>
520
 
521
</body>
522
</html>