]> 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                                                 // "Walk" through all products and unmark them as ordered
69                                                 for (final Product product : app.getProducts()) {
70                                                         // Unmark it as ordered
71                                                         app.unmarkProductAsOrdered(product, session);
72                                                         %>
73                                                         <tr>
74                                                                 <td>
75                                                                         <%=app.getPrintableChoosenFromRequestSession(product, request, session)%>
76                                                                 </td>
77                                                                 <td>
78                                                                         <%=app.handleAmountFromRequestSession(product, request, session)%>
79                                                                 </td>
80                                                                 <td>
81                                                                         <%=product.getTitle()%>
82                                                                 </td>
83                                                                 <td>
84                                                                         <%=product.getPrice()%>
85                                                                 </td>
86                                                                 <td>
87                                                                         <%=app.getTotalPositionPriceFromRequestSession(product, request, session)%>
88                                                                 </td>
89                                                         </tr>
90                                                         <%
91                                                         // Is it choosen and amount set?
92                                                         if (app.isProductChoosen(product, request, session)) {
93                                                                 // Then mark it as choosen
94                                                                 app.markProductAsChoosen(product, session);
95                                                         }
96                                                 }
97                                                 %>
98                                                 <tr>
99                                                         <td id="table_total_amount_left">
100                                                                 Menge:
101                                                         </td>
102                                                         <td id="table_total_amount_right">
103                                                                 <%=app.calculateTotalAmount(request, session)%>
104                                                         </td>
105                                                         <td class="spacer">
106                                                                 &nbsp;
107                                                         </td>
108                                                         <td id="table_total_sum_left">
109                                                                 Gesamtpreis:
110                                                         </td>
111                                                         <td id="table_total_sum_right">
112                                                                 <%=app.calculateTotalPrice(request, session)%>
113                                                         </td>
114                                                 </tr>
115
116                                                 <tr>
117                                                         <td colspan="5">
118                                                                 <fieldset id="personal_data">
119                                                                         <legend title="Bitte geben Sie Ihre Daten ein.">Bitte Ihre Daten eingeben:</legend>
120
121                                                                         <div class="data_row">
122                                                                                 <div class="data_left">
123                                                                                         <label for="gender">Anrede</label>
124                                                                                 </div>
125
126                                                                                 <div class="data_right">
127                                                                                         <jsp:include page="/static/gender_selection_box.jsp" flush="true" />
128                                                                                 </div>
129
130                                                                                 <div class="clear"></div>
131                                                                         </div>
132
133                                                                         <div class="data_row">
134                                                                                 <div class="data_left">
135                                                                                         <label for="companyname">Firmenname:</label>
136                                                                                 </div>
137
138                                                                                 <div class="data_right">
139                                                                                         <input type="text" id="companyname" name="companyName" size="15" maxlength="255" value="${customer.companyName}" <%=app.getDisabledHtmlFromSession(request, session)%> />
140                                                                                 </div>
141
142                                                                                 <div class="clear"></div>
143                                                                         </div>
144
145                                                                         <div class="data_row">
146                                                                                 <div class="data_left">
147                                                                                         <label for="surname">Vorname:</label>
148                                                                                 </div>
149
150                                                                                 <div class="data_right">
151                                                                                         <input type="text" id="surname" name="surname" size="10" maxlength="255" value="${customer.surname}" <%=app.getDisabledHtmlFromSession(request, session)%> />
152                                                                                 </div>
153
154                                                                                 <div class="clear"></div>
155                                                                         </div>
156
157                                                                         <div class="data_row">
158                                                                                 <div class="data_left">
159                                                                                         <label for="familyName">Nachname:</label>
160                                                                                 </div>
161
162                                                                                 <div class="data_right">
163                                                                                         <input type="text" id="familyName" name="familyName" size="10" maxlength="255" value="${customer.familyName}" <%=app.getDisabledHtmlFromSession(request, session)%> />
164                                                                                 </div>
165
166                                                                                 <div class="clear"></div>
167                                                                         </div>
168
169                                                                         <div class="data_row">
170                                                                                 <div class="data_left">
171                                                                                         <label for="street">Straße:</label>
172                                                                                 </div>
173
174                                                                                 <div class="data_right">
175                                                                                         <input type="text" id="street" name="street" size="20" maxlength="255" value="${customer.street}" <%=app.getDisabledHtmlFromSession(request, session)%> />
176                                                                                 </div>
177
178                                                                                 <div class="clear"></div>
179                                                                         </div>
180
181                                                                         <div class="data_row">
182                                                                                 <div class="data_left">
183                                                                                         <label for="houseNumber">Hausnummer:</label>
184                                                                                 </div>
185
186                                                                                 <div class="data_right">
187                                                                                         <input type="text" id="houseNumber" name="houseNumber" size="3" maxlength="5" value="${customer.houseNumber}" <%=app.getDisabledHtmlFromSession(request, session)%> />
188                                                                                 </div>
189
190                                                                                 <div class="clear"></div>
191                                                                         </div>
192
193                                                                         <div class="data_row">
194                                                                                 <div class="data_left">
195                                                                                         <label for="zipCode">Postleitzahl:</label>
196                                                                                 </div>
197
198                                                                                 <div class="data_right">
199                                                                                         <input type="text" id="zipCode" name="zipCode" size="5" maxlength="6" value="${customer.zipCode}" <%=app.getDisabledHtmlFromSession(request, session)%> />
200                                                                                 </div>
201
202                                                                                 <div class="clear"></div>
203                                                                         </div>
204
205                                                                         <div class="data_row">
206                                                                                 <div class="data_left">
207                                                                                         <label for="city">Ort:</label>
208                                                                                 </div>
209
210                                                                                 <div class="data_right">
211                                                                                         <input type="text" id="city" name="city" size="10" maxlength="255" value="${customer.city}" <%=app.getDisabledHtmlFromSession(request, session)%> />
212                                                                                 </div>
213
214                                                                                 <div class="clear"></div>
215                                                                         </div>
216
217                                                                         <div class="data_row">
218                                                                                 <div class="data_left">
219                                                                                         <label for="phoneNumber">Telefon:</label>
220                                                                                 </div>
221
222                                                                                 <div class="data_right">
223                                                                                         <input type="text" id="phoneNumber" name="phoneNumber" size="20" maxlength="255" value="${customer.phoneNumber}" <%=app.getDisabledHtmlFromSession(request, session)%> />
224                                                                                 </div>
225
226                                                                                 <div class="clear"></div>
227                                                                         </div>
228
229                                                                         <div class="data_row">
230                                                                                 <div class="data_left">
231                                                                                         <label for="faxNumber">Faxnummer:</label>
232                                                                                 </div>
233
234                                                                                 <div class="data_right">
235                                                                                         <input type="text" id="faxNumber" name="faxNumber" size="20" maxlength="255" value="${customer.faxNumber}" <%=app.getDisabledHtmlFromSession(request, session)%> />
236                                                                                 </div>
237
238                                                                                 <div class="clear"></div>
239                                                                         </div>
240
241                                                                         <div class="data_row">
242                                                                                 <div class="data_left">
243                                                                                         <label for="cellphoneNumber">Handy:</label>
244                                                                                 </div>
245
246                                                                                 <div class="data_right">
247                                                                                         <input type="text" id="cellphoneNumber" name="cellphoneNumber" size="20" maxlength="255" value="${customer.cellphoneNumber}" <%=app.getDisabledHtmlFromSession(request, session)%> />
248                                                                                 </div>
249
250                                                                                 <div class="clear"></div>
251                                                                         </div>
252                                                                 </fieldset>
253                                                         </td>
254                                                 </tr>
255
256                                                 <tr>
257                                                         <td colspan="5" class="table_footer">
258                                                                 <input type="reset" value="Formular zurücksetzen" />
259                                                                 <input type="submit" name="send" value="Bestellung abschliessen" <%=app.getDisabledHtmlFromSession(request, session)%> />
260                                                         </td>
261                                                 </tr>
262                                         </tbody>
263                                 </table>
264                                 </form>
265                         </div>
266                 </div>
267         </body>
268 </html>