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

Web服务器

开发平台:

PHP

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