<%-- 
/**
  * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  * USA
  *
  * Component of: Red Hat Application Server
  * 
  * Initial Developers: Aizaz Ahmed
  *                     Vivek Lakshmanan
  *                     Andrew Overholt
  *                     Matthew Wringe
  *
  */
--%>

<%@ page contentType="text/html"
     import="olstore.util.WebUtils"
	 import="olstore.framework.EJBHomeFactory"
%>

<%
    EJBHomeFactory factory = EJBHomeFactory.getInstance();
%>

<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>


<% request.setAttribute ( "page_title", "Checkout and Confirm Order" ); %>
    <jsp:include page="../nav/Header.jsp" />


<div id="form">
<jsp:include page="../general/Messages.jsp" />
<!-- Content begins here -->
 
<p> <div class="formHeader"> Items in Cart </div>
<html:form action="/checkout/Checkout.do">
<html:hidden property="submitType"/>

	<logic:iterate name="CheckoutForm" property="cartEntries" id="cartItem" indexId="i" >
		<div class="checkOutListView">
			<div class="spacer" ></div>
			<span class="label"> <html:link action = "/views/Item.do" paramId="itemId" paramName="cartItem" paramProperty="itemId"> 
							<bean:write name="cartItem" property="name"/> 
					     </html:link> 
			</span>
			<span class="qty">
				<html:text indexed = "true" name="cartItem" size="4" property="quantity"/>
			</span>
    			<span class="price">
				<bean:define name="cartItem" property="price" id = "price" type="java.math.BigDecimal"/>
				$<%= WebUtils.costDisplay(price)  %>
			</span>
    		     	<div class="spacer"></div>
		</div>
	</logic:iterate>

<hr>

<div class="itemsAndCosts">
	<div class="spacer" ></div>
	<span class="label">
		Total value of your selections so far
	</span>
	<span class="costs">
		<bean:define id="cost" name="CheckoutForm" property="totalCost" type="java.math.BigDecimal"/>
		$<%= WebUtils.costDisplay(cost) %>
	</span>
	<div class="spacer" ></div>
</div>

<div class="itemsAndCosts">
	<div class="spacer" ></div>
	<span class="items"> <html:submit value="update" onclick="this.form.submitType.value='update'"/> </span>
	<span class="costs">
		<html:submit value="order" onclick="this.form.submitType.value='submit'"/>
	</span>
	<div class="spacer" ></div>
</div>

</html:form>
	<div class="spacer" ></div>
		<br style="clear:both" />
	</div>


    <jsp:include page="../nav/Footer.jsp" />
