📄 basket.asp
字号:
<%@ CODEPAGE = "936" %>
<!--#include file="conn.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css.css">
<title><%if session("user_name")<>"" then%> <%=session("user_name")%>的购物车
<%else
response.write "购物车"
end if%></title>
</head>
<body bgcolor="ffffff">
<div align="center">
<table border="1" width="488" cellspacing="0" cellpadding="5" bordercolorlight="#CCCCCC" bordercolordark="#CCCCCC">
<%
if session("user_name")="" then %>
<tr>
<td bgcolor="#FFFFFF">
<div align="center">
<% response.write "您尚未登录或不是本站会员!"
response.write "<br>请登录后再订购本站货物!"
end if
if trim(request("hw_id"))="" then
response.write "没有此货物"
response.end
end if %>
<%
ReqNum = request("hw_id")
if not isNumeric (ReqNum) then
response.write "参数必须为数字型!"
response.end
end if
ReqNum = int(request("hw_id"))
%>
</div>
</td>
</tr>
<% dim rs,sql
sql="select * from hw where hw_id="&ReqNum
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,3
%>
<tr>
<td bgcolor="000000" height="1"></td>
</tr>
<tr>
<td width="96%" bgcolor="f7f7f7" height="18">
<div align="center">
<font color="#FF0000">
<b>※ 物品信息 ※</b>
</font>
</div>
</tr>
<tr>
<td bgcolor="000000" height="1"></td>
</tr>
<tr>
<td width="96%" bgcolor="#FFFFFF">
<form method="POST" action="buy.asp?action=buy&hw_id=<%=rs("hw_id")%>&hw_name=<%=rs("hw_name")%>&hw_cash=<%=rs("hw_cash1")%>">
<table border="0" width="95%" cellspacing="1">
<tr>
<td width="95%">
<table border="0" width="104%" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF">
<td width="20%" align="center">商品编号</td>
<td width="20%" align="center">商品名称</td>
<td width="20%" align="center">商品单价</td>
<td width="20%" align="center">订购数量</td>
<td width="20%" align="center">确认购买</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%" align="center"><%=rs("hw_id")%></td>
<td width="20%" align="center"><%=rs("hw_name")%></td>
<td width="20%" align="center">
<p align="center"><%=rs("hw_cash1")%>元</td>
<td width="20%" align="center"><select size="1" name="count">
<%for i = 1 to 100%>
<option><%=i%></option>
<%next%>
</select></td>
<td width="20%" align="center">
<p align="center"><input type="submit" value="确定" name="B1"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
<%rs.close
%>
<tr>
<td width="96%"></td>
</tr>
<tr>
<td width="96%" bgcolor="#FFFFFF">
<div align="right">
<font color="#FF0000">[</font><a href="buy.asp"><font color="#FF0000">查看购物车</font></a><font color="#FF0000">]</font>
<font color="#FF0000">[</font><a href="cash.asp" target="blank"><font color="#FF0000">收银台</font></a><font color="#FF0000">]</font><font color="666666">
</font><font color="#FF0000">[</font><a href="clear.asp"><font color="#FF0000">清空购物车</font></a><font color="#FF0000">] </font><a href='javascript:close()'><font color="#FF0000">[关闭窗口]</font></a>
</div>
</td>
</tr>
<tr>
<td bgcolor="000000" height="1"></td>
</tr>
<tr>
<td width="96%" bgcolor="f7f7f7" height="18">
<p align="center"><font color="#FF0000">※ 您已选购的货物如下 ※</font></td>
</tr>
<tr>
<td bgcolor="000000" height="1"></td>
</tr>
<tr>
<td width="96%" bgcolor="#FFFFFF">
<table border="0" width="98%" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">
<tr>
<td width="20%" bgcolor="#FFFFFF" align="center">商品编号</td>
<td width="20%" bgcolor="#FFFFFF" align="center">商品名称</td>
<td width="20%" bgcolor="#FFFFFF" align="center">商品单价</td>
<td width="20%" bgcolor="#FFFFFF" align="center">订购数量</td>
<td width="13%" bgcolor="#FFFFFF" align="center">合计</td>
</tr>
<%sql="select * from basket where user_name='"&session("user_name")&"' and basket_check=false"
rs.open sql,conn,3,3
if rs.eof then
%>
<tr>
<td width="93%" bgcolor="#FFFFFF" colspan="5">您没有选择任何商品</td>
</tr>
<%else
do while not rs.eof%>
<tr>
<td width="20%" bgcolor="#FFFFFF" align="center"><%=rs("hw_id")%></td>
<td width="20%" bgcolor="#FFFFFF" align="center"><%=rs("hw_name")%></td>
<td width="20%" bgcolor="#FFFFFF" align="center"><%=rs("hw_cash")%>元</td>
<td width="20%" bgcolor="#FFFFFF" align="center"><%=rs("basket_count")%></td>
<td width="13%" bgcolor="#FFFFFF" align="center"><%=rs("basket_count")*rs("hw_cash")%>元</td>
</tr>
<%totalcash=totalcash+(rs("basket_count")*rs("hw_cash"))%>
<%rs.movenext
loop
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<tr>
<td width="80%" bgcolor="#FFFFFF" colspan="4">
<p align="center">总计</td>
<td width="13%" bgcolor="#FFFFFF" align="center"><font color="red"><%=totalcash%></font>元</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="96%"></td>
</tr>
</table>
</div>
</body>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -