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

📄 shoucang.asp

📁 闲置物品免费交易的平台
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<html><head><title><%=webname%>--我的收藏架</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
<%
if request.Cookies("days6")("username")="" then
response.write "<script language=javascript>alert('对不起,您还没有登陆!');window.close();</script>"
response.End
end if
dim bookid,username,action
action=request.QueryString("action")
username=trim(request.Cookies("days6")("username"))
bookid=request.QueryString("id")

if InStr(action,"'")>0 then
response.write"<script>alert(""非法访问!"");window.close();</script>"
response.end
end if

if bookid<>"" then
if not isnumeric(bookid) then 
response.write"<script>alert(""非法访问!"");window.close();</script>"
response.end
else
if not isinteger(bookid) 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 "shoucang.asp?action=show"
end if
response.End
case "add"
'//收藏,判断是否存在
set rs=server.CreateObject("adodb.recordset")
rs.open "select bookid,username from shop_action where username='"&username&"' and bookid="&bookid&" 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 bookid,username,zhuangtai,zonger from shop_action",conn,1,3
rs.addnew
rs("bookid")=bookid
rs("username")=username
rs("zhuangtai")=6
rs("zonger")=0
rs.update
end if
rs.close
response.Redirect "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.bookid,shop_books.bookname,shop_books.newsbook,shop_books.kucun,shop_books.liulancount,shop_books.bookchuban,shop_books.closedate from shop_books inner join  shop_action on shop_books.bookid=shop_action.bookid where shop_action.username='"&request.Cookies("days6")("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>人 气</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=bookid type=checkbox checked value="&rs("bookid")&" ></div></td>"
response.write "<td bgcolor=#ffffff STYLE='PADDING-LEFT: 5px'><div align=left><a href=list.asp?id="&rs("bookid")&" >"&rs("bookname")&"</a></div></td>"		  
response.write "<td bgcolor=#ffffff><div align=center>"&datevalue(rs("closedate"))&"</div></td>"	
response.write "<td bgcolor=#ffffff><div align=center><font color=#dd6600>"&rs("kucun")&""&rs("bookchuban")&"</font></div></td>"
response.write "<td bgcolor=#ffffff><div align=center><font color=#FF3300>"&rs("liulancount")&"</font></div></td>"
response.write "<td bgcolor=#ffffff><div align=center>"
response.Write "<a href=shoucang.asp?action=del&actionid="&rs("actionid")&">"
response.Write "<img src=images/trash.gif border=0></a></div></td></tr>"
rs.movenext
loop
rs.close
set rs=nothing
%>
</form></table>
<%end select%>
</body>
</html>

⌨️ 快捷键说明

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