3 Created on : 04.08.2015, 10:55:10
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"%>
17 <jsp:useBean id="customer" scope="session" class="org.mxchange.pizzaapplication.customer.bean.PizzaServiceCustomerBean" type="CustomerBean" />
19 <jsp:setProperty name="customer" property="*" />
22 // Init application instance
23 PizzaApplication app = PizzaServiceApplication.getInstance(application);
25 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
26 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
28 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
29 <link rel="stylesheet" href="style.css" type="text/css"/>
30 <title><%=PizzaServiceApplication.MAIN_TITLE%> - Bestellung anzeigen</title>
35 <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Bestellung anzeigen</h1>
39 <jsp:include page="/static/menu.jsp" flush="true" />
42 <div id="content_outer">
43 <div id="content_title">
44 <h2>Folgendes möchten Sie bestellen:</h2>
48 <form action="<%=request.getContextPath()%>/form_handler/order.jsp" accept-charset="utf-8" id="form" method="post">
50 <thead class="table_header">
52 <th class="table_header_column">
55 <th class="table_header_column">
58 <th class="table_header_column">
61 <th class="table_header_column">
64 <th class="table_header_column">
69 <tbody class="table_body">
71 // Get iterator from products
72 Iterator<Map.Entry<String, Product>> iterator = app.getProductsIterator();
75 while (iterator.hasNext()) {
77 Map.Entry<String, Product> entry = iterator.next();
80 Product product = entry.getValue();
84 <%=app.getPrintableChoosenFromRequestSession(product, request, session)%>
87 <%=app.handleAmountFromRequestSession(product, request, session)%>
90 <%=product.getTitle()%>
93 <%=product.getPrice()%>
96 <%=app.getTotalPositionPriceFromRequestSession(product, request, session)%>
100 // Is it choosen and amount set?
101 if (app.isProductChoosen(product, request, session)) {
102 // Then mark it as choosen
103 product.markAsChoosen();
104 app.unmarkProductAsOrdered(product, session);
109 <td id="table_total_amount_left">
112 <td id="table_total_amount_right">
113 <%=app.calculateTotalAmount(request, session)%>
118 <td id="table_total_sum_left">
121 <td id="table_total_sum_right">
122 <%=app.calculateTotalPrice(request, session)%>
129 <legend title="Bitte geben Sie Ihre Daten ein.">Bitte Ihre Daten eingeben:</legend>
131 <div class="data_row">
132 <div class="data_left">
133 <label for="gender">Anrede</label>
135 <div class="data_right">
136 <select name="gender" id="gender" size="1">
138 Gender[] genders = Gender.values();
139 for (final Gender gender : genders) {
141 <option value="<%=gender.name()%>"<%
142 synchronized (session) {
144 Object value = session.getAttribute("gender");
145 if ((value instanceof Gender) && (value.equals(gender))) {
146 // Output selected="selected"
147 out.print("selected=\"selected\"");
150 %>><%=gender%></option>
156 <div class="clear"></div>
159 <div class="data_row">
160 <div class="data_left">
161 <label for="companyname">Firmenname:</label>
163 <div class="data_right">
164 <input type="text" id="companyname" name="companyName" size="10" maxlength="255" value="<%=app.getPrintableValeFromSession(session, "companyname")%>" <%=app.getDisabledHtmlFromSession(request, session)%> />
166 <div class="clear"></div>
169 <div class="data_row">
170 <div class="data_left">
171 <label for="surname">Vorname:</label>
173 <div class="data_right">
174 <input type="text" id="surname" name="surname" size="10" maxlength="255" value="<%=app.getPrintableValeFromSession(session, "surname")%>" <%=app.getDisabledHtmlFromSession(request, session)%> />
176 <div class="clear"></div>
179 <div class="data_row">
180 <div class="data_left">
181 <label for="familyName">Nachname:</label>
183 <div class="data_right">
184 <input type="text" id="familyName" name="familyName" size="10" maxlength="255" value="<%=app.getPrintableValeFromSession(session, "familyName")%>" <%=app.getDisabledHtmlFromSession(request, session)%> />
186 <div class="clear"></div>
189 <div class="data_row">
190 <div class="data_left">
191 <label for="street">Straße:</label>
193 <div class="data_right">
194 <input type="text" id="street" name="street" size="20" maxlength="255" value="<%=app.getPrintableValeFromSession(session, "street")%>" <%=app.getDisabledHtmlFromSession(request, session)%> />
196 <div class="clear"></div>
199 <div class="data_row">
200 <div class="data_left">
201 <label for="houseNumber">Hausnummer:</label>
203 <div class="data_right">
204 <input type="text" id="houseNumber" name="houseNumber" size="3" maxlength="5" value="<%=app.getPrintableValeFromSession(session, "houseNumber")%>" <%=app.getDisabledHtmlFromSession(request, session)%> />
206 <div class="clear"></div>
209 <div class="data_row">
210 <div class="data_left">
211 <label for="zipCode">Postleitzahl:</label>
213 <div class="data_right">
214 <input type="text" id="zipCode" name="zipCode" size="5" maxlength="6" value="<%=app.getPrintableValeFromSession(session, "zipCode")%>" <%=app.getDisabledHtmlFromSession(request, session)%> />
216 <div class="clear"></div>
219 <div class="data_row">
220 <div class="data_left">
221 <label for="city">Ort:</label>
223 <div class="data_right">
224 <input type="text" id="city" name="city" size="10" maxlength="255" value="<%=app.getPrintableValeFromSession(session, "city")%>" <%=app.getDisabledHtmlFromSession(request, session)%> />
226 <div class="clear"></div>
229 <div class="data_row">
230 <div class="data_left">
231 <label for="phoneNumber">Telefon:</label>
233 <div class="data_right">
234 <input type="text" id="phoneNumber" name="phoneNumber" size="20" maxlength="255" value="<%=app.getPrintableValeFromSession(session, "phoneNumber")%>" <%=app.getDisabledHtmlFromSession(request, session)%> />
236 <div class="clear"></div>
239 <div class="data_row">
240 <div class="data_left">
241 <label for="faxNumber">Faxnummer:</label>
243 <div class="data_right">
244 <input type="text" id="faxNumber" name="faxNumber" size="20" maxlength="255" value="<%=app.getPrintableValeFromSession(session, "faxNumber")%>" <%=app.getDisabledHtmlFromSession(request, session)%> />
246 <div class="clear"></div>
249 <div class="data_row">
250 <div class="data_left">
251 <label for="cellphoneNumber">Handy:</label>
253 <div class="data_right">
254 <input type="text" id="cellphoneNumber" name="cellphoneNumber" size="20" maxlength="255" value="<%=app.getPrintableValeFromSession(session, "cellphoneNumber")%>" <%=app.getDisabledHtmlFromSession(request, session)%> />
256 <div class="clear"></div>
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)%> />