]> 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 class="table_header">
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 class="table_body">
60                                                 <%
61                                                 // "Walk" through all products and unmark them as ordered
62                                                 for (final Product product : app.getUnmarkedProducts(session)) {
63                                                         %>
64                                                         <tr>
65                                                                 <td>
66                                                                         <input type="checkbox" name="<%=String.format(PizzaApplication.HTTP_PARAM_MASK, PizzaApplication.HTTP_PARAM_CHOOSE, product.getName())%>" value="1" <%=app.getCheckedHtmlFromProduct(product, request, session)%> />
67                                                                 </td>
68                                                                 <td>
69                                                                         <input type="text" name="<%=String.format(PizzaApplication.HTTP_PARAM_MASK, PizzaApplication.HTTP_PARAM_AMOUNT, product.getName())%>" value="<%=app.getAmountFromSession(product, session)%>" size="3" maxlength="20" />
70                                                                 </td>
71                                                                 <td>
72                                                                         <%=product.getTitle()%>
73                                                                 </td>
74                                                                 <td>
75                                                                         <%=product.getPrice()%>
76                                                                 </td>
77                                                         </tr>
78                                                         <%
79                                                 }
80                                                 %>
81
82                                                 <tr>
83                                                         <td colspan="4" class="table_footer">
84                                                                 <input type="reset" value="Formular zurücksetzen" />
85                                                                 <input type="submit" name="send" value="Bestellung ansehen" />
86                                                         </td>
87                                                 </tr>
88                                         </tbody>
89                                 </table>
90                                 </form>
91                         </div>
92                 </div>
93         </body>
94 </html>