⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 history_count.asp

📁 1。超强文件读写锁定
💻 ASP
字号:
<%'创建时间:2004/07/13
'创建人:
'功能:用于代理统计已结算的投注
'2006-03-52加多一个和局判断
%>
<!--#include file="Include/conn.asp"-->
<!--#include file="Include/Islogin.asp"-->
<html>
<head>

<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">
<BR>
<table border="1" width="739" cellspacing="0" cellpadding="0" bordercolor="#E0E0E0" style="border-collapse: collapse" height="10%">
  <tr>
    <td width="731" valign="top" align="center">
 <%
 
 
  dim s
  s=session("A_name")
  set M_rs=server.createobject("adodb.recordset")

    M_sql="select Agent_page,Agent_online,Agent_id,Agent_name,Agent_realname,Agent_total,Agent_list,Agent_rank,Agent_restart,Agent_fronttime,Agent_regtime from Agent where Agent_name='"&s&"'"
 M_rs.open M_sql,conn,1,3
    M_rs("Agent_page")="帐户历史"
  M_rs.update%>
<form name="form2" method="post" action="history_count_select.asp">
  <font size="2">请输入期数<b>:</b></font>
    <input name="issue" type="text" class="input" id="issue" size="20">
  <input name="Submit" type="submit" class="botton" value="提交">
</form>
<p>
  <% '------------------------------------------------------------------------------------------------------------------------
'下级代理区:
if session("A_rank")=1 then
 set Count_rs=server.createobject("adodb.recordset")
