📄 shoucang.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=webname%>-商品信息</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- 导航菜单 -->
<!--#include file="top.asp" -->
<div id="content">
<!-- 快捷导航 -->
<div id="content_m"><a href="index.asp">首页</a> >
</div>
<!-- 右侧内容 -->
<div id="content_r">
<div id="usercenter">
<%if request.cookies("godbook")("username")="" then
response.write "<script language=""JavaScript"" type=""text/javascript"">alert('对不起,您还没有登陆!');window.close();</script>"
response.End
end if
dim bookid,username,action
action=request.QueryString("action")
username=trim(request.cookies("godbook")("username"))
bookid=request.QueryString("id")
'//删除收藏
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"" type=""text/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"" type=""text/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 "<h2>您最多只能收藏十种商品</h2>"
set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_action.actionid,shop_action.bookid,shop_books.bookname,shop_books.shichangjia,shop_books.huiyuanjia,shop_books.vipjia,shop_books.dazhe from shop_books inner join shop_action on shop_books.bookid=shop_action.bookid where shop_action.username='"&request.cookies("godbook")("username")&"' and shop_action.zhuangtai=6",conn,1,1
%>
<form name='form1' method='post' action="sctogw.asp">
<table width="590" cellpadding=""0"" cellspacing=""0"">
<tr><td>选择</td>
<td>商品名称</td><td>市场价</td>
<td>会员价</td>
<td>VIP 价</td>
<td>删 除</td></tr>
<%do while not rs.eof%>
<%response.write "<tr><td><input name=""bookid"" type=""checkbox"" checked=""checked"" value="""&rs("bookid")&""" /></td>"%>
<%response.write "<td><a href=""list.asp?id="&rs("bookid")&""" target=""_blank""><strong>"&rs("bookname")&"</strong></a></td>"%>
<%response.write "<td>"&formatnumber(rs("shichangjia"),2)&"元</td>"%>
<%response.write "<td><span class=""new"">"&formatnumber(rs("huiyuanjia"),2)&"</span> 元</td>"%>
<%response.write "<td><span class=""red"">"&formatnumber(rs("vipjia"),2)&"</span> 元</td>"%>
<td>
<%response.Write "<a href=""shoucang.asp?action=del&actionid="&rs("actionid")&""">"%>
删除</a></td></tr>
<%rs.movenext
loop
rs.close
set rs=nothing
%>
</table>
<p><input class="pay" onfocus="this.blur()" type="submit" name="submit" value="" />
<input class="keepbuy" onfocus="this.blur()" onclick="javascript:window.close();" type="reset" name="button" value="" />
</p>
</form><%end select%>
</div>
</div>
<!-- 主内容左侧 -->
<div id="content_l">
<!-- 公告 -->
<!--#include file="userinfo.asp"-->
<!-- 左侧目录 -->
<!--#include file="shoppingbag.asp"-->
<div class="clear-both"> </div>
</div>
</div>
<div class="clear-both"> </div>
<!-- 服务声明 -->
<!--#include file="service.asp" -->
<!-- 版权信息 -->
<!--#include file="copyright.asp" -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -