]> git.mxchange.org Git - pizzaservice-war.git/blobdiff - web/index.jsp
Continued with project:
[pizzaservice-war.git] / web / index.jsp
index ab34c0855e7447ec68707603b4d1cdbb420604cd..31610d6b9dcd9f1e70227dc4d116b9d0a06a3f79 100644 (file)
@@ -4,7 +4,7 @@
        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.pizzaapplication.application.PizzaServiceApplication"%>
@@ -20,7 +20,7 @@
 <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" />
-               <link rel="stylesheet" href="style.css" type="text/css"/>
+               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
                <title><%=PizzaServiceApplication.MAIN_TITLE%> - Eingangsseite</title>
        </head>
 
@@ -37,7 +37,7 @@
                        </div>
 
                        <div id="content">
-                               <form action="<%=request.getContextPath()%>/preview.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>
 
                                        <tbody class="table_body">
                                                <%
+                                               // Get Iterator
+                                               Iterator<Product> iterator = app.getAvailableProducts();
+
                                                // "Walk" through all products and unmark them as ordered
-                                               for (final Product product : app.getUnmarkedProducts(session)) {
+                                               while (iterator.hasNext()) {
+                                                       // Get product instance
+                                                       Product product = iterator.next();
+
+                                                       // Unmark as ordered
+                                                       app.unmarkProductAsOrdered(product, session);
                                                        %>
                                                        <tr>
                                                                <td>
-                                                                       <input type="checkbox" name="<%=String.format(PizzaApplication.HTTP_PARAM_MASK, PizzaApplication.HTTP_PARAM_CHOOSE, product.getName())%>" value="1" <%=app.getCheckedHtmlFromProduct(product, request, session)%> />
+                                                                       <input type="checkbox" name="<%=String.format(PizzaApplication.HTTP_PARAM_MASK, PizzaApplication.HTTP_PARAM_CHOOSE, product.getId())%>" value="1" <%=app.getCheckedHtmlFromProduct(product, request, session)%> />
                                                                </td>
                                                                <td>
-                                                                       <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" />
+                                                                       <input type="text" name="<%=String.format(PizzaApplication.HTTP_PARAM_MASK, PizzaApplication.HTTP_PARAM_AMOUNT, product.getId())%>" value="<%=app.getAmountFromSession(product, session)%>" size="3" maxlength="20" />
                                                                </td>
                                                                <td>
                                                                        <%=product.getTitle()%>