📄 goodslist.jsp
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*"%>
<%@page import="java.sql.*,java.lang.Double.*"%>
<%@include file="comm.jsp"%>
<html>
<body >
<div>
<table>
<tr>
<td width="236" align=center valign=top><br>
<p ><font color="#000080"><a href=CustomerInfo.jsp?action=view>我的资料</a></font></p>
<p>商品信息
<br> <a href="GoodsList.jsp?type=1">可用商品</a>
</p>
<p>我的购物车
<br> <a href="CartInfo.jsp?action=view&type=1">未提交订单</a>
<br> <a href="CartInfo.jsp?action=view&type=2">已提交订单</a>
<br> <a href="CartInfo.jsp?action=view&type=3">已发货订单</a>
</p>
<p>帐单管理
<br> <a href="CustomerBill.jsp?action=view&type=1">已汇款帐单</a>
<br> <a href="CustomerBill.jsp?action=view&type=2">已确认帐单</a>
</td>
<%
String CustomerID=(String)session.getValue("user");
String Type=request.getParameter("type"); //用于判断商品查看类型
int iType=Integer.parseInt(Type);
if(CustomerID==null)
{%>
<jsp:forward page="CustomerLogin.htm"/>
<%}%>
<td align=center valign=top>
<p align=center>欢迎您:<%=CustomerID%></p>
<table>
<tr bgcolor=#E9E9D1>
<td width=59>ID</td>
<td width=169>商品名</td>
<td width=159>商品类型</td>
<td width=70>单价</td>
<td width=80>当前数量</td>
<td width=50></td>
</tr>
<%
strSql="{call dbo.sp_GetAllGoods(?)}";
cstmt=conn.prepareCall(strSql);
cstmt.setInt(1,iType);
rs=cstmt.executeQuery();
while(rs.next())
{
%>
<tr bgcolor="#EAFfFff">
<td><%=rs.getInt(1)%></td>
<td><%=new String(rs.getString(2).getBytes("8859_1"),"gb2312")%></td>
<td><%=new String(rs.getString(3).getBytes("8859_1"),"gb2312")%></td>
<td><%=rs.getDouble(4)%></td>
<td><%=rs.getInt(5)%></td>
<%if(iType==1) {%>
<td><a href=CartInfo.jsp?action=insert&type=1&GoodsID=<%=rs.getString(1)%>&Price=<%=rs.getDouble(4)%>>购买</a></td>
<%}%>
</tr>
<%}%>
</table>
</td>
<%
rs.close();
cstmt.close();
conn.close();
%>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -