<%-- 
/**
  * 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
  */
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<SCRIPT LANGUAGE="JavaScript" SRC="moduser.js"></SCRIPT>

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

    <!-- Content begins here -->

<div id="form">

    <jsp:include page="messages.jsp" />

    <!-- Include the form itself -->
    <form class="updateOrderForm" action="<c:url value="/admin/editStatus.do"/>" method="post">
    
    <div class="formheader">
        <span>Order Status</span>
    </div>
	<div class="orderlist">
		<c:forEach items="${command.ordersList}" var="prop" varStatus="loopStatus">
		
		<span class="orderid"> # <c:out value="${prop.orderId}"/></span>
		<span class="user"> <c:out value="${prop.userName}"/>  </span>
		<span class="label"> <a href="<c:url value="/viewItem.do"><c:param name="itemId" value="${prop.itemId}"/></c:url>">
			          <c:out value="${prop.itemName}"/></a></span>
		<span class="qty"><c:out value="${prop.itemQuantity}"/></span>
		<span class="price">
		<fmt:formatNumber value="${prop.orderCost}" pattern="$#,##0.00" />
        </span>
        
        <span class="status">
				<spring:bind path="command.ordersList[${loopStatus.index}].orderStatus">
					<select name="${status.expression}">
						<option value="Ordered" <c:if test="<%= status.getValue().equals(\"Ordered\") %>">SELECTED</c:if>>Ordered</option>
						<option value="Shipped" <c:if test="<%= status.getValue().equals(\"Shipped\") %>">SELECTED</c:if>>Shipped</option>
						<option value="Delivered" <c:if test="<%= status.getValue().equals(\"Delivered\") %>">SELECTED</c:if>>Delivered</option>

					</select>					
				</spring:bind>		
			</span> 
          
          <br/>&nbsp<br/>
           
		</c:forEach>  

	</div>

<p/>
	<div class="spacer"></div>
	<p/>
	<input type="submit" name="update-order" value="Save"/>

    </form>

    <!-- This is necessary to force the parent to expand and include floating divs -->
    <br style="clear:both">
</div>

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