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

📄 shoucang.asp

📁 BJXSHOP购物管理系统是一个功能完善、展示信息丰富的电子商店销售平台;针对企业与个人的网上销售系统;开放式远程商店管理;完善的订单管理、销售统计、结算系统;强力搜索引擎支持;提供网上多种在线支付方
💻 ASP
字号:
<!--#include file="connection.asp"-->
<!--#include file="webconfig.asp"-->
<html>
<head>
<title><%=webname%>--我的收藏架</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/default.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="3" topmargin="5" marginwidth="0" marginheight="0">
<%
if request.cookies("bookshop")("username")="" then
response.write "<script language=javascript>window.location.reload('login.asp')</script>"
response.End
end if
dim bookid,username,action
action=request.QueryString("action")
username=trim(request.cookies("bookshop")("username"))
if request.QueryString("id")="" then
bookid=request("bookid")
else
bookid=replace(request.QueryString("id"),"'","")
end if
select case action
case "del"			'//删除收藏
conn.execute "delete from shop_action where actionid="&request.QueryString("actionid")
if request.QueryString("ll")=22 then
response.redirect "myuser.asp?action=shoucang"
else
response.redirect "shoucang.asp?action=show"
end if
response.End
case "delall"		'//完全删除
conn.execute "delete from shop_action where username='"&request.cookies("bookshop")("username")&"' and zhuangtai=6"
response.write "<script language=javascript>alert('您的收藏架已完全清空!');window.location.reload('myuser.asp?action=shoucang')</script>"
case "add"			'//加入收藏
'//收藏,判断是否存在
dim ckxp		'//先单个读取bookid
if bookid="" then
response.write "您没有选择要收藏的图书!"
response.End
end if
set ckxp=server.CreateObject("adodb.recordset")
ckxp.open "select bookid,bookname from shop_books where bookid in ("&bookid&") ",conn,1,1
do while not ckxp.eof
set rs=server.CreateObject("adodb.recordset")
rs.open "select bookid,username from shop_action where username='"&username&"' and bookid="&ckxp("bookid")&" and zhuangtai=6",conn,1,1
if not rs.eof and not rs.bof then
response.write "<script language=javascript>alert('对不起,《"&trim(ckxp("bookname"))&"》已存在于您的收藏架中,不可以重复添加!');window.location.reload('shoucang.asp?action=show')</script>"
response.end
rs.close
set rs=nothing
end if
ckxp.movenext
loop
ckxp.close
set ckxp=nothing
'//判断收藏数
'set rs=server.CreateObject("adodb.recordset")
'rs.open "select bookid,username from shop_action where username='"&username&"'  and zhuangtai=6",conn,1,1
'if rs.recordcount>19 then
'if request.cookies("bookshop")("grtt")<>1 then
'response.write "<script language=javascript>alert('对不起,您的商品收藏已达到20个!');window.location.reload('shoucang.asp?action=show')</script>"
'response.end
'end if
'end if
'//添加收藏
set ckxp=server.CreateObject("adodb.recordset")
ckxp.open "select bookid from shop_books where bookid in ("&bookid&") ",conn,1,1
do while not ckxp.eof
response.write ckxp("bookid")
response.write bookid
set rs=server.CreateObject("adodb.recordset")
rs.open "select bookid,username,zhuangtai,zonger from shop_action",conn,1,3
rs.addnew
rs("bookid")=int(ckxp("bookid"))
rs("username")=username
rs("zhuangtai")=6
rs("zonger")=0
rs.update
ckxp.movenext
loop
ckxp.close
set ckxp=nothing

rs.close
response.Redirect "shoucang.asp?action=show"
set rs=nothing

case "show"
'///////////////////////////////////////////%>
<!--#include file="subuser.asp"-->
<%response.write "<table width=96% border=0 align=center cellpadding=2 cellspacing=2><tr><td width=60% >"
response.write "<img src=images/wishlist.gif width=260 height=59></td><td width=40% valign=baseline><div align=right>个人用户最多只能收藏1000种商品</div></td></tr></table>"
shoucang()
end select
conn.close
set conn=nothing%>
</body>
</html>

</body>
</html>

⌨️ 快捷键说明

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