<%-- 
/**
  * 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"
%>

<%--
    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", "Edit Order Status" ); %>
    <jsp:include page="../nav/Header.jsp" />


<div id="form">
<jsp:include page="../general/Messages.jsp" />
<!-- Content begins here -->

<%--
            Collection orderStatus = new Vector();
	    orderStatus.add("Ordered");
	    orderStatus.add("Shipped");
	    orderStatus.add("Delivered");
            pageContext.setAttribute("orderStatus", orderStatus, PageContext.REQUEST_SCOPE);
--%>
<logic:notEmpty name="UpdateOrderStatusForm" property="orders" >
<p> <div class="formHeader"> Order Status </div>
<html:form action="/admin/EditStatus">
<html:hidden property="submitType"/>
<html:hidden property="numOrders" />
	<logic:iterate name="UpdateOrderStatusForm" property="orders" id="orderEntry" >

		<div class="orderlist">
			<div class="spacer" ></div>
			<span class="orderid"> #<bean:write name="orderEntry" property="orderId"/> </span>
			<span class="user"> <bean:write name="orderEntry" property="userName"/>  </span>
			<span class="label"> <html:link action = "/views/Item.do" paramId="itemId" paramName="orderEntry" paramProperty="itemId" > 
						<bean:write name="orderEntry" property = "itemName" />
					     </html:link>
			</span>
    			<span class="qty">
				<bean:write name="orderEntry" property="itemQuantity" />
			</span>
    			<span class="price">
				< bean:define name="orderEntry" property="orderCost" id = "cost" type="java.math.BigDecimal" />
				$<%= WebUtils.costDisplay(cost)  %>	 
		        </span>
			<span class="status">
				<html:select indexed="true" name="orderEntry" property="orderStatus" >
					<html:option value="Ordered"> Ordered </html:option>
					<html:option value="Shipped" > Shipped </html:option> 
					<html:option value="Delivered" > Delivered </html:option> 
			        </html:select>
			<html:hidden indexed="true" name="orderEntry" property="orderId" />
			</span> 
    		     	<div class="spacer"></div>
		</div>

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


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


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