📄 agentaccountlistdo.asp
字号:
<% ModuleCode="M1010" %>
<!--#include file="../../Include/Reference.asp"-->
<%
Call PrintPageHead
%>
<!--#include file="../../Include/connect.asp"-->
<%
Dim PSum(),I,SumAllXF,SumAllHK,SumAllXYE,SumAllYE
UserID=Request("UserID")
FromTime=Request("FromTime")
ToTime=Request("ToTime")
OnlyOverMoney=Request("OnlyOverMoney")
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"
if UserID<>"" then
strSQL=strSQL & " and a.UserID=" & UserID
end if
if OnlyOverMoney<>"" then
strSQL=strSQL & " and a.HaveMoney<0"
end if
Set Rs=Server.CreateObject("ADODB.Recordset")
Set Rs1=Server.CreateObject("ADODB.Recordset")
Set Rs2=Server.CreateObject("ADODB.Recordset")
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
XF=Rs1("XF")
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
HK=Rs1("HK")
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>
<%
end if
Rs.Close
Set Rs=Nothing
Set Rs1=Nothing
Set Rs2=Nothing
Cn.Close
Set Cn=Nothing
Call PrintPageBottom
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -