]> git.mxchange.org Git - pizzaservice-war.git/blob - web/index.jsp
Continued with project:
[pizzaservice-war.git] / web / index.jsp
1 <%-- 
2         Document   : index
3         Created on : 04.08.2015, 10:33:10
4         Author     : Roland Haeder
5 --%>
6
7 <%--<%@page errorPage="errorHandler.jsp" %>--%>
8 <%@page import="java.util.Map"%>
9 <%@page import="java.util.Iterator"%>
10 <%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
11 <%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
12 <%@page import="org.mxchange.pizzaapplication.product.Product"%>
13 <%@page contentType="text/html" pageEncoding="UTF-8"%>
14
15 <%
16         // Init application instance
17         PizzaApplication app = PizzaServiceApplication.getInstance(application);
18 %>
19 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
20 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
21         <head>
22                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
23                 <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
24                 <title><%=PizzaServiceApplication.MAIN_TITLE%> - Eingangsseite</title>
25         </head>
26
27         <body>
28                 <div id="title">
29                         <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Eingangsseite</h1>
30                 </div>
31
32                 <jsp:include page="/static/menu.jsp" flush="true" />
33
34                 <div id="content_outer">
35                         <div id="content_title">
36                                 <h2>Folgendes kann bestellt werden:</h2>
37                         </div>
38
39                         <div id="content">
40                                 <form action="<%=request.getContextPath()%>/form_handler/do_preview.jsp" accept-charset="utf-8" id="form" method="post">
41                                 <table class="table">
42                                         <thead>
43                                                 <tr>
44                                                         <th class="table_header_column">
45                                                                 Bestellen?
46                                                         </th>
47                                                         <th class="table_header_column">
48                                                                 Anzahl:
49                                                         </th>
50                                                         <th class="table_header_column">
51                                                                 Produkt:
52                                                         </th>
53                                                         <th class="table_header_column">
54                                                                 Einzelpreis:
55                                                         </th>
56                                                 </tr>
57                                         </thead>
58
59                                         <tbody>
60                                                 <%
61                                                 // Get Iterator
62                                                 Iterator<Product> iterator = app.getAvailableProducts();
63
64                                                 // "Walk" through all products and unmark them as ordered
65                                                 while (iterator.hasNext()) {
66                                                         // Get product instance
67                                                         Product product = iterator.next();
68
69                                                         // Unmark as ordered
70                                                         app.unmarkProductAsOrdered(product, session);
71                                                         %>
72                                                         <tr>
73                                                                 <td>
74                                                                         <input class="input" type="checkbox" name="<%=String.format(PizzaApplication.HTTP_PARAM_MASK, PizzaApplication.HTTP_PARAM_CHOOSE, product.getId())%>" value="1" <%=app.getCheckedHtmlFromProduct(product, request, session)%> />
75                                                                 </td>
76                                                                 <td>
77                                                                         <input class="input" type="text" name="<%=String.format(PizzaApplication.HTTP_PARAM_MASK, PizzaApplication.HTTP_PARAM_AMOUNT, product.getId())%>" value="<%=app.getAmountFromSession(product, session)%>" size="3" maxlength="20" />
78                                                                 </td>
79                                                                 <td>
80                                                                         <%=product.getTitle()%>
81                                                                 </td>
82                                                                 <td align="right">
83                                                                         <fmt:formatNumber type="currency"><%=product.getPrice()%></fmt:formatNumber>
84                                                                 </td>
85                                                         </tr>
86                                                         <%
87                                                 }
88                                                 %>
89
90                                                 <tr>
91                                                         <td colspan="4" class="table_footer">
92                                                                 <input class="reset" type="reset" value="Formular zurücksetzen" />
93                                                                 <input class="submit" type="submit" name="send" value="Bestellung ansehen" />
94                                                         </td>
95                                                 </tr>
96                                         </tbody>
97                                 </table>
98                                 </form>
99                         </div>
100                 </div>
101
102                 <jsp:include page="/static/footer.jsp" flush="true" />
103         </body>
104 </html>