'Count_sql="select invest_second, total_invest=sum(invest_money),me_result=sum(i.mem_result),ag_result=sum(i.ag_result),ma_result=sum(i.ma_result) from (select invest_money,mem_result=case when invest_result=0 then -(invest_money*(1-invest_feico))when invest_result=1 then invest_money*invest_rate-invest_money*(1-invest_feico) end ,ag_result=case when invest_result=0 then invest_money*invest_agzc+invest_money*invest_mazc*invest_maco-invest_money*invest_agco*(invest_mazc+invest_agzc)when invest_result=1 then -( invest_money*invest_rate*invest_agzc-(invest_money*invest_agzc+invest_money*invest_mazc*invest_maco-invest_money*invest_agco*(invest_mazc+invest_agzc))) end ,ma_result=case when invest_result=0 then invest_money*invest_mazc*(1-invest_maco)when invest_result=1 then -(invest_money*invest_rate*invest_mazc-invest_money*invest_mazc*(1-invest_maco)) end ,invest_second from invest where invest_issue="&history_issue&" and invest_frist='"&session("a_name")&"' and invest_banlance=1 and invest_amount is null ) i group by invest_second"
count_sql="select invest_second, total_invest=sum(invest_money),me_result=sum(i.mem_result),ag_result=sum(i.ag_result),ma_result=sum(i.ma_result) from (select invest_money,mem_result=case when invest_result=0 then -(invest_money*(1-invest_feico))when invest_result=1 then invest_money*invest_rate-invest_money*(1-invest_feico) end ,ag_result=case when invest_result=0 then invest_money*invest_agzc+invest_money*invest_mazc*invest_maco-invest_money*invest_agco*(invest_mazc+invest_agzc)when invest_result=1 then -( invest_money*invest_rate*invest_agzc-(invest_money*invest_agzc+invest_money*invest_mazc*invest_maco-invest_money*invest_agco*(invest_mazc+invest_agzc))) end ,ma_result=case when invest_result=0 then invest_money*invest_mazc*(1-invest_maco)when invest_result=1 then -(invest_money*invest_rate*invest_mazc-invest_money*invest_mazc*(1-invest_maco)) end ,invest_second from invest where invest_issue="&history_issue&" and invest_frist='"&session("a_name")&"' and invest_banlance=1 and invest_amount is null union all SELECT Invest_money, mem_result = CASE WHEN invest_type <> 4 THEN (CASE WHEN invest_result = 0 THEN - (invest_money * (1 - invest_feico)) WHEN invest_result = 1 THEN invest_money * invest_rate1 - invest_money * (1 - invest_feico) END) WHEN invest_type = 4 THEN (CASE WHEN invest_result = 0 THEN - (invest_money * (1 - invest_feico) * invest_zs) WHEN invest_result = 1 THEN invest_money * win_thow * invest_rate1 + invest_money * win_zhow * invest_rate2 - invest_money * invest_zs * (1 - invest_feico) END) END, ag_result = CASE WHEN invest_type <> 4 THEN (CASE WHEN invest_result =0 THEN invest_money * invest_agzc + invest_money * invest_mazc * invest_maco - invest_money * invest_agco * (invest_mazc + invest_agzc) WHEN invest_result = 1 THEN - (invest_money * invest_rate1 * invest_agzc - (invest_money * invest_agzc + invest_money * invest_mazc * invest_maco - invest_money * invest_agco * (invest_mazc + invest_agzc))) END) WHEN invest_type = 4 THEN (CASE WHEN invest_result = 0 THEN invest_money * invest_agzc + invest_money * invest_mazc * invest_maco - invest_money * invest_agco        * (invest_mazc + invest_agzc) WHEN invest_result = 1 THEN - ((invest_money * win_thow * invest_rate1 * invest_agzc + invest_money * win_zhow * invest_rate2 * invest_agzc) - (invest_money * invest_zs * invest_agzc + invest_money * invest_zs * invest_mazc * invest_maco - invest_money * invest_zs * invest_agco * (invest_mazc + invest_agzc))) END) END, ma_result = CASE WHEN invest_type <> 4 THEN (CASE WHEN invest_result = 0 THEN invest_money * invest_mazc * (1 - invest_maco) WHEN invest_result = 1 THEN - (invest_money * invest_rate1 * invest_mazc - invest_money * invest_mazc * (1 - invest_maco)) END) WHEN invest_type = 4 THEN (CASE WHEN invest_result = 0 THEN invest_money * invest_mazc * (1 - invest_maco) WHEN invest_result = 1 THEN - ((invest_money * win_thow * invest_rate1 * invest_mazc + invest_money * win_zhow * invest_rate2 * invest_mazc) - invest_money * invest_zs * invest_mazc * (1 - invest_maco)) END) END,Invest_second FROM Invest_l WHERE (Invest_issue ="&history_issue&") AND (Invest_frist = '"&session("a_name")&"') AND (Invest_banlance = 1) AND (Invest_amount IS NULL)) i GROUP BY invest_second "
Count_rs.open Count_sql,conn,1,1
'response.write count_sql
%>
</p>
<center>
<table width="96%"  border="1" cellspacing="1" bordercolor="#F2F2F2" bordercolorlight="#F2F2F2" bordercolordark="#9D9CA4" height="87">
  <tr bgcolor="#E5EAEE">
    <td colspan="20" width="784" height="12"><span class="style11"><a href="#"><strong>分销商区:</strong></a><strong>( 点击分销商名字,可直接查看此代理的详细投注清况)</strong></span></td>
  </tr>
  <tr align="center" bgcolor="#CCCCCC">
    <td width="70" height="20" bgcolor="#BCD5E4"><span class="style9">代理商</span></td>
    <td width="114" height="20" bgcolor="#BCD5E4"><span class="style9">投注金额</span></td>
    <td width="114" height="20" bgcolor="#BCD5E4"><span class="style9">会员结果</span></td>
    <td width="114" bgcolor="#BCD5E4" height="20">应收分销商</td>
    <td width="114" bgcolor="#BCD5E4" height="20">您的最终结果</td>
    <td width="114" bgcolor="#BCD5E4" height="20">应付管理员</td>
    <td width="68" height="20" bgcolor="#BCD5E4"><span class="style9">下注期数</span></td>
    <td width="72" height="20" bgcolor="#BCD5E4"><span class="style9">详细</span></td>
  </tr>
  <%  do while not Count_rs.eof %>
    <tr align="center" bgcolor="#f2f2f2">
	<td width="70" height="23"><a href="History_count_detail.asp?second=<%=Count_rs("Invest_second")%>"><%=Count_rs("Invest_second")%></a> </td>
    <td width="114" height="23"><%=round(count_rs("total_invest"))%> </td>
    <td width="114" height="23"><%=round(count_rs("me_result"))%> </td>
    <td width="114" height="23"><%=round((count_rs("ag_result"))+(count_rs("ma_result")))%> </td>
    <td width="114" height="23"><%=round(count_rs("ag_result"))%>  </td>
    <td width="114" height="23"><%=round(count_rs("ma_result"))%> </td>
    <td width="68" height="23"><%=history_issue%> </td>
    <td width="72" height="23"><a href="History_count_detail.asp?second=<%=Count_rs("Invest_second")%>">详细资料</a></td>
  </tr>
  <% A_Total=A_Total+(count_rs("total_invest"))
  me_result=me_result+(count_rs("me_result"))
  ag_result=ag_result+(count_rs("ag_result"))
  ma_result=ma_result+(count_rs("ma_result"))
  fei_result=fei_result+(count_rs("ag_result"))+(count_rs("ma_result"))
  Count_rs.movenext
  loop
  set Count_rs=nothing%>
  <tr align="center" bgcolor="#f2f2f2">
    <td width="70" height="12"><strong>小计:</strong></td>
    <td width="114" height="12"><span class="style5 style8"><%=A_Total%></span></td>
    <td align="center" width="114" height="12"><%=round(me_result) %></td>
    <td align="center" width="114" height="12"><%=round(fei_result)%></td>
    <td align="center" width="114" height="12"><%=round(ag_result)%></td>
	    
    <td align="center" width="114" height="12"><%=round(ma_result)%></td>
    <td align="left" width="68" height="12">&nbsp;</td>
    <td align="left" width="72" height="12">&nbsp;</td>
  </tr>
