<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<%
titlename="已买商品"
If shopnet("id")="1" then%><body onLoad="show(A51),show(A52)"><%else%><body onLoad="show(C21),show(C22)"><%End if%>
<!--#include file="top.asp"-->
<!--#include file="../include/page.asp"-->
<html><head>
<meta http-equiv=Content-Type content='text/html; charset=gb2312'>
<link href="/include/css.css" rel="stylesheet" type="text/css">
<title><%=my_name%>-----会员中心</title></head>
<%hy "login.asp"%>
<table width="762" border="0" align="center" cellpadding="2" cellspacing="0" style='BORDER-COLLAPSE: collapse;MARGIN: 3px'>
  <tr> 
    <td height="25" colspan="2">您的位置： <A href="../index.asp">首页</A> &gt;&gt; <a href="index.asp">会员中心</a>&nbsp;&gt;&gt;  <%If shopnet("id")="1" then%>已买商品管理<%else%>已卖商品管理<%end if%></td>
  </tr>
  <tr> 
    <td width="180" valign="top">
<!--#include file="left.asp"-->
</td>
<td width="582" height="280" valign="top">
<script type="text/javascript" src="../include/click.js"></script>
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td><table border="0" align="left" cellpadding="0" cellspacing="0">
          <tr>
            <td width="1"><IMG SRC="../images/mytaobaobj1_3.gif" WIDTH=3 HEIGHT=25 ALT=""></td>
            <td width="120" align="center" background="../images/mytaobaobj1_4.gif"><font color="#FFFFFF"><%If shopnet("id")="1" then%>已买商品<%else%>已卖商品<%end if%></font><font color="#FFFFFF"></a></span></font></td>
            <td width="1"><IMG SRC="../images/mytaobaobj1_6.gif" WIDTH=7 HEIGHT=25 ALT=""></td>
          </tr>
      </table></td>
    </tr>
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td height="4" bgcolor="1E88C1"></td>
    </tr>
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td height="5"></td>
    </tr>
  </table>
  <table width="570" border="0" cellspacing="0" cellpadding="0" align="center">
    <%If shopnet("id")="1" then%>
	<form name="form2" method="post" action="?id=1"><tr valign="middle"> 
	<%else%>
	<form name="form2" method="post" action="?id=2"><tr valign="middle">
	<%End if%>
      <td height="40" colspan="2" align="center" valign="middle"> 开始日期 
        <script language=JavaScript>arrowtag("rq1",'<%=date()-1%>');</script>
        截止日期
        <script language=JavaScript>arrowtag("rq2",'<%=date()%>');</script> 
        <input name="Submit" type="submit" class="go-wenbenkuang" value="查询纪录">
              &nbsp; </td>
    </tr></form>
  </table>


<%
Set rs=Server.CreateObject("ADODB.Recordset")
if request("rq1")<>"" or request("rq2")<>"" then
rq1=datediff("d",cdate(shopnet("rq1")),now())+1
rq2=datediff("d",cdate(shopnet("rq2")),now())-1
If shopnet("id")<>"1" and myuserid="" Then response.Write("<Script>alert('卖家ID错误或者您还没有开设店铺，点击确定系统转向到开设店铺页面！');window.location='shop.asp';</script>")

If shopnet("id")="1" then
sql="select * from list where huiyuan='"&myhuiyuan&"' and over = 1 and datediff('d',sj,now())<"&clng(rq1)&" and datediff('d',sj,now())>"&clng(rq2)&" order by id desc"
Else
sql="select * from list where userid="&myuserid&" and over = 1 and datediff('d',sj,now())<"&clng(rq1)&" and datediff('d',sj,now())>"&clng(rq2)&" order by id desc"
End if
else
If shopnet("id")="1" then
sql="select * from list where huiyuan='"&myhuiyuan&"' and over = 1 order by id desc"
Else
sql="select * from list where userid="&myuserid&" and over = 1 order by id desc"
End if
end if
rs.open sql,conn,3,1 
if rs.eof then
'Response.Write("<p align=center><br>该查询条件下无记录</p>")
'end if
%>
<table width="570" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#efefef" id="data">
       <tr align="center" valign="middle" bgcolor="#f7f7f7">
          <td width="225" background="../image/bk.gif">商品名称</td> 
          <%If shopnet("id")="1" then%>
		  <td width="85" height="20" background="../image/bk.gif">商户</td>
          <td width="118" height="20" background="../image/bk.gif">购买日期</td>
		  <%else%>
		    <td width="85" height="20" background="../image/bk.gif">客户</td>
          <td width="118" height="20" background="../image/bk.gif">出售日期</td>
		  <%End if%>
          <td width="58" height="20" background="../image/bk.gif">价格</td>
          <td width="52" height="20" background="../image/bk.gif">数量</td>
        </tr>
 <tr valign="middle" bgcolor="#FFFFFF"><td bgcolor="#ffffff" height="21" colspan="5" align="center">当前没有<%If shopnet("id")="1" then%>购买<%else%>出售<%end if%>任何商品！</td></tr></table>

<%
else
page1("10")
i=1
do while not rs.eof and i<=rs.pagesize
zs = zs + rs("sl")
zj = zj + csng(rs("jg2")) * rs("sl")%>
<table width="570" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#efefef" id="data">商品单号：<%=rs("bh")%>&nbsp;&nbsp;完成状态：
 <%If shopnet("id")="1" then%>
  <%if rs("buyxinyong")=2 then%> 
  <span style="color: #FF0000"><span style="font-weight: bold">已完成，但卖家还没有给您信用评定</span>
    <%else%>
    <span style="color: #0000FF">完成，卖家给您评定的信用是<%=rs("buyxinyong")%>点
    <%end if%>
    </span>
	<%else%>
	<%if rs("sellxinyong")=2 then%> 
  <span style="color: #FF0000"><span style="font-weight: bold">已完成，但买家还没有给您信用评定</span>
    <%else%>
    <span style="color: #0000FF">完成，买家给您评定的信用是<%=rs("sellxinyong")%>点
    <%end if%>
    </span>
	<%End if%>

        <tr align="center" valign="middle" bgcolor="#f7f7f7">
          <td width="225" background="../image/bk.gif">商品名称</td> 
          <%If shopnet("id")="1" then%>
		  <td width="85" height="21" background="../image/bk.gif">商户</td>
          <td width="118" height="20" background="../image/bk.gif">购买日期</td>
		  <%else%>
		    <td width="85" height="20" background="../image/bk.gif">客户</td>
          <td width="118" height="20" background="../image/bk.gif">出售日期</td>
		  <%End if%>
          <td width="58" height="20" background="../image/bk.gif">价格</td>
          <td width="52" height="20" background="../image/bk.gif">数量</td>
        </tr>
        <tr valign="middle" bgcolor="#FFFFFF">
          <td width="225"><%=rs("mc")%></td> 
          <td width="85" height="21">
		  <%If shopnet("id")="1" then%>
		  <div align="center"><A HREF="../shop/1/myshop.asp?shopid=<%=RS("userid")%>"><% = conn.execute("select name from shop where id="&RS("userid")&"")(0)%></A></div>
		  <%else%>
		  <div align="center"><%=RS("username")%></div>
		  <%End if%></td>
          <td width="118" height="20" align="center"><%=rs("sj")%></td>
          <td width="58" height="20" align="center"><%=rs("jg2")%>元</td>
          <td width="52" height="20" align="center"><%=rs("sl")%></td>
      </tr></div>

  <%
i=i+1
rs.movenext
loop
%>
 <tr valign="middle" bgcolor="#FFFFFF"><td bgcolor="#ff0000" height="21" colspan="5" align="center" background="../image/bk1.gif"><%page2("rq1="&request("rq1")&"&rq2="&request("rq2")&"&")%></td></tr></table><p>
<%
If shopnet("id")="1" then
Response.Write("<br>本查询日期阶段共购买:"&zs&"件产品，消费总额:"&zj&"元")
Else
Response.Write("<br>本查询日期阶段共销售:"&zs&"件产品，销售总额:"&zj&"元")
End if
rs.close
set rs=nothing
end if
%> 
</p>
</td>
  </tr>
</table>
<!--#include file="../bottom.asp"-->
