]> git.mxchange.org Git - pizzaservice-war.git/blob - web/preview.jsp
Continued with project:
[pizzaservice-war.git] / web / preview.jsp
1 <%-- 
2         Document   : preview
3         Created on : 04.08.2015, 10:55:10
4         Author     : Roland Haeder
5 --%>
6
7 <%--<%@page errorPage="errorHandler.jsp" %>--%>
8 <%@page import="java.util.Iterator"%>
9 <%@page import="java.util.Map"%>
10 <%@page import="org.mxchange.jcore.contact.Gender"%>
11 <%@page import="org.mxchange.pizzaapplication.product.Product"%>
12 <%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
13 <%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
14 <%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %>
15 <%@page contentType="text/html" pageEncoding="UTF-8"%>
16
17 <jsp:useBean id="customer" scope="session" class="org.mxchange.pizzaapplication.customer.bean.PizzaServiceCustomerBean" type="CustomerBean" />
18 <jsp:setProperty name="customer" property="*" />
19
20 <%
21         // Init application instance
22         PizzaApplication app = PizzaServiceApplication.getInstance(application);
23 %>
24 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
25 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
26         <head>
27                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
28                 <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
29                 <title><%=PizzaServiceApplication.MAIN_TITLE%> - Bestellung anzeigen</title>
30         </head>
31
32         <body>
33                 <div id="title">
34                         <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Bestellung anzeigen</h1>
35                 </div>
36
37                 <jsp:include page="/static/menu.jsp" flush="true" />
38
39                 <div id="content_outer">
40                         <div id="content_title">
41                                 <h2>Folgendes möchten Sie bestellen:</h2>
42                         </div>
43
44                         <div id="content">
45                                 <form action="<%=request.getContextPath()%>/form_handler/do_order.jsp" accept-charset="utf-8" id="form" method="post">
46                                 <table class="table">
47                                         <thead class="table_header">
48                                                 <tr>
49                                                         <th class="table_header_column">
50                                                                 Bestellen?
51                                                         </th>
52                                                         <th class="table_header_column">
53                                                                 Anzahl:
54                                                         </th>
55                                                         <th class="table_header_column">
56                                                                 Produkt:
57                                                         </th>
58                                                         <th class="table_header_column">
59                                                                 Einzelpreis:
60                                                         </th>
61                                                         <th class="table_header_column">
62                                                                 Zwischensumme:
63                                                         </th>
64                                                 </tr>
65                                         </thead>
66                                         <tbody class="table_body">
67                                                 <%
68                                                 // Get Iterator
69                                                 Iterator<Product> iterator = app.getAvailableProducts();
70
71                                                 // "Walk" through all products and unmark them as ordered
72                                                 while (iterator.hasNext()) {
73                                                         // Get product instance
74                                                         Product product = iterator.next();
75
76                                                         // Unmark it as ordered
77                                                         app.unmarkProductAsOrdered(product, session);
78                                                         %>
79                                                         <tr>
80                                                                 <td>
81                                                                         <%=app.getPrintableChoosenFromRequestSession(product, request, session)%>
82                                                                 </td>
83                                                                 <td>
84                                                                         <%=app.handleAmountFromRequestSession(product, request, session)%>
85                                                                 </td>
86                                                                 <td>
87                                                                         <%=product.getTitle()%>
88                                                                 </td>
89                                                                 <td>
90                                                                         <%=product.getPrice()%>
91                                                                 </td>
92                                                                 <td>
93                                                                         <%=app.getTotalPositionPriceFromRequestSession(product, request, session)%>
94                                                                 </td>
95                                                         </tr>
96                                                         <%
97                                                         // Is it choosen and amount set?
98                                                         if (app.isProductChoosen(product, request, session)) {
99                                                                 // Then mark it as choosen
100                                                                 app.markProductAsChoosen(product, session);
101                                                         }
102                                                 }
103                                                 %>
104                                                 <tr>
105                                                         <td id="table_total_amount_left">
106                                                                 Menge:
107                                                         </td>
108                                                         <td id="table_total_amount_right">
109                                                                 <%=app.calculateTotalAmount(request, session)%>
110                                                         </td>
111                                                         <td class="spacer">
112                                                                 &nbsp;
113                                                         </td>
114                                                         <td id="table_total_sum_left">
115                                                                 Gesamtpreis:
116                                                         </td>
117                                                         <td id="table_total_sum_right">
118                                                                 <%=app.calculateTotalPrice(request, session)%>
119                                                         </td>
120                                                 </tr>
121
122                                                 <tr>
123                                                         <td colspan="5">
124                                                                 <fieldset id="personal_data">
125                                                                         <legend title="Bitte geben Sie Ihre Daten ein.">Bitte Ihre Daten eingeben:</legend>
126
127                                                                         <div class="data_row">
128                                                                                 <div class="data_left">
129                                                                                         <label for="gender">Anrede</label>
130                                                                                 </div>
131
132                                                                                 <div class="data_right">
133                                                                                         <jsp:include page="/static/gender_selection_box.jsp" flush="true" />
134                                                                                 </div>
135
136                                                                                 <div class="clear"></div>
137                                                                         </div>
138
139                                                                         <div class="data_row">
140                                                                                 <div class="data_left">
141                                                                                         <label for="companyname">Firmenname:</label>
142                                                                                 </div>
143
144                                                                                 <div class="data_right">
145                                                                                         <input type="text" id="companyname" name="companyName" size="15" maxlength="255" value="${customer.companyName}" <%=app.getDisabledHtmlFromSession(request, session)%> />
146                                                                                 </div>
147
148                                                                                 <div class="clear"></div>
149                                                                         </div>
150
151                                                                         <div class="data_row">
152                                                                                 <div class="data_left">
153                                                                                         <label for="surname">Vorname:</label>
154                                                                                 </div>
155
156                                                                                 <div class="data_right">
157                                                                                         <input type="text" id="surname" name="surname" size="10" maxlength="255" value="${customer.surname}" <%=app.getDisabledHtmlFromSession(request, session)%> />
158                                                                                 </div>
159
160                                                                                 <div class="clear"></div>
161                                                                         </div>
162
163                                                                         <div class="data_row">
164                                                                                 <div class="data_left">
165                                                                                         <label for="familyName">Nachname:</label>
166                                                                                 </div>
167
168                                                                                 <div class="data_right">
169                                                                                         <input type="text" id="familyName" name="familyName" size="10" maxlength="255" value="${customer.familyName}" <%=app.getDisabledHtmlFromSession(request, session)%> />
170                                                                                 </div>
171
172                                                                                 <div class="clear"></div>
173                                                                         </div>
174
175                                                                         <div class="data_row">
176                                                                                 <div class="data_left">
177                                                                                         <label for="street">Straße:</label>
178                                                                                 </div>
179
180                                                                                 <div class="data_right">
181                                                                                         <input type="text" id="street" name="street" size="20" maxlength="255" value="${customer.street}" <%=app.getDisabledHtmlFromSession(request, session)%> />
182                                                                                 </div>
183
184                                                                                 <div class="clear"></div>
185                                                                         </div>
186
187                                                                         <div class="data_row">
188                                                                                 <div class="data_left">
189                                                                                         <label for="houseNumber">Hausnummer:</label>
190                                                                                 </div>
191
192                                                                                 <div class="data_right">
193                                                                                         <input type="text" id="houseNumber" name="houseNumber" size="3" maxlength="5" value="${customer.houseNumber}" <%=app.getDisabledHtmlFromSession(request, session)%> />
194                                                                                 </div>
195
196                                                                                 <div class="clear"></div>
197                                                                         </div>
198
199                                                                         <div class="data_row">
200                                                                                 <div class="data_left">
201                                                                                         <label for="zipCode">Postleitzahl:</label>
202                                                                                 </div>
203
204                                                                                 <div class="data_right">
205                                                                                         <input type="text" id="zipCode" name="zipCode" size="5" maxlength="6" value="${customer.zipCode}" <%=app.getDisabledHtmlFromSession(request, session)%> />
206                                                                                 </div>
207
208                                                                                 <div class="clear"></div>
209                                                                         </div>
210
211                                                                         <div class="data_row">
212                                                                                 <div class="data_left">
213                                                                                         <label for="city">Ort:</label>
214                                                                                 </div>
215
216                                                                                 <div class="data_right">
217                                                                                         <input type="text" id="city" name="city" size="10" maxlength="255" value="${customer.city}" <%=app.getDisabledHtmlFromSession(request, session)%> />
218                                                                                 </div>
219
220                                                                                 <div class="clear"></div>
221                                                                         </div>
222
223                                                                         <div class="data_row">
224                                                                                 <div class="data_left">
225                                                                                         <label for="phoneNumber">Telefon:</label>
226                                                                                 </div>
227
228                                                                                 <div class="data_right">
229                                                                                         <input type="text" id="phoneNumber" name="phoneNumber" size="20" maxlength="255" value="${customer.phoneNumber}" <%=app.getDisabledHtmlFromSession(request, session)%> />
230                                                                                 </div>
231
232                                                                                 <div class="clear"></div>
233                                                                         </div>
234
235                                                                         <div class="data_row">
236                                                                                 <div class="data_left">
237                                                                                         <label for="faxNumber">Faxnummer:</label>
238                                                                                 </div>
239
240                                                                                 <div class="data_right">
241                                                                                         <input type="text" id="faxNumber" name="faxNumber" size="20" maxlength="255" value="${customer.faxNumber}" <%=app.getDisabledHtmlFromSession(request, session)%> />
242                                                                                 </div>
243
244                                                                                 <div class="clear"></div>
245                                                                         </div>
246
247                                                                         <div class="data_row">
248                                                                                 <div class="data_left">
249                                                                                         <label for="cellphoneNumber">Handy:</label>
250                                                                                 </div>
251
252                                                                                 <div class="data_right">
253                                                                                         <input type="text" id="cellphoneNumber" name="cellphoneNumber" size="20" maxlength="255" value="${customer.cellphoneNumber}" <%=app.getDisabledHtmlFromSession(request, session)%> />
254                                                                                 </div>
255
256                                                                                 <div class="clear"></div>
257                                                                         </div>
258                                                                 </fieldset>
259                                                         </td>
260                                                 </tr>
261
262                                                 <tr>
263                                                         <td colspan="5" class="table_footer">
264                                                                 <input type="reset" value="Formular zurücksetzen" />
265                                                                 <input type="submit" name="send" value="Bestellung abschliessen" <%=app.getDisabledHtmlFromSession(request, session)%> />
266                                                         </td>
267                                                 </tr>
268                                         </tbody>
269                                 </table>
270                                 </form>
271                         </div>
272                 </div>
273         </body>
274 </html>