Rev 8620 | Rev 12661 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.1 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><link type="image/x-icon" href="/Support/images/favicon_alt.ico" rel="shortcut icon"><link href="/Support/css/demo_page_amazon.css" type="text/css" rel="stylesheet"><link href="/Support/css/demo_table_amazon.css" type="text/css" rel="stylesheet"><script type="text/javascript" src="/Support/js/jquery-1.4.2.js"></script><style type="text/css">* { font-family: Verdana; font-size: 96%; }label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }p { clear: both; }.submit { margin-left: 12em; }em { font-weight: bold; padding-right: 1em; vertical-align: top; }ul { padding-left: 13px;}td{background-color:#B0BED9};</style><style>.loading-image {position: fixed;top: 50%;left: 50%;margin-top: -50px;margin-left: -100px;z-index: 100;}</style><script type="text/javascript">$(function(){jQuery.ajax({type : "GET",url : "/Support/amazon-list!fetchItems?searchText="+"&next=0",beforeSend: function(){$('#ajax-spinner').show();},complete: function(){$('#ajax-spinner').hide();},success : function(response) {$('#' + 'amazon-table').html(response);$(".previous").css("display", "none");var temp = $('.totalValue').text();$('.total').text(temp);}});});</script><script type="text/javascript">$(function(){$(".next").live('click', function() {var start = $( ".valueStart" ).text();var end = $( ".valueEnd" ).text();var searchText = $('#search_text').val();getNextItems(start,end,searchText);});$(".previous").live('click', function() {var start = $( ".valueStart" ).text();var end = $( ".valueEnd" ).text();var pre = end - 20;var searchText = $('#search_text').val();getPreviousItems(start,end,pre,searchText);});$("#search_item").live('click', function() {var searchText = $('#search_text').val();loadSearchInfo(searchText);});$(".editItem").live('click', function() {var itemId = $(this).attr('itemid')loadItemDetails("/Support/amazon-list/"+ itemId +"/edit");});});</script><script type="text/javascript">function getNextItems(start,end,searchText){jQuery.ajax({type : "GET",url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next="+end,beforeSend: function(){$('#ajax-spinner').show();},complete: function(){$('#ajax-spinner').hide();},success : function(response) {$('.valueEnd').text(+end + +10);$('.valueStart').text(+start + +10);var last = $('.valueEnd').text();var temp = $('.total').text();if (parseInt(last) >= parseInt(temp)){$(".next").css("display", "none");}$('#' + 'amazon-table').html(response);$(".previous").css("display", "");},error : function() {alert("Unable to fetch items");},});}function getPreviousItems(start,end,pre,searchText){jQuery.ajax({type : "GET",url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next="+pre,beforeSend: function(){$('#ajax-spinner').show();},complete: function(){$('#ajax-spinner').hide();},success : function(response) {$('.valueEnd').text(+end - +10);$('.valueStart').text(+start - +10);$('#' + 'amazon-table').html(response);$(".next").css("display", "");if (parseInt(start)==11){$(".previous").css("display", "none");}},error : function() {alert("Unable to fetch items");},});}function loadSearchInfo(searchText){jQuery.ajax({type : "GET",url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next=0",beforeSend: function(){$('#ajax-spinner').show();},complete: function(){$('#ajax-spinner').hide();},beforeSend: function(){$('#ajax-spinner').show();},complete: function(){$('#ajax-spinner').hide();},success : function(response) {$('#' + 'amazon-table').html(response);$('.valueEnd').text(10);$('.valueStart').text(1);$(".previous").css("display", "none");$(".next").css("display", "");var temp = $('.totalValue').text();var end = $('.valueEnd').text();$('.total').text(temp);if(parseInt(temp)<=10){$(".previous").css("display", "none");$(".next").css("display", "none");$('.valueEnd').text(temp);}if(searchText==""){$(".previous").css("display", "none");$(".next").css("display", "");$('.valueEnd').text(10);}},error : function() {alert("Unable to search given item.Please try again.");},});}function loadItemDetails(getUrl){jQuery.ajax({type : "GET",url : getUrl,beforeSend: function(){$('#ajax-spinner').show();},complete: function(){$('#ajax-spinner').hide();},success : function(response) {$('#' + 'item-details').html(response);},error : function() {alert("Unable to get Item details.Please try again.");},});}</script><script type="text/javascript">$(function(){$("#amazon-form").live('submit', function(){alert("uploading data");var data = $(this).serialize()jQuery.ajax({url: "/Support/amazon-list!update",type: 'POST',data: data,async: false,beforeSend: function(){$('#ajax-spinner').show();},complete: function(){$('#ajax-spinner').hide();},success: function (data) {alert("Changes propagated successfully");},error : function() {alert("OOPS!!!Failed to do changes.Try Again.");},cache: false,contentType: "application/x-www-form-urlencoded",processData: false});return false;});});</script><title>Amazon Listed Items</title></head><body><div style="padding: 20px 0px;"><a style="padding-left: 10px;" href="/Support/logout">Logout</a><input type="submit" id="search_item" value="Search" style="float: right;width:8%;"><input id="search_text" style="float: right;width:10%;"></div><div><div style="color:blue;">#sactionmessage()</div><div style="color:red;">#sactionerror()</div><div id="ajax-spinner" style="display:none;"><img src="/Support/images/ajax_loader_blue.gif" class="loading-image"></div><div id="amazon-table"></div><br><div class="display" style="float: left;">Showing <span class="valueStart">1</span> to <span class="valueEnd">10</span> of <span class="total"></span> entries</div><div class="paginate" style="float: right;"><a class="previous" href="#" style="margin: 20px;">Previous</a><a class="next" href="#" style="margin: 0px;">Next</a></div><div id="item-details" style="padding-top: 30px;"></div></div></body></html>