<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<!--#include file="fuction.asp"-->
<!--#include file="webtop.asp"-->
<%
if session("username") = "" then
response.write "<script language=javascript>alert('Pleas login!');window.history.go(-1);</script>"
response.End
end if
dim shopid,username,action

action		= nosql(request.QueryString("action"))
username	= nosql(session("username"))
shopid		= nosql(request.QueryString("id"))
actionid	= nosql(request.QueryString("actionid"))
username	= checkFFSQLStr(username)
'//删除收藏
select case action
case "del"
if Not isChkInteger(request.QueryString("actionid")) Then
	response.write "<script language=javascript>alert('参数错误!');window.close();</script>"
	response.end
end if

conn.execute "delete from shop_action where actionid="&actionid
response.redirect "to.asp?action=show"
response.End
case "add"
'//对比，判断是否存在
if not isChkInteger(shopid) then
	response.write "<script language=javascript>alert('参数错误!');window.close();</script>"
response.end
end if

set rs3=server.CreateObject("adodb.recordset")
rs3.open "select shopid,username from shop_action where username='"& username &"' and shopid="& shopid &" and zhuangtai=8",conn,1,1
if not rs3.eof and not rs3.bof then
response.write "<script language=javascript>alert('对不起，此商品已存在于您的对比架中，不可以重复添加！');window.location.href='to.asp?action=show';</script>"
response.end
end if
rs3.close
set rs3=Nothing

'//判断对比数
 set rs3=server.CreateObject("adodb.recordset")
rs3.open "select shopid,username from shop_action where username='"& username &"' and zhuangtai=8",conn,1,1
if rs3.recordcount>=4 then
  response.write "<script language=javascript>alert('对不起，您最多只能对比四件商品！');window.location.href='to.asp?action=show';</script>"
  response.end
else
  rs3.close
  set rs3=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")	= 8
  rs("zonger")		= 0
  rs.update
  rs.close
  response.Redirect "to.asp?action=show"
  set rs=nothing
end if

case "show"
%>
<table width="1000" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="6" colspan="4"></td>
  </tr>
  <tr>
    <td width="20"></td>
    <td width="479" valign="bottom"><img src="<%=weburl%>images/arrow01.gif" width="11" height="11" /> Your present position: <a href="<%=weburl%>"><%=webname%></a> -> Member Center-> <span class="table-shangxia">Comparison</span></td>
    <td width="479" valign="bottom"><MARQUEE onmouseover=this.stop(); onmouseout=this.start(); scrollAmount=3 scrollDelay=80 width=500>
       <font color="#ff0000"><span class="bulletin_td"><%=gonggao%></span></font></MARQUEE></td>
    <td width="22" valign="bottom">    </td>
  </tr>
  <tr>
    <td height="6" colspan="4"></td>
  </tr>
</table>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td>
      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
		<td width="205" valign="top"><table width="210" border="0" align="center" cellpadding="1" cellspacing="1" background="<%=weburl%>images/skin<%=cssid%>/z02.jpg">
            <tr>
              <td width="206" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="30" background="<%=weburl%>images/skin<%=cssid%>/z01.jpg"><div align="center"><span style="font-weight: bold; color: #000000">Member Centre</span></div></td>
                  </tr>
          <tr>
            <td valign="middle"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                <form name="userlogin" method="post" action="<%=weburl%>checkuserlogin.asp">
                  <tr>
                    <td height="25"><%
						set rslg=server.createobject("adodb.recordset")
						sql = "select jifen,yucun,reglx,vipdate from [shop_user] where username='"&nosql(session("username"))&"'"
                        rslg.open sql,conn,1,3
                        if rslg("vipdate")<>"" then 
                          '检查VIP是否过期
                          if rslg("vipdate") < date and rslg("reglx") = 2 then
                          rslg("reglx") = 1
                          rslg.update
                          end if
                        end if
                        session("yucun") = rslg("yucun")
                        session("jifen") = rslg("jifen")
                        session("reglx") = rslg("reglx")
                        rslg.close
                        set rslg = nothing%>
                      Username：<%=session("username")%> </td>
                  </tr>
                  <tr>
                    <td height="25">Usertype:
                      <%if session("reglx") = 2 then
				response.write " <font color=red>VIP</font>"
								elseif session("reglx")=3 then
				response.write "<font color=red>Wholesale</font>"
				else
				response.write "<font color=red>Member</font>"
				end if%></td>
                  </tr>
                  <tr>
                    <td height="30"><div align="center"><a href="<%=weburl%>logout.asp"><img src="images/login04.gif" width="140" height="28" border="0" /></a></div></td>
                  </tr>
                </form>
            </table></td>
          </tr>
          <tr>
            <td height="117" valign="middle"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="25" colspan="2" background="<%=weburl%>images/skin<%=cssid%>/hyzx.gif"><div align="center" style="color: #000000">Account Settings</div></td>
                </tr>
                <tr>
                  <td height="25" colspan="2">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="user.asp?action=myinfo">Check My Information</a></td>
                </tr>
                <tr>
                  <td height="25" colspan="2">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="user.asp?action=userziliao">Change My Information</a></td>
                </tr>
                <tr>
                  <td height="25" colspan="2">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="user.asp?action=savepass">Change Password</a></td>
                </tr>
                <tr>
                  <td height="25" colspan="2">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="user.asp?action=jifen">My Score</a></td>
                </tr>
                <tr>
                  <td height="25" colspan="2">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="bbs/mysms.asp?menu=write">Message to Me</a></td>
                </tr>
              </table>
                <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="25" background="<%=weburl%>images/skin<%=cssid%>/hyzx.gif"><div align="center" style="color: #000000">Shopping Settings</div></td>
                  </tr>
                  <tr>
                    <td height="25">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="user.asp?action=dindan">My Orders</a></td>
                  </tr>
                  <tr>
                    <td height="25">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="gouwu.asp?action=show&lx=1">My Shopping Cart</a> </td>
                  </tr>
                  <tr>
                    <td height="25">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="shoucang.asp?action=show">Collection</a></td>
                  </tr>
                  <tr>
                    <td height="25">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="to.asp?action=show">Comparison</a></td>
                  </tr>
                  <tr>
                    <td height="25">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="user.asp?action=myshhr">My Shipping information</a></td>
                  </tr>
                </table>
              <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="25" colspan="2" background="<%=weburl%>images/skin<%=cssid%>/hyzx.gif"><div align="center" style="color: #000000">VIP Settings</div></td>
                  </tr>
                  <tr>
                    <td height="25" colspan="2">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="user.asp?action=sqvip">How to be VIP Member</a></td>
                  </tr>
                  <tr>
                    <td height="25" colspan="2">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="user.asp?action=viphd">Offers For VIP</a></td>
                  </tr>
                  <tr>
                    <td height="25" colspan="2"><a href="to.asp?action=show"></a> &nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="vipdyj.asp?action=vipsq">Winner of VIPS</a></td>
                  </tr>
                </table>
              <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="25" colspan="2" background="<%=weburl%>images/skin<%=cssid%>/hyzx.gif"><div align="center" style="color: #000000">Other Settings</div></td>
                  </tr>
                  <tr>
                    <td height="25" colspan="2">&nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="<%=weburl%>fk.asp">Feedback</a></td>
                  </tr>
                  <tr>
                    <td height="25" colspan="2"><a href="to.asp?action=show"></a> &nbsp;<img src="<%=weburl%>images/arrow03.gif" width="4" height="6" /> <a href="<%=weburl%>qhdj.asp">Order it of "out of stock"</a></td>
                  </tr>
              </table></td>
          </tr>
              </table></td>
            </tr>
          </table></td>
          <td align="center" valign="top"><table width="98%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="23" bgcolor="#CCCCCC"><div align="center"><span class="STYLE2">TIPS：4 Goods to compare one time at the most.</span></div></td>
            </tr>
          </table>
             <form name='form1' method='post' action="sctogw.asp">
            <%
set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_action.actionid,shop_action.shopid,wygkcn_shop.shopname,wygkcn_shop.shichangjia,wygkcn_shop.huiyuanjia,wygkcn_shop.vipjia,wygkcn_shop.dazhe from wygkcn_shop inner join  shop_action on wygkcn_shop.shopid=shop_action.shopid where shop_action.username='"&checkFFSQLStr(session("username"))&"' and shop_action.zhuangtai=8",conn,1,1 
%>  
           <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
             <tr><td height="1" bgcolor="#CCCCCC"></td></tr>
             <tr>
               <td bgcolor="#FFFFFF"></td>
               <td></td>
               <td></td>
               <td bgcolor="#000000"></td>
               <td></td>
             </tr>
             
             <tr><td width="1" bgcolor="#FFFFFF"></td>
             <%
			 do while not rs.eof
			 %><td align="center" valign="top"><%
				set rs2=server.CreateObject("adodb.recordset")
			   rs2.open "select * from wygkcn_shop where shopid = "&rs("shopid"),conn,1,3
			   if rs2.EOF or rs2.bof  then
response.write"对不起，该商品不存在或已经删除"
else
sftc=rs2("sftc")
dq_2=rs2("dq")
dq_2=split(dq_2,",")
dq1=dq_2(0)
dq2=dq_2(1)
dq3=dq_2(2)
dq4=dq_2(3)
psdq_2=rs2("psdq")
psdq_2=split(psdq_2,",")
psdq1=psdq_2(0)
psdq2=psdq_2(1)
psdq3=psdq_2(2)
psdq4=psdq_2(3)
shopname=rs2("shopname")
zhuang=rs2("zhuang")
shoppic=rs2("shoppic")
shichangjia=rs2("shichangjia")
huiyuanjia=rs2("huiyuanjia")
pifajia=rs2("pifajia")
vipjia=rs2("vipjia")
mch=rs2("mch")
kucun=rs2("kucun")
isbn1=rs2("isbn1")
isbn=rs2("isbn")
jj=rs2("jj")
shopchuban=rs2("shopchuban")
cj=rs2("cj")
cjname=rs2("cjname")
gj=rs2("gj")
gjz=rs2("gjz")
pingjizong=rs2("pingjizong")
pingji=rs2("pingji")
ps=rs2("ps")
yeshu=rs2("yeshu")
x1=rs2("x1")
x2=rs2("x2")
x3=rs2("x3")
x4=rs2("x4")
x5=rs2("x5")
x6=rs2("x6")
y1=rs2("y1")
y2=rs2("y2")
y3=rs2("y3")
y4=rs2("y4")
y5=rs2("y5")
y6=rs2("y6")
shopid=rs2("shopid")
shopcontent=rs2("shopcontent")
newsshop=rs2("newsshop")
bestshop=rs2("bestshop")
tejiashop=rs2("tejiashop")
cxiaoshop=rs2("cxiaoshop")
hot=rs2("liulancount")
xiao=rs2("chengjiaocount")%><table width="168" align="center" cellpadding="0" cellspacing="0" bordercolor="#6699FF">
             <tr><td width="166" height="<%=upload14+10%>">
                <%if zhuang="" then%>
                <img src=img/emptyshop.gif border=0>
                <%else%>
                <img src="<%=weburl%><%=shoppic%>" width="<%=upload13%>" height="<%=upload14%>" border=0>
                <%end if%></td> 
              </tr>
              <tr>
                <td><span class="style4"><font color="#ff6600"><a href="list.asp?id=<%=shopid%>" title="<%=shopname%>"><%if len(shopname)>11 then
	response.write left(shopname,11)&""
	else
	response.write trim(shopname)
	end if%></a></font></span></td>
              </tr> <tr>
                <td><strong><%=jiagename1%>:</strong><s>￥<%=formatnumber(shichangjia,2)%></s></td>
              </tr>
              <tr>
                <td><font color="#FF0000"><font color="#FF0000"><strong><%=jiagename2%>:</strong>￥<%=formatnumber(huiyuanjia,2)%> (
                      <%response.write round(huiyuanjia/shichangjia,2)*10&"折"%>
)</font></font></td>
              </tr>
              <tr>
                <td><font color="#FF0000"><font color="#FF0000"><strong><%=jiagename3%>:</strong>￥<%=formatnumber(Vipjia,2)%> (
                      <%response.write round(vipjia/shichangjia,2)*10&"折"%>
)</font></font></td>
              </tr> <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>【State】
                  <%if kucun>0 then%>
in stock
<%else%>
<font color="#FF0000">out of stock </font>
<%end if%></td>
              </tr>
              <tr>
                <td>【<%=isbn1%>】<%=isbn%></td>
              </tr>
              <tr>
                <td>【<%=jj%>】<%=shopchuban%></td>
              </tr>
              <tr>
                <td>【<%=cj%>】<%=cjname%></td>
              </tr>
				<tr>
                      <td height="6">【<%=gj%>】
                          <%
	   sorts2=gjz
	  sorts2=trim(sorts2)
	if sorts2<>"" then 
	   bsort2=split(sorts2,",")
	  for i=0 to ubound(bsort2)
	   bsortb2=bsort2(i)
	   bsortb2=trim(bsortb2)
	  response.write "<a href=research.asp?action=2&searchkey="&bsortb2&"><u>"&bsortb2&"</u></a>&nbsp;"
	    next
		  end if%>                      </td>
                    </tr>
					 <tr>
                      <td height="22">【<%=ps%>】
                          <%if dq1=1 then%>
                          <font color="#FF0000"><%=psdq1%></font> 
                          <%end if%>
                          <%if dq2=1 then%>/
                          <font color="#FF0000"><%=psdq2%></font> 
                          <%end if%>
                          <%if dq3=1 then%>/
                          <font color="#FF0000"><%=psdq3%></font> 
                          <%end if%>
                          <%if dq4=1 then%>/
                          <font color="#FF0000"><%=psdq4%></font>
                          <%end if%>                      </td>
                    </tr>
			<tr>
                      <td height="11">【Score】<%=yeshu%></td>
                    </tr>
					<%if x1<>"" then%>
                    <tr>
                      <td height="5">【<%=x1%>】<%=y1%></td>
                    </tr>
                    <%end if%>
                    <%if x2<>"" then%>
                    <tr>
                      <td height="6">【<%=x2%>】<%=y2%></td>
                    </tr>
                    <%end if%>
                    <%if x3<>"" then%>
                    <tr>
                      <td height="11">【<%=x3%>】<%=y3%></td>
                    </tr>
                    <%end if%>
                    <%if x4<>"" then%>
                    <tr>
                      <td height="11">【<%=x4%>】<%=y4%></td>
                    </tr>
                    <%end if%>
                    <%if x5<>"" then%>
                    <tr>
                      <td height="11">【<%=x5%>】<%=y5%></td>
                    </tr>
                    <%end if%>
                    <%if x6<>"" then%>
                    <tr>
                      <td height="11">【<%=x6%>】<%=y6%></td>
                    </tr>
                    <%end if%>
			  
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>【Rank】
                  <%if pingjizong>0 and pingji>0 then
xx=pingjizong\pingji
else
xx=5
end if
response.write "<img src=img/pingji/"&xx&".gif alt=评论星级>"%></td>
              </tr>
              <tr>
                <td>【Score】<%=yeshu%></td>
              </tr>
              <tr>
                <td><input name=shopid type=checkbox checked value=<%=rs("shopid")%> >
                <a href=to.asp?action=del&actionid=<%=rs("actionid")%>><img src=img/trash.gif width=18 height=18 border=0></a></td>
              </tr>
              <tr>
                <td></td>
              </tr>
            </table>  
             </td>
             <td width="5"></td><td width="1" bgcolor="#000000"></td>
             <td width="5"></td>
             <%end if
rs.movenext
loop
rs.close
set rs=nothing
%>        
              </tr>
            </table>
           <br><br><input name="Submit2" type="submit" class="go-wenbenkuang" value="Add to Shopping Cart" onFocus="this.blur()">
                <input name="Submit32" type="button" class="go-wenbenkuang" value="Return to Shopping" onClick="javascript:window.history.go(-1)">
            </form>
            <p>
            <script language="Javascript">
function closeinfo(){window.close();}
setTimeout("closeinfo()", 600000);
            </script>
            <%
end select%>
            </p>
          <p>&nbsp;            </p></td>
        </tr>
    </table></td>
  </tr>
</table>
<!--#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>