]> git.mxchange.org Git - pizzaservice-war.git/blob - web/index.jsp
Added <%=request.getContextPath()%>
[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.pizzaservice.application.PizzaServiceApplication"%>
11 <%@page import="org.mxchange.pizzaservice.application.PizzaApplication"%>
12 <%@page import="org.mxchange.pizzaservice.product.Product"%>
13 <%@page contentType="text/html" pageEncoding="UTF-8"%>
14
15 <%
16         // Init service instance
17         PizzaApplication service = 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                 <title><%=PizzaServiceApplication.MAIN_TITLE%> - Eingangsseite</title>
24         </head>
25
26         <body>
27                 <div id="title">
28                         <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Eingangsseite</h1>
29                 </div>
30
31                 <div id="menu">
32                         <ul>
33                                 <li><a href="index.jsp" title="Eingangsseite">Home</a></li>
34                                 <li><a href="order.jsp" title="Bestellseite">Bestellung</a></li>
35                                 <li><a href="finished.jsp" title="Bestellung abgeschlossen">Vielen Dank</a></li>
36                                 <li><a href="bye.jsp" title="Sitzung beennden">Sitzung beenden</a></li>
37                         </ul>
38                 </div>
39
40                 <div id="content_outer">
41                         <div id="content_title">
42                                 <h2>Folgendes kann bestellt werden:</h2>
43                         </div>
44
45                         <div id="content">
46                                 <form action="<%=request.getContextPath()%>/order.jsp" accept-charset="utf-8" id="form" method="post">
47                                 <table class="table">
48                                         <thead class="table_header">
49                                                 <tr>
50                                                         <th class="table_header_column">
51                                                                 Bestellen?
52                                                         </th>
53                                                         <th class="table_header_column">
54                                                                 Anzahl:
55                                                         </th>
56                                                         <th class="table_header_column">
57                                                                 Produkt:
58                                                         </th>
59                                                         <th class="table_header_column">
60                                                                 Einzelpreis:
61                                                         </th>
62                                                 </tr>
63                                         </thead>
64                                         <tbody class="table_body">
65                                                 <%
66                                                 // Get iterator from products
67                                                 Iterator<Map.Entry<String, Product>> iterator = service.getProductsIterator();
68
69                                                 // Iterate over all
70                                                 while (iterator.hasNext()) {
71                                                         // Get entry
72                                                         Map.Entry<String, Product> entry = iterator.next();
73
74                                                         // Get product
75                                                         Product product = entry.getValue();
76                                                         service.unmarkProductAsOrdered(product, session);
77                                                         %>
78                                                         <tr>
79                                                                 <td>
80                                                                         <input type="checkbox" name="<%=String.format(PizzaApplication.HTTP_PARAM_MASK, PizzaApplication.HTTP_PARAM_CHOOSE, product.getName())%>" value="1" <%=service.getCheckedHtmlFromProduct(product, request, session)%> />
81                                                                 </td>
82                                                                 <td>
83                                                                         <input type="text" name="<%=String.format(PizzaApplication.HTTP_PARAM_MASK, PizzaApplication.HTTP_PARAM_AMOUNT, product.getName())%>" value="<%=service.getAmountFromSession(product, session)%>" size="3" maxlength="20" />
84                                                                 </td>
85                                                                 <td>
86                                                                         <%=product.getTitle()%>
87                                                                 </td>
88                                                                 <td>
89                                                                         <%=product.getPrice()%>
90                                                                 </td>
91                                                         </tr>
92                                                         <%
93                                                 }
94                                                 %>
95                                                 <tr>
96                                                         <td colspan="4" class="table_footer">
97                                                                 <input type="reset" value="Formular zurücksetzen" />
98                                                                 <input type="submit" name="send" value="Bestellung ansehen" />
99                                                         </td>
100                                                 </tr>
101                                         </tbody>
102                                 </table>
103                                 </form>
104                         </div>
105                 </div>
106         </body>
107 </html>