<%-- 
/**
  * 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
  * Developers: Greg Lapouchnian
  * 			Patrick Smith
  */
--%>
<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<jsp:include page="common/header.jsp" />

<div id="form">
<jsp:include page="messages.jsp" />

<!-- Content begins here -->
 
<p> <div class="formHeader"> Items in Cart </div>

<c:if test="${cart.numberOfItems == 0}">
Your cart is empty.
</c:if>

<c:if test="${cart.numberOfItems != 0}">
<form action="<c:url value="/store/cart.do"/>" method="post">
<input type="hidden" name="action" value="update"/>

<c:forEach var="item" items="${cart.items}">

		<div class="checkOutListView">
			<div class="spacer" ></div>
			<span class="label"> <a href="<c:url value="/store/viewItem.do"><c:param name="itemId" value="${itemId}"/></c:url>">
			          <c:out value="${item.name}"/></a>
			</span>
			<span class="qty">
				<input type="text" size="4" name="<c:out value="${item.itemId}"/>" value="<c:out value="${item.quantity}"/>" />
			</span>
    			<span class="price">
					<fmt:formatNumber value="${item.price}" pattern="$#,##0.00" />
				</span>
    		    <div class="spacer"></div>
		</div>
</c:forEach>

<hr>

<div class="itemsAndCosts">
	<div class="spacer" ></div>
	<span class="label">
		Total value of your selections so far
	</span>
	<span class="costs">
		<fmt:formatNumber value="${cart.totalCost}" pattern="$#,##0.00" />
	</span>
	<div class="spacer" ></div>
</div>

<div class="itemsAndCosts">
	<div class="spacer" ></div>
	<span class="items"><input type="submit" name="submit" value="Update"/></span>
	<span class="costs">
		<a href="<c:url value="/store/cart.do">
			<c:param name="action" value="order"/>
		    </c:url>">
			Order</a>
	</span>
	<div class="spacer" ></div>
</div>

</form>
</c:if>

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

	
<jsp:include page="common/footer.jsp" />