3 Created on : 04.08.2015, 10:33:10
7 <%--<%@page errorPage="errorHandler.jsp" %>--%>
8 <%@page import="java.util.Map"%>
9 <%@page import="java.util.Iterator"%>
10 <%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
11 <%@page import="org.mxchange.pizzaapplication.beans.PizzaBean"%>
12 <%@page import="org.mxchange.pizzaapplication.product.Product"%>
13 <%@page import="org.mxchange.pizzaapplication.basket.Basket"%>
14 <%@page import="org.mxchange.pizzaapplication.item.basket.BasketItem"%>
15 <%@page import="org.mxchange.pizzaapplication.item.AddableBasketItem"%>
16 <%@page contentType="text/html" pageEncoding="UTF-8"%>
17 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
18 <%@taglib prefix="basket" uri="http://mxchange.org/pizza-service/tags/basket" %>
19 <jsp:useBean id="controller" scope="session" class="org.mxchange.pizzaapplication.beans.PizzaServiceBean" type="org.mxchange.pizzaapplication.beans.PizzaBean" />
21 <jsp:setProperty name="controller" property="application" value="${pageContext.servletContext}" />
22 <jsp:setProperty name="controller" property="basket" value="${basket}" />
23 <%controller.init();%>
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">
28 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
29 <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
30 <title>Pizza-Service - Willkommen</title>
36 <h1>Pizza-Service - Willkommen</h1>
40 <jsp:include page="/static/guest/guest_menu.jsp" flush="false" />
42 <div id="content_outer">
43 <div id="content_title">
44 <h2>Folgendes kann bestellt werden:</h2>
48 <basket:mini_basket basket="${basket}" />
52 <th class="table_header_column">
55 <th class="table_header_column">
58 <th class="table_header_column">
61 <th class="table_header_column">
69 Iterator<Product> iterator = controller.getAvailableProducts();
71 // "Walk" through all products and unmark them as ordered
72 while (iterator.hasNext()) {
73 // Get product instance
74 Product product = iterator.next();
77 product.getLogger().debug("product.itemId=" + product.getItemId());
79 // Create an item instance form this product
80 AddableBasketItem item = controller.getBasket().getItem(product);
83 product.getLogger().debug("item=" + item);
85 // Has it been already added to the basket?
87 // Some nice output ...
92 <td class="table_data_column">
93 <a href="<%=request.getContextPath()%>/basket.jsp" title="Zum Warenkorb">Warenkorb</a>
95 <td class="table_data_column">
98 <td class="table_data_column">
99 <%=product.getTitle()%>
101 <td class="table_data_column" align="right">
102 <fmt:formatNumber type="currency"><%=product.getPrice()%></fmt:formatNumber>
108 // Then skip this item
112 <form action="<%=request.getContextPath()%>/form_handler/add_item.jsp" accept-charset="utf-8" id="form" method="post">
113 <table class="table">
116 <td class="table_data_column">
117 <input class="submit" type="submit" name="add" value="Hinzufügen" />
118 <input class="input" type="hidden" name="<%=PizzaApplication.HTTP_PARAM_ITEM_ID%>" value="<%=product.getItemId()%>" />
119 <input class="input" type="hidden" name="<%=PizzaApplication.HTTP_PARAM_ITEM_TYPE%>" value="Product" />
121 <td class="table_data_column">
122 <input class="input" type="text" name="<%=PizzaApplication.HTTP_PARAM_AMOUNT%>" size="3" maxlength="20" />
124 <td class="table_data_column">
125 <%=product.getTitle()%>
127 <td class="table_data_column" align="right">
128 <fmt:formatNumber type="currency"><%=product.getPrice()%></fmt:formatNumber>
140 <jsp:include page="/static/guest/guest_footer.jsp" flush="false" />