?? favorites.asp
字號(hào):
<!--#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="inc/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="3" topmargin="5" marginwidth="0" marginheight="0">
<!--#include file="mouse.asp"-->
<%
if request.cookies("web767")("username")="" then
response.write "<script language=javascript>alert('對(duì)不起,您還沒有登陸!');window.close();</script>"
response.End
end if
dim bookid,username,action
action=request.QueryString("action")
username=trim(request.cookies("web767")("username"))
bookid=request.QueryString("id")
'//刪除收藏
select case action
case "del"
conn.execute "delete from sh_action where actionid="&request.QueryString("actionid")
if request.QueryString("ll")=1 then
response.redirect "user.asp?action=favorites"
else
response.redirect "favorites.asp?action=show"
end if
response.End
case "add"
'//收藏,判斷是否存在
set rs=server.CreateObject("adodb.recordset")
rs.open "select bookid,username from sh_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('對(duì)不起,此商品已存在于您的收藏架中,不可以重復(fù)添加!');window.location.href='favorites.asp?action=show';</script>"
response.end
rs.close
set rs=nothing
else
'//判斷收藏?cái)?shù)
if rs.recordcount=10 then
response.write "<script language=javascript>alert('對(duì)不起,您最多只能收藏10件商品!');window.location.href='favorites.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 sh_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 "favorites.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 sh_action.actionid,sh_action.bookid,sh_books.bookname,sh_books.shichangjia,sh_books.huiyuanjia,sh_books.vipjia,sh_books.dazhe from sh_books inner join sh_action on sh_books.bookid=sh_action.bookid where sh_action.username='"&request.cookies("web767")("username")&"' and sh_action.zhuangtai=6",conn,1,1
%>
<table width=96% border=0 align=center cellpadding=1 cellspacing=1 bgcolor=#FFCC00>
<form name='form1' method='post' action="score_cart.asp">
<tr><td width=8% bgcolor=#FFEEAC><div align=center><font color=#666666>選擇</font></div></td>
<td width=42% bgcolor=#FFEEAC><div align=center><font color=#666666>商品名稱</font></div></td>
<td width=14% bgcolor=#FFEEAC><div align=center><font color=#666666>市場(chǎng)價(jià)</font></div></td>
<td width=14% bgcolor=#FFEEAC><div align=center><font color=#666666>會(huì)員價(jià)</font></div></td>
<td width=14% bgcolor=#FFEEAC><div align=center><font color=#666666>VIP 價(jià):<%if Request.Cookies("web767")("reglx")=2 then%><%=trim(rs("Vipjia"))%>元<%else%><font color="#FF9999">更優(yōu)惠!</font><%end if%></font></div></td>
<td width=8% bgcolor=#FFEEAC><div align=center><font color=#666666>刪除</font></div></td></tr>
<%do while not rs.eof
response.write "<tr><td bgcolor=#FFF9DF><div align=center><input name=bookid type=checkbox checked value="&rs("bookid")&" ></div></td>"
response.write "<td bgcolor=#FFF9DF STYLE='PADDING-LEFT: 5px'><div align=left><a href=list.asp?id="&rs("bookid")&" target=_blank>"&rs("bookname")&"</a></div></td>"
response.write "<td bgcolor=#FFF9DF><div align=center>"&formatnumber(rs("shichangjia"),2)&"元</div></td>"
response.write "<td bgcolor=#FFF9DF><div align=center><font color=#dd6600>"&formatnumber(rs("huiyuanjia"),2)&"元</font></div></td>"
response.write "<td bgcolor=#FFF9DF><div align=center><font color=#FF3300>"&formatnumber(rs("vipjia"),2)&"元</font></div></td>"
response.write "<td bgcolor=#FFF9DF><div align=center>"
response.Write "<a href=favorites.asp?action=del&actionid="&rs("actionid")&">"
response.Write "<img src=images/trash.gif width=15 height=17 border=0></a></div></td></tr>"
rs.movenext
loop
rs.close
set rs=nothing
%>
<tr>
<td height=36 colspan=6 bgcolor=#FFF5D0>
<div align=center>
<p>
<input name="submit" type="image" src="images/gwc.gif" width="70" height="19" border="0" onFocus="this.blur()">
<input name="button" type="image" src="images/cg1.gif" width="60" height="19" border="0" onFocus="this.blur()" onclick="javascript:window.close();">
<input name="imageField22" type="image" src="images/cf.gif" width="70" height="19" border="0" onFocus="this.blur()" onClick="this.form.action='ClearFavorites.asp';this.form.submit()">
<br>收藏夾將在10秒后自動(dòng)關(guān)閉
</div>
</td></tr></form></table>
<script language="Javascript">
function closeinfo(){window.close();}
setTimeout("closeinfo()", 10000 );
</script>
<%
end select%>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -