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. $_SESSION["menus"]="查看分类账";
  6. if($down_type<>"all")
  7. {
  8. $sq=" and sign='$down_type'";
  9. }else $sq="";
  10. $sqlcs=mysql_query("select * from member_cut where user_account='admin' and sign<>'0' $sq order by sign asc",$conn);
  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: 10px;
  20. }
  21. -->
  22. </style>
  23. </head>
  24. <body>
  25. <table width="693" border="0" align="left" cellpadding="0" cellspacing="0">
  26.   <tr bgcolor="#417dec">
  27.     <td width="9" height="35">&nbsp;</td>
  28.     <form name="form1">
  29.       <td width="492" 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><br>
  35. <table width="692" height="123" border="0" cellpadding="2" cellspacing="1" class="t12">
  36.   <tr>
  37.     <td height="30" colspan="9" bgcolor="#456594"><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 class="t11">
  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 colspan="3"><div align="center"></div>      
  51.     <div align="center" class="fw12">总代理</div>      
  52.     <div align="center"></div></td>
  53.     <td width="60" rowspan="2"><div align="center"></div>      
  54.     <div align="center" class="fw12">股东</div></td>
  55.   </tr>
  56.   <tr class="t19">
  57.     <td width="57" bgcolor="#666666"><div align="center" class="fw12">退水</div></td>
  58.     <td width="57" bgcolor="#666666"><div align="center" class="fw12">金额</div></td>
  59.     <td width="57" bgcolor="#666666"><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  all_agent='$all_agent' and cut_sign='$cut_sign' $sq ",$conn);
  69.     $bnum=0;
  70.     $drop_money=0;
  71. $user_win=0;
  72. $all_agent_cut=0;
  73. $all_agent_money=0;
  74. $agent_profit=0;
  75. $all_agent_result=0;
  76. $agent_submit=0;
  77. $all_agent_submit=0;
  78. $all_agent_cut=0;
  79. $all_agent_money=0;
  80. $all_agent_result=0;
  81. $all_agent_submit=0;
  82.   while($rs=mysql_fetch_array($sql))
  83.   { $bnum++;
  84. $drop_money+=$rs["drop_money"];
  85. $user_win+=$rs["user_win"];
  86. $all_agent_cut+=$rs["all_agent_cut"];
  87. $all_agent_money+=$rs["all_agent_money"];
  88. $agent_profit+=$rs["agent_profit"];
  89. $all_agent_result+=$rs["all_agent_result"];
  90. $agent_submit+=$rs["agent_submit"];
  91. $all_agent_submit+=$rs["all_agent_submit"];
  92.   }
  93.     $bnum_count+=$bnum;
  94.     $drop_money_count+=$drop_money;
  95. $user_win_count+=$user_win;
  96. $all_agent_cut_count+=$all_agent_cut;
  97. $all_agent_money_count+=$all_agent_money;
  98. $agent_profit_count+=$agent_profit;
  99. $all_agent_result_count+=$all_agent_result;
  100. $agent_submit_count+=$agent_submit;
  101. $all_agent_submit_count+=$all_agent_submit;
  102. if($bnum>0)
  103. {?>
  104.   <tr class="t15">
  105.     <td height="24"><div align="left">
  106.       <? if($rowcs["cut_unit"]=="特码A")
  107.   { 
  108.   echo "特码";
  109.   }else echo $rowcs["cut_unit"];
  110.   ?>
  111.     </div></td>
  112.     <td align="right"><?=$bnum?></td>
  113.     <td align="right"><a href="table_class_bill_details.php?cutsign=<?=$cut_sign?>&dates=<?=$date_num?>&droptype=<?=$rowcs["cut_unit"]?>" class="ags"><?=$drop_money?></a></td>
  114.     <td align="right"><?=$user_win?></td>
  115.     <td align="center"><div align="right">
  116.       <?=$agent_submit?>
  117.     </div></td>
  118.     <td align="right"><?=$all_agent_cut?></td>
  119.     <td align="right"><?=$all_agent_money?></td>
  120.     <td align="right"><?=$all_agent_result?></td>
  121.     <td align="right"> <?=$all_agent_submit?></td>
  122.   </tr><? }
  123.   }
  124.    ?>
  125.   <tr class="t13">
  126.     <td height="27" nowrap><div align="center"></div>      
  127.     <div align="right" class="fbback">总计:</div></td>
  128.     <td nowrap><div align="right" class="fbback">
  129.         <?=$bnum_count?>
  130.     </div></td>
  131.     <td nowrap><div align="right" class="fbback">
  132.         <?=$drop_money_count?>
  133.     </div></td>
  134.     <td nowrap><div align="right" class="fbback">
  135.         <?=$user_win_count?>
  136.     </div></td>
  137.     <td align="center" nowrap><div align="right"><span class="fbback">
  138.       <?=$agent_submit_count?>
  139.     </span></div></td>
  140.     <td nowrap><div align="right" class="fbback">
  141.         <?=$all_agent_cut_count?>
  142.     </div></td>
  143.     <td nowrap><div align="right" class="fbback">
  144.         <?=$all_agent_money_count?>
  145.     </div></td>
  146.     <td nowrap><div align="right" class="fbback">
  147.         <?=$all_agent_result_count?>
  148.     </div></td>
  149.     <td nowrap><div align="right" class="fbback"><?=$all_agent_submit_count?>
  150.     </div></td>
  151.   </tr>
  152. </table>
  153. </body>