<!--#include virtual="/show/adminhead.asp"-->
<!--#include file="adminleft.asp"-->

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=webname%>-最高权限-账务统计</title>
<%
call logquanxian("e7",1)
%>
<DIV>
<DIV id=main1200> 
<%call webleft()%>
<DIV id=main_right>
<DIV id=main_right_content>
<STYLE>.apply_style {
	POSITION: absolute
}
.right_title A {
	LINE-HEIGHT: 27px; WIDTH: 126px; DISPLAY: inline-block; BACKGROUND: url(<%=ossurl%>images/bg22.gif) no-repeat; HEIGHT: 27px
}
.right_title A.current {
	BACKGROUND: url(<%=ossurl%>images/main_right_title_bg.gif) no-repeat; COLOR: #fff; FONT-WEIGHT: bold
}
.table_style_1 TD {
	HEIGHT: 38px
}
.table_style_home_info TD {
	PADDING-BOTTOM: 0px; PADDING-LEFT: 10px; PADDING-RIGHT: 0px; HEIGHT: 30px; PADDING-TOP: 0px
}
</STYLE>
<%
link="adminzwtj.asp?cact="
act=request.QueryString("act")
%>
<DIV class=right_titleadmin>&nbsp;&nbsp;账务统计</DIV>
<DIV class=main>
<%
set rsj=server.CreateObject("adodb.recordset")
set rsd=server.CreateObject("adodb.recordset")
Set fso=Server.CreateObject("Scripting.FileSystemObject")
%>

<br>
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
  <tr>
    <td colspan="4" class="border_bottom"><span class="f14" style="font-weight: bold">&nbsp;&nbsp;今日账务统计 <%=date%></span>
	&nbsp;	<%
	'未结算金额,消保统计,套餐金额
	wjsje=0
	baozj=0
	taocanj=0
	rs.open "select ayyue,isjihuo from ayname where isjihuo=0 and ayyue>0",conn,1,1
	if not(rs.bof and rs.eof) then
	do while not rs.eof
	wjsje=ccur(wjsje)+ccur(rs("ayyue"))
	rs.movenext  
	loop
	end if
	rs.close
	
	rs.open "select ayisxiaojin from ayname where ayisxiaojin>0",conn,1,1
	if not(rs.bof and rs.eof) then
	do while not rs.eof
	baozj=ccur(baozj)+ccur(rs("ayisxiaojin"))
	rs.movenext  
	loop
	end if
	rs.close
	
	response.Write "(未申请结算金额："&wjsje&"元 VIP商家："&baozj&"元"
	
	'rs.open "select aytcjin from aytaocanlog",conn,1,1
	'if not(rs.bof and rs.eof) then
	'do while not rs.eof
	'taocanj=ccur(taocanj)+ccur(rs("aytcjin"))
	'rs.movenext  
	'loop
	'end if
	'rs.close
	'response.Write " 套餐金额："&taocanj&"元)"
	

	 '当月流量
	dyll=0  '当月发生金额
	ayptcjbs2=0 '当月成交笔数
	ayptbankj2=0 '当月网银金额
	ayptbank2=0 '当月网银笔数
	ayptalipayj2=0 '当月支付宝金额
	ayptalipay2=0 '当月支付宝笔数
	aypttenpayj2=0 '当月财付通金额
	aypttenpay2=0 '当月财付通笔数
	ayptcardj2=0 '当月充值卡金额
	ayptcard2=0  '当月充值卡笔数
	fandian2=0  '当月返点笔数
	fandianj2=0  '当月返点金额
	lirun2=0   '当月利润
	ayptsaoj2=0          '微信金额
	ayptsaob2=0          '微信笔数
	ayptsaol2=0          '微信利润
	wapalib2=0   'wap支付宝笔数 默认0  
	wapalij2=0    'wap支付宝金额 默认0
	wapalil2=0    'wap支付宝利润 默认0
	waptenb2=0   'wap财付通笔数 默认0  
	waptenj2=0    'wap财付通金额 默认0
	waptenl2=0    'wap财付通利润 默认0
		
	wapweib2=0
	wapweij2=0
	wapweil2=0
	wapqqb2=0
	wapqqj2=0
	wapqql2=0
	
	
jdj2=0  
jdb2=0         
jdl2=0    
wapjdj2=0        
wapjdb2=0  
wapjdl2=0         

ysfj2=0     
ysfb2=0         	
ysfl2=0         	  
wapysfj2=0        
wapysfb2=0    
wapysfl2=0       
		
	
	
	sql="select * from aypttj where aypttjuid=0 and aypttjzq=3 and datediff(mm,ayptdate,'"&now()&"')=0" 
	rs.open sql,conn,1,1
	if not(rs.bof and rs.eof) then
	do while not rs.eof
	dyll=ccur(dyll)+ccur(rs("ayptcjje"))   '当月发生金额
	ayptcjbs2=ccur(ayptcjbs2)+ccur(rs("ayptcjbs"))  '当月成交笔数
	ayptbankj2=ccur(ayptbankj2)+ccur(rs("ayptbankj")) '当月网银金额
	ayptbank2=ccur(ayptbank2)+ccur(rs("ayptbank"))   '当月网银笔数
	ayptalipayj2=ccur(ayptalipayj2)+ccur(rs("ayptalipayj")) '当月支付宝金额
	ayptalipay2=ccur(ayptalipay2)+ccur(rs("ayptalipay"))  '当月支付宝笔数
	aypttenpayj2=ccur(aypttenpayj2)+ccur(rs("aypttenpayj")) '当月财付通金额
	aypttenpay2=ccur(aypttenpay2)+ccur(rs("aypttenpay"))   '当月财付通笔数
	ayptcardj2=ccur(ayptcardj2)+ccur(rs("ayptcardj"))  '当月充值卡金额
	ayptcard2=ccur(ayptcard2)+ccur(rs("ayptcard"))  '当月充值卡笔数
	fandian2=ccur(fandian2)+ccur(rs("ayfandian"))    '当月返点笔数
	fandianj2=ccur(fandianj2)+ccur(rs("ayfandianj"))  '当月返点金额
	lirun2=ccur(lirun2)+ccur(rs("ayptcjlr"))    '当月利润
	shoukuanj2=ccur(shoukuanj2)+ccur(rs("shoukuanj"))  '当月收款金额
	ayptsaoj2=ccur(ayptsaoj2)+ccur(rs("ayptsaoj")) '当月扫码金额
	ayptsaob2=ccur(ayptsaob2)+ccur(rs("ayptsaob")) '当月扫码金额
	ayptsaol2=ccur(ayptsaol2)+ccur(rs("ayptsaol")) '当月扫码金额
	wapalib2=ccur(wapalib2)+ccur(rs("wapalib"))
	wapalij2=ccur(wapalij2)+ccur(rs("wapalij"))
	wapalil2=ccur(wapalil2)+ccur(rs("wapalil"))
	waptenb2=ccur(waptenb2)+ccur(rs("waptenb"))
	waptenj2=ccur(waptenj2)+ccur(rs("waptenj"))
	waptenl2=ccur(waptenl2)+ccur(rs("waptenl")) 
	qqsaob2=ccur(qqsaob2)+ccur(rs("qqsaob")) 
	qqsaoj2=ccur(qqsaoj2)+ccur(rs("qqsaoj")) 
	qqsaol2=ccur(qqsaol2)+ccur(rs("qqsaol")) 
	
	wapweib2=ccur(wapweib2)+ccur(rs("wapweib")) 
	wapweij2=ccur(wapweij2)+ccur(rs("wapweij")) 
	wapweil2=ccur(wapweil2)+ccur(rs("wapweil")) 
	
	wapqqb2=ccur(wapqqb2)+ccur(rs("wapqqb")) 
	wapqqj2=ccur(wapqqj2)+ccur(rs("wapqqj")) 
	wapqql2=ccur(wapqql2)+ccur(rs("wapqql")) 

	jdj2=ccur(jdj2)+ccur(rs("jdj")) 
	jdb2=ccur(jdb2)+ccur(rs("jdb")) 
	jdl2=ccur(jdl2)+ccur(rs("jdl")) 
	wapjdj2=ccur(wapjdj2)+ccur(rs("wapjdj")) 
	wapjdb2=ccur(wapjdb2)+ccur(rs("wapjdb")) 
	wapjdl2=ccur(wapjdl2)+ccur(rs("wapjdl")) 

	ysfj2=ccur(ysfj2)+ccur(rs("ysfj")) 
	ysfb2=ccur(ysfb2)+ccur(rs("ysfb")) 
	ysfl2=ccur(ysfl2)+ccur(rs("ysfl")) 
	wapysfj2=ccur(wapysfj2)+ccur(rs("wapysfj")) 
	wapysfb2=ccur(wapysfb2)+ccur(rs("wapysfb")) 
	wapysfl2=ccur(wapysfl2)+ccur(rs("wapysfl")) 

	rs.movenext  
	loop
	end if
	rs.close
	'response.Write lirun2
	'response.end
	%>	
    
    今日充值金额：<span id="czongshoujin"><img src="/images/jload.gif" /></span>元)</td>
    </tr>
  <tr>
    <td align="center" class="border_right border_bottom" style="font-weight: bold">今日入账金额</td>
    <td align="center" class="border_right border_bottom" style="font-weight: bold">
	<span id="zshouru"><img src="/images/jload.gif" /></span>元 | <span id="zshouru2"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom" style="font-weight: bold">其中收款金额</td>
    <td align="center" class="border_bottom" style="font-weight: bold"><span id="zongshoujin"><img src="/images/jload.gif" /></span>元| <span id="zongshoujinB"><img src="/images/jload.gif" /></span>元/月</td>
    </tr>
  <tr>
    <td align="center" class="border_right border_bottom" style="font-weight: bold">今日利润</td>
    <td align="center" class="border_right border_bottom" style="font-weight: bold">
	<span id="zlirun"><img src="/images/jload.gif" /></span>元 | <span id="zlirunB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom" style="font-weight: bold">总成交笔数</td>
    <td align="center" class="border_bottom" style="font-weight: bold"><span id="ddinb"><img src="/images/jload.gif" /></span>笔 | <span id="ddinbB"><img src="/images/jload.gif" /></span>笔/月</td>
    </tr>

  <tr>
    <td align="center" class="border_right border_bottom">支付宝</td>
    <td align="center" class="border_right border_bottom"><span id="alipayj"><img src="/images/jload.gif" /></span>元 | <span id="alipayjB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">支付宝成交</td>
    <td align="center" class="border_bottom"><span id="alipaysum"><img src="/images/jload.gif" /></span>笔 | <span id="alipaysumB"><img src="/images/jload.gif" /></span>笔/月</td>
    </tr>
  <tr>
    <td align="center" class="border_right border_bottom">微信</td>
    <td align="center" class="border_right border_bottom"><span id="ayptsaoj"><img src="/images/jload.gif" /></span>元 | <span id="ayptsaojB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">微信成交</td>
    <td align="center" class="border_bottom"><span id="ayptsaob"><img src="/images/jload.gif" /></span>笔 | <span id="ayptsaobB"><img src="/images/jload.gif" /></span>笔/月</td>
  </tr>
  <tr>
    <td align="center" class="border_right border_bottom">手Q</td>
    <td align="center" class="border_right border_bottom"><span id="qqsaoj"><img src="/images/jload.gif" /></span>元 | <span id="qqsaojB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">手Q成交</td>
    <td align="center" class="border_bottom"><span id="qqsaob"><img src="/images/jload.gif" /></span>笔 | <span id="qqsaobB"><img src="/images/jload.gif" /></span>笔/月</td>
  </tr>
  <tr>
    <td align="center" class="border_right border_bottom">财付通</td>
    <td align="center" class="border_right border_bottom"><span id="tenpayj"><img src="/images/jload.gif" /></span>元 | <span id="tenpayjB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">财付通成交</td>
    <td align="center" class="border_bottom"><span id="tenpaysum"><img src="/images/jload.gif" /></span>笔 | <span id="tenpaysumB"><img src="/images/jload.gif" /></span>笔/月</td>
    </tr>
  <tr>
    <td align="center" class="border_right border_bottom">网银</td>
    <td align="center" class="border_right border_bottom"><span id="bankj"><img src="/images/jload.gif" /></span>元 | <span id="bankjB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">网银成交</td>
    <td align="center" class="border_bottom"><span id="banksum"><img src="/images/jload.gif" /></span>笔 | <span id="banksumB"><img src="/images/jload.gif" /></span>笔/月</td>
    </tr>
  <tr>
    <td align="center" class="border_right border_bottom">京东</td>
    <td align="center" class="border_right border_bottom"><span id="jdj"><img src="/images/jload.gif" /></span>元 | <span id="jdjB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">京东成交</td>
    <td align="center" class="border_bottom"><span id="jdb"><img src="/images/jload.gif" /></span>笔 | <span id="jdbB"><img src="/images/jload.gif" /></span>笔/月</td>
    </tr>
<!--
  <tr>
    <td align="center" class="border_right border_bottom">云闪付</td>
    <td align="center" class="border_right border_bottom"><span id="ysfj"><img src="/images/jload.gif" /></span>元 | <span id="ysfjB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">云闪付成交</td>
    <td align="center" class="border_bottom"><span id="ysfb"><img src="/images/jload.gif" /></span>笔 | <span id="ysfbB"><img src="/images/jload.gif" /></span>笔/月</td>
    </tr>
-->
  <tr style="background-color:#FFF4FF">
    <td align="center" class="border_right border_bottom">支付宝WAP</td>
    <td align="center" class="border_right border_bottom"><span id="wapalij"><img src="/images/jload.gif" /></span>元 | <span id="wapalijB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">支付宝WAP成交</td>
    <td align="center" class="border_bottom"><span id="wapalib"><img src="/images/jload.gif" /></span>笔 | <span id="wapalibB"><img src="/images/jload.gif" /></span>笔/月</td>
  </tr>

  <tr style="background-color:#FFF4FF">
    <td align="center" class="border_right border_bottom">微信WAP</td>
    <td align="center" class="border_right border_bottom"><span id="wapweij"><img src="/images/jload.gif" /></span>元 | <span id="wapweijB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">微信WAP成交</td>
    <td align="center" class="border_bottom"><span id="wapweib"><img src="/images/jload.gif" /></span>笔 | <span id="wapweibB"><img src="/images/jload.gif" /></span>笔/月</td>
  </tr>

  <tr style="background-color:#FFF4FF">
    <td align="center" class="border_right border_bottom">手Q WAP</td>
    <td align="center" class="border_right border_bottom"><span id="wapqqj"><img src="/images/jload.gif" /></span>元 | <span id="wapqqjB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">手Q WAP成交</td>
    <td align="center" class="border_bottom"><span id="wapqqb"><img src="/images/jload.gif" /></span>笔 | <span id="wapqqbB"><img src="/images/jload.gif" /></span>笔/月</td>
  </tr>

  <tr style="background-color:#FFF4FF">
    <td align="center" class="border_right border_bottom">财付通WAP</td>
    <td align="center" class="border_right border_bottom"><span id="waptenj"><img src="/images/jload.gif" /></span>元 | <span id="waptenjB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">财付通WAP成交</td>
    <td align="center" class="border_bottom"><span id="waptenb"><img src="/images/jload.gif" /></span>笔 | <span id="waptenbB"><img src="/images/jload.gif" /></span>笔/月</td>
  </tr>
  
  <tr style="background-color:#FFF4FF">
    <td align="center" class="border_right border_bottom">京东WAP</td>
    <td align="center" class="border_right border_bottom"><span id="wapjdj"><img src="/images/jload.gif" /></span>元 | <span id="wapjdjB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">京东WAP成交</td>
    <td align="center" class="border_bottom"><span id="wapjdb"><img src="/images/jload.gif" /></span>笔 | <span id="wapjdbB"><img src="/images/jload.gif" /></span>笔/月</td>
  </tr>
<!--
  <tr style="background-color:#FFF4FF">
    <td align="center" class="border_right border_bottom">云闪付WAP</td>
    <td align="center" class="border_right border_bottom"><span id="wapysfj"><img src="/images/jload.gif" /></span>元 | <span id="wapysfjB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">云闪付WAP成交</td>
    <td align="center" class="border_bottom"><span id="wapysfb"><img src="/images/jload.gif" /></span>笔 | <span id="wapysfbB"><img src="/images/jload.gif" /></span>笔/月</td>
  </tr>


  <tr>
    <td align="center" class="border_right border_bottom">充值卡</td> 
    <td align="center" class="border_right border_bottom"><span id="cardj"><img src="/images/jload.gif" /></span>元 | <span id="cardjB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">充值卡成交</td> 
    <td align="center" class="border_bottom"><span id="cardsum"><img src="/images/jload.gif" /></span>笔 | <span id="cardsumB"><img src="/images/jload.gif" /></span>笔/月</td> 
    </tr>





  <tr>
    <td align="center" class="border_right border_bottom">引荐返点</td>
    <td align="center" class="border_right border_bottom"><span id="fandianj"><img src="/images/jload.gif" /></span>元 | <span id="fandianjB"><img src="/images/jload.gif" /></span>元/月</td>
    <td align="center" class="border_right border_bottom">引荐返点笔数</td>
    <td align="center" class="border_bottom" ><span id="fandian"><img src="/images/jload.gif" /></span>笔 | <span id="fandianB"><img src="/images/jload.gif" /></span>笔/月</td>
  </tr>
-->
  <tr>
    <td colspan="4" align="center" class="border_right" style="line-height:22px;">
网银利润<span id="banklirun"><img src="/images/jload.gif" /></span>&nbsp;
支付宝利润<span id="alipaylirun"><img src="/images/jload.gif" /></span>&nbsp;
财付通利润<span id="tenpaylirun"><img src="/images/jload.gif" /></span>&nbsp;
微信利润<span id="ayptsaol"><img src="/images/jload.gif" /></span>&nbsp;
手Q利润<span id="qqsaol"><img src="/images/jload.gif" /></span>&nbsp;
WAP支付宝利润<span id="wapalil"><img src="/images/jload.gif" /></span>&nbsp;
WAP财付通利润<span id="waptenl"><img src="/images/jload.gif" /></span>&nbsp;

WAP微信利润<span id="wapweil"><img src="/images/jload.gif" /></span>&nbsp;
WAP手Q利润<span id="wapqql"><img src="/images/jload.gif" /></span>&nbsp;<br>

京东利润<span id="jdl"><img src="/images/jload.gif" /></span>&nbsp;
京东WAP利润<span id="wapjdl"><img src="/images/jload.gif" /></span>&nbsp;

云闪付利润<span id="ysfl"><img src="/images/jload.gif" /></span>&nbsp;
云闪付WAP利润<span id="wapysfl"><img src="/images/jload.gif" /></span>&nbsp;

自动结算利润<span id="aotolirun"><img src="/images/jload.gif" /></span>&nbsp;
加急利润<span id="jiajilirun"><img src="/images/jload.gif" /></span>&nbsp;
秒结利润<span id="jishilirun"><img src="/images/jload.gif" /></span>&nbsp;
点卡返还利润<span id="diankalirun"><img src="/images/jload.gif" /></span>&nbsp;
充值利润<span id="chonglirun"><img src="/images/jload.gif" /></span>&nbsp;
收款利润<span id="shoulirun"><img src="/images/jload.gif" /></span>&nbsp;
消费金额<span id="xiaofeij"><img src="/images/jload.gif" /></span>



</td>
    </tr>
</table> 
<br>


<%
'***订单统计 开始**********************************************************************************************************
For sum=0 To 5 '订单库数量  总数量-1 如增加库 需修改updata\tongji下的相应文件  case "A"
if sum=0 then ddku="aydingdan"
if sum=1 then ddku="aydingdan01"
if sum=2 then ddku="aydingdan02"
if sum=3 then ddku="aydingdan03"
if sum=4 then ddku="aydingdan04"
if sum=5 then ddku="aydingdan05"

set txt=fso.opentextfile(server.mappath("\updata\tongji\"&ddku&".txt"),1,true) 
ddtxt=txt.readline
txt.close

ddtxt=split(ddtxt,"|")
if DateDiff("d",ddtxt(0),now())>0 then '已次日 重新统计
	ddstr=""
	ddstr=ddstr&now()&"|" 	'记录时间 ddtxt(0)
	ddstr=ddstr&"0|" 	'循环最后ID ddtxt(1)
	ddstr=ddstr&"0|"  	'订单笔数 ddtxt(2)
	ddstr=ddstr&"0|"   	'订单金额 ddtxt(3)
	ddstr=ddstr&"0|"  	'网银笔数 ddtxt(4)
	ddstr=ddstr&"0|"   	'网银金额 ddtxt(5)
	ddstr=ddstr&"0|"  	'充值卡笔数 ddtxt(6)
	ddstr=ddstr&"0|"   	'充值卡金额 ddtxt(7)
	ddstr=ddstr&"0|"    '支付宝笔数 ddtxt(8)
	ddstr=ddstr&"0|"   	'支付宝金额 ddtxt(9)
	ddstr=ddstr&"0|"    '财付通笔数 ddtxt(10)
	ddstr=ddstr&"0|"   	'财付通金额 ddtxt(11)
	ddstr=ddstr&"0|"  	'扫码笔数 ddtxt(12)
	ddstr=ddstr&"0|"   	'扫码金额 ddtxt(13)
	ddstr=ddstr&"0|"  	'WAP支付宝笔数 ddtxt(14)
	ddstr=ddstr&"0|"  	'WAP支付宝金额 ddtxt(15)
	ddstr=ddstr&"0|"  	'WAP财付通笔数 ddtxt(16)
	ddstr=ddstr&"0|"    'WAP财付通金额 ddtxt(17)
	ddstr=ddstr&"0|"    '手Q扫码笔数 ddtxt(18)
	ddstr=ddstr&"0|"    '手Q扫码金额 ddtxt(19)
	
	ddstr=ddstr&"0|"    'wap 微信笔数 ddtxt(20)
	ddstr=ddstr&"0|"    'wap 微信金额 ddtxt(21)
	ddstr=ddstr&"0|"    'wap QQ笔数  ddtxt(22)
	ddstr=ddstr&"0|"    'wap QQ金额  ddtxt(23)
	
	ddstr=ddstr&"0|"     '京东笔数  ddtxt(24)
	ddstr=ddstr&"0|"     '京东金额  ddtxt(25)
	ddstr=ddstr&"0|"     '京东wap笔数  ddtxt(26)
	ddstr=ddstr&"0|"     '京东wap金额  ddtxt(27)
	ddstr=ddstr&"0|"     '云闪付笔数  ddtxt(28)
	ddstr=ddstr&"0|"     '云闪付金额  ddtxt(29)
	ddstr=ddstr&"0|"     '云闪付wap笔数  ddtxt(30)
	ddstr=ddstr&"0"      '云闪付wap金额  ddtxt(31)
	
		
	set linkw=fso.createtextfile(server.mappath("\updata\tongji\"&ddku&".txt"),true)
	linkw.writeline ddstr
	linkw.close
	ddtxt=split(ddstr,"|")
end if
	
	lastid=ddtxt(1)   	 '循环最后ID ddtxt(1)
	ddinb=ddtxt(2)    	 '订单笔数 ddtxt(2)
	ddin=ddtxt(3)     	 '订单金额 ddtxt(3) 
	banksum=ddtxt(4)  	 '银行笔数 ddtxt(4)
	bankj=ddtxt(5)   	 '银行金额 ddtxt(5)
	cardsum=ddtxt(6) 	 '充值卡笔数 ddtxt(6) 
	cardj=ddtxt(7)   	 '充值卡金额 ddtxt(7) 
	alipaysum=ddtxt(8)   '支付宝笔数 ddtxt(8)
	alipayj=ddtxt(9)  	 '支付宝金额 ddtxt(9)
	tenpaysum=ddtxt(10)  '财付通笔数 ddtxt(10)
	tenpayj=ddtxt(11)    '财付通金额 ddtxt(11)
	ayptsaob=ddtxt(12)   '扫码笔数 ddtxt(12)
	ayptsaoj=ddtxt(13)   '扫码金额 ddtxt(13)
	wapalib=ddtxt(14)    'WAP支付宝笔数 ddtxt(14)
	wapalij=ddtxt(15)    'WAP支付宝金额 ddtxt(15)
	waptenb=ddtxt(16)    'WAP腾付通笔数 ddtxt(16)
	waptenj=ddtxt(17)    'WAP腾付通金额 ddtxt(17)
	qqsaob=ddtxt(18)     '手Q扫码笔数 ddtxt(18)
	qqsaoj=ddtxt(19)     '手Q扫码金额 ddtxt(19)
	
	wapweib=ddtxt(20)    'wap 微信笔数 ddtxt(20)
	wapweij=ddtxt(21)    'wap 微信金额 ddtxt(21)
	wapqqb=ddtxt(22)     'wap QQ笔数 ddtxt(22)
	wapqqj=ddtxt(23)     'wap QQ金额 ddtxt(23)
	
	jdb=ddtxt(24)    	 '京东笔数 ddtxt(24)
	jdj=ddtxt(25)    	 '京东金额 ddtxt(25)
	wapjdb=ddtxt(26)     '京东wap笔数 ddtxt(26)
	wapjdj=ddtxt(27)     '京东wap金额 ddtxt(27)
	
	ysfb=ddtxt(28)    	 '闪云付笔数 ddtxt(28)
	ysfj=ddtxt(29)    	 '闪云付金额 ddtxt(29)
	wapysfb=ddtxt(30)    '闪云付wap笔数 ddtxt(30)
	wapysfj=ddtxt(31)    '闪云付wap金额 ddtxt(31)
	

sqld="select aydingdanid,aydingdansj,aydingdanzt,aydingdanzj,ayddzffangshi from "&ddku&" where aydingdanid>"&lastid&" and datediff(day,aydingdansj,'"&now&"')=0 and aydingdanzt=1 order by aydingdanid asc" 
	rsd.open sqld,conn,1,1
	if not(rsd.bof and rsd.eof) then
	do while not rsd.eof
		ddinb=ddinb+1
		ddin=ccur(ddin)+ccur(rsd("aydingdanzj"))
			if rsd("ayddzffangshi")=0 then  			 '0网银
				banksum=banksum+1
				bankj=bankj+ccur(rsd("aydingdanzj"))
			elseif rsd("ayddzffangshi")=1 then 			 '充值卡
				cardsum=cardsum+1
				cardj=cardj+ccur(rsd("aydingdanzj"))
			elseif rsd("ayddzffangshi")=2 then 			 '2支付宝
				alipaysum=alipaysum+1
				alipayj=alipayj+ccur(rsd("aydingdanzj"))
			elseif rsd("ayddzffangshi")=3 then 			 '3财付通
				tenpaysum=tenpaysum+1
				tenpayj=tenpayj+ccur(rsd("aydingdanzj"))
			elseif rsd("ayddzffangshi")=4 then           '4微信 
				ayptsaob=ayptsaob+1
				ayptsaoj=ayptsaoj+ccur(rsd("aydingdanzj"))
			elseif rsd("ayddzffangshi")=5 then  			 '5手Q扫码
				qqsaob=qqsaob+1
				qqsaoj=qqsaoj+ccur(rsd("aydingdanzj"))
			elseif rsd("ayddzffangshi")=6 then  			 '6京东扫码
				jdb=jdb+1
				jdj=jdj+ccur(rsd("aydingdanzj"))
			elseif rsd("ayddzffangshi")=7 then  			 '7闪云付扫码
				ysfb=ysfb+1
				ysfj=ysfj+ccur(rsd("aydingdanzj"))
								
				
			elseif rsd("ayddzffangshi")=10 then 			 '10WAP支付宝
				wapalib=wapalib+1
				wapalij=wapalij+ccur(rsd("aydingdanzj"))
			elseif rsd("ayddzffangshi")=12 then 			 '12WAP财付通
				waptenb=waptenb+1
				waptenj=waptenj+ccur(rsd("aydingdanzj"))
			elseif rsd("ayddzffangshi")=13 then 			 '13WAP微信
				wapweib=wapweib+1
				wapweij=wapweij+ccur(rsd("aydingdanzj"))
			elseif rsd("ayddzffangshi")=14 then 			 '14 WAP qq
				wapqqb=wapqqb+1
				wapqqj=wapqqj+ccur(rsd("aydingdanzj"))
			elseif rsd("ayddzffangshi")=15 then 			 '15 京东wap
				wapjdb=wapjdb+1
				wapjdj=wapjdj+ccur(rsd("aydingdanzj"))
			elseif rsd("ayddzffangshi")=16 then 			 '16 闪云付wap
				wapysfb=wapysfb+1
				wapysfj=wapysfj+ccur(rsd("aydingdanzj"))

			end if
	lastid=rsd("aydingdanid")
	rsd.movenext  
	loop
	end if
	rsd.close
		
	ddstr=""   	 				'记录值字符串
	ddstr=ddstr&ddtxt(0)&"|" 	'记录时间 ddtxt(0)
	ddstr=ddstr&lastid&"|" 		'循环最后ID ddtxt(1)
	ddstr=ddstr&ddinb&"|"  		'订单笔数 ddtxt(2)
	ddstr=ddstr&ddin&"|"   		'订单金额 ddtxt(3) 
	ddstr=ddstr&banksum&"|"  	'网银笔数 ddtxt(4)
	ddstr=ddstr&bankj&"|"   	'网银金额 ddtxt(5)
	ddstr=ddstr&cardsum&"|"  	'充值卡笔数 ddtxt(6) 
	ddstr=ddstr&cardj&"|"   	'充值卡金额 ddtxt(7)
	ddstr=ddstr&alipaysum&"|"   '支付宝笔数 ddtxt(8)
	ddstr=ddstr&alipayj&"|"   	'支付宝金额 ddtxt(9)
	ddstr=ddstr&tenpaysum&"|"   '财付通笔数 ddtxt(10)
	ddstr=ddstr&tenpayj&"|"   	'财付通金额 ddtxt(11)
	ddstr=ddstr&ayptsaob&"|"  	'扫码笔数 ddtxt(12)
	ddstr=ddstr&ayptsaoj&"|"   	'扫码金额 ddtxt(13)
	ddstr=ddstr&wapalib&"|"  	'WAP支付宝笔数 ddtxt(14)
	ddstr=ddstr&wapalij&"|"  	'WAP支付宝金额 ddtxt(15)
	ddstr=ddstr&waptenb&"|"  	'WAP财付通笔数 ddtxt(16)
	ddstr=ddstr&waptenj&"|"   	'WAP财付通金额 ddtxt(17)
	ddstr=ddstr&qqsaob&"|"      '手Q扫码笔数 ddtxt(18)
	ddstr=ddstr&qqsaoj&"|"      '手Q扫码金额 ddtxt(19)
	
	ddstr=ddstr&wapweib&"|"     'wap 微信笔数 ddtxt(20)
	ddstr=ddstr&wapweij&"|"     'wap 微信金额 ddtxt(21)
	ddstr=ddstr&wapqqb&"|"      'wap QQ笔数 ddtxt(22)
	ddstr=ddstr&wapqqj&"|"      'wap QQ金额 ddtxt(23)
		
		
	ddstr=ddstr&jdb&"|"         '京东笔数 ddtxt(24)
	ddstr=ddstr&jdj&"|"         '京东金额 ddtxt(25)
	ddstr=ddstr&wapjdb&"|"      '京东wap笔数 ddtxt(26)
	ddstr=ddstr&wapjdj&"|"      '京东wap金额 ddtxt(27)
	
	ddstr=ddstr&ysfb&"|"         '云闪付笔数 ddtxt(28)
	ddstr=ddstr&ysfj&"|"         '云闪付金额 ddtxt(29)	
	ddstr=ddstr&wapysfb&"|"      '云闪付wap笔数 ddtxt(30)
	ddstr=ddstr&wapysfj          '云闪付wap金额 ddtxt(31)
			
	
	set linkw=fso.createtextfile(server.mappath("\updata\tongji\"&ddku&".txt"),true)
	linkw.writeline ddstr
	linkw.close
next
'***订单统计 结束***************************************************************************************************



'***财务统计********************************************************************************************************
For sum=0 To 5 '财务库数量  总数量-1 如增加库 需修改updata\tongji下的相应文件  case "A"
if sum=0 then cwku="aycaiwu"
if sum=1 then cwku="aycaiwu01"
if sum=2 then cwku="aycaiwu02"
if sum=3 then cwku="aycaiwu03"
if sum=4 then cwku="aycaiwu04"
if sum=5 then cwku="aycaiwu05"



ddstr=""
set txt=fso.opentextfile(server.mappath("\updata\tongji\"&cwku&".txt"),1,true) 
ddtxt=txt.readline
txt.close

ddtxt=split(ddtxt,"|")
if DateDiff("d",ddtxt(0),now())>0 then '已次日 重新统计
	ddstr=""
	ddstr=ddstr&now()&"|" 	'记录时间 ddtxt(0)
	ddstr=ddstr&"0|" 	'循环最后ID ddtxt(1)
	ddstr=ddstr&"0|"  	'发生金额 ddtxt(2)
	ddstr=ddstr&"0|"   	'充值笔数 ddtxt(3)
	ddstr=ddstr&"0|"  	'充值金额 ddtxt(4)
	ddstr=ddstr&"0|"   	'充值利润 ddtxt(5)
	ddstr=ddstr&"0|"  	'返点笔数 ddtxt(6)
	ddstr=ddstr&"0|"   	'返点金额 ddtxt(7)
	ddstr=ddstr&"0|"    '点卡余额返还笔数 ddtxt(8)
	ddstr=ddstr&"0|"   	'点卡余额返还金额 ddtxt(9)
	ddstr=ddstr&"0|"    '秒结笔数 ddtxt(10)
	ddstr=ddstr&"0|"   	'秒结利润 ddtxt(11)
	ddstr=ddstr&"0|"  	'加急笔数 ddtxt(12)
	ddstr=ddstr&"0|"   	'加急利润 ddtxt(13)
	ddstr=ddstr&"0|"  	'自动结算笔数 ddtxt(14)
	ddstr=ddstr&"0|"  	'自动结算利润 ddtxt(15)
	ddstr=ddstr&"0|"  	'收款笔数 ddtxt(16)
	ddstr=ddstr&"0|"    '收款金额 ddtxt(17)
	ddstr=ddstr&"0|"    '收款利润 ddtxt(18)
	ddstr=ddstr&"0|"    '网银利润 ddtxt(19)
	ddstr=ddstr&"0|"    '支付宝利润 ddtxt(20)
	ddstr=ddstr&"0|"    '财付通利润 ddtxt(21)
	ddstr=ddstr&"0|"    '扫码利润 ddtxt(22)
	ddstr=ddstr&"0|"    'wap支付宝利润 ddtxt(23)
	ddstr=ddstr&"0|"    'wap财付通利润 ddtxt(24)
	ddstr=ddstr&"0|"    '手Q扫码利润 ddtxt(25)
	
	ddstr=ddstr&"0|"     'wap 微信利润 ddtxt(26)
	ddstr=ddstr&"0|"     'wap qq利润 ddtxt(27)
	ddstr=ddstr&"0|"     '消费金额 ddtxt(28)
	
	ddstr=ddstr&"0|"     '京东利润 ddtxt(29)
	ddstr=ddstr&"0|"     '京东wap利润 ddtxt(30)
	ddstr=ddstr&"0|"     '云闪付利润 ddtxt(31)
	ddstr=ddstr&"0"      '云闪付wap利润 ddtxt(32)
	
	
	set linkw=fso.createtextfile(server.mappath("\updata\tongji\"&cwku&".txt"),true)
	linkw.writeline ddstr
	linkw.close
	ddtxt=split(ddstr,"|")
end if

lastid=ddtxt(1)   	 		'循环最后ID ddtxt(1)
minje=ddtxt(2)				'发生金额 ddtxt(2)
chonglirunsum=ddtxt(3)		'充值笔数 ddtxt(3)
czongshoujin=ddtxt(4)		'充值金额 ddtxt(4)
chonglirun=ddtxt(5)			'充值利润 ddtxt(5)
fandian=ddtxt(6)			'返点笔数 ddtxt(6)
fandianj=ddtxt(7)			'返点金额 ddtxt(7)
diankalirunsum=ddtxt(8)		'点卡余额返还笔数 ddtxt(8)
diankalirun=ddtxt(9)		'点卡余额返还金额 ddtxt(9)
jishilirunsum=ddtxt(10)		'秒结笔数 ddtxt(10)
jishilirun=ddtxt(11)		'秒结利润 ddtxt(11)
jiajilirunsum=ddtxt(12)		'加急笔数 ddtxt(12)
jiajilirun=ddtxt(13)		'加急利润 ddtxt(13)
aotolirunsum=ddtxt(14)		'自动结算笔数 ddtxt(14)
aotolirun=ddtxt(15)			'自动结算利润 ddtxt(15)
shoulirunsum=ddtxt(16)		'收款笔数 ddtxt(16)
zongshoujin=ddtxt(17)		'收款金额 ddtxt(17)
shoulirun=ddtxt(18)			'收款利润 ddtxt(18)
banklirun=ddtxt(19)			'网银利润 ddtxt(19)
alipaylirun=ddtxt(20)		'支付宝利润 ddtxt(20)
tenpaylirun=ddtxt(21)		'财付通利润 ddtxt(21)
ayptsaol=ddtxt(22)			'扫码利润 ddtxt(22)
wapalil=ddtxt(23)			'wap支付宝利润 ddtxt(23)
waptenl=ddtxt(24)			'wap财付通利润 ddtxt(24)
qqsaol=ddtxt(25)			'QQ扫码利润 ddtxt(25)

wapweil=ddtxt(26)			'wap微信利润 ddtxt(26)
wapqql=ddtxt(27)			'wap QQ利润 ddtxt(27)
xiaofeij=ddtxt(28)			'消费金额 ddtxt(28)

jdl=ddtxt(29)				'京东利润 ddtxt(29)
wapjdl=ddtxt(30)			'京东wap利润 ddtxt(30)
ysfl=ddtxt(31)				'云闪付利润 ddtxt(31)
wapysfl=ddtxt(32)			'云闪付wap利润 ddtxt(32)



sqlj="select aycailiushui,aycaiwuid,aycaiwudate,aycaiwuleibie,aycaiwuzt,aycwfsjin,apicheng,aycaiwubody,aycaiwuzhifu,aycaiwujine from "&cwku&" where aycaiwuid>"&lastid&" and datediff(day,aycaiwudate,'"&now()&"')=0 and (aycaiwuleibie=0 or aycaiwuleibie=3 or aycaiwuleibie=5 or aycaiwuleibie=8 or aycaiwuleibie=10 or aycaiwuleibie=12 or aycaiwuleibie=14 or aycaiwuleibie=15 or aycaiwuleibie=16 or aycaiwuleibie=17 or aycaiwuleibie=18) and aycaiwuzt=1 order by aycaiwuid asc" 
	rsj.open sqlj,conn,1,3
	if not(rsj.bof and rsj.eof) then
	do while not rsj.eof
		minje=ccur(minje)+ccur(rsj("aycwfsjin"))     '发生金额
			if rsj("aycaiwuleibie")=5 then  		 '消费 购买套餐等
			xiaofeij=xiaofeij+ccur(rsj("aycwfsjin"))
			end if
			if rsj("aycaiwuleibie")=3 then  		 '充值金额
			chonglirunsum=chonglirunsum+1 
			czongshoujin=czongshoujin+ccur(rsj("aycwfsjin"))
			end if
			if rsj("aycaiwuleibie")=8 then  		 '引荐返点
			fandian=fandian+1                       
			fandianj=fandianj+ccur(rsj("aycwfsjin"))
			end if
			if rsj("aycaiwuleibie")=10 then  		 '点卡余额利润
			diankalirunsum=diankalirunsum+1
			diankalirun=ccur(diankalirun)+ccur(rsj("aycaiwujine"))
			end if
			if rsj("aycaiwuleibie")=14 then 		 '即时到账利润
			jishilirunsum=jishilirunsum+1
			jishilirun=ccur(jishilirun)+ccur(rsj("aycaiwujine"))
			end if
			if rsj("aycaiwuleibie")=15 then 		 '加急手续费利润
			jiajilirunsum=jiajilirunsum+1
			jiajilirun=ccur(jiajilirun)+ccur(rsj("aycaiwujine"))
			end if
			if rsj("aycaiwuleibie")=16 then 		 '自动结算手续费利润
			aotolirunsum=aotolirunsum+1
			aotolirun=ccur(aotolirun)+ccur(rsj("aycaiwujine"))
			end if
			if rsj("aycaiwuleibie")=17 then 		 '收款手续费利润
			jin=""
			shoulirunsum=shoulirunsum+1
				jin=replace(trim(rsj("aycaiwubody")),"收款"," ")   '总收款金额
				jin=replace(trim(jin),"元"," ")
				jin=trim(jin)
				shoulirun=ccur(shoulirun)+rsj("apicheng")/100*ccur(jin)
				zongshoujin=ccur(zongshoujin)+ccur(jin)
			end if
			'接口利润
			if rsj("aycaiwuzhifu")=0 then  		'0网银
				if rsj("apicheng")<>"" then 
					if ccur(rsj("aycwfsjin"))<1 then
					banklirun=ccur(banklirun)+0.01
					else
					banklirun=ccur(banklirun)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				
			elseif rsj("aycaiwuzhifu")=2 then  '2支付宝
				if rsj("apicheng")<>"" then 
					if ccur(rsj("aycwfsjin"))<1 then
					alipaylirun=ccur(alipaylirun)+0.01
					else
					alipaylirun=ccur(alipaylirun)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				
			elseif rsj("aycaiwuzhifu")=3 then  '3财付通
				if rsj("apicheng")<>"" then 
					if ccur(rsj("aycwfsjin"))<1 then
					tenpaylirun=ccur(tenpaylirun)+0.01
					else
					tenpaylirun=ccur(tenpaylirun)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				
			elseif rsj("aycaiwuzhifu")=4 then  '4扫码支付
				if rsj("apicheng")<>"" then
					if ccur(rsj("aycwfsjin"))<1 then
					ayptsaol=ccur(ayptsaol)+0.01
					else
					ayptsaol=ccur(ayptsaol)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				
			elseif rsj("aycaiwuzhifu")=5 then  'QQ扫码支付
				if rsj("apicheng")<>"" then 
					if ccur(rsj("aycwfsjin"))<1 then
					qqsaol=ccur(qqsaol)+0.01
					else
					qqsaol=ccur(qqsaol)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				
			elseif rsj("aycaiwuzhifu")=6 then  '京东扫码支付
				if rsj("apicheng")<>"" then 
					if ccur(rsj("aycwfsjin"))<1 then
					jdl=ccur(jdl)+0.01
					else
					jdl=ccur(jdl)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				
			elseif rsj("aycaiwuzhifu")=7 then  '云闪付扫码支付
				if rsj("apicheng")<>"" then 
					if ccur(rsj("aycwfsjin"))<1 then
					ysfl=ccur(ysfl)+0.01
					else
					ysfl=ccur(ysfl)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				

				
			elseif rsj("aycaiwuzhifu")=10 then  'WAP支付宝	
				if rsj("apicheng")<>"" then 
					if ccur(rsj("aycwfsjin"))<1 then
					wapalil=ccur(wapalil)+0.01
					else
					wapalil=ccur(wapalil)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				
			elseif rsj("aycaiwuzhifu")=12 then  'WAP财付通	
				if rsj("apicheng")<>"" then 
					if ccur(rsj("aycwfsjin"))<1 then
					waptenl=ccur(waptenl)+0.01
					else
					waptenl=ccur(waptenl)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				
			elseif rsj("aycaiwuzhifu")=13 then  'WAP微信	
				if rsj("apicheng")<>"" then 
					if ccur(rsj("aycwfsjin"))<1 then
					wapweil=ccur(wapweil)+0.01
					else
					wapweil=ccur(wapweil)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				
			elseif rsj("aycaiwuzhifu")=14 then  'WAP QQ	
				if rsj("apicheng")<>"" then 
					if ccur(rsj("aycwfsjin"))<1 then
					wapqql=ccur(wapqql)+0.01
					else
					wapqql=ccur(wapqql)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				
			elseif rsj("aycaiwuzhifu")=15 then  '京东WAP	
				if rsj("apicheng")<>"" then 
					if ccur(rsj("aycwfsjin"))<1 then
					wapjdl=ccur(wapjdl)+0.01
					else
					wapjdl=ccur(wapjdl)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				
			elseif rsj("aycaiwuzhifu")=16 then  '云闪付WAP	
				if rsj("apicheng")<>"" then 
					if ccur(rsj("aycwfsjin"))<1 then
					wapysfl=ccur(wapysfl)+0.01
					else
					wapysfl=ccur(wapysfl)+rsj("apicheng")/100*rsj("aycwfsjin")
					end if
				end if
				
				
			end if

	lastid=rsj("aycaiwuid")
	rsj.movenext  
	loop
	end if
	rsj.close

	ddstr=""
	ddstr=ddstr&ddtxt(0)&"|" 		'记录时间 ddtxt(0)
	ddstr=ddstr&lastid&"|" 			'循环最后ID ddtxt(1)
	ddstr=ddstr&minje&"|"  			'发生金额 ddtxt(2)
	ddstr=ddstr&chonglirunsum&"|"   '充值笔数 ddtxt(3)
	ddstr=ddstr&czongshoujin&"|"  	'充值金额 ddtxt(4)
	ddstr=ddstr&chonglirun&"|"   	'充值利润 ddtxt(5)
	ddstr=ddstr&fandian&"|"  		'返点笔数 ddtxt(6)
	ddstr=ddstr&fandianj&"|"   		'返点金额 ddtxt(7)
	ddstr=ddstr&diankalirunsum&"|"  '点卡余额返还笔数 ddtxt(8)
	ddstr=ddstr&diankalirun&"|"   	'点卡余额返还金额 ddtxt(9)
	ddstr=ddstr&jishilirunsum&"|"   '秒结笔数 ddtxt(10)
	ddstr=ddstr&jishilirun&"|"   	'秒结利润 ddtxt(11)
	ddstr=ddstr&jiajilirunsum&"|"  	'加急笔数 ddtxt(12)
	ddstr=ddstr&jiajilirun&"|"   	'加急利润 ddtxt(13)
	ddstr=ddstr&aotolirunsum&"|"  	'自动结算笔数 ddtxt(14)
	ddstr=ddstr&aotolirun&"|"  		'自动结算利润 ddtxt(15)
	ddstr=ddstr&shoulirunsum&"|"  	'收款笔数 ddtxt(16)
	ddstr=ddstr&zongshoujin&"|"     '收款金额 ddtxt(17)
	ddstr=ddstr&shoulirun&"|"    	'收款利润 ddtxt(18)
	ddstr=ddstr&banklirun&"|"    	'网银利润 ddtxt(19)
	ddstr=ddstr&alipaylirun&"|"     '支付宝利润 ddtxt(20)
	ddstr=ddstr&tenpaylirun&"|"     '财付通利润 ddtxt(21)
	ddstr=ddstr&ayptsaol&"|"    	'扫码利润 ddtxt(22)
	ddstr=ddstr&wapalil&"|"   		'wap支付宝利润 ddtxt(23)
	ddstr=ddstr&waptenl&"|" 	    'wap财付通利润 ddtxt(24)
	ddstr=ddstr&qqsaol&"|"          'QQ扫码利润 ddtxt(25)
	
	ddstr=ddstr&wapweil&"|" 	    'wap微信利润 ddtxt(26)
	ddstr=ddstr&wapqql&"|"          'wap QQ利润 ddtxt(27)
	ddstr=ddstr&xiaofeij&"|"        '消费金额 ddtxt(28)
	
	ddstr=ddstr&jdl&"|"       	    '京东利润 ddtxt(29)
	ddstr=ddstr&wapjdl&"|"          '京东wap利润 ddtxt(30)
	ddstr=ddstr&ysfl&"|"       	    '云闪付利润 ddtxt(31)
	ddstr=ddstr&wapysfl             '云闪付wap利润 ddtxt(32)
		
	
	
	set linkw=fso.createtextfile(server.mappath("\updata\tongji\"&cwku&".txt"),true)
	linkw.writeline ddstr
	linkw.close
next
'****财务统计 结束***********************************************************************************************************
	

'**订单合计统计 开始***********************************************************************************************************
ddinb=0    	 '订单笔数 ddtxt(2)
ddin=0     	 '订单金额 ddtxt(3) 
banksum=0  	 '银行笔数 ddtxt(4)
bankj=0   	 '银行金额 ddtxt(5)
cardsum=0 	 '充值卡笔数 ddtxt(6) 
cardj=0  	 '充值卡金额 ddtxt(7) 
alipaysum=0   '支付宝笔数 ddtxt(8)
alipayj=0 	 '支付宝金额 ddtxt(9)
tenpaysum=0  '财付通笔数 ddtxt(10)
tenpayj=0    '财付通金额 ddtxt(11)
ayptsaob=0   '扫码笔数 ddtxt(12)
ayptsaoj=0  '扫码金额 ddtxt(13)
wapalib=0    'WAP支付宝笔数 ddtxt(14)
wapalij=0   'WAP支付宝金额 ddtxt(15)
waptenb=0    'WAP腾付通笔数 ddtxt(16)
waptenj=0    'WAP腾付通金额 ddtxt(17)
qqsaob=0    '手Q扫码笔数 ddtxt(18)
qqsaoj=0    '手Q扫码金额 ddtxt(19)

wapweib=0
wapweij=0
wapqqb=0
wapqqj=0

jdb=0
jdj=0
wapjdb=0
wapjdj=0

ysfb=0
ysfj=0
wapysfb=0
wapysfj=0


For sum=0 To 5 '订单库数量  总数量-1 如增加库 需修改updata\tongji下的相应文件  case "A"
if sum=0 then ddku="aydingdan"
if sum=1 then ddku="aydingdan01"
if sum=2 then ddku="aydingdan02"
if sum=3 then ddku="aydingdan03"
if sum=4 then ddku="aydingdan04"
if sum=5 then ddku="aydingdan05"
set txt=fso.opentextfile(server.mappath("\updata\tongji\"&ddku&".txt"),1,true) 
ddtxt=txt.readline
txt.close
ddtxt=split(ddtxt,"|")
ddinb=ddinb+ddtxt(2)    	 '订单笔数 ddtxt(2)
ddin=ddin+ddtxt(3)     	 '订单金额 ddtxt(3) 
banksum=banksum+ddtxt(4)  	 '银行笔数 ddtxt(4)
bankj=bankj+ddtxt(5)   	 '银行金额 ddtxt(5)
cardsum=cardsum+ddtxt(6) 	 '充值卡笔数 ddtxt(6) 
cardj=cardj+ddtxt(7)   	 '充值卡金额 ddtxt(7) 
alipaysum=alipaysum+ddtxt(8)   '支付宝笔数 ddtxt(8)
alipayj=alipayj+ddtxt(9)  	 '支付宝金额 ddtxt(9)
tenpaysum=tenpaysum+ddtxt(10)  '财付通笔数 ddtxt(10)
tenpayj=tenpayj+ddtxt(11)    '财付通金额 ddtxt(11)
ayptsaob=ayptsaob+ddtxt(12)   '扫码笔数 ddtxt(12)
ayptsaoj=ayptsaoj+ddtxt(13)   '扫码金额 ddtxt(13)
wapalib=wapalib+ddtxt(14)    'WAP支付宝笔数 ddtxt(14)
wapalij=wapalij+ddtxt(15)    'WAP支付宝金额 ddtxt(15)
waptenb=waptenb+ddtxt(16)    'WAP腾付通笔数 ddtxt(16)
waptenj=waptenj+ddtxt(17)    'WAP腾付通金额 ddtxt(17)
qqsaob=qqsaob+ddtxt(18)     '手Q扫码笔数 ddtxt(18)
qqsaoj=qqsaoj+ddtxt(19)     '手Q扫码金额 ddtxt(19)

wapweib=wapweib+ddtxt(20)     'wap微信笔数 ddtxt(20)
wapweij=wapweij+ddtxt(21)     'wap微信金额 ddtxt(21)
wapqqb=wapqqb+ddtxt(22)       'wap QQ笔数  ddtxt(22)
wapqqj=wapqqj+ddtxt(23)       'wap QQ金额  ddtxt(23)

jdb=jdb+ddtxt(24)      
jdj=jdj+ddtxt(25)       
wapjdb=wapjdb+ddtxt(26)   
wapjdj=wapjdj+ddtxt(27)     

ysfb=ysfb+ddtxt(28)     
ysfj=ysfj+ddtxt(29)      
wapysfb=wapysfb+ddtxt(30)    
wapysfj=wapysfj+ddtxt(31)     



next
'**合计统计 结束***********************************************************************************************************


'**财务合计统计 开始***********************************************************************************************************
minje=0				'发生金额 ddtxt(2)
chonglirunsum=0		'充值笔数 ddtxt(3)
czongshoujin=0		'充值金额 ddtxt(4)
chonglirun=0			'充值利润 ddtxt(5)
fandian=0			'返点笔数 ddtxt(6)
fandianj=0			'返点金额 ddtxt(7)
diankalirunsum=0		'点卡余额返还笔数 ddtxt(8)
diankalirun=0		'点卡余额返还金额 ddtxt(9)
jishilirunsum=0		'秒结笔数 ddtxt(10)
jishilirun=0		'秒结利润 ddtxt(11)
jiajilirunsum=0	'加急笔数 ddtxt(12)
jiajilirun=0		'加急利润 ddtxt(13)
aotolirunsum=0		'自动结算笔数 ddtxt(14)
aotolirun=0		'自动结算利润 ddtxt(15)
shoulirunsum=0		'收款笔数 ddtxt(16)
zongshoujin=0		'收款金额 ddtxt(17)
shoulirun=0		'收款利润 ddtxt(18)
banklirun=0		'网银利润 ddtxt(19)
alipaylirun=0		'支付宝利润 ddtxt(20)
tenpaylirun=0		'财付通利润 ddtxt(21)
ayptsaol=0			'扫码利润 ddtxt(22)
wapalil=0			'wap支付宝利润 ddtxt(23)
waptenl=0			'wap财付通利润 ddtxt(24)
qqsaol=0			'QQ扫码利润 ddtxt(25)

wapweil=0			'wap 微信利润 ddtxt(26)
wapqql=0			'wap QQ利润 ddtxt(27)
xiaofeij=0          '消费金额 ddtxt(28)

jdl=0          	   '京东利润 ddtxt(29)
wapjdl=0           '京东wap利润 ddtxt(30)
ysfl=0         	   '云闪付利润 ddtxt(31)
wapysfl=0          '云闪付wap利润 ddtxt(32)




For sum=0 To 5 '订单库数量  总数量-1 如增加库 需修改updata\tongji下的相应文件  case "A"
if sum=0 then cwku="aycaiwu"
if sum=1 then cwku="aycaiwu01"
if sum=2 then cwku="aycaiwu02"
if sum=3 then cwku="aycaiwu03"
if sum=4 then cwku="aycaiwu04"
if sum=5 then cwku="aycaiwu05"
set txt=fso.opentextfile(server.mappath("\updata\tongji\"&cwku&".txt"),1,true) 
ddtxt=txt.readline
txt.close
ddtxt=split(ddtxt,"|")
minje=minje+ddtxt(2)				'发生金额 ddtxt(2)
chonglirunsum=chonglirunsum+ddtxt(3)		'充值笔数 ddtxt(3)
czongshoujin=czongshoujin+ddtxt(4)		'充值金额 ddtxt(4)
chonglirun=chonglirun+ddtxt(5)			'充值利润 ddtxt(5)
fandian=fandian+ddtxt(6)			'返点笔数 ddtxt(6)
fandianj=fandianj+ddtxt(7)			'返点金额 ddtxt(7)
diankalirunsum=diankalirunsum+ddtxt(8)		'点卡余额返还笔数 ddtxt(8)
diankalirun=diankalirun+ddtxt(9)		'点卡余额返还金额 ddtxt(9)
jishilirunsum=jishilirunsum+ddtxt(10)		'秒结笔数 ddtxt(10)
jishilirun=jishilirun+ddtxt(11)		'秒结利润 ddtxt(11)
jiajilirunsum=jiajilirunsum+ddtxt(12)		'加急笔数 ddtxt(12)
jiajilirun=jiajilirun+ddtxt(13)		'加急利润 ddtxt(13)
aotolirunsum=aotolirunsum+ddtxt(14)		'自动结算笔数 ddtxt(14)
aotolirun=aotolirun+ddtxt(15)			'自动结算利润 ddtxt(15)
shoulirunsum=shoulirunsum+ddtxt(16)		'收款笔数 ddtxt(16)
zongshoujin=zongshoujin+ddtxt(17)		'收款金额 ddtxt(17)
shoulirun=shoulirun+ddtxt(18)			'收款利润 ddtxt(18)
banklirun=banklirun+ddtxt(19)			'网银利润 ddtxt(19)
alipaylirun=alipaylirun+ddtxt(20)		'支付宝利润 ddtxt(20)
tenpaylirun=tenpaylirun+ddtxt(21)		'财付通利润 ddtxt(21)
ayptsaol=ayptsaol+ddtxt(22)			'扫码利润 ddtxt(22)
wapalil=wapalil+ddtxt(23)			'wap支付宝利润 ddtxt(23)
waptenl=waptenl+ddtxt(24)			'wap财付通利润 ddtxt(24)
qqsaol=qqsaol+ddtxt(25)				'QQ扫码利润 ddtxt(25)

wapweil=wapweil+ddtxt(26)			'wap 微信利润 ddtxt(26)
wapqql=wapqql+ddtxt(27)				'wap QQ利润 ddtxt(27)
xiaofeij=xiaofeij+ddtxt(28)			'消费金额 ddtxt(28)

jdl=jdl+ddtxt(29)					'京东利润 ddtxt(29)
wapjdl=wapjdl+ddtxt(30)				'京东wap利润 ddtxt(30)
ysfl=ysfl+ddtxt(31)					'云闪付利润 ddtxt(31)
wapysfl=wapysfl+ddtxt(32)			'云闪付wap利润 ddtxt(32)


next
'**合计统计 结束***********************************************************************************************************


'总利润  
zlirun=0
zlirun=ccur(zlirun)+ccur(diankalirun) '点卡余额返回利润
zlirun=ccur(zlirun)+ccur(jishilirun)  '秒结利润
zlirun=ccur(zlirun)+ccur(jiajilirun)  '加急利润
zlirun=ccur(zlirun)+ccur(aotolirun)   '自动结算利润
zlirun=ccur(zlirun)+ccur(shoulirun)   '收款利润
zlirun=ccur(zlirun)+ccur(banklirun)   '网银接口利润
zlirun=ccur(zlirun)+ccur(alipaylirun) '支付宝接口利润
zlirun=ccur(zlirun)+ccur(tenpaylirun) '财付通接口利润
zlirun=ccur(zlirun)+ccur(ayptsaol)    '微信接口利润
zlirun=ccur(zlirun)+ccur(wapalil)     '支付宝WAP接口利润
zlirun=ccur(zlirun)+ccur(waptenl)     '财付通WAP接口利润
zlirun=ccur(zlirun)+ccur(qqsaol)      'qq扫码利润
zlirun=ccur(zlirun)+ccur(wapweil)      'wap 微信利润
zlirun=ccur(zlirun)+ccur(wapqql)       'wap qq利润
zlirun=ccur(zlirun)+ccur(xiaofeij)       '消费金额

zlirun=ccur(zlirun)+ccur(jdl)    
zlirun=ccur(zlirun)+ccur(wapjdl)     
zlirun=ccur(zlirun)+ccur(ysfl) 
zlirun=ccur(zlirun)+ccur(wapysfl)   


'总入款
zshouru=ccur(ddin)+ccur(czongshoujin)+ccur(zongshoujin) 


%>

<script type="text/javascript">
czongshoujin.innerHTML=<%=czongshoujin%>;
zshouru.innerHTML=<%=Formatnumber(zshouru,3,true,-1,0)%>;
zshouru2.innerHTML=<%=Formatnumber((dyll+zshouru),3,true,-1,0)%>;
zongshoujin.innerHTML=<%=Formatnumber(zongshoujin,3,true,-1,0)%>;
zongshoujinB.innerHTML=<%=Formatnumber(zongshoujin+shoukuanj2,3,true,-1,0)%>
zlirun.innerHTML=<%=Formatnumber(ccur(zlirun),3,true,-1,0)%>;
zlirunB.innerHTML=<%=Formatnumber(ccur(zlirun)+ccur(lirun2),3,true,-1,0)%>;
ddinb.innerHTML=<%=ddinb%>;
ddinbB.innerHTML=<%=ayptcjbs2+ddinb%>;
bankj.innerHTML=<%=Formatnumber(bankj,3,true,-1,0)%>;
bankjB.innerHTML=<%=Formatnumber(ayptbankj2+bankj,3,true,-1,0)%>;
banksum.innerHTML=<%=banksum%>;
banksumB.innerHTML=<%=ayptbank2+banksum%>;
alipayj.innerHTML=<%=Formatnumber(alipayj,3,true,-1,0)%>;
alipayjB.innerHTML=<%=Formatnumber(ayptalipayj2+alipayj,3,true,-1,0)%>;
alipaysum.innerHTML=<%=alipaysum%>;
alipaysumB.innerHTML=<%=ayptalipay2+alipaysum%>;
tenpayj.innerHTML=<%=Formatnumber(tenpayj,3,true,-1,0)%>;
tenpayjB.innerHTML=<%=Formatnumber(aypttenpayj2+tenpayj,3,true,-1,0)%>;
tenpaysum.innerHTML=<%=tenpaysum%>;
tenpaysumB.innerHTML=<%=aypttenpay2+tenpaysum%>;
ayptsaoj.innerHTML=<%=Formatnumber(ayptsaoj,3,true,-1,0)%>;
ayptsaojB.innerHTML=<%=Formatnumber(ayptsaoj2+ayptsaoj,3,true,-1,0)%>;
ayptsaob.innerHTML=<%=ayptsaob%>;
ayptsaobB.innerHTML=<%=ayptsaob2+ayptsaob%>;
qqsaoj.innerHTML=<%=Formatnumber(qqsaoj,3,true,-1,0)%>;
qqsaojB.innerHTML=<%=Formatnumber(qqsaoj2+qqsaoj,3,true,-1,0)%>;
qqsaob.innerHTML=<%=qqsaob%>;
qqsaobB.innerHTML=<%=qqsaob2+qqsaob%>;
//cardj.innerHTML=<%=Formatnumber(cardj,3,true,-1,0)%>;
//cardjB.innerHTML=<%=Formatnumber(ayptcardj2+cardj,3,true,-1,0)%>;
//cardsum.innerHTML=<%=cardsum%>;
//cardsumB.innerHTML=<%=ayptcard2+cardsum%>;
wapalij.innerHTML=<%=Formatnumber(wapalij,3,true,-1,0)%>;
wapalijB.innerHTML=<%=Formatnumber(wapalij2+wapalij,3,true,-1,0)%>;
wapalib.innerHTML=<%=wapalib%>;
wapalibB.innerHTML=<%=wapalib2+wapalib%>;
waptenj.innerHTML=<%=Formatnumber(waptenj,3,true,-1,0)%>;
waptenjB.innerHTML=<%=Formatnumber(waptenj2,3,true,-1,0)%>;
waptenb.innerHTML=<%=waptenb%>;
waptenbB.innerHTML=<%=waptenb2%>;
//fandianj.innerHTML=<%=Formatnumber(fandianj,3,true,-1,0)%>;
//fandianjB.innerHTML=<%=Formatnumber(fandianj2+fandianj,3,true,-1,0)%>;
//fandian.innerHTML=<%=fandian%>;
//fandianB.innerHTML=<%=fandian2+fandian%>;
jishilirun.innerHTML=<%=Formatnumber(jishilirun,3,true,-1,0)%>;
jiajilirun.innerHTML=<%=Formatnumber(jiajilirun,3,true,-1,0)%>;
aotolirun.innerHTML=<%=Formatnumber(aotolirun,3,true,-1,0)%>;
diankalirun.innerHTML=<%=Formatnumber(diankalirun,3,true,-1,0)%>;
shoulirun.innerHTML=<%=Formatnumber(shoulirun,3,true,-1,0)%>;
banklirun.innerHTML=<%=Formatnumber(banklirun,3,true,-1,0)%>;
alipaylirun.innerHTML=<%=Formatnumber(alipaylirun,3,true,-1,0)%>;
tenpaylirun.innerHTML=<%=Formatnumber(tenpaylirun,3,true,-1,0)%>;
ayptsaol.innerHTML=<%=Formatnumber(ayptsaol,3,true,-1,0)%>;
qqsaol.innerHTML=<%=Formatnumber(qqsaol,3,true,-1,0)%>;
wapalil.innerHTML=<%=Formatnumber(wapalil,3,true,-1,0)%>;
waptenl.innerHTML=<%=Formatnumber(waptenl,3,true,-1,0)%>;
chonglirun.innerHTML=<%=Formatnumber(chonglirun,3,true,-1,0)%>;

wapweij.innerHTML=<%=Formatnumber(wapweij,3,true,-1,0)%>;
wapweib.innerHTML=<%=Formatnumber(wapweib,3,true,-1,0)%>;
wapweil.innerHTML=<%=Formatnumber(wapweil,3,true,-1,0)%>;
wapweijB.innerHTML=<%=Formatnumber(wapweij2+wapweij,3,true,-1,0)%>;
wapweibB.innerHTML=<%=wapweib2+wapweib%>;


wapqqj.innerHTML=<%=Formatnumber(wapqqj,3,true,-1,0)%>;
wapqqb.innerHTML=<%=Formatnumber(wapqqb,3,true,-1,0)%>;
wapqql.innerHTML=<%=Formatnumber(wapqql,3,true,-1,0)%>;

wapqqjB.innerHTML=<%=Formatnumber(wapqqj2+wapqqj,3,true,-1,0)%>;
wapqqbB.innerHTML=<%=wapqqb2+wapqqb%>;
xiaofeij.innerHTML=<%=Formatnumber(xiaofeij,3,true,-1,0)%>;




jdj.innerHTML=<%=Formatnumber(jdj,3,true,-1,0)%>;
jdjB.innerHTML=<%=Formatnumber(jdj2+jdj,3,true,-1,0)%>;

jdb.innerHTML=<%=Formatnumber(jdb,3,true,-1,0)%>;
jdbB.innerHTML=<%=jdb2+jdb%>;

wapjdj.innerHTML=<%=Formatnumber(wapjdj,3,true,-1,0)%>;
wapjdjB.innerHTML=<%=Formatnumber(wapjdj2+wapjdj,3,true,-1,0)%>;

wapjdb.innerHTML=<%=Formatnumber(wapjdb,3,true,-1,0)%>;
wapjdbB.innerHTML=<%=wapjdb2+wapjdb%>;

jdl.innerHTML=<%=Formatnumber(jdl,3,true,-1,0)%>;
wapjdl.innerHTML=<%=Formatnumber(wapjdl,3,true,-1,0)%>;





//ysfj.innerHTML=<%=Formatnumber(ysfj,3,true,-1,0)%>;
//ysfjB.innerHTML=<%=Formatnumber(ysfj2+ysfj,3,true,-1,0)%>;

//ysfb.innerHTML=<%=Formatnumber(ysfb,3,true,-1,0)%>;
//ysfbB.innerHTML=<%=ysfb2+ysfb%>;

//wapysfj.innerHTML=<%=Formatnumber(wapysfj,3,true,-1,0)%>;
//wapysfjB.innerHTML=<%=Formatnumber(wapysfj2+wapysfj,3,true,-1,0)%>;

//wapysfb.innerHTML=<%=Formatnumber(wapysfb,3,true,-1,0)%>;
//wapysfbB.innerHTML=<%=wapysfb2+wapysfb%>;

ysfl.innerHTML=<%=Formatnumber(ysfl,3,true,-1,0)%>;
wapysfl.innerHTML=<%=Formatnumber(wapysfl,3,true,-1,0)%>;


</script>

  <table width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
       <tr>
         <td colspan="25" align="left" class="border_bottom" ><span class="f14" style="font-weight: bold">&nbsp;&nbsp;日 历史账务统计</span>              </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" >消费        
         <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" >成交                         
         <th align="center" class="border_right border_bottom">网银                         
         <th align="center" class="border_right border_bottom">支付宝
         
         
                                
         <th align="center" class="border_right border_bottom">微信  
         <th align="center" class="border_right border_bottom">财付通         
         <th align="center" class="border_right border_bottom">手Q         
         <th align="center" class="border_right border_bottom">京东   
               <!--
         <th align="center" class="border_right border_bottom">云闪付 
                 
         <th align="center" class="border_bottom border_right">充值卡  
                  -->       
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">支付宝</span>  
              
          
                
         <th align="center" class="border_bottom border_right"> <span style="color:#FF3399">微信</span>   
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">财付通</span>     
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">手Q</span>        
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">京东</span>    
         <!--     
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">云闪付</span>  
               
         <th align="center" class="border_bottom">返点       </tr>
         --> 
<%
sql="select top 31 * from aypttj where aypttjzq=3 and aypttjuid=0 order by ayptdate desc"  
rs.open sql,conn,1,1
rs.pagesize=15 
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
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"),0,true,-1,0)%></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=Formatnumber(rs("chonglirun"),1,true,-1,0)%>(<%=rs("chongzhib")%>笔)"><%=Formatnumber(rs("chongzhij"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=Formatnumber(rs("shoulirun"),1,true,-1,0)%>(<%=rs("shoulirunsum")%>笔)"><%=Formatnumber(rs("shoukuanj"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("xiaofeij"),0,true,-1,0)%></td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("ayptcjlr"),0,true,-1,0)%></td>
        <td align="center" class="border_right border_bottom"><span title="<%=rs("jishilirunsum")%>笔"><%=Formatnumber(rs("jishilirun"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><span title="<%=rs("jiajilirunsum")%>笔"><%=Formatnumber(rs("jiajilirun"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><span title="<%=rs("aotolirunsum")%>笔"><%=Formatnumber(rs("aotolirun"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><%=rs("ayptcjbs")%></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("banklirun")%>"><%=Formatnumber(rs("ayptbankj"),0,true,-1,0)%>(<%=rs("ayptbank")%>笔)</span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("alipaylirun")%>"><%=Formatnumber(rs("ayptalipayj"),0,true,-1,0)%>(<%=rs("ayptalipay")%>笔)</span></td>
        
        
        
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("ayptsaol")%>"><%=Formatnumber(rs("ayptsaoj"),00,true,-1,0)%>(<%=rs("ayptsaob")%>笔)</span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("tenpaylirun")%>"><%=Formatnumber(rs("aypttenpayj"),0,true,-1,0)%>(<%=rs("aypttenpay")%>笔)</span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("qqsaol")%>"><%=Formatnumber(rs("qqsaoj"),00,true,-1,0)%>(<%=rs("qqsaob")%>笔)</span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("jdl")%>"><%=Formatnumber(rs("jdj"),00,true,-1,0)%>(<%=rs("jdb")%>笔)</span></td>

	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapalil")%>"><%=Formatnumber(rs("wapalij"),0,true,-1,0)%>(<%=rs("wapalib")%>笔)</span></td>
        
	    
        
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapweil")%>"><%=Formatnumber(rs("wapweij"),0,true,-1,0)%>(<%=rs("wapweib")%>笔)</span></td>
        <td align="center" class="border_bottom border_right"><span title="利润<%=rs("waptenl")%>"><%=Formatnumber(rs("waptenj"),0,true,-1,0)%>(<%=rs("waptenb")%>笔)</span></td>
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapqql")%>"><%=Formatnumber(rs("wapqqj"),0,true,-1,0)%>(<%=rs("wapqqb")%>笔)</span></td>
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapjdl")%>"><%=Formatnumber(rs("wapjdj"),0,true,-1,0)%>(<%=rs("wapjdb")%>笔)</span></td>
<!--
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapysfl")%>"><%=Formatnumber(rs("wapysfj"),0,true,-1,0)%>(<%=rs("wapysfb")%>笔)</span></td>
	    <td align="center" class="border_bottom"><%=Formatnumber(rs("ayfandianj"),0,true,-1,0)%>(<%=rs("ayfandian")%>笔)</td>
 -->
	  </tr>
<%
n=n+1
rs.movenext
if n>=rs.pagesize then exit do  
loop
end if
zongshu=rs.RecordCount
rs.close%>
	  

      <tr>
        <td colspan="25">&nbsp;
          <%if pagecount=0 then   
response.write("首页 ")
elseif page=1 then       
response.write("首页 ")
else%>                   
<a href="<%=link%>&page=1">首页</a>
<%end if

if pagecount=0 then   
response.write("上页&nbsp;")
elseif page=1 then       
response.write("上页&nbsp;")
else%>                   
<a href="<%=link%>&page=<%=page-1%>">上页</a>&nbsp;
<%end if

if pagecount>20 then
if page<=10 then 
aa=1
bb=20
aabu=""
bbbu=" … "
elseif page>=11 then 
aa=page-9
bb=page+10
aabu=" …"
bbbu=" … "
	if bb>=pagecount then 
	aa=pagecount-20
	bb=pagecount
	aabu=" … "
	bbbu=""
	end if
end if
response.Write aabu
for aa=aa to bb
if page=aa then
response.Write("<a href="&link&"&page="&aa&"><strong>"&aa&"</strong></a>&nbsp;")
else
response.Write("<a href="&link&"&page="&aa&">"&aa&"</a>&nbsp;")
end if
next
response.Write bbbu

else

for i=1 to pagecount
if page=i then
response.Write("<a href="&link&"&page="&i&"><strong>"&i&"</a></strong>&nbsp;")
else
response.Write("<a href="&link&"&page="&i&">"&i&"</a>&nbsp;")
end if
next

end if

if pagecount=0 then 
response.write("下页&nbsp;")
elseif page=pagecount then 
response.write("下页&nbsp;")
else%>                    
<a href="<%=link%>&page=<%=page+1%>">下页</a>
<%end if%>
<%if pagecount=0 then  '总页数为0 显示空
response.write("尾页 ") 
elseif page=pagecount then 
response.write("尾页 ")
else%>                    
<a href="<%=link%>&page=<%=pagecount %>">尾页</a>
<%end if

if pagecount<>0 then 
response.Write page&"/"&pagecount
end if
response.Write "&nbsp;共"&zongshu&"条"
%>		</td>
      </tr>
    </table>
<A NAME="yuetj"></a>
	<br>
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
       <tr>
         <td colspan="25" align="left" class="border_bottom" ><span class="f14" style="font-weight: bold">&nbsp;&nbsp;月 历史账务统计</span>       </tr>
	   
       <tr>
         <th align="center" class="border_right border_bottom" >时间
         <th align="center" class="border_right border_bottom" >金额         
         <th align="center" class="border_right border_bottom" >充值
         <th align="center" class="border_right border_bottom" >收款                         
         <th align="center" class="border_right border_bottom" >消费         
         <th align="center" class="border_right border_bottom" >纯利         
         <th align="center" class="border_right border_bottom" >秒        
         <th align="center" class="border_right border_bottom" >急         
         <th align="center" class="border_right border_bottom" >自         
         <th align="center" class="border_right border_bottom" >成交                         
         <th align="center" class="border_right border_bottom">网银                         
         <th align="center" class="border_right border_bottom">支付宝
                                  
         <th align="center" class="border_right border_bottom">微信   
         <th align="center" class="border_right border_bottom">财付通    
         <th align="center" class="border_right border_bottom">手Q         
         <th align="center" class="border_right border_bottom">京东     
         <!--    
         <th align="center" class="border_right border_bottom">云闪付         
         <th align="center" class="border_bottom border_right">充值卡   
         -->               
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">支付宝</span>       
               
         <th align="center" class="border_bottom border_right"> <span style="color:#FF3399">微信</span>  
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">财付通</span>        
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">手Q</span>       
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">京东</span>  
         <!--       
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">云闪付</span>        
         <th align="center" class="border_bottom">返点       </tr>
         -->
<%
sql="select * from aypttj where aypttjzq=2 and aypttjuid=0 order by ayptdate desc"  
rs.open sql,conn,1,1
rs.pagesize=12 
pagecount=rs.pagecount 
if request("ypage")="" then 
ypage=1
else
ypage=int(request("ypage")) 
end if
if ypage<=0 then ypage=1 
if request("ypage")="" then ypage=1
if not(rs.bof and rs.eof) then
rs.absolutepage=ypage
do while not rs.eof%>

	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
        <td align="center" class="border_right border_bottom"><%=rs("aypttjjl")%></td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("ayptcjje"),0,true,-1,0)%></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=Formatnumber(rs("chonglirun"),1,true,-1,0)%>(<%=rs("chongzhib")%>笔)"><%=Formatnumber(rs("chongzhij"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=Formatnumber(rs("shoulirun"),1,true,-1,0)%>(<%=rs("shoulirunsum")%>笔)"><%=Formatnumber(rs("shoukuanj"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("xiaofeij"),0,true,-1,0)%></td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("ayptcjlr"),0,true,-1,0)%></td>
        <td align="center" class="border_right border_bottom"><span title="<%=rs("jishilirunsum")%>笔"><%=Formatnumber(rs("jishilirun"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><span title="<%=rs("jiajilirunsum")%>笔"><%=Formatnumber(rs("jiajilirun"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><span title="<%=rs("aotolirunsum")%>笔"><%=Formatnumber(rs("aotolirun"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><%=rs("ayptcjbs")%></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("banklirun")%>"><%=Formatnumber(rs("ayptbankj"),0,true,-1,0)%>(<%=rs("ayptbank")%>笔)</span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("alipaylirun")%>"><%=Formatnumber(rs("ayptalipayj"),0,true,-1,0)%>(<%=rs("ayptalipay")%>笔)</span></td>
        
        
        
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("ayptsaol")%>"><%=Formatnumber(rs("ayptsaoj"),0,true,-1,0)%>(<%=rs("ayptsaob")%>笔)</span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("tenpaylirun")%>"><%=Formatnumber(rs("aypttenpayj"),0,true,-1,0)%>(<%=rs("aypttenpay")%>笔)</span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("qqsaol")%>"><%=Formatnumber(rs("qqsaoj"),00,true,-1,0)%>(<%=rs("qqsaob")%>笔)</span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("jdl")%>"><%=Formatnumber(rs("jdj"),00,true,-1,0)%>(<%=rs("jdb")%>笔)</span></td>
<!--
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("ysfl")%>"><%=Formatnumber(rs("ysfj"),00,true,-1,0)%>(<%=rs("ysfb")%>笔)</span></td>
        <td align="center" class="border_bottom border_right"><span title="利润<%=rs("cardlirun")%>"><%=Formatnumber(rs("ayptcardj"),0,true,-1,0)%>(<%=rs("ayptcard")%>笔)</span></td>
 -->
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapalil")%>"><%=Formatnumber(rs("wapalij"),0,true,-1,0)%>(<%=rs("wapalib")%>笔)</span></td>
	    
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapweil")%>"><%=Formatnumber(rs("wapweij"),0,true,-1,0)%>(<%=rs("wapweib")%>笔)</span></td>
        <td align="center" class="border_bottom border_right"><span title="利润<%=rs("waptenl")%>"><%=Formatnumber(rs("waptenj"),0,true,-1,0)%>(<%=rs("waptenb")%>笔)</span></td>
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapqql")%>"><%=Formatnumber(rs("wapqqj"),0,true,-1,0)%>(<%=rs("wapqqb")%>笔)</span></td>
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapjdl")%>"><%=Formatnumber(rs("wapjdj"),0,true,-1,0)%>(<%=rs("wapjdb")%>笔)</span></td>
<!--
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapysfl")%>"><%=Formatnumber(rs("wapysfj"),0,true,-1,0)%>(<%=rs("wapysfb")%>笔)</span></td>
	    <td align="center" class="border_bottom"><%=Formatnumber(rs("ayfandianj"),0,true,-1,0)%>(<%=rs("ayfandian")%>笔)</td>
-->
	  </tr>
<%
yn=yn+1
rs.movenext
if yn>=rs.pagesize then exit do  
loop
end if
yzongshu=rs.RecordCount
rs.close%>
	  

      <tr>
        <td colspan="25">&nbsp;
          <%if pagecount=0 then   
response.write("首页 ")
elseif ypage=1 then       
response.write("首页 ")
else%>                   
<a href="<%=link%>&ypage=1#yuetj">首页</a>
<%end if

if pagecount=0 then   
response.write("上页&nbsp;")
elseif ypage=1 then       
response.write("上页&nbsp;")
else%>                   
<a href="<%=link%>&ypage=<%=page-1%>#yuetj">上页</a>&nbsp;
<%end if

if pagecount>20 then
if ypage<=10 then 
yaa=1
ybb=20
yaabu=""
ybbbu=" … "
elseif ypage>=11 then 
yaa=ypage-9
ybb=ypage+10
yaabu=" …"
ybbbu=" … "
	if ybb>=pagecount then 
	yaa=pagecount-20
	ybb=pagecount
	yaabu=" … "
	ybbbu=""
	end if
end if
response.Write yaabu
for yaa=yaa to ybb
if ypage=yaa then
response.Write("<a href="&link&"&ypage="&yaa&"#yuetj><strong>"&yaa&"</strong></a>&nbsp;")
else
response.Write("<a href="&link&"&ypage="&yaa&"#yuetj>"&yaa&"</a>&nbsp;")
end if
next
response.Write ybbbu

else

for yi=1 to pagecount
if ypage=yi then
response.Write("<a href="&link&"&ypage="&yi&"#yuetj><strong>"&yi&"</a></strong>&nbsp;")
else
response.Write("<a href="&link&"&ypage="&yi&"#yuetj>"&yi&"</a>&nbsp;")
end if
next

end if

if pagecount=0 then 
response.write("下页&nbsp;")
elseif ypage=pagecount then 
response.write("下页&nbsp;")
else%>                    
<a href="<%=link%>&ypage=<%=ypage+1%>#yuetj">下页</a>
<%end if%>
<%if pagecount=0 then  '总页数为0 显示空
response.write("尾页 ") 
elseif ypage=pagecount then 
response.write("尾页 ")
else%>                    
<a href="<%=link%>&ypage=<%=pagecount %>#yuetj">尾页</a>
<%end if

if pagecount<>0 then 
response.Write ypage&"/"&pagecount
end if
response.Write "&nbsp;共"&yzongshu&"条"
%>		</td>
      </tr>
    </table>
	
	
	
<br>
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
       <tr>
         <td colspan="25" align="left" class="border_bottom" ><span class="f14" style="font-weight: bold">&nbsp;&nbsp;年 历史账务统计</span>       </tr>
	   
       <tr>
         <th align="center" class="border_right border_bottom" >时间
         <th align="center" class="border_right border_bottom" >金额         
         <th align="center" class="border_right border_bottom" >充值
         <th align="center" class="border_right border_bottom" >收款                         
         <th align="center" class="border_right border_bottom" >消费        
         <th align="center" class="border_right border_bottom" >纯利         
         <th align="center" class="border_right border_bottom" >秒         
         <th align="center" class="border_right border_bottom" >急         
         <th align="center" class="border_right border_bottom" >自         
         <th align="center" class="border_right border_bottom" >成交                         
         <th align="center" class="border_right border_bottom">网银                         
         <th align="center" class="border_right border_bottom">支付宝
                                  
         <th align="center" class="border_right border_bottom">微信
         <th align="center" class="border_right border_bottom">财付通         
         <th align="center" class="border_right border_bottom">手Q        
         <th align="center" class="border_right border_bottom">京东  
         <!--       
         <th align="center" class="border_right border_bottom">云闪付       
         <th align="center" class="border_bottom border_right">充值卡 
         -->                 
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">支付宝</span>       
                 
         <th align="center" class="border_bottom border_right"> <span style="color:#FF3399">微信</span>   
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">财付通</span>     
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">手Q</span>         
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">京东</span>  
         <!--        
         <th align="center" class="border_bottom border_right"><span style="color:#FF3399">云闪付</span>         
         <th align="center" class="border_bottom">返点       </tr>
         -->
<%
sql="select * from aypttj where aypttjzq=1 and aypttjuid=0 order by ayptdate desc"  
rs.open sql,conn,1,1
rs.pagesize=5 
pagecount=rs.pagecount 
if request("npage")="" then 
npage=1
else
npage=int(request("npage")) 
end if
if npage<=0 then npage=1 
if request("npage")="" then npage=1
if not(rs.bof and rs.eof) then
rs.absolutepage=npage
do while not rs.eof%>

	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
        <td align="center" class="border_right border_bottom"><%=rs("aypttjjl")%></td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("ayptcjje"),0,true,-1,0)%></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=Formatnumber(rs("chonglirun"),0,true,-1,0)%>(<%=rs("chongzhib")%>笔)"><%=Formatnumber(rs("chongzhij"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=Formatnumber(rs("shoulirun"),0,true,-1,0)%>(<%=rs("shoulirunsum")%>笔)"><%=Formatnumber(rs("shoukuanj"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("xiaofeij"),0,true,-1,0)%></td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("ayptcjlr"),0,true,-1,0)%></td>
        <td align="center" class="border_right border_bottom"><span title="<%=rs("jishilirunsum")%>笔"><%=Formatnumber(rs("jishilirun"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><span title="<%=rs("jiajilirunsum")%>笔"><%=Formatnumber(rs("jiajilirun"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><span title="<%=rs("aotolirunsum")%>笔"><%=Formatnumber(rs("aotolirun"),0,true,-1,0)%></span></td>
        <td align="center" class="border_right border_bottom"><%=rs("ayptcjbs")%></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("banklirun")%>"><%=Formatnumber(rs("ayptbankj"),0,true,-1,0)%><br>(<%=rs("ayptbank")%>笔)</span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("alipaylirun")%>"><%=Formatnumber(rs("ayptalipayj"),0,true,-1,0)%><br>(<%=rs("ayptalipay")%>笔)</span></td>
        
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("ayptsaol")%>"><%=Formatnumber(rs("ayptsaoj"),1,true,-1,0)%><br>(<%=rs("ayptsaob")%>笔)</span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("tenpaylirun")%>"><%=Formatnumber(rs("aypttenpayj"),0,true,-1,0)%><br>(<%=rs("aypttenpay")%>笔)</span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("qqsaol")%>"><%=Formatnumber(rs("qqsaoj"),00,true,-1,0)%><br>(<%=rs("qqsaob")%>笔)</span></td>
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("jdl")%>"><%=Formatnumber(rs("jdj"),00,true,-1,0)%><br>(<%=rs("jdb")%>笔)</span></td>
<!-- 
        <td align="center" class="border_right border_bottom"><span title="利润<%=rs("ysfl")%>"><%=Formatnumber(rs("ysfj"),00,true,-1,0)%><br>(<%=rs("ysfb")%>笔)</span></td>
        <td align="center" class="border_bottom border_right"><span title="利润<%=rs("cardlirun")%>"><%=Formatnumber(rs("ayptcardj"),0,true,-1,0)%><br>(<%=rs("ayptcard")%>笔)</span></td>
-->
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapalil")%>"><%=Formatnumber(rs("wapalij"),0,true,-1,0)%><br>(<%=rs("wapalib")%>笔)</span></td>
	    
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapweil")%>"><%=Formatnumber(rs("wapweij"),0,true,-1,0)%><br>(<%=rs("wapweib")%>笔)</span></td>
        <td align="center" class="border_bottom border_right"><span title="利润<%=rs("waptenl")%>"><%=Formatnumber(rs("waptenj"),0,true,-1,0)%><br>(<%=rs("waptenb")%>笔)</span></td>
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapqql")%>"><%=Formatnumber(rs("wapqqj"),0,true,-1,0)%><br>(<%=rs("wapqqb")%>笔)</span></td>
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapjdl")%>"><%=Formatnumber(rs("wapjdj"),0,true,-1,0)%><br>(<%=rs("wapjdb")%>笔)</span></td>
<!-- 
	    <td align="center" class="border_bottom border_right"><span title="利润<%=rs("wapysfl")%>"><%=Formatnumber(rs("wapysfj"),0,true,-1,0)%><br>(<%=rs("wapysfb")%>笔)</span></td>
	    <td align="center" class="border_bottom"><%=Formatnumber(rs("ayfandianj"),0,true,-1,0)%><br>(<%=rs("ayfandian")%>笔)</td>
-->
	  </tr>
<%
nn=nn+1
rs.movenext
if nn>=rs.pagesize then exit do  
loop
end if
nzongshu=rs.RecordCount
rs.close%>
	  

      <tr>
        <td colspan="25">&nbsp;
          <%if pagecount=0 then   
response.write("首页 ")
elseif npage=1 then       
response.write("首页 ")
else%>                   
<a href="<%=link%>&npage=1">首页</a>
<%end if

if pagecount=0 then   
response.write("上页&nbsp;")
elseif npage=1 then       
response.write("上页&nbsp;")
else%>                   
<a href="<%=link%>&npage=<%=page-1%>">上页</a>&nbsp;
<%end if

if pagecount>20 then
if npage<=10 then 
naa=1
nbb=20
naabu=""
nbbbu=" … "
elseif npage>=11 then 
naa=npage-9
nbb=npage+10
naabu=" …"
nbbbu=" … "
	if nbb>=pagecount then 
	naa=pagecount-20
	nbb=pagecount
	naabu=" … "
	nbbbu=""
	end if
end if
response.Write naabu
for naa=naa to nbb
if npage=naa then
response.Write("<a href="&link&"&npage="&naa&"><strong>"&naa&"</strong></a>&nbsp;")
else
response.Write("<a href="&link&"&npage="&naa&">"&naa&"</a>&nbsp;")
end if
next
response.Write nbbbu

else

for ni=1 to pagecount
if npage=ni then
response.Write("<a href="&link&"&npage="&ni&"><strong>"&ni&"</a></strong>&nbsp;")
else
response.Write("<a href="&link&"&npage="&ni&">"&ni&"</a>&nbsp;")
end if
next

end if

if pagecount=0 then 
response.write("下页&nbsp;")
elseif npage=pagecount then 
response.write("下页&nbsp;")
else%>                    
<a href="<%=link%>&npage=<%=npage+1%>">下页</a>
<%end if%>
<%if pagecount=0 then  '总页数为0 显示空
response.write("尾页 ") 

elseif npage=pagecount then 
response.write("尾页 ")
else%>                    
<a href="<%=link%>&npage=<%=pagecount %>">尾页</a>
<%end if

if pagecount<>0 then 
response.Write npage&"/"&pagecount
end if
response.Write "&nbsp;共"&nzongshu&"条"
%>		</td>
      </tr>
    </table>
	
</DIV>


</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>
<SCRIPT>
$(function(){
$('.left_title').each(function(){
   $(this).click(function(){
	   var index=$('.left_title').index(this);
	   if($(this).next().hasClass('hide_m')){
		   $(this).next().removeClass('hide_m');
           $(this).next().show();		 
		   $(this).find('img').attr('src','<%=ossurl%>images/expansion.gif');
		   $.cookie('m_index_'+index,'',{expires:0});
	   } else {

	       $(this).next().hide();
		   $(this).next().addClass('hide_m');
		   $(this).find('img').attr('src','<%=ossurl%>images/shrank.gif');		   
		   $.cookie('m_index_'+index,'none',{expires:365});
	   }
   })
})

$('.left_title').each(function(){
	var index=$('.left_title').index(this);
    $(this).next().css('display',$.cookie('m_index_'+index) ? $.cookie('m_index_'+index) : '');
	if($.cookie('m_index_'+index)){
	    $(this).next().addClass('hide_m');
	}
	$(this).find('img').attr('src',$.cookie('m_index_'+index) ? '<%=ossurl%>images/shrank.gif' : '<%=ossurl%>images/expansion.gif');
})
})

</SCRIPT>


	<!--#include virtual="/show/footadmin.asp"-->

