Subversion Repositories SmartDukaan

Rev

Rev 9725 | Rev 9736 | 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();
9242 kshitij.so 200
 
201
	if (warehouseId=="" || isNaN(warehouseId)){
202
		jAlert('Illegal Entry In Warehouse Id', 'ERROR');
203
		return false;
204
	}
205
 
206
	if (transferPrice==0 || transferPrice=="" || isNaN(transferPrice)){
207
		jAlert('Illegal Entry In Transfer Price', 'ERROR');
208
		return false;
209
	}
9478 kshitij.so 210
 
9725 kshitij.so 211
	if (sellingPrice==0 || sellingPrice=="" || isNaN(sellingPrice)){
212
		jAlert('Illegal Entry In Selling Price', 'ERROR');
213
		return false;
214
	}
215
 
216
	if (otherCost=="" || isNaN(otherCost)){
217
		jAlert('Illegal Entry In Other Cost ', 'ERROR');
218
		return false;
219
	}
220
 
9478 kshitij.so 221
	if (maxNlc==0 || maxNlc=="" || isNaN(maxNlc)){
222
		jAlert('Illegal Entry In Max NLC field', 'ERROR');
223
		return false;
224
	}
225
 
9725 kshitij.so 226
	if (parseFloat(sellingPrice) < minPossibleSp){
9734 kshitij.so 227
		if ((confirm('Selling Price is below Minimum Possible Selling Price.Do you want to update?'))){
228
			if (!(confirm('Are you sure?Selling Price is below Minimum Possible Selling Price.'))){
9725 kshitij.so 229
			return false;
9734 kshitij.so 230
			}
9725 kshitij.so 231
		}
9734 kshitij.so 232
		else{
233
			return false;
234
		}
9725 kshitij.so 235
	}
9478 kshitij.so 236
 
9725 kshitij.so 237
 
9242 kshitij.so 238
 
239
	var data = $(this).serialize() 
240
 
241
    jQuery.ajax({
242
        url: "/Support/snapdeal-list!update",
243
        type: 'POST',
244
        data: data,
245
        async: false,
246
		beforeSend: function(){
247
        $('#ajax-spinner').show();
248
        },
249
        complete: function(){
250
        $('#ajax-spinner').hide();
251
        },
252
        success: function (data) {
9734 kshitij.so 253
			if(data==0){
254
				alert("Backend validation failed");
255
				return false;
256
			}
9242 kshitij.so 257
            alert("Changes propagated successfully");
258
        },
259
		 error : function() {
260
		 	alert("OOPS!!!Failed to do changes.Try Again.");
261
		 },
262
        cache: false,
263
        contentType: "application/x-www-form-urlencoded",
264
        processData: false
265
    });
266
 
267
    return false;
