Subversion Repositories SmartDukaan

Rev

Rev 8172 | Rev 8639 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8172 Rev 8620
Line 1... Line 1...
1
<!DOCTYPE html PUBLIC 
1
<!DOCTYPE html PUBLIC 
2
    "-//W3C//DTD XHTML 1.1 Transitional//EN"
2
    "-//W3C//DTD XHTML 1.1 Transitional//EN"
3
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
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">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<head>
5
<head>
6
#set($mapItem = $action.getAliveItemMap())
-
 
7
<link type="image/x-icon" href="/Support/images/favicon_alt.ico" rel="shortcut icon">
6
<link type="image/x-icon" href="/Support/images/favicon_alt.ico" rel="shortcut icon">
8
<link href="/Support/css/demo_page_amazon.css" type="text/css" rel="stylesheet">
7
<link href="/Support/css/demo_page_amazon.css" type="text/css" rel="stylesheet">
9
<link href="/Support/css/demo_table_amazon.css" type="text/css" rel="stylesheet">
8
<link href="/Support/css/demo_table_amazon.css" type="text/css" rel="stylesheet">
10
<script type="text/javascript" src="/Support/js/jquery-1.4.2.js"></script>
9
<script type="text/javascript" src="/Support/js/jquery-1.4.2.js"></script>
11
<script type="text/javascript" src="/Support/js/jquery.dataTables.min.js"></script>
-
 
12
<style type="text/css">   
10
<style type="text/css">   
13
* { font-family: Verdana; font-size: 96%; }
11
* { font-family: Verdana; font-size: 96%; }
14
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
12
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
15
p { clear: both; }
13
p { clear: both; }
16
.submit { margin-left: 12em; }
14
.submit { margin-left: 12em; }
17
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
15
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
18
ul { padding-left: 13px;}
16
ul { padding-left: 13px;}
19
.dataTable { width: 100%;}
17
td{background-color:#B0BED9};
20
</style>
18
</style>
21
<script type="text/javascript">
19
<script type="text/javascript">
-
 
20
		$(function(){
-
 
21
jQuery.ajax({
-
 
22
        type : "GET",
-
 
23
        url : "/Support/amazon-list!fetchItems?searchText="+"&next=0",
22
$(document).ready( function() {
24
        success : function(response) {
23
  $('#amazon-listed').dataTable( {
25
        $('#' + 'amazon-table').html(response);
-
 
26
		$(".previous").css("display", "none");
-
 
27
		var temp = $('.totalValue').text();
24
    "bAutoWidth": false,
28
		$('.total').text(temp);
-
 
29
        }
-
 
30
    });  
-
 
31
});
-
 
32
</script>
-
 
33
		
-
 
34
<script type="text/javascript">
25
    "iDisplayLength": 15,
35
  $(function(){	
-
 
36
	$(".next").live('click', function() {
-
 
37
		var start = $( ".valueStart" ).text();
-
 
38
		var end = $( ".valueEnd" ).text();
-
 
39
		var searchText = $('#search_text').val();
-
 
40
		getNextItems(start,end,searchText);
-
 
41
    });
-
 
42
	$(".previous").live('click', function() {
-
 
43
		var start = $( ".valueStart" ).text();
-
 
44
		var end = $( ".valueEnd" ).text();
26
		"aoColumns": [
45
		var pre = end - 20;
-
 
46
		var searchText = $('#search_text').val();
-
 
47
		getPreviousItems(start,end,pre,searchText);
-
 
48
    });
-
 
49
	$("#search_item").live('click', function() {
-
 
50
		var searchText = $('#search_text').val();
-
 
51
		loadSearchInfo(searchText);
-
 
52
    });
-
 
53
	$(".editItem").live('click', function() {
-
 
54
		var itemId = $(this).attr('itemid')
-
 
55
		loadItemDetails("/Support/amazon-list/"+ itemId +"/edit");
-
 
56
    });
-
 
57
});
-
 
58
</script>
-
 
59
<script type="text/javascript">
-
 
60
function getNextItems(start,end,searchText){
-
 
61
jQuery.ajax({
-
 
62
        type : "GET",
-
 
63
        url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next="+end,
-
 
64
        success : function(response) {
-
 
65
			$('.valueEnd').text(+end + +10);
-
 
66
			$('.valueStart').text(+start + +10);
-
 
67
			var last = $('.valueEnd').text();
-
 
68
			var temp = $('.total').text();
-
 
69
			if (parseInt(last) >= parseInt(temp)){
-
 
70
				$(".next").css("display", "none");
-
 
71
			}
-
 
72
            $('#' + 'amazon-table').html(response);
-
 
73
			$(".previous").css("display", "");
27
      null,
74
        },
-
 
75
		error : function() {
-
 
76
			alert("Unable to fetch items");
-
 
77
		 },
28
      null,
78
    });  
-
 
79
}
-
 
80
function getPreviousItems(start,end,pre,searchText){
-
 
81
jQuery.ajax({
-
 
82
        type : "GET",
-
 
83
        url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next="+pre,
-
 
84
        success : function(response) {
-
 
85
			$('.valueEnd').text(+end - +10);
-
 
86
			$('.valueStart').text(+start - +10);
-
 
87
            $('#' + 'amazon-table').html(response);
-
 
88
			$(".next").css("display", "");	
-
 
89
			if (parseInt(start)==11)
-
 
90
			{
-
 
91
			  $(".previous").css("display", "none");	
-
 
92
			}
-
 
93
			
29
      null,
94
        },
-
 
95
		error : function() {
-
 
96
			alert("Unable to fetch items");
-
 
97
		 },
30
      null,
98
    });
-
 
99
}
-
 
100
function loadSearchInfo(searchText){
-
 
101
jQuery.ajax({
-
 
102
        type : "GET",
-
 
103
        url : "/Support/amazon-list!fetchItems?searchText="+searchText+"&next=0",
-
 
104
        success : function(response) {
-
 
105
            $('#' + 'amazon-table').html(response);
-
 
106
			$('.valueEnd').text(10);
-
 
107
			$('.valueStart').text(1);
-
 
108
			$(".previous").css("display", "none");
-
 
109
			$(".next").css("display", "");
-
 
110
			var temp = $('.totalValue').text();
-
 
111
			var end = $('.valueEnd').text();
-
 
112
			$('.total').text(temp);
-
 
113
			if(parseInt(temp)<=10){
-
 
114
				$(".previous").css("display", "none");
-
 
115
				$(".next").css("display", "none");
-
 
116
				$('.valueEnd').text(temp);
-
 
117
			}
-
 
118
			
-
 
119
			if(searchText==""){
-
 
120
				$(".previous").css("display", "none");
-
 
121
				$(".next").css("display", "");
-
 
122
				$('.valueEnd').text(10);
-
 
123
			}
-
 
124
			
31
      null,
125
        },
-
 
126
		error : function() {
-
 
127
		 	alert("Unable to search given item.Please try again.");
32
	  null,
128
		 },
33
      null,
129
    });  
-
 
130
}
-
 
131
function loadItemDetails(getUrl){
-
 
132
jQuery.ajax({
-
 
133
        type : "GET",
-
 
134
        url : getUrl,
-
 
135
        success : function(response) {
-
 
136
            $('#' + 'item-details').html(response);
34
      null,
137
        },
-
 
138
		error : function() {
-
 
139
		 	alert("Unable to get Item details.Please try again.");
-
 
140
		 },
35
      null,
141
    });  
-
 
142
}
-
 
143
</script>
-
 
144
<script type="text/javascript">
-
 
145
$(function(){	
-
 
146
$("#amazon-form").live('submit', function(){
-
 
147
	alert("uploading data");
-
 
148
    var data = $(this).serialize() 
-
 
149
 
-
 
150
    jQuery.ajax({
-
 
151
        url: "/Support/amazon-list!update",
36
	  { "sType": "html" },
152
        type: 'POST',
37
	  { "sType": "html" },
153
        data: data,
-
 
154
        async: false,
-
 
155
        success: function (data) {
-
 
156
            alert("Changes propagated successfully");
38
      null
157
        },
-
 
158
		 error : function() {
-
 
159
		 	alert("OOPS!!!Failed to do changes.Try Again.");
39
    ],
160
		 },
-
 
161
        cache: false,
40
    "aLengthMenu": [[15, 25 ,50, 100, -1], [15 ,25, 50, 100, "All"]]
162
        contentType: "application/x-www-form-urlencoded",
-
 
163
        processData: false
41
  } );
164
    });
-
 
165
 
-
 
166
    return false;
-
 
167
});
42
} );
168
});
43
</script>
169
</script>
44
<title>Amazon Listed Items</title>
170
<title>Amazon Listed Items</title>
45
</head>
171
</head>
46
<body>
172
<body>
47
	<div>
173
	<div style="padding: 20px 0px;">
48
       <a style="padding-left: 10px;" href="/Support/logout">Logout</a>
174
       <a style="padding-left: 10px;" href="/Support/logout">Logout</a>
-
 
175
	   <input type="submit" id="search_item" value="Search" style="float: right;width:8%;">
-
 
176
	   <input id="search_text" style="float: right;width:10%;">
49
</div>
177
</div>
50
<div>
178
<div>
51
    <div style="color:blue;">
179
    <div style="color:blue;">
52
    #sactionmessage()
180
    #sactionmessage()
53
    </div>
181
    </div>
54
    <div style="color:red;">
182
    <div style="color:red;">
55
    #sactionerror()
183
    #sactionerror()
56
    </div>
184
    </div>
-
 
185
	   <div id="amazon-table">
-
 
186
	   </div>
-
 
187
	<br>
-
 
188
        <div class="display" style="float: left;">
-
 
189
		Showing&nbsp;<span class="valueStart">1</span>&nbsp;to&nbsp;<span class="valueEnd">10</span>&nbsp;of&nbsp;
-
 
190
		<span class="total"></span>&nbsp;entries
-
 
191
	</div>
-
 
192
	<div class="paginate" style="float: right;">
-
 
193
		<a class="previous" href="#" style="margin: 20px;">Previous</a>
-
 
194
		<a class="next" href="#" style="margin: 0px;">Next</a>
-
 
195
	</div>
-
 
196
	<div id="item-details" style="padding-top: 30px;">
-
 
197
	</div>
57
    
198
    
58
    #drawAllItems($action.fetchItems())
-
 
-
 
199
 
59
</div>
200
</div>
60
 
201
 
61
</body>
202
</body>
62
</html>
203
</html>
63
 
-
 
64
#macro (drawAllItems $items)
-
 
65
    <table id="amazon-listed" style="width: 100%">
-
 
66
        <thead>
-
 
67
            <tr>
-
 
68
                <th>Item Id</th>
-
 
69
				<th>Category</th>
-
 
70
				<th>Asin</th>
-
 
71
				<th>Saholic / Amazon Item Description</th>
-
 
72
				<th>Price Difference</th>
-
 
73
				<th>Risky</th>
-
 
74
                 <th>Status</th>
-
 
75
				<th>Shipping</th>
-
 
76
				<th>Inventory Override</th>
-
 
77
				<th>Mfn Listing</th>
-
 
78
				<th>Fba Listing</th>
-
 
79
				<th>Action</th>
-
 
80
            </tr>
-
 
81
        </thead>
-
 
82
        <tbody>
-
 
83
    #foreach ( $item in $items )
-
 
84
            <tr style="border: 1px">
-
 
85
                <td>$item.getItemid()</td>
-
 
86
				<td>$item.getCategory()</td>
-
 
87
				<td>$item.getAsin()</td>
-
 
88
				#if ($mapItem.get($item.getItemid()))
-
 
89
				<td style="text-align:left;">SAHOLIC: $mapItem.get($item.getItemid()).getBrand() $mapItem.get($item.getItemid()).getModelName() $mapItem.get($item.getItemid()).getModelNumber() $mapItem.get($item.getItemid()).getColor()<br /> AMAZON: $item.getName()</td>
-
 
90
				#else
-
 
91
					#set ($saholicItem = $action.getSaholicItem("$item.getItemid()"))
-
 
92
				<td style="text-align:left;">SAHOLIC: $saholicItem.getBrand() $saholicItem.getModelName() $saholicItem.getModelNumber() $saholicItem.getColor()<br /> AMAZON: $item.getName()</td>
-
 
93
				#end
-
 
94
				#if ($mapItem.get($item.getItemid()))
-
 
95
					#if($mapItem.get($item.getItemid()).getSellingPrice() != $item.getFbaPrice() || $mapItem.get($item.getItemid()).getSellingPrice() != $item.getSellingPrice())
-
 
96
						<td>Saholic: $mapItem.get($item.getItemid()).getSellingPrice() / FBA: $item.getFbaPrice() / MFN: $item.getSellingPrice()</td>
-
 
97
					#else
-
 
98
						<td>-</td>
-
 
99
					#end
-
 
100
				#else
-
 
101
					#if($saholicItem.getSellingPrice() != $item.getFbaPrice() || $saholicItem.getSellingPrice() != $item.getSellingPrice())
-
 
102
						<td>$saholicItem.getSellingPrice() / FBA: $item.getFbaPrice() / MFN: $item.getSellingPrice()</td>
-
 
103
					#else
-
 
104
						<td>-</td>
-
 
105
					#end
-
 
106
				#end
-
 
107
				#if ($mapItem.get($item.getItemid()))
-
 
108
					#if($mapItem.get($item.getItemid()).isRisky())
-
 
109
						<td><a style="visibility: hidden;">A</a><img alt="active" src="/Support/images/active.ico" style="width: 18px;"></td>
-
 
110
					#else
-
 
111
						<td><a style="visibility: hidden;">I</a><img alt="Inactive" src="/Support/images/inactive.ico" style="width: 18px;"></td>
-
 
112
					#end
-
 
113
				#else
-
 
114
					#if($saholicItem.isRisky())
-
 
115
						<td><a style="visibility: hidden;">A</a><img alt="active" src="/Support/images/active.ico" style="width: 18px;"></td>
-
 
116
					#else
-
 
117
						<td><a style="visibility: hidden;">I</a><img alt="Inactive" src="/Support/images/inactive.ico" style="width: 18px;"></td>
-
 
118
					#end
-
 
119
				#end
-
 
120
                #if ($mapItem.get($item.getItemid()))
-
 
121
					<td>$mapItem.get($item.getItemid()).getItemStatus()</td>
-
 
122
				#else
-
 
123
					<td>$saholicItem.getItemStatus()</td>
-
 
124
				#end
-
 
125
				#if($item.isIsCustomTime())
-
 
126
					<td>Set To Custom</td>
-
 
127
				#else
-
 
128
					<td>Set To Default</td>
-
 
129
				#end
-
 
130
				#if($item.isIsInventoryOverride())
-
 
131
					<td><a style="visibility: hidden;">A</a><img alt="active" src="/Support/images/active.ico" style="width: 18px;"></td>
-
 
132
				#else
-
 
133
					<td><a style="visibility: hidden;">I</a><img alt="Inactive" src="/Support/images/inactive.ico" style="width: 18px;"></td>
-
 
134
				#end
-
 
135
				#if($item.isIsNonFba())
-
 
136
					<td><a style="visibility: hidden;">A</a><img alt="active" src="/Support/images/active.ico" style="width: 18px;"></td>
-
 
137
				#else
-
 
138
				<td><a style="visibility: hidden;">I</a><img alt="inactive" src="/Support/images/inactive.ico" style="width: 18px;"></td>
-
 
139
				#end
-
 
140
				#if($item.isIsFba())
-
 
141
					<td><a style="visibility: hidden;">A</a><img alt="active" src="/Support/images/active.ico" style="width: 18px;"></td>
-
 
142
				#else
-
 
143
					<td><a style="visibility: hidden;">I</a><img alt="inactive" src="/Support/images/inactive.ico" style="width: 18px;"></td>
-
 
144
				#end
-
 
145
				<td><a href="/Support/amazon-list/$item.getItemid()/edit">View/Edit</a></td>
-
 
146
				</td>
-
 
147
            </tr>
-
 
148
    #end
-
 
149
        </tbody>
-
 
150
    </table>
-
 
151
	<br>
-
 
152
		<br>
-
 
153
			<br>
-
 
154
		<hr/>
-
 
155
#end
-