📄 favorites.asp
字号:
<%@ language="vbscript"%>
<%response.Expires = 0%>
<!--#include file="conn.asp"-->
<%
UserId=Session("LoginSuccess")
Product_Id=request("Product_Id")
id=request("id")
If UserId="" Then
Response.Write ("<script>alert('对不起,你还没有登录,不能收藏商品!');javascript:window.close()</script>")
response.end()
end if
if id<>"" then
mysql="delete from Favorites where id="&id
conn.execute(mysql)
end if
set rs=server.createobject("adodb.recordset")
sql="select * from Favorites where UserId='" &UserId& "' and Product_Id='" &Product_Id& "'"
rs.open sql,conn,1,1
if rs.recordcount>=1 then
Fa="yes"
else
Fa="no"
end if
rs.close
set rs=server.createobject("adodb.recordset")
sql="select * from Favorites where UserId='" &UserId& "'"
rs.open sql,conn,1,3
if Product_Id<>"" and Fa="no" then
if rs.recordcount>=8 then
response.write"<script>alert('对不起!你的收藏夹已满!');window.location.href='Favorites.asp'</script>"
else
rs.addnew
set P_rs=server.createobject("adodb.recordset")
sql="select * from Product where Product_Id='" &Product_Id& "'"
P_rs.open sql,conn,1,1
rs("UserId")=UserId
rs("Product_Id")=P_rs("Product_Id")
rs("Product_Name")=P_rs("Product_Name")
rs("P_OldPrice")=P_rs("P_OldPrice")
rs("P_NewPrice")=P_rs("P_NewPrice")
rs("shop_name2")=P_rs("shop_name2")
rs("p_shop")=P_rs("p_shop")
rs.update
P_rs.close
response.redirect"Favorites.asp"
end if
end if
%>
<html>
<head>
<title>会员管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE>BODY {
FONT-SIZE: 9pt
}
TD {
FONT-SIZE: 9pt
}
a { text-decoration: none }
a:hover { text-decoration: underline; color: #0000FF }
</STYLE>
<SCRIPT language=JavaScript>
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" background="../pic/bg.jpg" text="#000000" topmargin="5">
<div align="center"><font color="#FF0000"><b>我 的 收 藏 夹</b></font> <br>
<TABLE width=560 border="1" cellPadding=4 cellspacing="0" bordercolorlight="#0000FF" bordercolordark="#FFFFFF" class=main>
<TR align="center">
<TD width="28">序号</TD>
<TD width=163>商 品 名 称</TD>
<TD width="54">市场价</TD>
<TD width="55">会员价</TD>
<TD width="91">供货网店</TD>
<TD width="57">购买</TD>
<TD width="40">删除</TD>
</TR>
<TBODY>
<%
if rs.eof then
response.write"<TR align=center><TD colspan=7>没有收藏的商品资料</TD></TR>"
else
i=1
do while not rs.eof
%>
<TR align="center">
<TD><%=i%></TD>
<TD><a href="../<%=rs("p_shop")%>/default.asp?sb=product&Product_id=<%=rs("Product_id")%>" target="_blank"><%=rs("Product_Name")%></a></TD>
<TD><%=rs("P_OldPrice")%></TD>
<TD><%=rs("P_NewPrice")%></TD>
<TD><%=rs("shop_name2")%></TD>
<TD><a href="../check.asp?cpbm=<%=rs("Product_Id")%>&shopname=<%=rs("p_shop")%>"><img src="../PIC/goumai.gif" width="43" height="12" border="0"></a></TD>
<TD><a href="Favorites.asp?id=<%=rs("Id")%>">DEL</a></TD>
</TR>
<%
rs.movenext
i=i+1
loop
end if
rs.close
conn.close
%>
</TBODY>
</TABLE>
<br>
<a href="javascript:window.close()">关闭窗口</a> </div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -