Subversion Repositories SmartDukaan

Rev

Rev 9242 | Rev 9725 | 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>
19
<style>
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(){
192
	var itemWeight=document.forms["snapdeal-form"]["itemWeight"].value;
193
	var warehouseId=document.forms["snapdeal-form"]["warehouseId"].value;
194
	var transferPrice=document.forms["snapdeal-form"]["transferPrice"].value;
9478 kshitij.so 195
	var maxNlc=document.forms["snapdeal-form"]["maxNlc"].value;
9242 kshitij.so 196
 
197
	if (warehouseId=="" || isNaN(warehouseId)){
198
		jAlert('Illegal Entry In Warehouse Id', 'ERROR');
199
		return false;
200
	}
201
 
202
	if (transferPrice==0 || transferPrice=="" || isNaN(transferPrice)){
203
		jAlert('Illegal Entry In Transfer Price', 'ERROR');
204
		return false;
205
	}
9478 kshitij.so 206
 
207
	if (maxNlc==0 || maxNlc=="" || isNaN(maxNlc)){
208
		jAlert('Illegal Entry In Max NLC field', 'ERROR');
209
		return false;
210
	}
211
 
212
 
9242 kshitij.so 213
 
214
	var data = $(this).serialize() 
215
 
216
    jQuery.ajax({
217
        url: "/Support/snapdeal-list!update",
218
        type: 'POST',
219
        data: data,
220
        async: false,
221
		beforeSend: function(){
222
        $('#ajax-spinner').show();
223
        },
224
        complete: function(){
225
        $('#ajax-spinner').hide();
226
        },
227
        success: function (data) {
228
            alert("Changes propagated successfully");
229
        },
230
		 error : function() {
231
		 	alert("OOPS!!!Failed to do changes.Try Again.");
232
		 },
233
        cache: false,
234
        contentType: "application/x-www-form-urlencoded",
235
        processData: false
236
    });
237
 
238
    return false;
239
});
240
});
241
</script>
242
<script type="text/javascript">
243
$(function(){	
244
$("#add-new-item").live('submit', function(){
245
	var itemWeight=document.forms["add-new-item"]["itemWeight"].value;
246
	var transferPrice=document.forms["add-new-item"]["transferPrice"].value;
247
	var warehouseId=document.forms["add-new-item"]["warehouseId"].value;
248
	var itemId=document.forms["add-new-item"]["itemId"].value;
9478 kshitij.so 249
	var maxNlc=document.forms["add-new-item"]["maxNlc"].value;
9242 kshitij.so 250
 
251
	if (itemId==0 || itemId=="" || isNaN(itemId)){
252
		jAlert('Illegal Entry In Item Id ', 'ERROR');
253
		return false;
254
	}
255
 
256
	if (warehouseId=="" || isNaN(warehouseId)){
257
		jAlert('Illegal Entry In Warehouse Id ', 'ERROR');
258
		return false;
259
	}
260
 
261
	if (transferPrice==0 || transferPrice=="" || isNaN(transferPrice)){
262
		jAlert('Illegal Entry In Transfer Price ', '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
 
9242 kshitij.so 271
    var data = $(this).serialize() 
272
 
273
    jQuery.ajax({
274
        url: "/Support/snapdeal-list!addNewItem",
275
        type: 'POST',
276
        data: data,
277
        async: false,
278
		beforeSend: function(){
279
        $('#ajax-spinner').show();
280
        },
281
        complete: function(){
282
        $('#ajax-spinner').hide();
283
        },
284
        success: function (data) {
285
            alert("Changes propagated successfully");
286
        },
287
		 error : function() {
288
		 	alert("OOPS!!!Failed to do changes.Try Again.");
289
		 },
290
        cache: false,
291
        contentType: "application/x-www-form-urlencoded",
292
        processData: false
293
    });
294
 
295
    return false;
296
});
297
});
298
</script>
299
<script type="text/javascript">
300
$('#addNewItem').live('click', function(){
301
	jQuery.ajax({
302
        type : "GET",
303
        url : "/Support/snapdeal-list!getAddNewItemForm",
304
		beforeSend: function(){
305
        $('#ajax-spinner').show();
306
        },
307
        complete: function(){
308
        $('#ajax-spinner').hide();
309
        },
310
        success : function(response) {
311
            $('#' + 'snapdealitem-details').html(response);
312
        },
313
		error : function() {
314
			alert("Unable to get add new item form.");
315
		 },
316
    });
317
});
318
</script>
319
<title>SnapDeal Listed Items</title>
320
</head>
321
<body>
322
	<div style="padding: 20px 0px;">
323
       <a style="padding-left: 10px;" href="/Support/logout">Logout</a>
324
	   <input type="button" style="padding-left: 5px; margin-left: 10px;width: 15%;float:right;" id="addNewItem" name="addNewItem" value="Add New Item">
325
	   <input type="submit" id="search_item" value="Search" style="float: right;width:8%;">
326
	   <input id="search_text" style="float: right;width:10%;">
327
 
328
</div>
329
<div>
330
    <div style="color:blue;">
331
    #sactionmessage()
332
    </div>
333
    <div style="color:red;">
334
    #sactionerror()
335
    </div>
336
		<div id="ajax-spinner" style="display:none;">
337
		<img src="/Support/images/ajax_loader_blue.gif" class="loading-image">
338
		</div>
339
	   <div id="snapdeal-table">
340
	   </div>
341
	<br>
342
        <div class="display" style="float: left;">
343
		Showing&nbsp;<span class="valueStart">1</span>&nbsp;to&nbsp;<span class="valueEnd">10</span>&nbsp;of&nbsp;
344
		<span class="total"></span>&nbsp;entries
345
	</div>
346
	<div class="paginate" style="float: right;">
347
		<a class="previous" href="#" style="margin: 20px;">Previous</a>
348
		<a class="next" href="#" style="margin: 0px;">Next</a>
349
	</div>
350
	<div id="snapdealitem-details" style="padding-top: 30px;">
351
	</div>
352
 
353
 
354
</div>
355
 
356
</body>
357
</html>