📄 goods_sall_his.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java"%>
<%@ page import="java.sql.*"%>
<jsp:useBean scope="page" id="books" class="mypkg.books" />
<jsp:useBean scope="page" id="goods" class="mypkg.goods" />
<%
//获取当前访问用户的用户名
String s_UserName = (String) session.getAttribute("UserName");
if(s_UserName == null)
{
s_UserName = "";
}
//获取当前访问用户的索引号
//获取当前访问用户购物车中的所有信息
ResultSet rs = goods.showsall();%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>欢迎光临网上书店</title>
<link rel=stylesheet type=text/css href="../lib/book.css">
</head>
<body bgcolor="#F4FFFE">
<form name="form1" method="post" action="user_form.jsp">
<label><br>
<br><div align="center">
<table width="774" height="225" cellspacing="0" cellpadding="0" border="1">
<tr bgcolor="#0066ff">
<td height="38" align="center" colspan="5"><font color="#ff0000"> 销售历史</font> </td>
</tr>
<tr>
<td width="19%" height="25" align="center"><font color="#0000ff">图书名称</font></td>
<td width="11%" height="25" align="center"><font color="#0000ff">图书作者</font></td>
<td width="26%" height="25" align="center"><font color="#0000ff">出版社</font></td>
<td width="7%" height="25" align="center"><font color="#0000ff">价格</font></td>
<td width="11%" height="25" align="center"><font color="#0000ff">购买数量</font></td>
</tr>
<%
float total = 0; //所有商品的总价
//循环显示所有购物信息
while(rs.next())
{
long l_GoodsID = rs.getLong("GoodsID");
books.setBookID(rs.getLong("BookID"));
books.init();
int i_BuyNumber = rs.getInt("BuyNumber");
//计算商品总价
total = i_BuyNumber * books.getPrice() + total;
String bookname=books.getBookName();
float price=books.getPrice();
int number=i_BuyNumber;
String author=books.getAuthor();
%>
<tr>
<td width="19%" height="25" align="left"> <a href="book_detail.jsp?BookID=<%=books.getBookID()%>" target="_self"><font color="#0000ff"><%=bookname%></font></a></td>
<td width="11%" height="25" align="left"> <%=author%></td>
<td width="26%" height="25" align="left"> <%=books.getPub()%></td>
<td width="7%" height="25" align="left"> <%=price%></td>
<td width="11%" height="25" align="center"><%=number%><br></td>
</tr>
<%
}
%>
<tr>
</tr>
<tr>
</tr>
</table>
<p><%rs.close();%>
</p>
</div>
</label>
<br>
<div align="center"><label>
</label></div></form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -