<%@page language="java" contentType="text/html; charset=Windows-31J"%>
<%@page import="jp.ossc.petstore.OpenstandiaConst"%>
<%@page import="jp.ossc.petstore.common.Cart"%>
<%@page import="jp.ossc.petstore.common.CartItem"%>
<%@taglib uri="/tags/struts-bean" prefix="bean" %>
<%@taglib uri="/tags/struts-html" prefix="html" %>
<%@taglib uri="/tags/struts-logic" prefix="logic" %>

<%-- エラー表示エリア --%>
<html:messages id="msg" message="false">
	<font color="#ff0000"><b><bean:write name="msg"/></b></font><br />
</html:messages>
<html:messages id="msg" message="true">
	<font color="#ff0000"><b><bean:write name="msg"/></b></font><br />
</html:messages>
<%-- エラー表示エリア --%>

<logic:present name="<%=OpenstandiaConst.ENV_SES_ATRBT_CART%>">
<html:form action="UpdateCart" >
<h1>商品情報</h1>
	<table width="520" border="0" cellspacing="0" cellpadding="0" id="cartTable">
		<tr>
			<th>商品名</th>
			<th>金額</th>
			<th>注文数</th>
			<th>合計金額</th>
			<th>削除</th>
		</tr>
	<logic:iterate id="item" name="<%=OpenstandiaConst.ENV_SES_ATRBT_CART%>" property="itemList" type="CartItem">
		<tr>
			<td><bean:write name="item" property="name"/></td>
			<td align="right"><bean:write name="item" property="price" format="###,###,###,###"/>円</td>

			<td align="center">
				<html:text property="quantity" name="item" maxlength="2" size="3"/>
			</td>

			<td align="right"><bean:write name="item" property="totalPrice" format="###,###,###,###"/>円</td>
			<td align="center">
				<html:link action="DeleteCart" paramId="product_id" paramName="item" paramProperty="id">
					<img src="images/delete.gif" width="35" height="23" border="0" />
				</html:link>
			</td>
			<input type="hidden" name="product_id" value="<bean:write name="item" property="id"/>" />
		</tr>
	</logic:iterate>
		<tr>
			<td colspan="2" align="right" id="goukei">合計</td>
			<td colspan="2" align="right"><bean:write name="<%=OpenstandiaConst.ENV_SES_ATRBT_CART%>" property="totalPrice" format="###,###,###,###"/>円</td>
			<td>&nbsp;</td>
		</tr>
	</table>
	<br />
	<center>
	<table>
		<tr>
			<td>
				<html:submit value="注文数変更を反映"/>
			</td>
				</html:form>
				<html:form action="Register" method="post">
			<td width="20"></td>
			<td>
				<html:submit value="レジへ進む"/>
			</td>
				</html:form>
		</tr>
	</table>
	</center>
</logic:present>
