<%if session("loogoo.com")="" then
    session("loogoo.com")="loogoo.com"
end if%>
<!--#include file="../conn/zkconn.asp" -->
<% if request("userid")<>"" then
   userid=clng(request("userid"))
   else
   userid=1
   end if

   huiyuan=session("huiyuan")   
if huiyuan="" then
   Response.redirect "cart-login.asp?userid="&userid
   Response.end
end if

cp_id=clng(request("cp_id"))
if cp_id<>"" then
   conn.execute("Insert into shoucang(cp_id,huiyuan) values("&cp_id&",'"&huiyuan&"')")
end if
%>

<!--#include file="top.asp" -->
<table width="760" bgcolor="#ffffff" border="0" align="center" cellpadding="0" cellspacing="0" class="table-zuoyou">
  <tr>
    <td width="170" valign="top" bgcolor="#f3f3f3" class="table-you"> 
    <!--#include file="conn/logininc.asp" -->
	<!--#include file="conn/centerinc.asp" --> 
    </TD>
    <td width="590" height="350" align="center" valign="top">
	 <!--#include file="conn/bannerinc.asp" --> 
	<table width="590" border="0" align="center" cellpadding="0" cellspacing="0" class="table-shang">
	 <tr><TD height=30 vAlign=center>&nbsp;&nbsp;您目前的位置：<A href="index.asp?userid=<%=userid%>">网站首页</A> -&gt; <A href="huiyuan-1.asp?userid=<%=userid%>">会员中心</A> -&gt; 我的收藏夹</td></TR>
	<TR><TD background=../image/1x3.gif height=1></TD></TR>
	 <tr><td align="center" height="350" valign="top"><br>&nbsp;&nbsp;<img src="../image/tp009.gif" width="15" height="15">&nbsp;<a href="../huiyuan-2.asp" target="_blank"><u>点击这儿查看您在商盟内所有的收藏</u></a><br><br>
<%
'处理请求
if request("del")="yes" then
         set rs = conn.execute("select huiyuan from shoucang where id="&clng(Request("id"))&"")
		huiyuan=rs("huiyuan")
	    rs.close
    if huiyuan=session("huiyuan") then
      conn.execute("Delete shoucang where id="&clng(Request("id"))&"")
        Response.redirect "huiyuan-2.asp?userid="&userid
    else
		Response.Write("对不起，您不能删除该条信息。如有疑问请与网站管理员联系。")
	 end if
end if
%><table width="98%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#CCCCCC">
        <tr align="center" bgcolor="#FFFFFF"> 
          <td colspan="5" class="d13"><b> 
            <%response.write session("huiyuan")&"的收藏夹"%>
            </b></td>
        </tr>
        <tr bgcolor="#f1f1f1"> 
          <td class="d13"> <div align="center">商品名称</div></td>
          <td width="75" class="d13"> <div align="center">市场价（元）</div></td>
          <td width="75" class="d13"> <div align="center">会员价（元）</div></td>
          <td width="50" class="d13"> <div align="center">购买</div></td>
          <td width="50" align="center" class="d13"> <div align="center">操作</div></td>
        </tr>
        <%set rs = conn.execute("select * from shoucang where huiyuan='"&session("huiyuan")&"'")		  
		while not rs.eof
          set rs2 = conn.execute("select * from chanpin where id="&rs("cp_id")&" and userid="&userid&" and cang=0")
        if not rs2.eof then
        %>
        <tr> 
          <td height="11" bgcolor="#FFFFFF" class="unnamed1"> <div align="center"><a href=xiangxi.asp?userid=<%=rs2("userid")%>&id=<%=rs2("id")%>><%=rs2("mc")%></a></div></td>
          <td width="75" height="11" bgcolor="#FFFFFF" class="unnamed2"> <div align="center"><font color="#FF0000"><b><%=rs2("jg1")%></b></font></div></td>
          <td width="75" height="11" bgcolor="#FFFFFF" class="unnamed1"> <div align="center"><font color="#FF0000"><b><%=rs2("jg2")%></b></font></div></td>
          <td width="50" height="11" bgcolor="#FFFFFF" class="unnamed1"> <div align="center"><a href=huiyuan-2.asp?cpid=<%=rs2("id")%>>购买</a></div></td>
          <td width="50" height="11" bgcolor="#FFFFFF" class="unnamed1"> <div align="center"><a href="?del=yes&id=<%=rs("id")%>">移除</a> 
            </div></td>
        </tr>
               <% end if
		  rs2.close
		  rs.movenext
		  wend
		  rs.close
		  set rs=nothing
                  set rs2=nothing 
		  %>
      </table></td>
  </tr>
</table></td>
  </tr>
</table>
<!--#include file="bd.asp" -->