⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 my_goods_management.jsp

📁 在eclispe下写的电子务平台
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java"%>
<%@ page import="java.sql.*"%>
<jsp:useBean scope="page" id="books" class="dlut.Books" />
<jsp:useBean scope="page" id="sorts" class="dlut.Sorts" />
<jsp:useBean scope="page" id="goods" class="dlut.Goods" />
<%
	//获取当前访问用户的用户名
	String s_UserName = (String) session.getAttribute("UserName");	
	if(s_UserName == null)
	{
		s_UserName = "";
	}		
	//获取当前访问用户的索引号
	long l_UserID = (Long) session.getAttribute("UserID");
	goods.setUserID(l_UserID);
	//获取当前访问用户购物车中的所有信息
	ResultSet rs = goods.showGoods();
%>
<!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>欢迎光临Books Online</title>
	<link rel=stylesheet type=text/css href="../lib/book.css">
	<style type="text/css">
<!--
.STYLE1 {color: #000000}
-->
    </style>
	</head>
	<body bgcolor="#F4FFFE">
	<div align="center">
	<table width="90%" cellpadding="0" cellspacing="0" border="1">
		<tr bgcolor="#0066FF">
		<td width="100%" height="30" colspan="6" align="center" bgcolor="#CCFF00"><font color="#000000"><%=s_UserName%> </font><span class="STYLE1">的购物车</span></td>
		</tr>
		<tr>
		<td width="25%" height="25" align="center"><span class="STYLE1">图书名称</span></td>
		<td width="15%" height="25" align="center"><span class="STYLE1">图书作者</span></td>
		<td width="20%" height="25" align="center"><span class="STYLE1">出版社</span></td>
		<td width="10%" height="25" align="center"><span class="STYLE1">价格</span></td>
		<td width="15%" height="25" align="center"><span class="STYLE1">购买数量</span></td>
		<td width="15%" height="25" align="center"><span class="STYLE1">从购物车中清除</span></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;
	%>
		<tr>
		<td width="25%" height="25" align="left">&nbsp;<a href="book_detail.jsp?BookID=<%=books.getBookID()%>" target="_self"><font color="#0000FF"><%=books.getBookName()%></font></a></td>
		<td width="15%" height="25" align="left">&nbsp;<%=books.getAuthor()%></td>
		<td width="20%" height="25" align="left">&nbsp;<%=books.getPub()%></td>
		<td width="10%" height="25" align="left">&nbsp;<%=books.getPrice()%></td>
		<td width="15%" height="25" align="center"><%=i_BuyNumber%></td>
		<td width="15%" height="25" align="center"><input type="button" name="btn" value="清除" onClick='javascript:window.location="delete_goods.jsp?GoodsID=<%=l_GoodsID%>"'></td>
		</tr>
	<%
		}
	%>
		<tr>
		<td height="30" align="center" colspan="6">总计:<font color="#0000FF"><%=total%></font>&nbsp;(RMB)</td>
		</tr>
	</table>
	<%rs.close();%>
	</div>
	</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -