Subversion Repositories SmartDukaan

Rev

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