table_all_bill.php
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:5k
源码类别:

Web服务器

开发平台:

PHP

  1. <?php 
  2. session_start();
  3. include("checks.php");
  4. include("../inc/base_status.inc.php");
  5. $sqluser=mysql_query("select * from member where agent='$agent' order by id desc",$conn);
  6. $_SESSION["menus"]="查看$agent代理商报表";
  7. ?>
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  10. <link href="../css/css.CSS" rel="stylesheet" type="text/css">
  11. <title></title>
  12. <style type="text/css">
  13. <!--
  14. body {
  15. margin-left: 0px;
  16. }
  17. -->
  18. </style>
  19. </head>
  20. <body>
  21. <table width="100%" height="25" border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#6A9BD8">
  22.   <tr>
  23.     <td width="9">&nbsp;</td>
  24.     <form name="form1">
  25.       <td width="492" class="fw12">代理商 报表管理(清单)</td>
  26.       <td width="183" class="fw12"><div align="right"><a href="table.php" class="ah">查询</a>&nbsp;<a href="#" class="ah" onClick="document.execCommand('print','true','true')">列印</a>&nbsp;<a href="table_search.php" class="ah">返回上一页</a></div></td>
  27.     </form>
  28.     <td width="10">&nbsp;</td>
  29.   </tr>
  30. </table><br>
  31. <br>
  32. <table width="100%" height="119" border="0" cellpadding="2" cellspacing="1" class="t12">
  33.   <tr>
  34.     <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>
  35.   </tr>
  36.   <tr bgcolor="#456594">
  37.     <td rowspan="2"><div align="center" class="fw12">会员账号</div>      <div align="center"></div></td>
  38.     <td rowspan="2"><div align="center" class="fw12">会员名称</div>      <div align="center"></div></td>
  39.     <td rowspan="2"><div align="center" class="fw12">笔数</div>      <div align="center"></div></td>
  40.     <td rowspan="2"><div align="center" class="fw12">下注金额</div>      <div align="center"></div></td>
  41.     <td rowspan="2"><div align="center" class="fw12">会员</div>      <div align="center"></div></td>
  42.     <td colspan="4"><div align="center"></div>      
  43.     <div align="center" class="fw12">代理商</div>      <div align="center"></div></td>
  44.     <td rowspan="2"><div align="center"></div>      
  45.     <div align="center" class="fw12">总代理</div></td>
  46.   </tr>
  47.   <tr class="t19">
  48.     <td bgcolor="#456594"><div align="center" class="fw12">退水</div></td>
  49.     <td bgcolor="#456594"><div align="center" class="fw12">金额</div></td>
  50.     <td bgcolor="#456594"><div align="center" class="fw12">占成</div></td>
  51.     <td bgcolor="#456594"><div align="center" class="fw12">结果</div></td>
  52.   </tr><?php 
  53.        if($date_num=="no")
  54.    {
  55.      $sq=" and drop_time>='$start_time' and drop_time<='$end_time' ";
  56.    }else $sq=" and drop_date='$date_num' ";
  57.    while($rsp=mysql_fetch_array($sqluser))
  58.    { 
  59.     $user_account=$rsp["user_account"];
  60.     $sql=mysql_query("select * from drop_bill where user_name='$user_account' $sq",$conn);
  61.     $bnum=0;
  62.     $drop_money=0;
  63. $user_win=0;
  64. $agent_cut=0;
  65. $agent_money=0;
  66. $agent_profit=0;
  67. $agent_result=0;
  68. $agent_submit=0;
  69.   while($rs=mysql_fetch_array($sql))
  70.   { $bnum++;
  71. $drop_money+=$rs["drop_money"];
  72. $user_win+=$rs["user_win"];
  73. $agent_cut+=$rs["agent_cut"];
  74. $agent_money+=$rs["agent_money"];
  75. $agent_profit=$rs["agent_profit"];
  76. $agent_result+=$rs["agent_result"];
  77. $agent_submit+=$rs["agent_submit"];
  78.   } $bnum_count+=$bnum;
  79.     $drop_money_count+=$drop_money;
  80. $user_win_count+=$user_win;
  81. $agent_cut_count+=$agent_cut;
  82. $agent_money_count+=$agent_money;
  83. $agent_profit_count+=$agent_profit;
  84. $agent_result_count+=$agent_result;
  85. $agent_submit_count+=$agent_submit;
  86. if($bnum>0)
  87. {
  88.    ?>
  89.   <tr class="t15">
  90.     <td><div align="right"><?=$user_account?></div></td>
  91.     <td><div align="right"><?=$rsp["user_name"]?></div></td>
  92.     <td align="right"><?=$bnum?></td>
  93.     <td><div align="right"><a href="table_all_bill_details.php?user=<?=$user_account?>&dates=<?=$date_num?>" class="ags"><?=$drop_money?></a></div></td>
  94.     <td><div align="right"><?=$user_win?></div></td>
  95.     <td><div align="right"><?=$agent_cut?></div></td>
  96.     <td><div align="right">
  97.       <?=$agent_money?>
  98.     </div></td>
  99.     <td><div align="right"><?=$agent_profit?></div></td>
  100.     <td><div align="right">
  101.   <?=$agent_result?>
  102.     </div></td>
  103.     <td><div align="right">
  104.       <?=$agent_submit?>
  105. </div></td>
  106.   </tr><? 
  107.        }
  108.   } ?>
  109.   <tr class="t13">
  110.     <td colspan="2" nowrap><div align="right" class="fbback">总计:</div></td>
  111.     <td nowrap><div align="right" class="fbback"><?=$bnum_count?></div></td>
  112.     <td nowrap><div align="right" class="fbback"><?=$drop_money_count?></div></td>
  113.     <td nowrap><div align="right" class="fbback"><?=$user_win_count?></div></td>
  114.     <td nowrap><div align="right" class="fbback"><?=$agent_cut_count?></div></td>
  115.     <td nowrap><div align="right" class="fbback"><?=$agent_money_count?></div></td>
  116.     <td nowrap><div align="right"></div></td>
  117.     <td nowrap><div align="right" class="fbback"><?=$agent_result_count?></div></td>
  118.     <td nowrap><div align="right" class="fbback"><?=$agent_submit_count?></div></td>
  119.   </tr>
  120. </table>
  121. </body>