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

Web服务器

开发平台:

PHP

  1. <?php 
  2. session_start();
  3. include("checks.php");
  4. include("../inc/base_status.inc.php");
  5. if($down_type<>"all")
  6. {
  7. $sq=" and sign='$down_type'";
  8. }else $sq="";
  9. $sqlcs=mysql_query("select * from member_cut where user_account='admin' and sign<>'0' $sq order by sign asc",$conn);
  10. $_SESSION["menus"]="查看分类账";
  11. ?>
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  14. <link href="../css/css.CSS" rel="stylesheet" type="text/css">
  15. <title></title>
  16. <style type="text/css">
  17. <!--
  18. body {
  19. margin-left: 0px;
  20. }
  21. -->
  22. </style>
  23. </head>
  24. <body>
  25. <table width="100%" height="25" border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#6a9bd8">
  26.   <tr>
  27.     <td width="9">&nbsp;</td>
  28.     <form name="form1">
  29.       <td width="492" height="20" class="fw12">代理商 报表管理(清单)</td>
  30.       <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.php" class="ah">返回上一页</a></div></td>
  31.     </form>
  32.     <td width="10">&nbsp;</td>
  33.   </tr>
  34. </table><br><br>
  35. <table width="100%" height="123" border="0" cellpadding="2" cellspacing="1" class="t12">
  36.   <tr bgcolor="#B77700">
  37.     <td height="30" colspan="11" class="t11"><span class="fw12"> 日期范围:
  38.       <?=$start_time?>
  39.       到
  40.       <?=$end_time?> 期数:<?php if($date_num<>"no") echo "期数:<strong>".$date_num."</strong> 期";?>
  41.     报表种类:分类账 </span></td>
  42.   </tr>
  43.   <tr bgcolor="#456594">
  44.     <td width="109" rowspan="2"><div align="center" class="fw12">下注种类</div>      
  45.     <div align="center"></div></td>
  46.     <td width="57" rowspan="2"><div align="center" class="fw12">笔数</div>      <div align="center"></div></td>
  47.     <td width="109" rowspan="2"><div align="center" class="fw12">下注金额</div>      <div align="center"></div></td>
  48.     <td width="64" rowspan="2"><div align="center" class="fw12">会员</div>      <div align="center"></div></td>
  49.     <td width="76" rowspan="2" align="center" class="fw12">代理商</td>
  50.     <td width="76" rowspan="2" align="center" class="fw12">总代理</td>
  51.     <td width="76" rowspan="2" align="center" class="fw12"><div align="center" class="fw12"></div>
  52.     <div align="center">股东</div></td>
  53.     <td colspan="4"><div align="center"></div>      
  54.     <div align="center" class="fw12">管理员</div>    </td>
  55.   </tr>
  56.   <tr class="t19">
  57.     <td width="57" bgcolor="#456594"><div align="center" class="fw12">退水</div></td>
  58.     <td width="57" bgcolor="#456594"><div align="center" class="fw12">金额</div></td>
  59.     <td width="56" colspan="2" bgcolor="#456594"><div align="center" class="fw12">结果</div></td>
  60.   </tr> <?php 
  61.                 if($date_num=="no")
  62.                 {
  63.                 $sq=" and drop_time>='$start_time' and drop_time<='$end_time' ";
  64.                  }else $sq=" and drop_date='$date_num' ";
  65. $count_cuts=0;
  66. while($rowcs=mysql_fetch_array($sqlcs))
  67.   $cut_sign=$rowcs["sign"];
  68.   $sql=mysql_query("select * from drop_bill where cut_sign='$cut_sign' $sq ",$conn);
  69.     $bnum=0;
  70.     $drop_money=0;
  71. $user_win=0;
  72. $manage_cut=0;
  73. $manage_money=0;
  74. $agent_profit=0;
  75. $manage_result=0;
  76. $agent_submit=0;
  77. $all_agent_submit=0;
  78. $manage_cut=0;
  79. $manage_money=0;
  80. $manage_result=0;
  81. $all_agent_submit=0;
  82. $super_agent_submit=0;
  83.   while($rs=mysql_fetch_array($sql))
  84.   { $bnum++;
  85. $drop_money+=$rs["drop_money"];
  86. $user_win+=$rs["user_win"];
  87. $manage_cut+=$rs["manage_cut"];
  88. $manage_money+=$rs["manage_money"];
  89. $agent_profit+=$rs["agent_profit"];
  90. $manage_result+=$rs["manage_result"];
  91. $agent_submit+=$rs["agent_submit"];
  92. $all_agent_submit+=$rs["all_agent_submit"];
  93. $super_agent_submit+=$rs["super_agent_submit"];
  94.   }
  95.     $bnum_count+=$bnum;
  96.     $drop_money_count+=$drop_money;
  97. $user_win_count+=$user_win;
  98. $manage_cut_count+=$manage_cut;
  99. $manage_money_count+=$manage_money;
  100. $agent_profit_count+=$agent_profit;
  101. $manage_result_count+=$manage_result;
  102. $agent_submit_count+=$agent_submit;
  103. $all_agent_submit_count+=$all_agent_submit;
  104. $super_agent_submit_count+=$super_agent_submit;
  105. if($bnum>0)
  106. {?>
  107.   <tr class="t15">
  108.     <td height="24" nowrap><div align="left">
  109.       <? if($rowcs["cut_unit"]=="特码A")
  110.       { echo "特码";
  111.   }else echo $rowcs["cut_unit"];?>
  112.     </div></td>
  113.     <td align="right" nowrap><?=$bnum?></td>
  114.     <td align="right" nowrap><a href="table_class_bill_details.php?cutsign=<?=$cut_sign?>&dates=<?=$date_num?>&droptype=<?=$rowcs["cut_unit"]?>" class="ags"><?=$drop_money?></a></td>
  115.     <td align="right" nowrap><?=$user_win?></td>
  116.     <td align="center" nowrap><div align="right">
  117.       <?=$agent_submit?>
  118.     </div></td>
  119.     <td align="right" nowrap><?=$all_agent_submit?></td>
  120.     <td align="right" nowrap><?=$super_agent_submit?></td>
  121.     <td align="right" nowrap><?=$manage_cut?></td>
  122.     <td align="right" nowrap><?=$manage_money?></td>
  123.     <td colspan="2" align="right" nowrap><?=$manage_result?></td>
  124.   </tr><? }
  125.   }
  126.    ?>
  127.   <tr class="t13">
  128.     <td height="27" nowrap><div align="center"></div>      
  129.     <div align="right" class="fbback">总计:</div></td>
  130.     <td nowrap><div align="right" class="fbback">
  131.         <?=$bnum_count?>
  132.     </div></td>
  133.     <td nowrap><div align="right" class="fbback">
  134.         <?=$drop_money_count?>
  135.     </div></td>
  136.     <td nowrap><div align="right" class="fbback">
  137.         <?=$user_win_count?>
  138.     </div></td>
  139.     <td align="center" nowrap><div align="right"><span class="fbback">
  140.       <?=$agent_submit_count?>
  141.     </span></div></td>
  142.     <td align="right" nowrap><span class="fbback">
  143.       <?=$all_agent_submit_count?>
  144.     </span></td>
  145.     <td align="right" nowrap><span class="fbback">
  146.       <?=$super_agent_submit_count?>
  147.     </span></td>
  148.     <td nowrap><div align="right" class="fbback">
  149.         <?=$manage_cut_count?>
  150.     </div></td>
  151.     <td nowrap><div align="right" class="fbback">
  152.         <?=$manage_money_count?>
  153.     </div></td>
  154.     <td colspan="2" nowrap><div align="right" class="fbback">
  155.         <?=$manage_result_count?>
  156.     </div></td>
  157.   </tr>
  158. </table>
  159. </body>