<%@ page language="java" contentType="text/html; charset=GB2312"
	pageEncoding="GB2312"%>
<%@ page import="java.util.Collection,java.util.Iterator"%>
<%@ page import="com.wxpn.tutorial.ec.bean.ECOrderItem"%>
<%@ include file="../include/header.jsp"%>
<%if (session.getAttribute("username") == null
					|| session.getAttribute("username") == "") {
				response.sendRedirect("../member/login.jsp?url="
						+ request.getRequestURI());
			}

			%>
<html>
<head>
<title>购物车</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<table width="80%" border="0" bgcolor="#CCCCFF">
	<tr bgcolor="#9999FF">
		<td colspan="2">
		<div align="center"><b>购 物 车</b></div>
		</td>
	</tr>
</table>
<p>您的购物车中包含以下货物：</p>
<table width="80%" border="0" align="center">
	<tr bgcolor="#FFCCCC">
		<td width="15%">
		<div align="center"><font color="#0000FF">购买数量</font></div>
		</td>
		<td width="35%">
		<div align="center"><font color="#0000FF">书名</font></div>
		</td>
		<td width="15%">
		<div align="center"><font color="#0000FF">单价</font></div>
		</td>
		<td width="35%">
		<div align="center"><font color="#0000FF">总价格</font></div>
		</td>
	</tr>
	<%if (request.getAttribute("c") == null) {

			%>
	<tr>
		<td width="" 75%"" colspan=5 bgcolor="#FCFCFC" align=center>还没有任何订单。</td>
	</tr>
	<%} else {
				Collection c = (Collection) request.getAttribute("c");
				if (c == null) {

				%>
	<tr>
		<td width="" colspan=5 bgcolor="#FCFCFC" align=center>还没有任何订单。</td>
	</tr>
	<%} else {
					int totalPageNum = ((Integer) (request
							.getAttribute("totalPageNum"))).intValue();
					int currentPage = 1;
					if (request.getParameter("page") != null) {
						currentPage = Integer.parseInt(request
								.getParameter("page"));
					}
					Iterator iterator = c.iterator();
					double allprice = 0;
					while (iterator.hasNext()) {
						ECOrderItem orderitem = (ECOrderItem) iterator.next();

						%>
	<tr bgcolor="#CCFFCC">
		<td width="15%">
		<div align="center"><font color="#0000FF"> <%=orderitem.getBooknumber()%>
		</font></div>
		</td>
		<td width="35%">
		<div align="center"><font color="#0000FF"><%=orderitem.getBookname()%></font></div>
		</td>
		<td width="15%">
		<div align="center"><font color="#0000FF">&yen;<%=orderitem.getGoods_price()%></font></div>
		</td>

		<td width="35%">
		<div align="center"><font color="#0000FF">&yen;<%=(double) orderitem.getGoods_price()
								* orderitem.getBooknumber()%></font></div>
		</td>
	</tr>
	<%allprice = allprice
								+ (double) orderitem.getGoods_price()
								* orderitem.getBooknumber();
					}
%>

	<tr bgcolor="#CCCCFF">
		<td colspan="3">
		<div align="center"><font color="#0000FF">货物价格</font></div>
		</td>
		<td width="16%">
		<div align="center"><font color="#0000FF">&yen;<%=allprice%></font></div>
		</td>
	</tr>
	<tr>
		<td height="18" colspan="3" bgcolor="#CCCC99"><font color="#0000FF">&nbsp;
		</font>
		<div align="center"><font color="#0000FF">运输费用</font></div>
		</td>
		<td height="18" width="16%" bgcolor="#CCCC99">
		<div align="center"><font color="#0000FF">&yen;5.00</font></div>
		</td>
	</tr>
	<tr bgcolor="#66FF66">
		<td colspan="3">
		<div align="center"><b><font color="#FF0000">总费用</font></b></div>
		</td>
		<td width="16%">
		<div align="center"><b><font color="#FF0000">&yen;<%=allprice + 5%></font></b></div>
		</td>
	</tr>
	<tr align="center">
		<td colspan="4"><a href="javascript:close();">关闭窗口</a>|<a
			href="javascript:print();">打印订单</a></td>
	</tr>
	<%}
			}

		%>
</table>
</div>
</body>
</html>
