]> git.mxchange.org Git - pizzaservice-war.git/blob - web/finished.jsp
Added footer for admin area + error include file "direct_call.jsp"
[pizzaservice-war.git] / web / finished.jsp
1 <%-- 
2         Document   : finished
3         Created on : 04.08.2015, 10:55:47
4         Author     : Roland Haeder
5 --%>
6
7 <%--<%@page errorPage="errorHandler.jsp" %>--%>
8 <%@page contentType="text/html" pageEncoding="UTF-8"%>
9
10 <%@page import="java.lang.reflect.Field"%>
11 <%@page import="java.util.Map"%>
12 <%@page import="java.util.Iterator"%>
13 <%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
14 <%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
15 <%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %>
16 <%@page import="org.mxchange.pizzaapplication.product.Product"%>
17
18 <jsp:useBean id="customer" scope="session" class="org.mxchange.pizzaapplication.customer.bean.PizzaServiceCustomerBean" type="CustomerBean" />
19 <jsp:setProperty name="customer" property="*" />
20
21 <%
22         // Init application instance
23         PizzaApplication app = PizzaServiceApplication.getInstance(application);
24 %>
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">
27         <head>
28                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
29                 <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
30                 <title><%=PizzaServiceApplication.MAIN_TITLE%> - Vielen Dank!</title>
31         </head>
32
33         <body>
34                 <div id="header"> 
35                         <div id="title">
36                                 <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Vielen Dank!</h1>
37                         </div>
38                 </div>
39
40                 <jsp:include page="/static/menu.jsp" flush="true" />
41
42                 <div id="content_outer">
43                         <div id="content_title">
44                                 <h2>Folgendes haben Sie bestellt:</h2>
45                         </div>
46
47                         <div id="content">
48                                 <table class="table">
49                                         <thead>
50                                                 <tr>
51                                                         <th class="table_header_column">
52                                                                 Bestellen?
53                                                         </th>
54                                                         <th class="table_header_column">
55                                                                 Anzahl:
56                                                         </th>
57                                                         <th class="table_header_column">
58                                                                 Produkt:
59                                                         </th>
60                                                         <th class="table_header_column">
61                                                                 Einzelpreis:
62                                                         </th>
63                                                         <th class="table_header_column">
64                                                                 Zwischensumme:
65                                                         </th>
66                                                 </tr>
67                                         </thead>
68                                         <tbody>
69                                                 <%
70                                                 // Get Iterator
71                                                 Iterator<Product> iterator = app.getAvailableProducts();
72
73                                                 // "Walk" through all products and unmark them as ordered
74                                                 while (iterator.hasNext()) {
75                                                         // Get product instance
76                                                         Product product = iterator.next();
77                                                         %>
78                                                         <tr>
79                                                                 <td>
80                                                                         <%=app.getPrintableChoosenFromRequestSession(product, request, session)%>
81                                                                 </td>
82                                                                 <td>
83                                                                         <%=app.handleAmountFromRequestSession(product, request, session)%>
84                                                                 </td>
85                                                                 <td>
86                                                                         <%=product.getTitle()%>
87                                                                 </td>
88                                                                 <td>
89                                                                         <%=product.getPrice()%>
90                                                                 </td>
91                                                                 <td align="right">
92                                                                         <%=app.getTotalPositionPriceFromRequestSession(product, request, session)%>
93                                                                 </td>
94                                                         </tr>
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>
106                                                                 &nbsp;
107                                                         </td>
108                                                         <td id="table_total_sum_left">
109                                                                 Gesamtpreis:
110                                                         </td>
111                                                         <td id="table_total_sum_right" align="right">
112                                                                 <%=app.calculateTotalPrice(request, session)%>
113                                                         </td>
114                                                 </tr>
115
116                                                 <tr>
117                                                         <td colspan="5" class="table_header">
118                                                                 Ihre Daten:
119                                                         </td>
120                                                 </tr>
121
122                                                 <tr>
123                                                         <td colspan="5" class="table_row">
124                                                                 <%
125                                                                 // Debug message
126                                                                 app.getLogger().debug("customer=" + customer);
127
128                                                                 // Get iterator on all fields/attributes
129                                                                 Iterator<Map.Entry<Field, Object>> fieldIterator = customer.iterator();
130                                                                 %>
131                                                                 <ul>
132                                                                 <%
133                                                                 while (fieldIterator.hasNext()) {
134                                                                         Map.Entry<Field, Object> entry = fieldIterator.next();
135                                                                         %>
136                                                                         <li><%=entry.getKey().getName()%> set to: <%=entry.getValue()%></li>
137                                                                         <%
138                                                                 }
139                                                                 %>
140                                                                 </ul>
141                                                         </td>
142                                                 </tr>
143
144                                                 <tr>
145                                                         <td colspan="5" class="table_footer">
146                                                                 <%
147                                                                 if (("POST".equals(request.getMethod())) && (app.calculateTotalAmount(request, session) > 0)) {
148                                                                         out.print("Ihre Bestellung ist eingegangen.");
149                                                                         synchronized(session) {
150                                                                                 //session.invalidate();
151                                                                                 out.print("<div>Zu Demo-Zwecken wird die Sitzung nicht gekillt. Bitte 'Bestellung' aufrufen, um zu gucken, dass die Daten da sind.</div>");
152                                                                         }
153                                                                 } else {
154                                                                         // Nothing ordered
155                                                                         out.print("Keine Bestellung aufgegeben.");
156                                                                 }
157                                                                 %>
158                                                         </td>
159                                                 </tr>
160                                         </tbody>
161                                 </table>
162                         </div>
163                 </div>
164
165                 <jsp:include page="/static/footer.jsp" flush="true" />
166         </body>
167 </html>