Subversion Repositories SmartDukaan

Rev

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

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