268
});
269
});
270
</script>
271
<script type="text/javascript">
272
$(function(){	
273
$("#add-new-item").live('submit', function(){
9725 kshitij.so 274
	var itemWeight=$('#itemWeight').val();
275
	var transferPrice=$('#transferPrice').val();
276
	var warehouseId=$('#warehouseId').val();
277
	var itemId=$('#itemId').val();
278
	var maxNlc=$('#maxNlc').val();
279
	var otherCost=$('#otherCost').val();
280
	var minPossibleSp=$('#minPosSp').val();
281
	var sellingPrice=$('#sellingPrice').val();
9242 kshitij.so 282
 
283
	if (itemId==0 || itemId=="" || isNaN(itemId)){
284
		jAlert('Illegal Entry In Item Id ', 'ERROR');
285
		return false;
286
	}
287
 
288
	if (warehouseId=="" || isNaN(warehouseId)){
289
		jAlert('Illegal Entry In Warehouse Id ', 'ERROR');
290
		return false;
291
	}
292
 
9725 kshitij.so 293
	if (sellingPrice==0 || sellingPrice=="" || isNaN(sellingPrice)){
294
		jAlert('Illegal Entry In Selling Price', 'ERROR');
295
		return false;
296
	}
297
 
9242 kshitij.so 298
	if (transferPrice==0 || transferPrice=="" || isNaN(transferPrice)){
299
		jAlert('Illegal Entry In Transfer Price ', 'ERROR');
300
		return false;
301
	}
302
 
9725 kshitij.so 303
	if (otherCost=="" || isNaN(otherCost)){
304
		jAlert('Illegal Entry In Other Cost ', 'ERROR');
305
		return false;
306
	}
307
 
9478 kshitij.so 308
	if (maxNlc==0 || maxNlc=="" || isNaN(maxNlc)){
309
		jAlert('Illegal Entry In Max NLC field', 'ERROR');
310
		return false;
311
	}
312
 
9725 kshitij.so 313
	if (parseFloat(sellingPrice) < minPossibleSp){
314
		if (!(confirm('Selling Price is below Minimum Possible Selling Price.Do you want to update?'))){
315
			return false;
316
		}
317
	}
318
 
9242 kshitij.so 319
    var data = $(this).serialize() 
320
 
321
    jQuery.ajax({
322
        url: "/Support/snapdeal-list!addNewItem",
323
        type: 'POST',
324
        data: data,
325
        async: false,
326
		beforeSend: function(){
327
        $('#ajax-spinner').show();
328
        },
329
        complete: function(){
330
        $('#ajax-spinner').hide();
331
        },
332
        success: function (data) {
333
            alert("Changes propagated successfully");
334
        },
335
		 error : function() {
336
		 	alert("OOPS!!!Failed to do changes.Try Again.");
337
		 },
338
        cache: false,
339
        contentType: "application/x-www-form-urlencoded",
340
        processData: false
341
    });
342
 
343
    return false;
344
});
345
});
346
</script>
347
<script type="text/javascript">
348
$('#addNewItem').live('click', function(){
349
	jQuery.ajax({
350
        type : "GET",
351
        url : "/Support/snapdeal-list!getAddNewItemForm",
352
		beforeSend: function(){
353
        $('#ajax-spinner').show();
354
        },
355
        complete: function(){
356
        $('#ajax-spinner').hide();
357
        },
358
        success : function(response) {
359
            $('#' + 'snapdealitem-details').html(response);
360
        },
361
		error : function() {
362
			alert("Unable to get add new item form.");
363
		 },
364
    });
365
});
366
</script>
9725 kshitij.so 367
<script type="text/javascript">
368
$('.changeHeld').live('click', function(){
369
	var whId = $(this).attr('warehouse_id');
370
	var item_id = $(this).attr('item_id');
371
	var held=$('#heldInventory_'+whId).val();
372
	if (held<0 || held=="" || isNaN(held)){
373
		jAlert('Illegal Entry In Held ', 'ERROR');
374
		return false;
375
	}
376
	jQuery.ajax({
377
        type : "GET",
378
        url : "/Support/snapdeal-list!changeHeldForSource?itemId="+item_id+"&warehouseId="+whId+"&held="+held,
379
		beforeSend: function(){
380
        $('#ajax-spinner').show();
381
        },
382
        complete: function(){
383
        $('#ajax-spinner').hide();
384
        },
385
        success : function(json){
386
		alert("Updated successfuly New Held="+held+" for warehouse Id "+whId);
387
        },
388
		error : function() {
389
			alert("Unable to update");
390
		 },
391
    });
392
	return false;
393
});
394
</script>
9242 kshitij.so 395
<title>SnapDeal Listed Items</title>
396
</head>
397
<body>
398
	<div style="padding: 20px 0px;">
399
       <a style="padding-left: 10px;" href="/Support/logout">Logout</a>
400
	   <input type="button" style="padding-left: 5px; margin-left: 10px;width: 15%;float:right;" id="addNewItem" name="addNewItem" value="Add New Item">
401
	   <input type="submit" id="search_item" value="Search" style="float: right;width:8%;">
402
	   <input id="search_text" style="float: right;width:10%;">
403
 
404
</div>
405
<div>
406
    <div style="color:blue;">
407
    #sactionmessage()
408
    </div>
409
    <div style="color:red;">
410
    #sactionerror()
411
    </div>
412
		<div id="ajax-spinner" style="display:none;">
413
		<img src="/Support/images/ajax_loader_blue.gif" class="loading-image">
414
		</div>
415
	   <div id="snapdeal-table">
416
	   </div>
417
	<br>
418
        <div class="display" style="float: left;">
419
		Showing&nbsp;<span class="valueStart">1</span>&nbsp;to&nbsp;<span class="valueEnd">10</span>&nbsp;of&nbsp;
420
		<span class="total"></span>&nbsp;entries
421
	</div>
422
	<div class="paginate" style="float: right;">
423
		<a class="previous" href="#" style="margin: 20px;">Previous</a>
424
		<a class="next" href="#" style="margin: 0px;">Next</a>
425
	</div>
426
	<div id="snapdealitem-details" style="padding-top: 30px;">
427
	</div>
428
 
429
 
430
</div>
431
 
432
</body>
433
</html>