📄 shoucang.asp
字号:
<!--#include file="../conn/conn.asp"-->
<!--#include file="../conn/webconfig.asp"-->
<html><head><title><%=webname%>--我的收藏夹 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="img/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
<%
if request.Cookies("shopxp")("username")="" then
response.write "<script language=javascript>alert('对不起,您还没有登陆!');window.close();</script>"
response.End
end if
dim productid,username,action
action=request.QueryString("action")
username=trim(request.Cookies("shopxp")("username"))
productid=request.QueryString("id")
if InStr(action,"'")>0 then
response.write"<script>alert(""非法访问!"");window.close();</script>"
response.end
end if
if productid<>"" then
if not isnumeric(productid) then
response.write"<script>alert(""非法访问!"");window.close();</script>"
response.end
else
if not isinteger(productid) then
response.write"<script>alert(""非法访问!"");window.close();</script>"
end if
end if
end if
'//删除收藏
select case action
case "del"
conn.execute "delete from shop_action where actionid="&request.QueryString("actionid")
if request.QueryString("ll")=1 then
response.redirect "user.asp?action=shoucang"
else
response.redirect "user/shoucang.asp?action=show"
end if
response.End
case "add"
'//收藏,判断是否存在
set rs=server.CreateObject("adodb.recordset")
rs.open "select productid,username from shop_action where username='"&username&"' and productid="&productid&" and zhuangtai=6",conn,1,1
if not rs.eof and not rs.bof then
response.write "<script language=javascript>alert('对不起,此商品已存在于您的收藏架中,不可以重复添加!');window.location.href='shoucang.asp?action=show';</script>"
response.end
rs.close
set rs=nothing
else
'//判断收藏数
if rs.recordcount=10 then
response.write "<script language=javascript>alert('对不起,您最多只能收藏10件商品!');window.location.href='shoucang.asp?action=show';</script>"
response.end
else
rs.close
set rs=nothing
'//添加收藏
set rs=server.CreateObject("adodb.recordset")
rs.open "select productid,username,zhuangtai,zonger from shop_action",conn,1,3
rs.addnew
rs("productid")=productid
rs("username")=username
rs("zhuangtai")=6
rs("zonger")=0
rs.update
end if
rs.close
response.Redirect "user/shoucang.asp?action=show"
set rs=nothing
end if
case "show"
'//////////////////
response.write "<table width=96% border=0 align=center cellpadding=2 cellspacing=2><tr><td width=60% >"
response.write "</td><td width=40% valign=baseline><div align=right>您最多只能收藏十种商品</div></td></tr></table>"
set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_action.actionid,shop_action.productid,shop_product.productname,shop_product.shichangjia,shop_product.huiyuanjia,shop_product.vipjia,shop_product.dazhe from shop_product inner join shop_action on shop_product.productid=shop_action.productid where shop_action.username='"&request.Cookies("shopxp")("username")&"' and shop_action.zhuangtai=6",conn,1,1
%>
<table width=96% border=0 align=center cellpadding=2 cellspacing=1 bgcolor=#cccccc>
<form name='form1' method='post' action="sctogw.asp">
<%
response.write "<tr align=center><td width=8% bgcolor=#f1f1f1>选择</td>"
response.Write "<td width=42% bgcolor=#f1f1f1>商品名称</td>"
response.Write "<td width=14% bgcolor=#f1f1f1>市场价</td>"
response.Write "<td width=14% bgcolor=#f1f1f1>会员价</td>"
response.Write "<td width=14% bgcolor=#f1f1f1>VIP 价</td>"
response.Write "<td width=8% bgcolor=#f1f1f1>删 除</td></tr>"
do while not rs.eof
response.write "<tr><td bgcolor=#ffffff><div align=center><input name=productid type=checkbox checked value="&rs("productid")&" ></div></td>"
response.write "<td bgcolor=#ffffff STYLE='PADDING-LEFT: 5px'><div align=left><a href=product.asp?id="&rs("productid")&" >"&rs("productname")&"</a></div></td>"
response.write "<td bgcolor=#ffffff><div align=center>"&formatnumber(rs("shichangjia"),2)&"元</div></td>"
response.write "<td bgcolor=#ffffff><div align=center><font color=#dd6600>"&formatnumber(rs("huiyuanjia"),2)&"元</font></div></td>"
response.write "<td bgcolor=#ffffff><div align=center><font color=#FF3300>"&formatnumber(rs("vipjia"),2)&"元</font></div></td>"
response.write "<td bgcolor=#ffffff><div align=center>"
response.Write "<a href=user/shoucang.asp?action=del&actionid="&rs("actionid")&">"
response.Write "<img src=img/trash.gif border=0></a></div></td></tr>"
rs.movenext
loop
rs.close
set rs=nothing
%>
<tr>
<td height=36 colspan=6 bgcolor=#ffffff align=center>
<input class="go-wenbenkuang" onFocus="this.blur()" type="submit" name="submit" value=" 去收银台 ">
<input class="go-wenbenkuang" onFocus="this.blur()" onclick="javascript:window.close();" type=reset name="button" value=" 继续购物 ">
</td></tr></form></table>
<%end select%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -