-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinventory.jsp
195 lines (165 loc) · 6.2 KB
/
inventory.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<%@ include file = 'header.jsp' %>
<%@ page import="java.util.*" %>
</div>
<%
ArrayList<String> inventory = (ArrayList<String>) session.getAttribute("inventory");
ArrayList<String> discount = (ArrayList<String>) session.getAttribute("discount");
if (request.getParameter("task")!=null){
if (request.getParameter("task").equals("availability")){
%>
</div>
<div class="container-fluid"><center>
<table align="center" border="1px" style='border:1px solid orange'>
<br/><br/><br/><br/><br/><br/><tr> Available Cars</tr>
<tr>
<th style='font-size:16px;border:1px solid orange'>Car ID</th>
<th style='font-size:16px;border:1px solid orange'>Name</th>
<th style='font-size:16px;border:1px solid orange'>Category</th>
<th style='font-size:16px;border:1px solid orange'>Brand Name</th>
<th style='font-size:16px;border:1px solid orange'>Car Model</th>
<th style='font-size:16px;border:1px solid orange'>Car Mileage</th>
<th style='font-size:16px;border:1px solid orange'>Car Production Year</th>
<th style='font-size:16px;border:1px solid orange'>Car Color</th>
<th style='font-size:16px;border:1px solid orange'>Image Path</th>
<th style='font-size:16px;border:1px solid orange'>Price</th>
<th style='font-size:16px;border:1px solid orange'>Reservation Status</th>
<th style='font-size:16px;border:1px solid orange'>location</th>
</tr>
<br/>
<br/>
<tr>
<td>
</td>
</tr>
<%int count = 0;
while(count<inventory.size()){%>
<tr>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(inventory.get(count));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(inventory.get(count+1));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(inventory.get(count+2));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(inventory.get(count+3));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(inventory.get(count+4));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center> <%out.print(inventory.get(count+5));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(inventory.get(count+6));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(inventory.get(count+7));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(inventory.get(count+8));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(inventory.get(count+9));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(inventory.get(count+10));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(inventory.get(count+11));%></center>
</td>
</tr>
<%count=count+12;
}%>
</table>
</center>
</div>
<%
}
else if (request.getParameter("task").equals("onsale")){%>
</div>
<div class="container-fluid"><center>
<table align="center" border="1px" style='border:1px solid orange'>
<br/><br/><br/><br/><br/><br/><tr> Cars on sale</tr>
<tr>
<th style='font-size:16px;border:1px solid orange'>Car ID</th>
<th style='font-size:16px;border:1px solid orange'>Name</th>
<th style='font-size:16px;border:1px solid orange'>Category</th>
<th style='font-size:16px;border:1px solid orange'>Brand Name</th>
<th style='font-size:16px;border:1px solid orange'>Car Model</th>
<th style='font-size:16px;border:1px solid orange'>Car Mileage</th>
<th style='font-size:16px;border:1px solid orange'>Car Production Year</th>
<th style='font-size:16px;border:1px solid orange'>Car Color</th>
<th style='font-size:16px;border:1px solid orange'>Image Path</th>
<th style='font-size:16px;border:1px solid orange'>Price</th>
<th style='font-size:16px;border:1px solid orange'>Reservation Status</th>
<th style='font-size:16px;border:1px solid orange'>location</th>
<th style='font-size:16px;border:1px solid orange'>Discount</th>
</tr>
<br/>
<br/>
<tr>
<td>
</td>
</tr>
<%int count = 0;
while(count<discount.size()){%>
<tr>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(discount.get(count));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(discount.get(count+1));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(discount.get(count+2));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(discount.get(count+3));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(discount.get(count+4));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center> <%out.print(discount.get(count+5));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(discount.get(count+6));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(discount.get(count+7));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(discount.get(count+8));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(discount.get(count+9));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(discount.get(count+10));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(discount.get(count+11));%></center>
</td>
<td style='font-size:14px;border:1px solid orange'>
<center><%out.print(discount.get(count+12));%></center>
</td>
</tr>
<%count=count+13;
}%>
</table>
</center>
</div>
<%
}
}else {%>
<div class="container" style="margin-top:150px">
<a href="inventory.jsp?task=availability" style="font-size:20px"> Available Cars </a><br/><br/>
<a href="inventory.jsp?task=onsale" style="font-size:20px"> Cars onsale </a><br/><br/>
<a href="ChartGeneration" style="font-size:20px"> Graphs </a>
</div>
<%
}
%>