<!--#include file="../include/nowshop.asp"-->
<!--#include file="checkadmin.asp"-->
  <%
sub checkmanage(str)
Set mrs = conn.Execute("select * from manage where username='"&request.cookies("buyok")("admin")&"'")
if not (mrs.bof and mrs.eof) then
manage=mrs("manage")
if instr(manage,str)<=0 then
response.write "<script language='javascript'>"
response.write "alert('警告：您没有此项操作的权限！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
else
session("buyok_admin_login")=0
end if
else 
response.write "<script language='javascript'>"
response.write "alert('没有登陆，不能执行此操作！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
end if
set mrs=nothing
end sub
%>
<%call checkmanage("04")%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../images/css.css" type=text/css rel=stylesheet>
<LINK href="../list/newhead.css" type=text/css rel=stylesheet>
</head>
<BODY bgcolor="#D9EAFC">
		  <table height="5"><tr><td></td></tr></table>
<TABLE cellSpacing=0 cellPadding=0 width=95% border=0 style="BORDER-RIGHT: #b1bfee 1px solid; BORDER-TOP: #b1bfee 1px solid; BORDER-LEFT: #b1bfee 1px solid; BORDER-BOTTOM: #b1bfee 1px solid" 
>
  <TBODY>
    <TR> 
      <TD width="90%" bgColor=#f4f5fd><font color="#000000">　<B><font color="#FF0000">销售统计</font></B></font></TD>
      <TD bgColor=#f4f5fd height=30><font color="#000000">&nbsp;<a href="http://www.nowshop.com.cn/help/index.asp?boardid=2&page=1" target="_blank">设置帮助</a></font></TD>
    </TR>
  </TBODY>
</TABLE>		  <table height="5"><tr><td></td></tr></table>

<table border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee" width="95%">
  <tr bgcolor="#FFFFFF"> 
    <td height=30 width="10%">订单编号</td>
    <td width="20%" align=center>销售日期</td>
    <td width="10%" align=center>商品编号</td>
    <td width="30%" align=center>商品名称</td>
    <td width="10%" align=center>销售数量</td>
    <td width="10%" align=center>结算单价</td>
    <td width="10%" align=center>销售金额</td></td>
  </tr>
  <%
sql="select A.ordertime,b.ordersum,A.Userid,A.OrderNum,A.PEI,A.FEI,A.ProdId,A.BuyPrice,A.ProdUnit,B.thiskou,B.Memo,B.Status,B.Recname,B.RecPhone,B.Recmail,B.RecAddress,B.Zipcode,B.Paytype,B.Notes,B.Compphone,B.gettime,C.ProdName from bOrder A,bOrderList B,bproduc C where A.OrderNum<>'' and A.OrderNum = B.OrderNum and A.ProdId=C.Prodid and b.status='99' and b.del<>true order by a.ordertime asc"
set rs=Server.Createobject("ADODB.RecordSet")
rs.open sql,conn,1,3
if rs.eof and rs.bof  then
response.write "<tr  bgcolor=#FFFFFF><td height=50 colspan=7>暂时没有订单</td></tr>"
else
pages=50
totalrs=rs.RecordCount
rs.pageSize = pages
allPages = rs.pageCount
page = Request("page")
If not isNumeric(page) then page=1
if isEmpty(page) or int(page) <= 1 then
page = 1
elseif int(page) > allPages then
page = allPages 
end if
rs.AbsolutePage = page
	Total = 0
	Do While Not rs.eof and pages>0
	Sum = rs("ProdUnit")* csng(rs("BuyPrice")) * csng(rs("thiskou"))/10
	Sum = FormatNumber(Sum,2) 
	Total = Sum + Total
	response.write "<tr bgcolor=#FFFFFF><td height=30>"&rs("ordernum")&"</td><td align=center>"&rs("ordertime")&"</td><td>"&rs("ProdId")&"</td><td><a alt='查看此商品的前台页面' href=../gotourl.asp?list.asp?ProdId="&rs("ProdId")&" target='blank_'>"&rs("ProdName")&"</a></td><td align=center>"&rs("ProdUnit")&"</td><td align=right>"&FormatNumber(csng(rs("BuyPrice")) * csng(rs("thiskou"))/10,2)&" &nbsp; </td><td align=right>"&Sum&" &nbsp; </td></tr>"
	pages = pages - 1
	rs.movenext
if rs.eof then exit do
loop
response.write "<tr bgcolor=#FFFFFF><td height=30 colspan=7 align=right>本页总计金额："&formatnumber(total,2)&" &nbsp; </td></tr>"
%>
  <tr bgcolor="#FFFFFF">
    <td colspan=7 height=30><input type='button' name='pnt' value='打印报表' onclick="javascript:window.print();"></td>
  </tr>
</table>

<%
call listpage()
end if
rs.close
set rs=nothing

sub listpage()
response.write "<br>总记录数<font color=red>"&totalrs&"</font> &nbsp; 每页<font color=red>50</font>&nbsp; "
if page = 1 then
response.write "<font color=darkgray>首页 前页</font>"
else
response.write "<a href=order5.asp?keywords="&keywords&"&page=1>首页</a> <a href=order5.asp?keywords="&keywords&"&page="&page-1&">前页</a>"
end if
if page = allpages then
response.write "<font color=darkgray> 下页 末页</font>"
else
response.write " <a href=order5.asp?keywords="&keywords&"&page="&page+1&">下页</a> <a href=order5.asp?keywords="&keywords&"&page="&allpages&">末页</a>"
end if
end sub
%>
<table width="95%" border="0">
  <tr> 
    <td height="60"><font color="#FF0000">我们将为购买正版NowShop商城系统者免费设计全套广告图片；提供免费安装调试；免费送1%网银接口、支付宝接口；免费提供技术支持；免费提供系统升级；免费提供系统模板更换；免费代办网站ICP备案；使您的网店更具吸引力！</font></td>
  </tr>
  <tr> 
    <td><p>购买咨询或技术支持，请在周一至周五8：00-18：00间联系<br>
        Email / MSN：shop@nowshop.com.cn<br>
        电话：0551-5123308&nbsp;&nbsp;13965090551<br>
        QQ：2055008<br>
        网站：<a href="http://www.nowshop.com.cn" target="_blank">http://www.nowshop.com.cn</a><br>
        演示：<a href="http://ys.nowshop.com.cn" target="_blank">http://ys.nowshop.com.cn</a><br>
      </p>
      <p>Powerd By：NowShop商城系统 V3.5</p></td>
  </tr>
</table>
</body>
</html>
