Author : Roland Haeder
--%>
-<%@page errorPage="errorHandler.jsp" %>
+<%--<%@page errorPage="errorHandler.jsp" %>--%>
<%@page import="java.util.Map"%>
<%@page import="java.util.Iterator"%>
-<%@page import="org.mxchange.pizzaservice.service.Service"%>
-<%@page import="org.mxchange.pizzaservice.product.Product"%>
-<%@page import="org.mxchange.pizzaservice.service.PizzaService"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
+<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
+<%@page import="org.mxchange.pizzaapplication.product.Product"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
- // Init service instance
- Service service = PizzaService.getInstance(application);
+ // Init application instance
+ PizzaApplication app = PizzaServiceApplication.getInstance(application);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title><%=PizzaService.MAIN_TITLE%> - Eingangsseite</title>
+ <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
+ <title><%=PizzaServiceApplication.MAIN_TITLE%> - Eingangsseite</title>
</head>
<body>
<div id="title">
- <h1><%=PizzaService.MAIN_TITLE%> - Eingangsseite</h1>
+ <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Eingangsseite</h1>
</div>
- <div id="menu">
- <ul>
- <li><a href="index.jsp" title="Eingangsseite">Home</a></li>
- <li><a href="order.jsp" title="Bestellseite">Bestellung</a></li>
- <li><a href="finished.jsp" title="Bestellung abgeschlossen">Vielen Dank</a></li>
- <li><a href="bye.jsp" title="Sitzung beennden">Sitzung beenden</a></li>
- </ul>
- </div>
+ <jsp:include page="/static/menu.jsp" flush="true" />
<div id="content_outer">
<div id="content_title">
</div>
<div id="content">
- <form action="order.jsp" accept-charset="utf-8" id="form" method="post">
+ <form action="<%=request.getContextPath()%>/form_handler/do_preview.jsp" accept-charset="utf-8" id="form" method="post">
<table class="table">
<thead class="table_header">
<tr>
</th>
</tr>
</thead>
+
<tbody class="table_body">
<%
- // Get iterator from products
- Iterator<Map.Entry<String, Product>> iterator = service.getProductsIterator();
-
- // Iterate over all
- while (iterator.hasNext()) {
- // Get entry
- Map.Entry<String, Product> entry = iterator.next();
-
- // Get product
- Product product = entry.getValue();
- service.unmarkProductAsOrdered(product, session);
+ // "Walk" through all products and unmark them as ordered
+ for (final Product product : app.getUnmarkedProducts(session)) {
%>
<tr>
<td>
- <input type="checkbox" name="<%=String.format(Service.HTTP_PARAM_MASK, Service.HTTP_PARAM_CHOOSE, product.getName())%>" value="1" <%=service.getCheckedHtmlFromProduct(product, request, session)%> />
+ <input type="checkbox" name="<%=String.format(PizzaApplication.HTTP_PARAM_MASK, PizzaApplication.HTTP_PARAM_CHOOSE, product.getName())%>" value="1" <%=app.getCheckedHtmlFromProduct(product, request, session)%> />
</td>
<td>
- <input type="text" name="<%=String.format(Service.HTTP_PARAM_MASK, Service.HTTP_PARAM_AMOUNT, product.getName())%>" value="<%=service.getAmountFromSession(product, session)%>" size="3" maxlength="20" />
+ <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" />
</td>
<td>
<%=product.getTitle()%>
<%
}
%>
+
<tr>
<td colspan="4" class="table_footer">
<input type="reset" value="Formular zurücksetzen" />