]> git.mxchange.org Git - pizzaservice-war.git/blob - web/index.jsp
ec70c2df286c4f59b72d032ef5fe27b60ee9b76c
[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="org.mxchange.pizzaapplication.beans.controller.PizzaBean"%>
9 <%@page contentType="text/html" pageEncoding="UTF-8"%>
10 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
11 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
12 <%@taglib prefix="basket" uri="http://mxchange.org/jshop/tags/basket" %>
13
14 <jsp:useBean id="controller" scope="session" class="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean" type="PizzaBean" />
15
16 <jsp:setProperty name="controller" property="application" value="${pageContext.servletContext}" />
17 <jsp:setProperty name="controller" property="basket" value="${basket}" />
18 <%
19         // TODO: Can be removed later
20         controller.init();
21 %>
22
23 <c:set var="basePath" value="${pageContext.request.contextPath}" />
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="${basePath}/style.css" type="text/css" />
30                 <title>Pizza-Service - Willkommen</title>
31         </head>
32
33         <body>
34                 <div id="header"> 
35                         <div id="title">
36                                 <h1>Pizza-Service - Willkommen</h1>
37                         </div>
38                 </div>
39
40                 <jsp:include page="/static/guest/guest_menu.jsp" flush="false" />
41
42                 <div id="content_outer">
43                         <div id="content_title">
44                                 <h2>Eingangsseite (dummy):</h2>
45                         </div>
46
47                         <div id="content">
48                                 <!-- TODO: Missing in xhtml: //-->
49                                 <basket:mini_basket basket="${basket}" />
50
51                                 <table class="table">
52                                         <thead>
53                                                 <tr>
54                                                         <th colspan="4" class="table_header">
55                                                                 Folgendes kann bestellt werden:
56                                                         </th>
57                                                 </tr>
58                                         </thead>
59
60                                         <tbody>
61                                                 <tr>
62                                                         <th class="table_header_column">
63                                                                 Bestellen?
64                                                         </th>
65                                                         <th class="table_header_column">
66                                                                 Anzahl:
67                                                         </th>
68                                                         <th class="table_header_column">
69                                                                 Produkt:
70                                                         </th>
71                                                         <th class="table_header_column">
72                                                                 Einzelpreis:
73                                                         </th>
74                                                 </tr>
75                                         </tbody>
76                                 </table>
77
78                                 <c:forEach var="product" items="${controller.availableProductsIterator}">
79                                         <c:choose>
80                                                 <c:when test="${controller.basket.isAdded(product)}">
81                                                         <c:set var="item" value="${controller.basket.item}" />
82                                                         <table class="table">
83                                                                 <tbody>
84                                                                                 <tr>
85                                                                                         <td class="table_data_column">
86                                                                                                 <a href="${basePath}/basket.jsp" title="Zum Warenkorb">Warenkorb</a>
87                                                                                         </td>
88                                                                                         <td class="table_data_column">
89                                                                                                 ${item.amount}
90                                                                                         </td>
91                                                                                         <td class="table_data_column">
92                                                                                                 ${product.title}
93                                                                                         </td>
94                                                                                         <td class="table_data_column" align="right">
95                                                                                                 <fmt:formatNumber type="currency" minFractionDigits="2" maxFractionDigits="2" value="${product.price}" />
96                                                                                         </td>
97                                                                                 </tr>
98                                                                 </tbody>
99                                                         </table>
100                                                 </c:when>
101                                                 <c:otherwise>
102                                                         <form action="${basePath}/form_handler/add_item.jsp" accept-charset="utf-8" id="form" method="post">
103                                                         <table class="table">
104                                                                 <tbody>
105                                                                                 <tr>
106                                                                                         <td class="table_data_column">
107                                                                                                 <input class="submit" type="submit" name="add" value="Hinzuf&uuml;gen" />
108                                                                                                 <input type="hidden" name="itemId" value="${product.itemId}" />
109                                                                                                 <input type="hidden" name="itemType" value="Product" />
110                                                                                         </td>
111                                                                                         <td class="table_data_column">
112                                                                                                 <input class="input" type="text" name="amount" size="3" maxlength="20" />
113                                                                                         </td>
114                                                                                         <td class="table_data_column">
115                                                                                                 ${product.title}
116                                                                                         </td>
117                                                                                         <td class="table_data_column" align="right">
118                                                                                                 <fmt:formatNumber type="currency" minFractionDigits="2" maxFractionDigits="2" value="${product.price}" />
119                                                                                         </td>
120                                                                                 </tr>
121                                                                 </tbody>
122                                                         </table>
123                                                         </form>
124                                                 </c:otherwise>
125                                         </c:choose>
126                                 </c:forEach>
127                         </div>
128                 </div>
129
130                 <jsp:include page="/static/guest/guest_footer.jsp" flush="false" />
131         </body>
132 </html>