<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<body onLoad="show(c911),show(c912)">
<!--#include file="top.asp"-->
<!--#include file="../include/page.asp"-->
<table width="762" border="0" align="center" cellpadding="2" cellspacing="0" style='BORDER-COLLAPSE: collapse;MARGIN: 3px'>
  <tr> 
    <td height="20" colspan="2">您的位置： <A href="../index.asp">首页</A> &gt;&gt; <a href="index.asp">会员中心</a>&nbsp;&gt;&gt; 销售报表</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" bgcolor="#FFFFFF"><font color="#FFFFFF" span class="C">销售报表</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"> 
	<form name="form2" method="post" action="?id=2"><tr valign="middle">
      <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>

<table width="570" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#efefef" id="data">
<%if request("submit")="查询显示" and request("rq1")<>"" or request("rq2")<>"" then
rq1=datediff("d",cdate(shopnet("rq1")),now())+1
rq2=datediff("d",cdate(shopnet("rq2")),now())-1
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from list where userid="&myuserid&" and datediff('d',sj,now())<"&clng(rq1)&" and datediff('d',sj,now())>"&clng(rq2)&" order by id desc"
else
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select top 10 * from list where userid="&myuserid&" order by id desc"
end if
rs.open sql,conn,3,1 

page1("10")
%>

        <tr align="center" valign="middle" bgcolor="#f7f7f7">
          <td width="225" height="21" valign="middle" background="../image/bk.gif">商品名称/订单号</td> 
          
		    <td width="85" height="21" valign="middle" background="../image/bk.gif">客户</td>
          <td width="118" height="21" valign="middle" background="../image/bk.gif">出售日期</td>

          <td width="58" height="21" valign="middle" background="../image/bk.gif">价格</td>
          <td width="52" height="21" valign="middle" background="../image/bk.gif">数量</td>
        </tr>
<%

  if rs.eof then
  response.write "<tr><td colspan=5 align=center bgcolor=white height=21 valgin=bottom >该查询条件下无记录！</td></tr>"
  else	


i=1
do while not rs.eof and i<=rs.pagesize
zs = zs + rs("sl")
zj = zj + csng(rs("jg2")) * rs("sl")%>

        <tr valign="middle" bgcolor="#FFFFFF">
          <td width="225" height="21"><div align="center"><%=rs("mc")%>/<%=rs("bh")%></div></td> 
          <td width="85" height="21">
		  <div align="center"><%=RS("username")%></div></td>
          <td width="118" height="21" align="center"><%=rs("sj")%></td>
          <td width="58" height="21" align="center"><%=rs("jg2")%>元</td>
          <td width="52" height="21" align="center"><%=rs("sl")%></td>
        </tr>
<%
i=i+1
rs.movenext
loop
%>
        <tr valign="middle" bgcolor="#FFFFFF">
          <td height="21" colspan="5" background="../image/bk.gif" align="center"><%page2("rq1="&request("rq1")&"&rq2="&request("rq2")&"&")%></td>
        </tr>
        </div>
<p>
<%

msg1="<br>本查询日期阶段共销售:"&zs&"件产品，销售总额:"&zj&"元"
rs.close
set rs=nothing
end if 
%> 
</p></table>
<%=msg%><%=msg1%>
</td>
  </tr>
</table>
<!--#include file="../bottom.asp"-->
