<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<!--#include file="fuction.asp"-->
<!--#include file="webtop.asp"-->
      <%
if request.cookies("snsn")("username")="" then
response.write "<script language=javascript>alert('对不起，您还没有登陆！');window.history.go(-1);</script>"
response.End
end if
dim shopid,username,action
action=request.QueryString("action")
username=trim(request.cookies("snsn")("username"))
shopid=request.QueryString("id")
'//删除收藏
select case action
case "del"
if Not isChkInteger(request.QueryString("actionid")) then
	%>
	<script language=javascript>
		alert("参数错误！");
		window.close();
	</script>
	<%
	response.end
end if

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"
'//收藏，判断是否存在
if not isChkInteger(shopid) then
%>
<script language=javascript>
		alert("参数错误！");
		window.close();
	</script>
	      <%
response.end
end if

set rs=server.CreateObject("adodb.recordset")
rs.open "select shopid,username from shop_action where username='"&checkFFSQLStr(username)&"' and shopid="&shopid&" 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 shopid,username,zhuangtai,zonger from shop_action",conn,1,3
rs.addnew
rs("shopid")=shopid
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"
'//////////////////%><html>
<head> 
<title><%=webname%>--我的收藏</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onMouseOver="window.status='【<%=webname%>】<%=weburl%> 如果您喜欢本站,别忘了把本站介绍给您的好友哦！：）';return true"> 
<div align="center">
<TABLE id=table1 style="MARGIN: 0px auto; BORDER-BOTTOM: #ffffff 0px solid" 
height="100%" cellSpacing=0 borderColorDark=#FFFFFF cellPadding=0 width=976 
borderColorLight=#CECECE border=1>
  <TBODY>
  <TR><!--sart left-->
    <TD vAlign=top width=234 bgcolor="#F1F1F1">
      <p align="center"><!--#include file="left.asp"--></TD><!---end left--><!--start right-->
          <td valign="top">
            <br> 
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" id="table2">
              <tr> 
                <td height="1" bgcolor="cccccc"><img src="images/dot_03.gif" width="9" height="1" border="0"></td>
              </tr>
              <tr> 
                <td height="25" bgcolor="efefef"><strong>&nbsp;&nbsp;<img src="images/dot_03.gif" width="9" height="9" border="0"> 
                  </strong><b>我的收藏</b></td>
              </tr>
              <tr> 
                <td height="1" bgcolor="cccccc"><img src="images/dot_03.gif" width="9" height="1" border="0"></td>
              </tr>
            </table>
            <%
set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_action.actionid,shop_action.shopid,shop_snsn.shopname,shop_snsn.shichangjia,shop_snsn.huiyuanjia,shop_snsn.vipjia,shop_snsn.dazhe from shop_snsn inner join  shop_action on shop_snsn.shopid=shop_action.shopid where shop_action.username='"&checkFFSQLStr(request.cookies("snsn")("username"))&"' and shop_action.zhuangtai=6",conn,1,1 
%>
            <table width=96% border=0 align=center cellpadding=0 cellspacing=1 bgcolor="#CCCCCC" id="table3">
              <form name='form1' method='post' action="sctogw.asp">
                <tr bgcolor="f1f1f1"> 
                  <td width=8% height="25" > 
                    <div align=center><strong><font color=#666666>选择</font></strong></div></td>
                  <td width=42% height="25" > 
                    <div align=center><strong><font color=#666666>商品名称</font></strong></div></td>
                  <td width=14% height="25" > 
                    <div align=center><strong><font color=#666666>市场价</font></strong></div></td>
                  <td width=14% height="25" > 
                    <div align=center><strong><font color=#666666>会员价</font></strong></div></td>
                  <td width=14% height="25" > 
                    <div align=center><strong><font color=#666666>VIP 价</font></strong></div></td>
                  <td width=8% height="25" > 
                    <div align=center><strong><font color=#666666>删除</font></strong></div></td>
                </tr>
                <%do while not rs.eof%>
                <tr bgcolor="#FFFFFF"> 
                  <td height="25" > <div align=center> 
                      <input name=shopid type=checkbox checked value=<%=rs("shopid")%>>
                    </div></td>
                  <td height="25"  STYLE='PADDING-LEFT: 5px'> <div align=left><a href=list.asp?id=<%=rs("shopid")%> target=_blank><%=rs("shopname")%></a>
                    </div></td>
                  <td height="25" > <div align=center><%=formatnumber(rs("shichangjia"),2)%>元</div></td>
                  <td height="25" > <div align=center><font color=#dd6600><%=formatnumber(rs("huiyuanjia"),2)%>元</font></div></td>
                  <td height="25" > <div align=center><font color=#FF3300><%=formatnumber(rs("vipjia"),2)%>元</font></div></td>
                  <td height="25" > <div align=center> <a href=shoucang.asp?action=del&actionid=<%=rs("actionid")%>> 
                      <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=#FFFFFF class="table-xiayou"> 
                    <div align=center> 
                      <input name="Submit2" type="submit" class="go-wenbenkuang" value="放入购物车" onFocus="this.blur()">
                      <input name="Submit32" type="button" class="go-wenbenkuang" value="返回继续购物" onClick="javascript:window.history.go(-1)">
                    </div></td>
                </tr>
              </form>
            </table>
            <p>　</p>
            <p><br>
              <script language="Javascript">
function closeinfo(){window.close();}
setTimeout("closeinfo()", 600000);
</script>
              <%
end select%>
            </p>
          </td>
        <!--end right--></TR></TBODY></TABLE></div>

<!--#include file="copyright.asp"-->
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function checkk()
{
   if(checkspace(document.form2.searchkey.value)&&((document.form2.action.value=="3")||(document.form2.action.value=="1")))  {
	document.form2.searchkey.focus();
	alert("请输入搜索关键字！");
	return false;
  }
   document.form2.submit();
}

//-->
</script>