Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
7283 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>
7420 kshitij.so 6
<link type="image/x-icon" href="/Support/images/favicon_alt.ico" rel="shortcut icon">
7283 kshitij.so 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;}
8620 kshitij.so 17
td{background-color:#B0BED9};
10922 kshitij.so 18
.diffColor {
19
    background: grey;
20
}
7283 kshitij.so 21
</style>
8639 kshitij.so 22
<style>
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>
7283 kshitij.so 32
<script type="text/javascript">
8620 kshitij.so 33
		$(function(){
34
jQuery.ajax({
35
        type : "GET",
36
        url : "/Support/amazon-list!fetchItems?searchText="+"&next=0",
8639 kshitij.so 37
		beforeSend: function(){
38
        $('#ajax-spinner').show();
39
        },
40
        complete: function(){
41
        $('#ajax-spinner').hide();
42
        },
8620 kshitij.so 43
        success : function(response) {
44
        $('#' + 'amazon-table').html(response);
45
		$(".previous").css("display", "none");
46
		var temp = $('.totalValue').text();
47
		$('.total').text(temp);
48
        }
49
    });  
50
});
7283 kshitij.so 51
</script>
8620 kshitij.so 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
    });
10922 kshitij.so 72
 
73
	$("#search_text").keyup(function(event){
74
    	if(event.keyCode == 13){
75
        	$("#search_item").click();
76
    	}
77
	});
78
 
8620 kshitij.so 79
	$(".editItem").live('click', function() {
10922 kshitij.so 80
		$("tr").removeClass("diffColor");
81
		$("td").css("background-color","")
82
        $(this).parents("tr").addClass("diffColor");
83
		$('tr.diffColor').children('td').css('backgroundColor', '#7F98FA');
8620 kshitij.so 84
		var itemId = $(this).attr('itemid')
85
		loadItemDetails("/Support/amazon-list/"+ itemId +"/edit");
86
    });
87
});
88
</script>
89
<script type="text/javascript">
90
function getNextItems(start,end,searchText){
91
jQuery.ajax({
92
        type : "GET",
93
        url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next="+end,
8639 kshitij.so 94
		beforeSend: function(){
95
        $('#ajax-spinner').show();
96
        },
97
        complete: function(){
98
        $('#ajax-spinner').hide();
99
        },
8620 kshitij.so 100
        success : function(response) {
101
			$('.valueEnd').text(+end + +10);
102
			$('.valueStart').text(+start + +10);
103
			var last = $('.valueEnd').text();
104
			var temp = $('.total').text();
105
			if (parseInt(last) >= parseInt(temp)){
106
				$(".next").css("display", "none");
107
			}
108
            $('#' + 'amazon-table').html(response);
109
			$(".previous").css("display", "");
110
        },
111
		error : function() {
112
			alert("Unable to fetch items");
113
		 },
114
    });  
115
}
116
function getPreviousItems(start,end,pre,searchText){
117
jQuery.ajax({
118
        type : "GET",
119
        url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next="+pre,
8639 kshitij.so 120
		beforeSend: function(){
121
        $('#ajax-spinner').show();
122
        },
123
        complete: function(){
124
        $('#ajax-spinner').hide();
125
        },
8620 kshitij.so 126
        success : function(response) {
127
			$('.valueEnd').text(+end - +10);
128
			$('.valueStart').text(+start - +10);
129
            $('#' + 'amazon-table').html(response);
130
			$(".next").css("display", "");	
131
			if (parseInt(start)==11)
132
			{
133
			  $(".previous").css("display", "none");	
134
			}
135
 
136
        },
137
		error : function() {
138
			alert("Unable to fetch items");
139
		 },
140
    });
141
}
142
function loadSearchInfo(searchText){
143
jQuery.ajax({
144
        type : "GET",
8639 kshitij.so 145
        url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next=0",beforeSend: function(){
146
        $('#ajax-spinner').show();
147
        },
148
        complete: function(){
149
        $('#ajax-spinner').hide();
150
        },
151
		beforeSend: function(){
152
        $('#ajax-spinner').show();
153
        },
154
        complete: function(){
155
        $('#ajax-spinner').hide();
156
        },
8620 kshitij.so 157
        success : function(response) {
158
            $('#' + 'amazon-table').html(response);
10922 kshitij.so 159
			$('#' + 'item-details').html('');
8620 kshitij.so 160
			$('.valueEnd').text(10);
161
			$('.valueStart').text(1);
162
			$(".previous").css("display", "none");
163
			$(".next").css("display", "");
164
			var temp = $('.totalValue').text();
165
			var end = $('.valueEnd').text();
166
			$('.total').text(temp);
167
			if(parseInt(temp)<=10){
168
				$(".previous").css("display", "none");
169
				$(".next").css("display", "none");
170
				$('.valueEnd').text(temp);
171
			}
172
 
173
			if(searchText==""){
174
				$(".previous").css("display", "none");
175
				$(".next").css("display", "");
176
				$('.valueEnd').text(10);
177
			}
178
 
179
        },
180
		error : function() {
181
		 	alert("Unable to search given item.Please try again.");
182
		 },
183
    });  
184
}
185
function loadItemDetails(getUrl){
186
jQuery.ajax({
187
        type : "GET",
188
        url : getUrl,
8639 kshitij.so 189
		beforeSend: function(){
190
        $('#ajax-spinner').show();
191
        },
192
        complete: function(){
193
        $('#ajax-spinner').hide();
194
        },
8620 kshitij.so 195
        success : function(response) {
196
            $('#' + 'item-details').html(response);
197
        },
198
		error : function() {
199
		 	alert("Unable to get Item details.Please try again.");
200
		 },
201
    });  
202
}
203
</script>
204
<script type="text/javascript">
205
$(function(){	
206
$("#amazon-form").live('submit', function(){
12661 kshitij.so 207
    var fbaPrice = $('#fbaPrice').val();
208
    var nonFbaPrice = $('#sellingPrice').val();
209
	var fbbPrice = $('#fbbPrice').val();
210
    var holdInventory = $('#holdInventory').val();
211
    var defaultInventory = $('#defaultInventory').val();
212
    var customHandlingTime = $('#customHandlingTime').val();
213
    if ( fbaPrice==null || fbaPrice=="" || isNaN(fbaPrice))
214
      {
215
      jAlert('Illegal Entry In Fba Price Field', 'ERROR');
216
      return false;
217
      }
218
 
219
    if ( nonFbaPrice==null || nonFbaPrice=="" || isNaN(nonFbaPrice) )
220
      {
221
      jAlert('Illegal Entry In Non Fba Price Field', 'ERROR');
222
      return false;
223
      }
224
 
225
    if ( fbbPrice==null || fbbPrice=="" || isNaN(fbbPrice) )
226
      {
227
      jAlert('Illegal Entry In Fbb Price Field', 'ERROR');
228
      return false;
229
      }
230
 
231
    if ( customHandlingTime > 30 || customHandlingTime==null || customHandlingTime=="" || isNaN(customHandlingTime) )
232
      {
233
      jAlert('Unacceptable Value In Lead Time To Ship', 'ERROR');
234
      return false;
235
      }
236
 
237
    if ( holdInventory==null || holdInventory=="" || isNaN(holdInventory))
238
      {
239
      jAlert('Illegal Entry In Hold Inventory Field', 'ERROR');
240
      return false;
241
      }
242
 
243
    if ( defaultInventory==null || defaultInventory=="" || isNaN(defaultInventory) )
244
      {
245
      jAlert('Illegal Entry In Default Inventory Field', 'ERROR');
246
      return false;
247
      }  	
248
 
249
 
8620 kshitij.so 250
    var data = $(this).serialize() 
251
 
252
    jQuery.ajax({
253
        url: "/Support/amazon-list!update",
254
        type: 'POST',
255
        data: data,
256
        async: false,
8639 kshitij.so 257
		beforeSend: function(){
258
        $('#ajax-spinner').show();
259
        },
260
        complete: function(){
261
        $('#ajax-spinner').hide();
262
        },
8620 kshitij.so 263
        success: function (data) {
264
            alert("Changes propagated successfully");
265
        },
266
		 error : function() {
267
		 	alert("OOPS!!!Failed to do changes.Try Again.");
268
		 },
269
        cache: false,
270
        contentType: "application/x-www-form-urlencoded",
271
        processData: false
272
    });
273
 
274
    return false;
275
});
276
});
277
</script>
12661 kshitij.so 278
<script type="text/javascript">
279
$(function(){	
280
$("#amazon-promo-form").live('submit', function(){
281
    var fbaPromoStatus = $('#isFbaPromotionActive').val();
282
	var fbbPromoStatus = $('#isFbbPromotionActive').val();
12671 kshitij.so 283
	if (fbaPromoStatus=="true"){
13409 kshitij.so 284
		var fbaPromoPrice = parseFloat($('#fbaPromoPrice').val());
285
		var maxFbaSalePrice = parseFloat($('#fbaMaxSalePrice').val());
12661 kshitij.so 286
 
12676 kshitij.so 287
		if (fbaPromoPrice<=0 || fbaPromoPrice==null || fbaPromoPrice=="" || isNaN(fbaPromoPrice)){
12661 kshitij.so 288
			jAlert('Illegal value in Fba Promo Price field', 'ERROR');
289
      		return false;
290
		}
291
 
292
		if (maxFbaSalePrice<=0){
293
			jAlert('Illegal value in Fba Max Promo Price field', 'ERROR');
294
      		return false;
295
		}
296
 
297
		if (fbaPromoPrice > maxFbaSalePrice){
298
			jAlert('Fba Promo Price cant be greater than Fba Max Promo Price', 'ERROR');
299
      		return false;
300
		}
301
	}
302
 
12671 kshitij.so 303
	if (fbbPromoStatus=="true"){
13409 kshitij.so 304
		var fbbPromoPrice = parseFloat($('#fbbPromoPrice').val());
305
		var maxFbbSalePrice = parseFloat($('#fbbMaxSalePrice').val());
12661 kshitij.so 306
 
12676 kshitij.so 307
		if (fbbPromoPrice<=0 || fbbPromoPrice==null || fbbPromoPrice=="" || isNaN(fbbPromoPrice)){
12661 kshitij.so 308
			jAlert('Illegal value in Fbb Promo Price field', 'ERROR');
309
      		return false;
310
		}
311
 
312
		if (maxFbbSalePrice<=0){
313
			jAlert('Illegal value in Fbb Max Promo Price field', 'ERROR');
314
      		return false;
315
		}
316
 
317
		if (fbbPromoPrice > maxFbbSalePrice){
318
			jAlert('Fbb Promo Price cant be greater than Fbb Max Promo Price', 'ERROR');
319
      		return false;
320
		}
321
	}
322
 
323
	var data = $(this).serialize() 
324
 
325
    jQuery.ajax({
326
        url: "/Support/amazon-list!updatePromo",
327
        type: 'POST',
328
        data: data,
329
        async: false,
330
		beforeSend: function(){
331
        $('#ajax-spinner').show();
332
        },
333
        complete: function(){
334
        $('#ajax-spinner').hide();
335
        },
336
        success: function (data) {
337
            alert("Changes propagated successfully");
338
        },
339
		 error : function() {
340
		 	alert("OOPS!!!Failed to do changes.Try Again.");
341
		 },
342
        cache: false,
343
        contentType: "application/x-www-form-urlencoded",
344
        processData: false
345
    });
346
 
347
    return false;
348
});
349
});
350
</script>
7283 kshitij.so 351
<title>Amazon Listed Items</title>
352
</head>
353
<body>
8620 kshitij.so 354
	<div style="padding: 20px 0px;">
10922 kshitij.so 355
	   <a style="padding-left: 10px;" href="/Support/amazon-list/options">Back</a>
7603 kshitij.so 356
       <a style="padding-left: 10px;" href="/Support/logout">Logout</a>
8620 kshitij.so 357
	   <input type="submit" id="search_item" value="Search" style="float: right;width:8%;">
358
	   <input id="search_text" style="float: right;width:10%;">
7591 kshitij.so 359
</div>
7283 kshitij.so 360
<div>
361
    <div style="color:blue;">
362
    #sactionmessage()
363
    </div>
364
    <div style="color:red;">
365
    #sactionerror()
366
    </div>
8639 kshitij.so 367
		<div id="ajax-spinner" style="display:none;">
368
		<img src="/Support/images/ajax_loader_blue.gif" class="loading-image">
369
		</div>
8620 kshitij.so 370
	   <div id="amazon-table">
371
	   </div>
372
	<br>
373
        <div class="display" style="float: left;">
374
		Showing&nbsp;<span class="valueStart">1</span>&nbsp;to&nbsp;<span class="valueEnd">10</span>&nbsp;of&nbsp;
375
		<span class="total"></span>&nbsp;entries
376
	</div>
377
	<div class="paginate" style="float: right;">
378
		<a class="previous" href="#" style="margin: 20px;">Previous</a>
379
		<a class="next" href="#" style="margin: 0px;">Next</a>
380
	</div>
381
	<div id="item-details" style="padding-top: 30px;">
382
	</div>
7283 kshitij.so 383
 
8620 kshitij.so 384
 
7283 kshitij.so 385
</div>
386
 
387
</body>
388
</html>