📄 agentaccountdo.asp
字号:
<% ModuleCode="M1010" %>
<!--#include file="../../Include/Reference.asp"-->
<%
UserID=Request.Form("UserID")
FromTime=Request.Form("FromTime")
ToTime=Request.Form("ToTime")
OnlyOverMoney=Request("OnlyOverMoney")
ttype=Request("ttype")
if ttype<>"2" then
Call PrintPageHead
%>
<!--#include file="../../Include/connect.asp"-->
<%
Dim PSum(),I,SumAllXF,SumAllHK,SumAllXYE,SumAllYE
else
'response.write "AgentAccountListDo.asp?UserID=" & UserID & "&FromTime=" & FromTime & "&ToTime=" & ToTime & "&OnlyOverMoney=" & OnlyOverMoney
Response.redirect "AgentAccountListDo.asp?UserID=" & UserID & "&FromTime=" & FromTime & "&ToTime=" & ToTime & "&OnlyOverMoney=" & OnlyOverMoney
'Response.end
end if
Set Rs=Server.CreateObject("ADODB.Recordset")
Set Rs1=Server.CreateObject("ADODB.Recordset")
Set Rs2=Server.CreateObject("ADODB.Recordset")
if Trim(UserID)="" then
strSQL="Select Sum(UAMoney) as UU from T_DNS_UserAccount where ((UAType='4' and UAStat='2') or (UAType<>'4' and UAStat='1')) and UAMoney>=0"
if FromTime<>"" then
strSQL = strSQL & " and UATime >= '" & FromTime & " 00:00:00'"
strQuery = strQuery & "&FromTime=" & FromTime
end if
Rs.open strSQL,Cn
if ToTime<>"" then
strSQL = strSQL & " and UATime <= '" & ToTime & " 23:59:59'"
strQuery = strQuery & "&ToTime=" & ToTime
end if
if ISNull(Rs("UU")) or Rs("UU")="" then
HK=0
else
HK=CCur(Rs("UU"))
end if
Rs.Close
strSQL="Select Sum(UAMoney) as UU from T_DNS_UserAccount where ((UAType='4' and UAStat='2') or (UAType<>'4' and UAStat='1')) and UAMoney<0"
if FromTime<>"" then
strSQL = strSQL & " and UATime >= '" & FromTime & " 00:00:00'"
strQuery = strQuery & "&FromTime=" & FromTime
end if
Rs.open strSQL,Cn
if ToTime<>"" then
strSQL = strSQL & " and UATime <= '" & ToTime & " 23:59:59'"
strQuery = strQuery & "&ToTime=" & ToTime
end if
if ISNull(Rs("UU")) or Rs("UU")="" then
XF=0
else
XF=CCur(Rs("UU"))
end if
Rs.Close
%>
<table width="400" align="center" border="0" cellpadding="2" cellspacing="1" bgcolor="<%=Opt_Table_BGColor%>">
<tr>
<td colspan="2" align="center" class="titletext">
<strong>公司帐务统计</strong>
</td>
</tr>
<tr bgcolor="<%=Opt_TR_BGColor%>" height="24">
<TD>
总汇款
</TD>
<TD bgcolor="<%=Opt_TD_BGColor2%>">
<%=HK%> 元
</TD>
</TR>
<tr bgcolor="<%=Opt_TR_BGColor%>" height="24">
<TD>
总消费
</TD>
<TD bgcolor="<%=Opt_TD_BGColor2%>">
<%=ABS(XF)%> 元
</TD>
</TR>
<%
strSQL="Select * from T_DNS_ServiceType"
Rs.open strSQL,Cn,1,1
while not Rs.eof
Response.Write "<tr bgcolor=" & Opt_TR_BGColor & "><td>" & Rs("STName") & "</td>"
strSQL="Select Count(*) as PNum from T_DNS_UserOrder a,T_DNS_ProdInfo b where a.ProdCode=b.ProdCode and a.OSCode='01' and b.STCode='" & Rs("STCode") & "'"
if FromTime<>"" then
strSQL = strSQL & " and a.UOTime >= '" & FromTime & " 00:00:00'"
end if
if ToTime<>"" then
strSQL = strSQL & " and a.UOTime <= '" & ToTime & " 23:59:59'"
end if
Rs1.open strSQL,Cn
Response.Write "<td bgcolor=" & Opt_TD_BGColor2 & ">" & Rs1("PNum") & "</td></tr>"
Rs1.Close
Rs.movenext
wend
Rs.Close
%>
</table>
<p align="center">
<a href="AgentQueryDo.asp?FromTime=<%=FromTime%>&ToTime=<%=ToTime%>" class="a2">财务明细...</a>
</p>
<%
else
strSQL="Select a.UserID,a.UserName,a.HaveMoney,a.AllMoney,a.OverMoney,b.LevelName from T_DNS_UserInfo a, T_DNS_UserLevel b Where a.LevelCode=b.LevelCode"
strSQL=strSQL & " and a.UserID=" & UserID
Rs.Open strSQL,Cn
if Rs.Eof then
Response.Write "<br><br><br><p align='center' class='titletext'>没有相应的统计数据</p>"
Call PrintPageBottom
Response.End
else
%>
<font color="<%=Opt_Font_TitleColor%>" class="titletext"><strong>代理帐户查询</strong></font>
<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="<%=Opt_Table_BGColor%>">
<tr bgcolor="<%=Opt_TR_BGColor%>" height="24">
<td>代理名</td>
<td>代理级别</td>
<td>信用额</td>
<td>余额</td>
<td>总消费(元)</td>
<td>总汇款(元)</td>
<%
I=0
strSQL="Select * from T_DNS_ServiceType"
Rs1.open strSQL,Cn,1,1
ReDim PSum(Rs1.recordcount-1)
while not Rs1.eof
PSum(I)=0
Response.Write "<td>" & Rs1("STName") & "</td>"
Rs1.movenext
I=I+1
wend
Rs1.Close
%>
</tr>
<%
line=0
SumAllXF=0
SumAllHK=0
SumAllXYE=0
SumAllYE=0
while not Rs.eof
if ISNull(Rs("OverMoney")) or Rs("OverMoney")="" then
OverMoney=0
else
OverMoney=CCur(Rs("OverMoney"))
end if
if ISNull(Rs("HaveMoney")) or Rs("HaveMoney")="" then
HaveMoney=0
else
HaveMoney=CCur(Rs("HaveMoney"))
end if
SumAllXYE=SumAllXYE+OverMoney
SumAllYE=SumAllYE+HaveMoney
if line mod 2 =0 Then %>
<tr bgcolor="<%=Opt_TD_BGColor1%>" height="20">
<% else %>
<tr bgcolor="<%=Opt_TD_BGColor2%>" height="20">
<% end if %>
<td>
<a href="UserAccount.asp?UserID=<%=Rs("UserID")%>&SFromTime=<%=FromTime%>&SToTime=<%=ToTime%>" class="a2"><%=Rs("UserID")%>/<%=Rs("UserName")%></a>
</td>
<td>
<%=Rs("LevelName")%>
</td>
<td>
<%=OverMoney%>
</td>
<td>
<%=HaveMoney%>
</td>
<%
strSQL="select sum(UAMoney) as XF from T_DNS_UserAccount where UserID=" & Rs("UserID") & " and ((UAType='4' and UAStat='2') or (UAType<>'4' and UAStat='1'))"
strSQL=strSQL & " and ((UAType='2' and UAStat='1') or (UAType='3' and UAStat='1') or (UAType='1' and UAMoney<0)) "
if FromTime<>"" then
strSQL = strSQL & " and InTime >= '" & FromTime & " 00:00:00'"
end if
if ToTime<>"" then
strSQL = strSQL & " and InTime <= '" & ToTime & " 23:59:59'"
end if
Rs1.open strSQL,Cn
if rs1.bof and rs1.eof then
XF=0
else
if ISNull(Rs1("XF")) or Rs1("XF")="" then
XF=0
else
XF=-1*CCur(Rs1("XF"))
end if
end if
Rs1.Close
strSQL="select sum(UAMoney) as HK from T_DNS_UserAccount where UserID=" & Rs("UserID") & " and UAMoney>=0 and ((UAType='4' and UAStat='2') or (UAType<>'4' and UAStat='1'))"
strSQL=strSQL & " and ((UAType='4' and UAStat='2') or (UAType='1' and UAMoney>=0)) "
if FromTime<>"" then
strSQL = strSQL & " and InTime >= '" & FromTime & " 00:00:00'"
end if
if ToTime<>"" then
strSQL = strSQL & " and InTime <= '" & ToTime & " 23:59:59'"
end if
Rs1.open strSQL,Cn
if rs1.bof and rs1.eof then
HK=0
else
if ISNull(Rs1("HK")) or Rs1("HK")="" then
HK=0
else
HK=CCur(Rs1("HK"))
end if
end if
Rs1.Close
if IsNull(XF) then XF=0
if ISNull(HK) then HK=0
'XF=ABS(CCur(XF))
'HK=ABS(CCur(HK))
SumAllXF=SumAllXF + XF
SumAllHK=SumAllHK + HK
%>
<td>
<a href="AgentQueryDo.asp?UserID=<%=Rs("UserID")%>&FromTime=<%=FromTime%>&ToTime=<%=ToTime%>" class="a2"><%=XF%></a>
</td>
<td>
<%=HK%>
</td>
<%
I=0
strSQL="Select * from T_DNS_ServiceType"
Rs1.open strSQL,Cn,1,1
while not Rs1.eof
%>
<td>
<%
strSQL="Select Count(*) as PNum from T_DNS_UserOrder a,T_DNS_ProdInfo b where a.ProdCode=b.ProdCode and a.OSCode='01' and b.STCode='" & Rs1("STCode") & "' and a.UserID=" & Rs("UserID")
if FromTime<>"" then
strSQL = strSQL & " and a.UOTime >= '" & FromTime & " 00:00:00'"
end if
if ToTime<>"" then
strSQL = strSQL & " and a.UOTime <= '" & ToTime & " 23:59:59'"
end if
Rs2.open strSQL,Cn
Response.Write Rs2("PNum")
PSum(I)=PSum(I)+CLng(Rs2("PNum"))
Rs2.Close
%>
</td>
<%
Rs1.movenext
I=I+1
wend
Rs1.Close
Rs.movenext
line=line+1
Response.Write "</tr>"
wend
%>
<!--
<% if line mod 2 =0 Then %>
<tr bgcolor="<%=Opt_TD_BGColor1%>" height="20">
<% else %>
<tr bgcolor="<%=Opt_TD_BGColor2%>" height="20">
<% end if %>
<td colspan="2">
<strong>合计</strong>
</td>
<td>
<strong><%=SumAllXYE%></strong>
</td>
<td>
<strong><%=SumAllYE%></strong>
</td>
<td>
<strong><%=SumAllXF%></strong>
</td>
<td>
<strong><%=SumAllHK%></strong>
</td>
<%
For I=0 to UBound(PSum)
Response.Write "<td><strong>" & PSum(I) & "</strong></td>"
Next
%>
-->
</table>
<p align="right">
<a href="UserAccount.asp?UserID=<%=UserID%>" class="a2">帐务信息</a>
<a href="AgentQueryDo.asp?UserID=<%=UserID%>&FromTime=<%=FromTime%>&ToTime=<%=ToTime%>" class="a2">帐务明细</a>
</p>
<%
end if
Rs.Close
Set Rs=Nothing
Set Rs1=Nothing
Set Rs2=Nothing
end if
Cn.Close
Set Cn=Nothing
Call PrintPageBottom
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -