<!--#include virtual="/inc/conn.asp"-->


<script src="/Template/date.js" type="text/javascript"></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body{ margin:0; padding:0;font-family:"Microsoft YaHei",Verdana,Arial;font-size:12px; color:#6f6f6f; }
.table_style_a1{width:1180px;border:1px solid #ccc; font-size:13px}
.table_style_a1 .border_bottom{border-bottom:1px solid #ccc}
.table_style_a1 .border_right{border-right:1px solid #ccc}
.table_style_a1 th{background:#f2fae3;color:#666;height:26px;}
.table_style_a1 td{height:35px;}
-->
</style></head>
<%
if SafeRequest("act")="cha" then
date1r=SafeRequestform("date1r")
date2r=SafeRequestform("date2r")

if date1r="" then call PopErr("请输入其实日期")
if date2r="" then date2r=now()

if date1r<>"" then
response.Cookies("date1r")=date1r
else
response.Cookies("date1r")=""
end if

if date2r<>"" then
response.Cookies("date2r")=date2r
else
response.Cookies("date2r")=""
end if

if request.Cookies("date1r")<>"" then 
sqldd=sqldd&" and  datediff(day,ayptdate,'"&request.Cookies("date1r")&"')<=0"
end if
if request.Cookies("date2r")<>"" then 
sqldd=sqldd&" and  datediff(day,ayptdate,'"&request.Cookies("date2r")&"')>=0"
end if


end if
%>
<body>
<table border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
       <tr>
         <td colspan="12" align="left" class="border_bottom" >
<br>
<form action="?act=cha" method="post" name="chaxun" id="chaxun">
&nbsp;时间查询：
从<input name="date1r" type="text" class="inpcss" id="date1r" onFocus="this.select()" onClick="fPopCalendar(event,this,this)" value="<%if request.Cookies("date1r")<>"" then response.Write request.Cookies("date1r")%>" size="17" readonly="readonly" /> &nbsp;到&nbsp;
<input name="date2r" type="text" class="inpcss" id="date2r" onFocus="this.select()" onClick="fPopCalendar(event,this,this)" value="<%if request.Cookies("date2r")<>"" then response.Write request.Cookies("date2r")%>" size="17" readonly="readonly" />
&nbsp;
<input type="submit" name="Submit" value=" 查 询 ">
</form> </tr>
	   
       <tr>
         <th align="center" class="border_right border_bottom" >日期
         <th align="center" class="border_right border_bottom" ><span title="只统计成功订单金额">金额</span>         
         <th align="center" class="border_right border_bottom" ><span title="包括充值，收款，返点，代理商品入款">其他入款</span>           
         <th align="center" class="border_right border_bottom" ><span title="平台手续费">佣金</span>         
         <th align="center" class="border_right border_bottom" ><span title="成功订单金额-订单成本金额">利润</span>            
         <th align="center" class="border_right border_bottom" ><span title="订单成交笔数">成交</span>                             
         <th align="center" class="border_right border_bottom"><span title="订单-网银支付">网银</span>                            
         <th align="center" class="border_right border_bottom"><span title="订单-支付宝支付">支付宝</span>   
         <th align="center" class="border_right border_bottom"><span title="订单-财付通支付">财付通</span>                            
         <th align="center" class="border_right border_bottom"><span title="订单-微信扫码支付">微信</span>        
         <th align="center" class="border_right border_bottom">手Q<th align="center" class="border_bottom"><span title="订单-充值卡支付">充值卡</span>         </tr>
<%
link="tongjiri?cact="

sql="select top 90 * from aypttj where aypttjzq=3 and aypttjuid="&clng(request.Cookies("aynameid"))&sqldd&" order by ayptdate desc"  
rs.open sql,conn,1,1
rs.pagesize=30 
pagecount=rs.pagecount 
if request("page")="" then 
page=1
else
page=int(request("page")) 
end if
if page<=0 then page=1 
if request("page")="" then page=1
if not(rs.bof and rs.eof) then
rs.absolutepage=page
hayptcjje=0
hayptcjlr=0
hdailiin=0
hayptcjbs=0
hayptbankj=0
hayptalipayj=0
haypttenpayj=0
hayptsaoj=0
hayptcardj=0
hayfandianj=0
hqqsaoj=0
shoufei=0

wapalib=0        
wapalij=0     

waptenb=0      
waptenj=0    

qqsaob=0      
qqsaoj=0 

do while not rs.eof%>
	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
        <td align="center" class="border_right border_bottom"><%=DateValue(rs("ayptdate"))%></td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("ayptcjje"),1,true,-1,0)%>元</td>
        <td align="center" class="border_right border_bottom"><span title="代理商品入款<%=rs("dailiin")%>元
其他入款<%=rs("qitain")%>元"><%=Formatnumber(ccur(rs("qitain"))+ccur(rs("dailiin")),1,true,-1,0)%>元</span></td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("shoufei"),1,true,-1,0)%>元</td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("ayptcjlr"),1,true,-1,0)%>元</td>
        <td align="center" class="border_right border_bottom"><%=rs("ayptcjbs")%>笔</td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("ayptbankj"),1,true,-1,0)%>元(<%=rs("ayptbank")%>笔)</td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(ccur(rs("ayptalipayj"))+ccur(rs("wapalij")),1,true,-1,0)%>元(<%=ccur(rs("ayptalipay"))+ccur(rs("wapalib"))%>笔)</td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(ccur(rs("aypttenpayj"))+ccur(rs("waptenj")),1,true,-1,0)%>元(<%=ccur(rs("aypttenpay"))+ccur(rs("waptenb"))%>笔)</td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("ayptsaoj"),1,true,-1,0)%>元(<%=rs("ayptsaob")%>笔)</td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("qqsaoj"),1,true,-1,0)%>元(<%=rs("qqsaob")%>笔)</td>
        <td align="center" class="border_bottom"><%=Formatnumber(rs("ayptcardj"),1,true,-1,0)%>元(<%=rs("ayptcard")%>笔)</td>
      </tr>
<%
hayptcjje=ccur(hayptcjje)+ccur(rs("ayptcjje"))
hayptcjlr=ccur(hayptcjlr)+ccur(rs("ayptcjlr"))
hdailiin=ccur(hdailiin)+ccur(rs("qitain"))+ccur(rs("dailiin"))
hayptcjbs=ccur(hayptcjbs)+ccur(rs("ayptcjbs"))
hayptbankj=ccur(hayptbankj)+ccur(rs("ayptbankj"))
hayptalipayj=ccur(hayptalipayj)+ccur(rs("ayptalipayj"))+ccur(rs("wapalij"))
haypttenpayj=ccur(haypttenpayj)+ccur(rs("aypttenpayj"))+ccur(rs("waptenj"))
hayptsaoj=ccur(hayptsaoj)+ccur(rs("ayptsaoj"))
hayptcardj=ccur(hayptcardj)+ccur(rs("ayptcardj"))
hayfandianj=ccur(hayfandianj)+ccur(rs("ayfandianj"))
hqqsaoj=ccur(hqqsaoj)+ccur(rs("qqsaoj"))
shoufei=ccur(shoufei)+ccur(rs("shoufei"))

n=n+1
rs.movenext
if n>=rs.pagesize then exit do  
loop
end if
zongshu=rs.RecordCount
rs.close%>
	  

      <tr>
        <td align="center" class="border_bottom border_right"><strong>合计          	</strong></td>
        <td align="center" class="border_bottom border_right"><strong><%=Formatnumber(hayptcjje,2,true,-1,0)%>元</strong></td>
        <td align="center" class="border_bottom border_right"><strong><%=Formatnumber(hdailiin,2,true,-1,0)%>元</strong></td>
        <td align="center" class="border_bottom border_right"><strong><%=Formatnumber(shoufei,2,true,-1,0)%>元</strong></td>
        <td align="center" class="border_bottom border_right"><strong><%=Formatnumber(hayptcjlr,2,true,-1,0)%>元</strong></td>
        <td align="center" class="border_bottom border_right"><strong><%=hayptcjbs%>笔</strong></td>
        <td align="center" class="border_bottom border_right"><strong><%=Formatnumber(hayptbankj,2,true,-1,0)%>元</strong></td>
        <td align="center" class="border_bottom border_right"><strong><%=Formatnumber(hayptalipayj,2,true,-1,0)%>元</strong></td>
        <td align="center" class="border_bottom border_right"><strong><%=Formatnumber(haypttenpayj,2,true,-1,0)%>元</strong></td>
        <td align="center" class="border_bottom border_right"><strong><%=Formatnumber(hayptsaoj,2,true,-1,0)%>元</strong></td>
        <td align="center" class="border_bottom border_right"><strong><%=Formatnumber(hqqsaoj,2,true,-1,0)%>元</strong></td>
        <td align="center" class="border_bottom"><strong><%=Formatnumber(hayptcardj,2,true,-1,0)%>元</strong></td>
      </tr>
      <tr>
        <td colspan="12">&nbsp;&nbsp;<%call pageye()%>	</td>
      </tr>
    </table>
</body>
</html>
