]> git.mxchange.org Git - pizzaservice-war.git/blob - web/index.jsp
Added footer for admin area + error include file "direct_call.jsp"
[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 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
15
16 <%
17         // Init application instance
18         PizzaApplication app = PizzaServiceApplication.getInstance(application);
19 %>
20 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
21 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
22         <head>
23                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
24                 <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
25                 <title><%=PizzaServiceApplication.MAIN_TITLE%> - Willkommen</title>
26         </head>
27
28         <body>
29                 <div id="header"> 
30                         <div id="title">
31                                 <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Willkommen</h1>
32                         </div>
33                 </div>
34
35                 <jsp:include page="/static/menu.jsp" flush="true" />
36
37                 <div id="content_outer">
38                         <div id="content_title">
39                                 <h2>Folgendes kann bestellt werden:</h2>
40                         </div>
41
42                         <div id="content">
43                                 <table class="table">
44                                         <thead>
45                                                 <tr>
46                                                         <th class="table_header_column">
47                                                                 Bestellen?
48                                                         </th>
49                                                         <th class="table_header_column">
50                                                                 Anzahl:
51                                                         </th>
52                                                         <th class="table_header_column">
53                                                                 Produkt:
54                                                         </th>
55                                                         <th class="table_header_column">
56                                                                 Einzelpreis:
57                                                         </th>
58                                                 </tr>
59                                         </thead>
60
61                                         <tbody>
62                                                 <%
63                                                 // Get Iterator
64                                                 Iterator<Product> iterator = app.getAvailableProducts();
65
66                                                 // "Walk" through all products and unmark them as ordered
67                                                 while (iterator.hasNext()) {
68                                                         // Get product instance
69                                                         Product product = iterator.next();
70
71                                                         // Unmark as ordered
72                                                         app.unmarkProductAsOrdered(product, session);
73                                                         %>
74                                                         <tr>
75                                                                 <form action="<%=request.getContextPath()%>/form_handler/add_item.jsp" accept-charset="utf-8" id="form" method="post">
76                                                                 <td>
77                                                                         <input class="submit" type="submit" name="add" value="Hinzuf&uuml;gen" />
78                                                                         <input class="input" type="hidden" name="<%=PizzaApplication.HTTP_PARAM_ITEM_ID%>" value="<%=product.getId()%>" />
79                                                                         <input class="input" type="hidden" name="<%=PizzaApplication.HTTP_PARAM_ITEM_TYPE%>" value="<%=Product.class%>" />
80                                                                 </td>
81                                                                 <td>
82                                                                         <input class="input" type="text" name="<%=PizzaApplication.HTTP_PARAM_AMOUNT%>" size="3" maxlength="20" />
83                                                                 </td>
84                                                                 <td>
85                                                                         <%=product.getTitle()%>
86                                                                 </td>
87                                                                 <td align="right">
88                                                                         <fmt:formatNumber type="currency"><%=product.getPrice()%></fmt:formatNumber>
89                                                                 </td>
90                                                         </tr>
91                                                         </form>
92                                                         <%
93                                                 }
94                                                 %>
95                                         </tbody>
96                                 </table>
97                         </div>
98                 </div>
99
100                 <jsp:include page="/static/footer.jsp" flush="true" />
101         </body>
102 </html>