</table></td>
  </tr>
</table>

<% else
' End
'-----------------------------------------------------------------------------------------------------%>
<%'----------------------------------------------------------------------------------------------
'会员区:
type1=request.querystring("type1")
 set Count_rs2=server.createobject("adodb.recordset")
'Count_sql2="select in_money=sum(invest_money),mem_result=isnull(sum(mem_result),0),fei_result=isnull(sum(fei_result),0),re=count(*),invest_name from (select mem_result=case when invest_result=0 then -(invest_money*(1-invest_feico))when invest_result=1 then invest_money*invest_rate-invest_money*(1-invest_feico) end ,fei_result=case when invest_result=0 then invest_money*invest_feizc-invest_money*invest_feico+invest_money*invest_agco*(invest_mazc+invest_agzc)when invest_result=1 then -(invest_money*invest_rate*invest_feizc-(invest_money*invest_feizc-invest_money*invest_feico+invest_money*invest_agco*(invest_mazc+invest_agzc))) end ,invest_money,invest_name  from invest where invest_issue="&history_issue&" and invest_second='"&session("a_name")&"' and invest_banlance=1 and invest_amount is null) i group by invest_name "	
count_sql2="select in_money=sum(invest_money),mem_result=isnull(sum(mem_result),0),fei_result=isnull(sum(fei_result),0),re=count(*),invest_name from (select mem_result=case when invest_result=0 then -(invest_money*(1-invest_feico))when   invest_result=1 then invest_money*invest_rate-invest_money*(1-invest_feico) end ,fei_result=case when   invest_result=0 then invest_money*invest_feizc-invest_money*invest_feico+invest_money*invest_agco*(invest_mazc+invest_agzc)when invest_result=1 then -(invest_money*invest_rate*invest_feizc-(invest_money*invest_feizc-invest_money*invest_feico+invest_money*invest_agco*(invest_mazc+invest_agzc))) end ,invest_money,invest_name from invest where invest_issue="&history_issue&" and invest_second='"&session("a_name")&"' and invest_banlance=1 and invest_amount is null union all SELECT  mem_result = CASE WHEN invest_type <> 4 THEN (CASE WHEN invest_result = 0 THEN - (invest_money * (1 - invest_feico)) WHEN invest_result = 1 THEN invest_money * invest_rate1 - invest_money * (1 - invest_feico) END) WHEN invest_type = 4 THEN (CASE WHEN invest_result = 0 THEN - (invest_money * (1 - invest_feico) * invest_zs) WHEN invest_result = 1 THEN invest_money * win_thow * invest_rate1 + invest_money * win_zhow * invest_rate2 - invest_money * invest_zs * (1 - invest_feico) END) END, fei_result = CASE WHEN invest_type <> 4 THEN (CASE WHEN invest_result =0 THEN invest_money * invest_agzc + invest_money * invest_mazc * invest_maco - invest_money * invest_agco * (invest_mazc + invest_agzc) WHEN invest_result = 1 THEN - (invest_money * invest_rate1 * invest_agzc - (invest_money * invest_agzc + invest_money * invest_mazc * invest_maco - invest_money * invest_agco * (invest_mazc + invest_agzc))) END) WHEN invest_type = 4 THEN (CASE WHEN invest_result = 0 THEN invest_money * invest_agzc + invest_money * invest_mazc * invest_maco - invest_money * invest_agco        * (invest_mazc + invest_agzc) WHEN invest_result = 1 THEN - ((invest_money * win_thow * invest_rate1 * invest_agzc + invest_money * win_zhow * invest_rate2 * invest_agzc) - (invest_money * invest_zs * invest_agzc + invest_money * invest_zs * invest_mazc * invest_maco - invest_money * invest_zs * invest_agco * (invest_mazc + invest_agzc))) END) END, Invest_money,Invest_name FROM Invest_l WHERE (Invest_issue ="&history_issue&") AND (invest_second='"&session("a_name")&"') AND (Invest_banlance = 1) AND (Invest_amount IS NULL) ) i group by invest_name "		
Count_rs2.open Count_sql2,conn,1,1
'response.write count_sql2
'------------------------------------------------------------------------------------------------%>
<table border="1" width="739" cellspacing="0" cellpadding="0" bordercolor="#E0E0E0" style="border-collapse: collapse" height="100%">
  <tr>
    <td width="731" valign="top" align="center">
<center>
<table width="96%" border="1" cellspacing="1" bordercolor="#F2F2F2" bordercolorlight="#F2F2F2" bordercolordark="#9D9CA4" height="115">
  <tr align="left" bgcolor="#E5EAEE">
    <td height="18" colspan="5"><strong>直属会员区:( 点击投注者名字,可直接查看此会员的详细投注清况)</strong></td>
  </tr>
  <tr align="center" bgcolor="#E5EAEE">
    <td height="18" colspan="5"><span class="style2">
    <a  href="#" onClick="javascript:history.go(-1)"> </a></span>
    </td>
  </tr>
  <tr align="center" bgcolor="#CCCCCC">
    <td width="8%" height="20" bgcolor="#BCD5E4">投注者</td>
    <td width="12%" height="20" bgcolor="#BCD5E4">投注笔数</td>
    <td width="12%" height="20" bgcolor="#BCD5E4">投注金额</td>
    <td width="16%" height="20" bgcolor="#BCD5E4">会员结果</td>
        <td width="18%" height="20" bgcolor="#BCD5E4">下注期数</td>
  </tr>
  <%
  do while not Count_rs2.eof
  
 %>
  <tr align="center" bgcolor="#f2f2f2">
   
    <td height="22"><a href="History_Person_detail.asp?name=<%=Count_rs2("Invest_name")%>"><%=Count_rs2("Invest_name")%></a> </td>
    <td height="22"><%=count_rs2("re")%> </td>
    <td height="22"><%=int(count_rs2("in_money"))%> </td>
	
    <td height="22"><%=int(count_rs2("mem_result"))%> </td>
    <td height="22"><%=history_issue%> </td>
  </tr>
  <%Total=Total+int(count_rs2("in_money"))
   Record=Record+count_rs2("re")
   in_Result=in_Result+int(count_rs2("mem_result"))
  fei_result=fei_result+int(count_rs2("fei_result"))
  ag_result=ag_result+ag_result2
  Count_rs2.movenext
  loop%>
  <tr align="center" bgcolor="#f2f2f2">
    <td height="12"><strong>小计:</strong></td>
    <td height="12"><strong>总</strong><%=Record%>笔 </td>
    <td height="12">总共<%=Total%>元</td>
    <td height="12">总结果:<%=in_result%>元 </td>
    <td align="left" height="12">&nbsp;</td>
    
  </tr>
</table>
<%end if%>
<p> </p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -