📄 agent_detail.asp
字号:
<%'创建时间:2004/07/13
'创建人:
'功能:用于代理统计已结算的投注
'2004-07-22加多一个和局判断
%>
<!--#include file="Include/conn.asp"-->
<!--#include file="Include/Islogin.asp"-->
<!--#include file="Include/zc.asp"-->
<%issue=request("issue")
if issue="" then
Set Kithe_rs=server.CreateObject("adodb.recordset")
Kithe_sql="select Kithe_issue from Kithe order by Kithe_issue desc"
Kithe_rs.open Kithe_sql,conn,1,1
if not Kithe_rs.eof then
issue=Kithe_rs("Kithe_issue")
else
issue=1
end if
end if
%>
<html>
<head>
<%
'子层数据处理子程序
Function toSql(str)
If IsNull(str) Then Exit Function
toSql = replace(str, "'", "''")
End Function
Function f__Result(id)
Dim rs_sub, sub_sql
Dim tempMoney, tempTotal, tempRate
Dim tempClass
tempClass = toSql(id)
' 注释掉的sql语句是没加和局判断的
'sub_sql="select winorlist=case when invest_result=1 then worl when invest_result=0 then -(case when Invest_type='1' then sm*(1-T_commision) when Invest_type='2' then sm*(1-Z_commision) when invest_type='3' then sm*(1-Twain_commision) when Invest_type='4' then sm*(1-L_commision) when Invest_type='5' then sm*(1-Color_commision) end )end,Commision=case when Invest_type='1' then T_commision when Invest_type='2' then Z_commision when Invest_type='3' then Twain_commision when Invest_type='4' then L_commision when Invest_type='5' then Color_commision end from ( select invest_winorlost ,invest_result,invest_name,sm=sum(Invest_money),Invest_type,worl=sum(invest_money*invest_rate) from Invest where (Invest_second='"&id&"' or Invest_frist='"&id&"') and Invest_issue="&issue&" and Invest_banlance=1 group by invest_winorlost,invest_result,invest_rate,invest_name,invest_type ) a left join member b on a.Invest_name=b.member_name "
sub_sql="select winorlist=case when invest_result=1 then ( case when invest_amount='和局' then 0 else worl-(case when Invest_type='1' then sm*(1-T_commision) when Invest_type='2' then sm*(1-Z_commision) when invest_type='3' then sm*(1-Twain_commision) when Invest_type='4' then sm*(1-L_commision) when Invest_type='5' then sm*(1-Color_commision) end ) end ) when invest_result=0 then -(case when Invest_type='1' then sm*(1-T_commision) when Invest_type='2' then sm*(1-Z_commision) when invest_type='3' then sm*(1-Twain_commision) when Invest_type='4' then sm*(1-L_commision) when Invest_type='5' then sm*(1-Color_commision) end )end,Commision=case when Invest_type='1' then T_commision when Invest_type='2' then Z_commision when Invest_type='3' then Twain_commision when Invest_type='4' then L_commision when Invest_type='5' then Color_commision end from ( select invest_winorlost ,invest_result,invest_name,sm=sum(Invest_money),Invest_type,Invest_amount,worl=sum(invest_money*invest_rate) from Invest where (Invest_second='"&id&"' ) and invest_issue="&issue&" and Invest_banlance=1 group by invest_winorlost,invest_result,invest_rate,invest_name,invest_type,Invest_amount ) a left join member b on a.Invest_name=b.member_name "
Set rs_sub = conn.execute(sub_sql)
DO WHIlE Not rs_sub.eof
tempMoney = rs_sub("winorlist")
f__result = f__result + tempMoney
rs_sub.movenext
loop
rs_sub.close
End Function
%>
<link href="include/css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body {
margin-top: 0px;
}
.style2 {color: #FF9900}
.unnamed1 {
color: #FF9900;
text-decoration: none;
}
.style4 {color: #FF9900; font-weight: bold; }
.style5 {
color: #FF6600;
font-weight: bold;
}
.style6 {color: #FF6600}
.style9 {color: #333333}
.style11 {color: #CC9900}
.style8 {color: #000000}
-->
</style></head>
<body style="background-color: #F2F2F2">
<p>
<% '------------------------------------------------------------------------------------------------------------------------
'下级代理区:
if session("A_rank")=1 then
set Count_rs=server.createobject("adodb.recordset")
'Count_sql="select Invest_issue,sm, Invest_second,b.Agent_ma_zc from ( select Invest_issue,Invest_frist,Invest_second,sm=sum(Invest_money) from Invest where Invest_frist='"&session("A_name")&"' and Invest_issue="&issue&" and Invest_banlance=1 group by Invest_second,Invest_frist,Invest_issue ) a left join Agent b on a.Invest_second=b.agent_name order by a.Invest_second"
'response.write Count_sql
Count_sql="select Invest_issue, sm,Invest_second,b.Agent_ma_zc from ( select Invest_issue,Invest_frist,Invest_second,sm=sum(Invest_money) from Invest where (Invest_frist='"&session("A_name")&"' ) and Invest_issue="&issue&" and Invest_banlance=1 group by Invest_second,Invest_issue,Invest_frist ) a left join Agent b on a.Invest_second=b.agent_name order by a.Invest_second"
Count_rs.open Count_sql,conn,1,1
%>
</p>
<BR>
<table border="1" width="739" cellspacing="0" cellpadding="0" bordercolor="#E0E0E0" style="border-collapse: collapse" height="10%">
<tr>
<td width="731" valign="top">
<center><table width="96%" border="1" cellspacing="1" bordercolor="#F2F2F2" bordercolorlight="#F2F2F2" bordercolordark="#9D9CA4">
<tr bgcolor="#E5EAEE">
<td colspan="17"><span class="style11"><a href="#"><strong>分销商区:</strong></a><strong>( 点击分销商名字,可直接查看此代理的详细投注清况)</strong></span></td>
</tr>
<tr align="center" bgcolor="#CCCCCC">
<td width="9%" height="25" bgcolor="#BCD5E4"><span class="style9">代理人</span></td>
<td width="9%" height="25" bgcolor="#BCD5E4"><span class="style9">投注金额</span></td>
<td width="15%" height="25" bgcolor="#BCD5E4"><span class="style9"> 您的占成</span></td>
<td width="15%" height="25" bgcolor="#BCD5E4"><span class="style9">结果</span></td>
<td width="16%" bgcolor="#BCD5E4">占成所得</td>
<td width="17%" height="25" bgcolor="#BCD5E4"><span class="style9">下注期数</span></td>
<td width="19%" height="25" bgcolor="#BCD5E4"><span class="style9">详细</span></td>
</tr>
<%
do while not Count_rs.eof
%>
<tr align="center" bgcolor="#f2f2f2">
<td><a href="History_count_detail.asp?second=<%=Count_rs("Invest_second")%>"><%=Count_rs("Invest_second")%></a> </td>
<td><%=Count_rs("sm")%> </td>
<td><%=(count_rs("Agent_ma_zc"))%> </td>
<td><%result=f__result(count_rs("Invest_second"))%><%=result%> </td>
<td><%=Count_rs("sm")*count_rs("Agent_ma_zc")%> </td>
<td><%=Count_rs("Invest_issue")%> </td>
<td><a href="History_count_detail.asp?second=<%=Count_rs("Invest_second")%>">详细资料</a></td>
</tr>
<% A_Total=A_Total+Count_rs("sm")
ZC_result=ZC_result+count_rs("Agent_ma_zc")*Count_rs("sm")'占成所得
Fact=Fact+result
Count_rs.movenext
loop
set Count_rs=nothing%>
<tr align="center" bgcolor="#f2f2f2">
<td><strong>小计:</strong></td>
<td><span class="style5 style8"><%=A_Total%></span> </td>
<td align="left"> </td>
<td align="center"><span class="style5"><span class="style9"><%=Fact%></span></span> </td>
<td align="center"><strong><%= ZC_result%></strong> </td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
</table>
<p> </p>
<% else
' End
'-----------------------------------------------------------------------------------------------------%>
<%'----------------------------------------------------------------------------------------------
'会员区:
type1=request.querystring("type1")
set Count_rs2=server.createobject("adodb.recordset")
if type1="" then
Count_sql2="select Invest_name,cs,sm,Invest_issue from ( select Invest_name,Invest_issue,cs=count(Invest_name),sm=sum(Invest_money) from Invest where Invest_second='"&session("A_name")&"' and Invest_issue="&issue&" and Invest_banlance=1 group by Invest_name,Invest_issue) a left join member b on a.Invest_name=b.member_name "
else
Count_sql2="select Invest_type,Invest_name,cs,sm,Invest_rate,Invest_issue,invest_winorlost,invest_result,winorlist=case when invest_result=1 then ( case when invest_amount='和局' then 0 else worl-(case when Invest_type='1' then sm*(1-T_commision) when Invest_type='2' then sm*(1-Z_commision) when invest_type='3' then sm*(1-Twain_commision) when Invest_type='4' then sm*(1-L_commision) when Invest_type='5' then sm*(1-Color_commision) end ) end ) when invest_result=0 then -(case when Invest_type='1' then sm*(1-T_commision) when Invest_type='2' then sm*(1-Z_commision) when invest_type='3' then sm*(1-Twain_commision) when Invest_type='4' then sm*(1-L_commision) when Invest_type='5' then sm*(1-Color_commision) end )end,Commision=case when Invest_type='1' then T_commision when Invest_type='2' then Z_commision when Invest_type='3' then Twain_commision when Invest_type='4' then L_commision when Invest_type='5' then Color_commision end from ( select Invest_type,Invest_name,Invest_issue,invest_winorlost,invest_result,cs=count(Invest_type),Invest_amount,sm=sum(Invest_money),Invest_rate,worl=sum(invest_money*invest_rate) from Invest where Invest_second='"&session("A_name")&"' and Invest_issue="&issue&"and Invest_type='"&type1&"' and Invest_banlance=1 group by Invest_type,Invest_rate,Invest_name,Invest_issue,invest_winorlost,invest_result,Invest_amount ) a left join member b on a.Invest_name=b.member_name "
'Count_sql2="select Invest_type,a.Invest_name,cs,Invest_issue,sm ,Commision=case when Invest_type='1' then T_commision when Invest_type='2' then Z_commision when Invest_type='3' then Twain_commision when Invest_type='4' then L_commision end,Fact_money=case when Invest_type='1' then sm*(1-T_commision) when Invest_type='2' then sm*(1-Z_commision) when Invest_type='3' then sm*(1-Twain_commision) when Invest_type='4' then sm*(1-L_commision) end from ( select Invest_type,Invest_name,Invest_issue,cs=count(Invest_type),sm=sum(Invest_money) from Invest where Invest_second='"&session("Ma_name")&"' and Invest_type='"&type1&"' and Invest_banlance=0 group by Invest_type,Invest_name,Invest_issue ) a left join member b on a.Invest_name=b.member_name order by a.Invest_type"
end if
Count_rs2.open Count_sql2,conn,1,1
'------------------------------------------------------------------------------------------------%>
<center><table width="96%" border="1" cellspacing="1" bordercolor="#F2F2F2" bordercolorlight="#F2F2F2" bordercolordark="#9D9CA4">
<tr align="left" bgcolor="#E5EAEE">
<td height="23" colspan="14"><strong>直属会员区:( 点击投注者名字,可直接查看此会员的详细投注清况)</strong></td>
</tr>
<tr align="center" bgcolor="#E5EAEE">
<td height="23" colspan="14"><span class="style2">
<a href="#" onClick="javascript:history.go(-1)"> </a></span>
<form name="form1" method="post" action="">
<span class="style2"><a href="#" onClick="javascript:history.go(-1)">
</a>
<input name="radio" type="radio" onclick="javascript:self.location.href='?second=<%=second1%>'" <%if type1="" then response.write "checked"%>>
全部 <input type="radio" name="radio" onclick="javascript:self.location.href='?type1=1&second=<%=second1%>&issue=<%=issue%>'" <%if type1="1" then response.write "checked"%>>
特码
<input type="radio" name="radio" onclick="javascript:self.location.href='?type1=2&second=<%=second1%>&issue=<%=issue%>'" <%if type1="2" then response.write "checked"%>>
正码
<input type="radio" name="radio" onclick="javascript:self.location.href='?type1=6&second=<%=second1%>&issue=<%=issue%>'" <%if type1="6" then response.write "checked"%> >
正码1-6 <input type="radio" name="radio" onclick="javascript:self.location.href='?type1=3&second=<%=second1%>&issue=<%=issue%>'" <%if type1="3" then response.write "checked"%>>
两面 <input type="radio" name="radio" onclick="javascript:self.location.href='?type1=5&second=<%=second1%>&issue=<%=issue%>'" <%if type1="5" then response.write "checked"%>>
波色 <input type="radio" name="radio" onclick="javascript:self.location.href='?type1=4&second=<%=second1%>&issue=<%=issue%>'" <%if type1="4" then response.write "checked"%>> 连码
<input type="radio" name="radiobutton" value="radiobutton">
正码过关
<input type="radio" name="radiobutton" value="radiobutton">
生肖
</span>
</form></td>
</tr>
<tr align="center" bgcolor="#CCCCCC">
<!--td width="8%" height="25">类别</td-->
<td width="8%" height="25" bgcolor="#BCD5E4">投注会员</td>
<td width="12%" height="25" bgcolor="#BCD5E4">投注笔数</td>
<td width="12%" height="25" bgcolor="#BCD5E4">投注金额</td>
<%if type1<>"" then%>
<td width="14%" height="25" bgcolor="#BCD5E4">佣金</td>
<td width="12%" height="25" bgcolor="#BCD5E4">赔率</td>
<td width="16%" height="25" bgcolor="#BCD5E4">结果</td>
<%end if%>
<td width="18%" height="25" bgcolor="#BCD5E4">下注期数</td>
</tr>
<%
do while not Count_rs2.eof
%>
<tr align="center" bgcolor="#f2f2f2">
<!--td><%'select case Count_rs2("Invest_type")
' case "1"
' response.write "特码"
' case "2"
' response.write "正码"
' case "3"
' response.write "两面"
' case "4"
' response.write "连码"
' case "5"
' response.write "波色"
' end select%> </td-->
<td><a href="History_Person_detail.asp?name=<%=Count_rs2("Invest_name")%>"><%=Count_rs2("Invest_name")%></a> </td>
<td><%=Count_rs2("cs")%> </td>
<td><%=Count_rs2("sm")%> </td>
<%if type1<>"" then%>
<td><%=formatnumber(Count_rs2("Commision"),,-1)%> </td>
<td><%=Count_rs2("invest_rate")%> </td>
<td><%if Count_rs2("winorlist")=0 then
response.write "<font color='red'>和局</font>"
else
response.write Count_rs2("winorlist")
end if%> </td>
<% Result2=Result2+Count_rs2("winorlist")
end if%>
<td><%=Count_rs2("Invest_issue")%> </td>
</tr>
<%Total=Total+Count_rs2("sm")
Record=Record+Count_rs2("cs")
Count_rs2.movenext
loop%>
<tr align="center" bgcolor="#f2f2f2">
<td><strong>小计:</strong></td>
<td><strong>总</strong><%=Record%>笔 </td>
<td>共<%=Total%>元<br>
扣除后:<%=Total*(1-Agent_zc)%></td>
<% if type1<>"" then%>
<td> </td>
<td> </td>
<td><span class="style4"><span class="style6">
总结果:<%=Result2%>元
<%end if%>
</span></span></td>
<td> </td>
</tr>
</table>
<%end if%>
<p> </p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -