Subversion Repositories SmartDukaan

Rev

Rev 12672 | Go to most recent revision | 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();
12672 kshitij.so 283
	console.log(fbaPromoStatus=="true");
284
	console.log(fbbPromoStatus=="true");
12671 kshitij.so 285
	if (fbaPromoStatus=="true"){
12661 kshitij.so 286
		var fbaPromoPrice = $('#fbaPromoPrice').val();
287
		var maxFbaSalePrice = $('#fbaMaxSalePrice').val();
288
 
12676 kshitij.so 289
		if (fbaPromoPrice<=0 || fbaPromoPrice==null || fbaPromoPrice=="" || isNaN(fbaPromoPrice)){
12661 kshitij.so 290
			jAlert('Illegal value in Fba Promo Price field', 'ERROR');
291
      		return false;
292
		}
293
 
294
		if (maxFbaSalePrice<=0){
295
			jAlert('Illegal value in Fba Max Promo Price field', 'ERROR');
296
      		return false;
297
		}
298
 
299
		if (fbaPromoPrice > maxFbaSalePrice){
300
			jAlert('Fba Promo Price cant be greater than Fba Max Promo Price', 'ERROR');
301
      		return false;
302
		}
303
	}
304
 
12671 kshitij.so 305
	if (fbbPromoStatus=="true"){
12661 kshitij.so 306
		var fbbPromoPrice = $('#fbbPromoPrice').val();
307
		var maxFbbSalePrice = $('#fbbMaxSalePrice').val();
308
 
12676 kshitij.so 309
		if (fbbPromoPrice<=0 || fbbPromoPrice==null || fbbPromoPrice=="" || isNaN(fbbPromoPrice)){
12661 kshitij.so 310
			jAlert('Illegal value in Fbb Promo Price field', 'ERROR');
311
      		return false;
312
		}
313
 
314
		if (maxFbbSalePrice<=0){
315
			jAlert('Illegal value in Fbb Max Promo Price field', 'ERROR');
316
      		return false;
317
		}
318
 
319
		if (fbbPromoPrice > maxFbbSalePrice){
320
			jAlert('Fbb Promo Price cant be greater than Fbb Max Promo Price', 'ERROR');
321
      		return false;
322
		}
323
	}
324
 
325
	var data = $(this).serialize() 
326
 
327
    jQuery.ajax({
328
        url: "/Support/amazon-list!updatePromo",
329
        type: 'POST',
330
        data: data,
331
        async: false,
332
		beforeSend: function(){
333
        $('#ajax-spinner').show();
334
        },
335
        complete: function(){
336
        $('#ajax-spinner').hide();
337
        },
338
        success: function (data) {
339
            alert("Changes propagated successfully");
340
        },
341
		 error : function() {
342
		 	alert("OOPS!!!Failed to do changes.Try Again.");
343
		 },
344
        cache: false,
345
        contentType: "application/x-www-form-urlencoded",
346
        processData: false
347
    });
348
 
349
    return false;
350
});
351
});
352
</script>
7283 kshitij.so 353
<title>Amazon Listed Items</title>
354
</head>
355
<body>
8620 kshitij.so 356
	<div style="padding: 20px 0px;">
10922 kshitij.so 357
	   <a style="padding-left: 10px;" href="/Support/amazon-list/options">Back</a>
7603 kshitij.so 358
       <a style="padding-left: 10px;" href="/Support/logout">Logout</a>
8620 kshitij.so 359
	   <input type="submit" id="search_item" value="Search" style="float: right;width:8%;">
360
	   <input id="search_text" style="float: right;width:10%;">
7591 kshitij.so 361
</div>
7283 kshitij.so 362
<div>
363
    <div style="color:blue;">
364
    #sactionmessage()
365
    </div>
366
    <div style="color:red;">
367
    #sactionerror()
368
    </div>
8639 kshitij.so 369
		<div id="ajax-spinner" style="display:none;">
370
		<img src="/Support/images/ajax_loader_blue.gif" class="loading-image">
371
		</div>
8620 kshitij.so 372
	   <div id="amazon-table">
373
	   </div>
374
	<br>
375
        <div class="display" style="float: left;">
376
		Showing&nbsp;<span class="valueStart">1</span>&nbsp;to&nbsp;<span class="valueEnd">10</span>&nbsp;of&nbsp;
377
		<span class="total"></span>&nbsp;entries
378
	</div>
379
	<div class="paginate" style="float: right;">
380
		<a class="previous" href="#" style="margin: 20px;">Previous</a>
381
		<a class="next" href="#" style="margin: 0px;">Next</a>
382
	</div>
383
	<div id="item-details" style="padding-top: 30px;">
384
	</div>
7283 kshitij.so 385
 
8620 kshitij.so 386
 
7283 kshitij.so 387
</div>
388
 
389
</body>
390
</html>