]> git.mxchange.org Git - pizzaservice-war.git/blob - web/index.jsp
Some changes for internationalization + jcore.jar, jsfcore.jar, updated
[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                                 <basket:mini_basket basket="${basket}" />
49
50                                 <table class="table">
51                                         <thead>
52                                                 <tr>
53                                                         <th colspan="4" class="table_header">
54                                                                 Folgendes kann bestellt werden:
55                                                         </th>
56                                                 </tr>
57                                         </thead>
58
59                                         <tbody>
60                                                 <tr>
61                                                         <th class="table_header_column">
62                                                                 Bestellen?
63                                                         </th>
64                                                         <th class="table_header_column">
65                                                                 Anzahl:
66                                                         </th>
67                                                         <th class="table_header_column">
68                                                                 Produkt:
69                                                         </th>
70                                                         <th class="table_header_column">
71                                                                 Einzelpreis:
72                                                         </th>
73                                                 </tr>
74                                         </tbody>
75                                 </table>
76
77                                 <c:forEach var="product" items="${controller.availableProducts}">
78                                         <c:choose>
79                                                 <c:when test="${controller.basket.isAdded(product)}">
80                                                         <c:set var="item" value="${controller.basket.item}" />
81                                                         <table class="table">
82                                                                 <tbody>
83                                                                                 <tr>
84                                                                                         <td class="table_data_column">
85                                                                                                 <a href="${basePath}/basket.jsp" title="Zum Warenkorb">Warenkorb</a>
86                                                                                         </td>
87                                                                                         <td class="table_data_column">
88                                                                                                 ${item.amount}
89                                                                                         </td>
90                                                                                         <td class="table_data_column">
91                                                                                                 ${product.title}
92                                                                                         </td>
93                                                                                         <td class="table_data_column" align="right">
94                                                                                                 <fmt:formatNumber type="currency" minFractionDigits="2" maxFractionDigits="2" value="${product.price}" />
95                                                                                         </td>
96                                                                                 </tr>
97                                                                 </tbody>
98                                                         </table>
99                                                 </c:when>
100                                                 <c:otherwise>
101                                                         <form action="${basePath}/form_handler/add_item.jsp" accept-charset="utf-8" id="form" method="post">
102                                                         <table class="table">
103                                                                 <tbody>
104                                                                                 <tr>
105                                                                                         <td class="table_data_column">
106                                                                                                 <input class="submit" type="submit" name="add" value="Hinzuf&uuml;gen" />
107                                                                                                 <input type="hidden" name="itemId" value="${product.itemId}" />
108                                                                                                 <input type="hidden" name="itemType" value="Product" />
109                                                                                         </td>
110                                                                                         <td class="table_data_column">
111                                                                                                 <input class="input" type="text" name="amount" size="3" maxlength="20" />
112                                                                                         </td>
113                                                                                         <td class="table_data_column">
114                                                                                                 ${product.title}
115                                                                                         </td>
116                                                                                         <td class="table_data_column" align="right">
117                                                                                                 <fmt:formatNumber type="currency" minFractionDigits="2" maxFractionDigits="2" value="${product.price}" />
118                                                                                         </td>
119                                                                                 </tr>
120                                                                 </tbody>
121                                                         </table>
122                                                         </form>
123                                                 </c:otherwise>
124                                         </c:choose>
125                                 </c:forEach>
126                         </div>
127                 </div>
128
129                 <jsp:include page="/static/guest/guest_footer.jsp" flush="false" />
130         </body>
131 </html>