- <ui:include src="/static/guest/guest_menu.xhtml" id="menu" />
-
- <div id="content_outer">
- <div id="content_title">
- <h2>Folgendes kann bestellt werden:</h2>
- </div>
-
- <div id="content">
- <h:panelGrid class="table" columns="4">
- <h:column class="table_header_column">Bestellen?</h:column>
- <h:column class="table_header_column">Anzahl:</h:column>
- <h:column class="table_header_column">Produkt:</h:column>
- <h:column class="table_header_column">Einzelpreis:</h:column>
- </h:panelGrid>
-
- <%
- // Get app instance
- PizzaApplication app = PizzaServiceApplication.getInstance(application);
-
- // Get Iterator
- Iterator<Product> iterator = app.getAvailableProducts();
-
- // "Walk" through all products and unmark them as ordered
- while (iterator.hasNext()) {
- // Get product instance
- Product product = iterator.next();
-
- // Get basket instance
- Basket<AddableBasketItem> basket = ItemBasket.getInstance(session);
-
- // Create an item instance form this product
- AddableBasketItem item = basket.getItem(product);
-
- // Has it been already added to the basket?
- if (item != null) {
- // Some nice output ...
- %>
- <h:panelGrid class="table" columns="4">
- <h:column class="table_header_column"><a href="#{path}/basket.jsp" title="Zum Warenkorb">Warenkorb</a></h:column>
- <h:column class="table_header_column"><%=item.getAmount()%></h:column>
- <h:column class="table_header_column"><%=product.getTitle()%></h:column>
- <h:column class="table_header_column"><f:convertNumber type="currency"><%=product.getPrice()%></f:convertNumber></h:column>
- </h:panelGrid>
- <%
- // Then skip this item
- continue;
- }
-
- // Unmark as ordered
- app.unmarkProductAsOrdered(product, session);
- %>
- <h:form>
- <h:panelGrid class="table" columns="4">
- <h:column class="table_header_column">
- <h:commandButton action="#{path}/form_handler/add_item.jsp" class="submit" value="Hinzufügen" />
- <input class="input" type="hidden" name="<%=PizzaApplication.HTTP_PARAM_ITEM_ID%>" value="<%=product.getId()%>" />
- <input class="input" type="hidden" name="<%=PizzaApplication.HTTP_PARAM_ITEM_TYPE%>" value="Product" />
- </h:column>
- <h:column class="table_header_column">
- <!--<h:inputText class="input" size="3" maxlength="20" />-->
- <input class="input" type="text" name="<%=PizzaApplication.HTTP_PARAM_AMOUNT%>" size="3" maxlength="20" />
- </h:column>
- <h:column class="table_header_column">
- <%=product.getTitle()%>
- </h:column>
- <h:column class="table_header_column right">
- <f:convertNumber type="currency"><%=product.getPrice()%></f:convertNumber>
- </h:column>
- </h:panelGrid>
- </h:form>
- <%
- }
- %>
- </div>
- </div>
-
- <ui:include src="/static/guest/guest_footer.xhtml" id="footer" />
-
- </h:body>
-</html>