table_all_bill.php
资源名称:Nsix.rar [点击查看]
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:5k
源码类别:
Web服务器
开发平台:
PHP
- <?php
- session_start();
- include("checks.php");
- include("../inc/base_status.inc.php");
- $sqluser=mysql_query("select * from member where agent='$agent' order by id desc",$conn);
- $_SESSION["menus"]="查看$agent代理商报表";
- ?>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <link href="../css/css.CSS" rel="stylesheet" type="text/css">
- <title></title>
- <style type="text/css">
- <!--
- body {
- margin-left: 0px;
- }
- -->
- </style>
- </head>
- <body>
- <table width="100%" height="25" border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#6A9BD8">
- <tr>
- <td width="9"> </td>
- <form name="form1">
- <td width="492" class="fw12">代理商 报表管理(清单)</td>
- <td width="183" class="fw12"><div align="right"><a href="table.php" class="ah">查询</a> <a href="#" class="ah" onClick="document.execCommand('print','true','true')">列印</a> <a href="table_search.php" class="ah">返回上一页</a></div></td>
- </form>
- <td width="10"> </td>
- </tr>
- </table><br>
- <br>
- <table width="100%" height="119" border="0" cellpadding="2" cellspacing="1" class="t12">
- <tr>
- <td height="30" colspan="10" class="t11"><span class="fw12"> 日期范围:<?=$start_time?> 到 <?=$end_time?> <?php if($date_num<>"no") echo "期数:<strong>".$date_num."</strong> 期";?> 报表种类:总账</span></td>
- </tr>
- <tr bgcolor="#456594">
- <td rowspan="2"><div align="center" class="fw12">会员账号</div> <div align="center"></div></td>
- <td rowspan="2"><div align="center" class="fw12">会员名称</div> <div align="center"></div></td>
- <td rowspan="2"><div align="center" class="fw12">笔数</div> <div align="center"></div></td>
- <td rowspan="2"><div align="center" class="fw12">下注金额</div> <div align="center"></div></td>
- <td rowspan="2"><div align="center" class="fw12">会员</div> <div align="center"></div></td>
- <td colspan="4"><div align="center"></div>
- <div align="center" class="fw12">代理商</div> <div align="center"></div></td>
- <td rowspan="2"><div align="center"></div>
- <div align="center" class="fw12">总代理</div></td>
- </tr>
- <tr class="t19">
- <td bgcolor="#456594"><div align="center" class="fw12">退水</div></td>
- <td bgcolor="#456594"><div align="center" class="fw12">金额</div></td>
- <td bgcolor="#456594"><div align="center" class="fw12">占成</div></td>
- <td bgcolor="#456594"><div align="center" class="fw12">结果</div></td>
- </tr><?php
- if($date_num=="no")
- {
- $sq=" and drop_time>='$start_time' and drop_time<='$end_time' ";
- }else $sq=" and drop_date='$date_num' ";
- while($rsp=mysql_fetch_array($sqluser))
- {
- $user_account=$rsp["user_account"];
- $sql=mysql_query("select * from drop_bill where user_name='$user_account' $sq",$conn);
- $bnum=0;
- $drop_money=0;
- $user_win=0;
- $agent_cut=0;
- $agent_money=0;
- $agent_profit=0;
- $agent_result=0;
- $agent_submit=0;
- while($rs=mysql_fetch_array($sql))
- { $bnum++;
- $drop_money+=$rs["drop_money"];
- $user_win+=$rs["user_win"];
- $agent_cut+=$rs["agent_cut"];
- $agent_money+=$rs["agent_money"];
- $agent_profit=$rs["agent_profit"];
- $agent_result+=$rs["agent_result"];
- $agent_submit+=$rs["agent_submit"];
- } $bnum_count+=$bnum;
- $drop_money_count+=$drop_money;
- $user_win_count+=$user_win;
- $agent_cut_count+=$agent_cut;
- $agent_money_count+=$agent_money;
- $agent_profit_count+=$agent_profit;
- $agent_result_count+=$agent_result;
- $agent_submit_count+=$agent_submit;
- if($bnum>0)
- {
- ?>
- <tr class="t15">
- <td><div align="right"><?=$user_account?></div></td>
- <td><div align="right"><?=$rsp["user_name"]?></div></td>
- <td align="right"><?=$bnum?></td>
- <td><div align="right"><a href="table_all_bill_details.php?user=<?=$user_account?>&dates=<?=$date_num?>" class="ags"><?=$drop_money?></a></div></td>
- <td><div align="right"><?=$user_win?></div></td>
- <td><div align="right"><?=$agent_cut?></div></td>
- <td><div align="right">
- <?=$agent_money?>
- </div></td>
- <td><div align="right"><?=$agent_profit?></div></td>
- <td><div align="right">
- <?=$agent_result?>
- </div></td>
- <td><div align="right">
- <?=$agent_submit?>
- </div></td>
- </tr><?
- }
- } ?>
- <tr class="t13">
- <td colspan="2" nowrap><div align="right" class="fbback">总计:</div></td>
- <td nowrap><div align="right" class="fbback"><?=$bnum_count?></div></td>
- <td nowrap><div align="right" class="fbback"><?=$drop_money_count?></div></td>
- <td nowrap><div align="right" class="fbback"><?=$user_win_count?></div></td>
- <td nowrap><div align="right" class="fbback"><?=$agent_cut_count?></div></td>
- <td nowrap><div align="right" class="fbback"><?=$agent_money_count?></div></td>
- <td nowrap><div align="right"></div></td>
- <td nowrap><div align="right" class="fbback"><?=$agent_result_count?></div></td>
- <td nowrap><div align="right" class="fbback"><?=$agent_submit_count?></div></td>
- </tr>
- </table>
- </body>