<%--
  % This Javer Server Page is part of the iX JSP tutorial.
  % The user can choose a pizza plus some additional 
  % ingredients
 --%>


<%-- Setting up an error page --%>
<%@ page errorPage="/jspTutorial/errorpage.jsp" %>
<%@ taglib uri="/ixtaglib" prefix="jsptut" %>


<%-- import needed java classes --%>	 
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="de.ix.jspTutorial.model.Customer" %>
<%@ page import="de.ix.jspTutorial.model.Pizza" %>
<%@ page import="de.ix.jspTutorial.model.PizzaList" %>
<%@ page import="de.ix.jspTutorial.model.PersonalPizza" %>
<%@ page import="de.ix.jspTutorial.model.Ingredient" %>
<%@ page import="de.ix.jspTutorial.model.IngredientList" %>



<%-- get model manager --%>
 <jsp:useBean
     id    = "pizzaModelManager"
     class = "de.ix.jspTutorial.controller.ModelManager"
     scope = "session"
 />

<%	
   Customer customer           = pizzaModelManager.getCustomer();
   pageContext.setAttribute("Customer",customer) ;
   PersonalPizza personalPizza = pizzaModelManager.getPersonalPizza();  
%>

<HTML>
<HEAD>
	<TITLE>PIZZA SERVICE ONLINE - CONFIRM</TITLE>
</HEAD>

<BODY BGCOLOR="#FFFFFF" LINK="#406E6E" ALINK="#406E6E" VLINK="#406E6E">


<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR VALIGN="top">
	<TD WIDTH="115"><A HREF="index.jsp"><IMG SRC="logo.gif" WIDTH="115" HEIGHT="115" ALT="" BORDER="0"></A></TD>
	<TD WIDTH="50">&nbsp;</TD>
	<TD WIDTH="500"><FONT FACE="Arial,Helvetica" SIZE="2">
	<FONT SIZE="5" COLOR="#406E6E"><B><I>Bestätigung</I></B></FONT><BR>
	<BR>
	Vielen Dank für Ihre Bestellung.<BR>
	<BR>
	Folgende Bestellung ist bei uns eingegangen:<BR>
	<BR> 
	<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
	<TR BGCOLOR="#406E6E">
		<TD WIDTH="280"><FONT FACE="Arial,Helvetica" SIZE="2" COLOR="#FFFFFF">&nbsp;Position</TD>
		<TD WIDTH="20"><FONT FACE="Arial,Helvetica" SIZE="2" COLOR="#FFFFFF">&nbsp;</TD>
		<TD WIDTH="100"><FONT FACE="Arial,Helvetica" SIZE="2" COLOR="#FFFFFF">&nbsp;Preis</TD>
	</TR>
	<TR VALIGN="top">
		<TD><FONT FACE="Arial,Helvetica" SIZE="2">&nbsp;Pizza: <%=personalPizza.getName() %>, <%=personalPizza.getSize() %></TD>
		<TD WIDTH="20">&nbsp;</TD>
		<TD><FONT FACE="Arial,Helvetica" SIZE="2">&nbsp;DM <jsptut:currency value="<%=(personalPizza.getBasePrice())%>"/></TD>
	</TR>

  	
<jsptut:foreach item="Ingredient" list="<%=personalPizza.getIngredients()%>" >
	<%	
	   Ingredient ingredient = (Ingredient)pageContext.findAttribute("Ingredient")  ;
	%>

<TR VALIGN="top">
		<TD><FONT FACE="Arial,Helvetica" SIZE="2">&nbsp;Extra <jsp:getProperty name="Ingredient" property="name"/></TD>
		<TD WIDTH="20">&nbsp;</TD>
		<TD><FONT FACE="Arial,Helvetica" SIZE="2">&nbsp;DM <jsptut:currency value="<%=ingredient.getPrice()%>"/></TD>
	</TR>	
	</jsptut:foreach>

  <TR VALIGN="top" BGCOLOR="#406E6E">
		<TD COLSPAN="3"><IMG SRC="blank.gif" WIDTH="1" HEIGHT="1"></TD>
	</TR>	
	<TR VALIGN="top">
		<TD><FONT FACE="Arial,Helvetica" SIZE="2">&nbsp;<B>Gesamtbetrag</B></TD>
		<TD WIDTH="20">&nbsp;</TD>
		<TD><FONT FACE="Arial,Helvetica" SIZE="2">&nbsp;<B>DM <jsptut:currency value="<%=personalPizza.calcTotalPrice()%>"/></B></TD>
	</TR>			
	</TABLE>		
	<BR>
	<BR>
	Die Bestellung wird an folgende Adresse geliefert:<BR>
	<BR>	
	<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
	<TR BGCOLOR="#406E6E">
		<TD WIDTH="350"><FONT FACE="Arial,Helvetica" SIZE="2" COLOR="#FFFFFF">&nbsp;Lieferadresse</TD>		
	</TR>
	<TR VALIGN="top">
		<TD><FONT FACE="Arial,Helvetica" SIZE="2">&nbsp;Kundennummer&nbsp;&nbsp;<jsp:getProperty name="Customer" property="id" /></TD>
	</TR>
	<TR VALIGN="top"><TD>&nbsp;</TD></TR>
	<TR VALIGN="top">
		<TD><FONT FACE="Arial,Helvetica" SIZE="2">&nbsp;<jsp:getProperty name="Customer" property="firstname" />&nbsp;<jsp:getProperty name="Customer" property="lastname" /></TD>
	</TR>	
	<TR VALIGN="top">
		<TD><FONT FACE="Arial,Helvetica" SIZE="2">&nbsp;<jsp:getProperty name="Customer" property="address1" /></TD>
	</TR>	
	<TR VALIGN="top">
		<TD><FONT FACE="Arial,Helvetica" SIZE="2">&nbsp;<jsp:getProperty name="Customer" property="address2" /></TD>
	</TR>	
	<TR VALIGN="top">
		<TD><FONT FACE="Arial,Helvetica" SIZE="2">&nbsp;<jsp:getProperty name="Customer" property="zip" />&nbsp;<jsp:getProperty name="Customer" property="town" /></TD>
	</TR>	
	</TABLE>
	<BR>
	<BR>
	Leider bekommen Sie auch im 3. Teil des Tutorials nur eine <i>virtuelle Pizza</i> geschickt.
	<BR>
	<BR>
	<BR>
	<%@ include file="/jspTutorial/includes/copyright.html"%>
	</FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>