-
Notifications
You must be signed in to change notification settings - Fork 30
/
approvefeature.jsp
272 lines (236 loc) · 14.4 KB
/
approvefeature.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<%@page import="java.util.ArrayList"%>
<%@page import="models.Features"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<jsp:include page="Templates/HeadMetaInfo.jsp"/>
<title>Manager Portal</title>
</head>
<body style="background-color:black; background: url('./assets/img/dashboard.jpg'); background-size:cover;">
<jsp:include page="Templates/AdminHeader.jsp"/>
<div class="row">
<jsp:include page="Templates/ManagerPanel.jsp"/>
<!-- Table -->
<section class="col-9" style="margin:1%;">
<table class="table table-inverse table-striped table-bordered table-hover mx-auto table-responsive">
<thead>
<tr>
<th>#</th>
<th>Features</th>
<th>Economy</th>
<th>Business</th>
<th>First Class</th>
</tr>
</thead>
<tbody>
<%
ArrayList<Features> fres = (ArrayList<Features>)(application.getAttribute("features"));
Features e = fres.get(0);
Features b = fres.get(1);
Features f = fres.get(2);
%>
<tr>
<th scope="row">1</th>
<th>Seat Pitch</th>
<td <% if ((e.getNewSeatPitch() != e.getSeatPitch()) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> > <input type="number" name="seat_pitch_e" min="29" max="38" placeholder="29-38" disabled value ='${(features[0])["seatPitch"]}'> </td>
<td <% if ((b.getNewSeatPitch() != b.getSeatPitch()) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> > <input type="number" name="seat_pitch_b" min="30" max="87" placeholder="30-87" disabled value ='${(features[1])["seatPitch"]}'> </td>
<td <% if ((f.getNewSeatPitch() != f.getSeatPitch()) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> > <input type="number" name="seat_pitch_f" min="42" max="90" placeholder="42-90" disabled value ='${(features[2])["seatPitch"]}'> </td>
</tr>
<tr>
<th scope="row">2</th>
<th>Seat Width</th>
<td <% if ((e.getNewSeatWidth() != e.getSeatWidth()) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> > <input type="number" name="seat_width_e" min="17" max="20" placeholder="17-20" disabled value ='${(features[0])["seatWidth"]}'> </td>
<td <% if ((b.getNewSeatWidth() != b.getSeatWidth()) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> > <input type="number" name="seat_width_b" min="17" max="34" placeholder="17-34" disabled value ='${(features[1])["seatWidth"]}'> </td>
<td <% if ((f.getNewSeatWidth() != f.getSeatWidth()) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> > <input type="number" name="seat_width_f" min="18.5" max="35.5" placeholder="18.5-35.5" disabled value ='${(features[2])["seatWidth"]}'> </td>
</tr>
<tr>
<th scope="row">3</th>
<th>Video Type</th>
<td <% if ((e.getNewVideoType() != null) && (!e.getNewVideoType().equals(e.getVideoType())) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<select name="video_e" disabled>
<option selected hidden value ='${(features[0])["videoType"]}'>${(features[0])["videoType"]}</option>
<option value="None">None</option>
<option value="On-Demand TV">Personal TV</option>
<option value="Overhead TV">Overhead TV</option>
<option value="Portable Device">Portable Device</option>
<option value="Satellite TV">Satellite TV</option>
<option value="Seatback TV">Seatback TV</option>
</select>
</td>
<td <% if ((b.getNewVideoType() != null) && (!b.getNewVideoType().equals(b.getVideoType())) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<select name="video_b" disabled>
<option selected hidden value ='${(features[1])["videoType"]}'>${(features[1])["videoType"]}</option>
<option value="None">None</option>
<option value="On-Demand TV">On-Demand TV</option>
<option value="Overhead TV">Overhead TV</option>
<option value="Portable Device">Portable Device</option>
<option value="Seatback TV">Seatback TV</option>
</select>
</td>
<td <% if ((f.getNewVideoType() != null) && (!f.getNewVideoType().equals(f.getVideoType())) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<select name="video_f" disabled>
<option selected hidden value ='${(features[2])["videoType"]}'>${(features[2])["videoType"]}</option>
<option value="None">None</option>
<option value="On-Demand TV">On-Demand TV</option>
<option value="Overhead TV">Overhead TV</option>
<option value="Portable Device">Portable Device</option>
<option value="Seatback TV">Seatback TV</option>
</select>
</td>
</tr>
<tr>
<th scope="row">4</th>
<th>Power Type</th>
<td <% if ((e.getNewPowerType() != null) && (!e.getNewPowerType().equals(e.getPowerType())) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<select name="power_e" disabled>
<option selected hidden value ='${(features[0])["powerType"]}'>${(features[0])["powerType"]}</option>
<option value="None">None</option>
<option value="AC Power">AC Power</option>
</select>
</td>
<td <% if ((b.getNewPowerType() != null) && (!b.getNewPowerType().equals(b.getPowerType())) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<select name="power_b" disabled>
<option selected hidden value ='${(features[1])["powerType"]}'>${(features[1])["powerType"]}</option>
<option value="None">None</option>
<option value="AC Power">AC Power</option>
</select>
</td>
<td <% if ((f.getNewPowerType() != null) && (!f.getNewPowerType().equals(f.getPowerType())) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<select name="power_f" disabled>
<option selected hidden value ='${(features[2])["powerType"]}'>${(features[2])["powerType"]}</option>
<option value="None">None</option>
<option value="DC Power">DC Power</option>
<option value="AC Power">AC Power</option>
</select>
</td>
</tr>
<tr>
<th scope="row">5</th>
<th>Wi-fi</th>
<td>
<select name="wifi_e" disabled>
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
</td>
<td <% if ((b.getNewWifi() != null) && (!b.getNewWifi().equals(b.getWifi())) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<select name="wifi_b" disabled>
<option selected hidden value ='${(features[1])["wifi"]}'>${(features[1])["wifi"]}</option>
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
</td>
<td <% if ((f.getNewWifi() != null) && (!f.getNewWifi().equals(f.getWifi())) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<select name="wifi_f" disabled>
<option selected hidden value ='${(features[2])["wifi"]}'>${(features[2])["wifi"]}</option>
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
</td>
</tr>
<tr>
<th scope="row">6</th>
<th>Seat Type</th>
<td <% if ((e.getNewSeatType() != null) && (!e.getNewSeatType().equals(e.getSeatType())) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<select name="seat_type_e" disabled>
<option selected hidden value ='${(features[0])["seatType"]}'>${(features[0])["seatType"]}</option>
<option value="Recliner">Recliner</option>
<option value="Standard">Standard</option>
</select>
</td>
<td <% if ((b.getNewSeatType() != null) && (!b.getNewSeatType().equals(b.getSeatType())) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<select name="seat_type_b" disabled>
<option selected hidden value ='${(features[1])["seatType"]}'>${(features[1])["seatType"]}</option>
<option value="Angle Lie Flat">Angle Lie Flat</option>
<option value="Flat Bed">Flat Bed</option>
<option value="Open Suite">Open Suite</option>
<option value="Recliner">Recliner</option>
</select>
</td>
<td <% if ((f.getNewSeatType() != null) && (!f.getNewSeatType().equals(f.getSeatType())) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<select name="seat_type_f" disabled>
<option selected hidden value ='${(features[2])["seatType"]}'>${(features[2])["seatType"]}</option>
<option value="Closed Suite">Closed Suite</option>
<option value="Angle Lie Flat">Angle Lie Flat</option>
<option value="Flat Bed">Flat Bed</option>
<option value="Open Suite">Open Suite</option>
<option value="Recliner">Recliner</option>
</select>
</td>
</tr>
<tr>
<th scope="row">7</th>
<th>Special Food</th>
<td>
<select name="special_food_e" disabled>
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
</td>
<td>
<select name="special_food_b" disabled>
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
</td>
<td <% if ((f.getNewSpecialFood() != null) && (!f.getNewSpecialFood().equals(f.getSpecialFood())) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<select name="special_food_f" disabled>
<option selected hidden value ='${(features[2])["specialFood"]}'>${(features[2])["specialFood"]}</option>
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
</td>
</tr>
<tr>
<th scope="row"></th>
<th scope="row">Price</th>
<td <% if ((e.getNewPrice() != e.getPrice()) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<div class="input-group">
<div class="input-group-addon col-1 d-inline">$</div>
<input type="number" min="10" max="200" placeholder="10-200" name="price_e" disabled value="${(features[0])["price"]}">
</div>
</td>
<td <% if ((b.getNewPrice() != b.getPrice()) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<div class="input-group">
<div class="input-group-addon col-1 d-inline">$</div>
<input type="number" min="300" max="350" placeholder="300-350" name="price_b" disabled value="${(features[1])["price"]}">
</div>
</td>
<td <% if ((f.getNewPrice() != f.getPrice()) && (e.getIsChanged())){out.print("Class = 'bg-success text-white'");}%> >
<div class="input-group">
<div class="input-group-addon col-1 d-inline">$</div>
<input type="number" min="1000" max="5000" placeholder="1000-5000" name="price_f" disabled value="${(features[2])["price"]}">
</div>
</td>
</tr>
</tbody>
</table>
<%
if (Features.isChanged)
{
out.print("<div style='text-align:right;'>");
out.print("<form action='ApproveFeatures.do' method='post'>");
out.print("<button class='btn btn-primary flex-row-reverse' id='approve_button' type='submit'>Approve</button> </form> </div> ");
out.print(" <div style='text-align:right; margin-top:1%;'>");
out.print(" <form action='DisapproveFeatures.do' method='post'>");
out.print(" <button class='btn btn-primary flex-row-reverse' id='reject_button' style='margin-left:2%;' type='submit'>Reject</button> </form> </div> ");
}
else
{
out.print("<div style='text-align:center;' class='bg-success text-white'>");
out.print("No changes to be approved/disapproved.");
out.print("</div>");
}
%>
</section>
</div>
<jsp:include page="Templates/Footer.jsp"/>
</body>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
</body>
</html>