Subversion Repositories SmartDukaan

Rev

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