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

Web服务器

开发平台:

PHP

  1. <?php 
  2. session_start();
  3. set_time_limit(3600);
  4. include("checks.php");
  5. include("../inc/conn.php");
  6. include("../inc/profit.inc.php");
  7. include("../inc/win_unit.php");
  8. $dates=$_GET["dates"];
  9. $_SESSION["menus"]="查看$dates期开奖结算细节";
  10. $sql=mysql_query("select * from drop_bill where drop_date='$dates' order by ID asc",$conn); 
  11. ?>
  12. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  13. <link href="../css/css.CSS" rel="stylesheet" type="text/css">
  14. <style type="text/css">
  15. <!--
  16. .style1 {
  17. font-size: 16px;
  18. font-weight: bold;
  19. }
  20. body {
  21. margin-top: 5px;
  22. }
  23. -->
  24. </style>
  25. <body>
  26. <div align="center" class="style1"><?=$dates?>期 开奖查看总报表
  27. </div>
  28. [<a href="#" class="ags" onclick="document.execCommand('print','true','true')">打印</a>] [<a href="#" class="ags" onclick="javascript:window.close();">关闭窗口</a>]
  29. <table border="0" align="center" cellpadding="2" cellspacing="1" class="t12">
  30.   <tr class="t11">
  31.     <td rowspan="2" nowrap><div align="center" class="fw12">状态</div></td>
  32.     <td rowspan="2" nowrap><div align="center" class="fw12">单号</div></td>
  33.     <td rowspan="2" nowrap><div align="center" class="fw12">账号</div></td>
  34.     <td rowspan="2" nowrap><div align="center" class="fw12">退水</div> </td>
  35.     <td rowspan="2" nowrap><div align="center" class="fw12">期数</div>  </td>
  36.     <td rowspan="2" nowrap><div align="center" class="fw12">下注内容</div>  </td>
  37.     <td rowspan="2" nowrap><div align="center"></div>      
  38.     <div align="center" class="fw12">赔率</div>   </td>
  39.     <td rowspan="2" nowrap><div align="center" class="fw12">下注金额</div></td>
  40.     <td rowspan="2" nowrap><div align="center" class="fw12">退水</div></td>
  41.     <td rowspan="2" nowrap class="fw12">实际输赢</td>
  42.     <td rowspan="2" nowrap><div align="center" class="fw12">会员结果</div></td>
  43.     <td colspan="4" nowrap><div align="center" class="fw12">代理商</div></td>
  44.     <td rowspan="2" nowrap class="fw12">交总代理</td>
  45.     <td colspan="4" nowrap><div align="center" class="fw12">总代理</div></td>
  46.     <td rowspan="2" nowrap class="fw12">交股东</td>
  47.     <td colspan="4" nowrap><div align="center" class="fw12">股东</div></td>
  48.     <td rowspan="2" nowrap class="fw12">交管理员</td>
  49.     <td colspan="4" nowrap><div align="center" class="fw12">管理员</div></td>
  50.   </tr>
  51.   <tr class="t11">
  52.     <td nowrap class="fw12">退水</td>
  53.     <td nowrap class="fw12">金额</td>
  54.     <td nowrap class="fw12">占成</td>
  55.     <td nowrap class="fw12">结果</td>
  56.     <td nowrap class="fw12">退水</td>
  57.     <td nowrap class="fw12">金额</td>
  58.     <td nowrap class="fw12">占成</td>
  59.     <td nowrap class="fw12">结果</td>
  60.     <td nowrap class="fw12">退水</td>
  61.     <td nowrap class="fw12">金额</td>
  62.     <td nowrap class="fw12">占成</td>
  63.     <td nowrap class="fw12">结果</td>
  64.     <td nowrap class="fw12">退水</td>
  65.     <td nowrap class="fw12">金额</td>
  66.     <td nowrap class="fw12">占成</td>
  67.     <td nowrap class="fw12">结果</td>
  68.   </tr>
  69.   <?php
  70.   $deleted=0;
  71.   $i=0;
  72.   $n=0;
  73.   $s=0;
  74.    while($rs=mysql_fetch_array($sql))
  75.    { $super_agent_profit=0; 
  76.      $ID=$rs["ID"];
  77.      $dates=$rs["drop_date"];
  78.      $user_name=$rs["user_name"];
  79.      $agent=$rs["agent"];
  80.  $cut_sign=$rs["cut_sign"];
  81.  $drop_plate=$rs["drop_plate"];
  82.  $all_agent=$rs["all_agent"];
  83.  $drop_time=$rs["drop_time"];
  84.  $super_agent=$rs["super_agent"];
  85.  $drop_money=$rs["drop_money"];
  86.  $drop_cut=str_replace("&nbsp;","",$rs["drop_cut"]);
  87.  $num_sign=$rs["num_sign"];
  88.  $drop_content=$rs["drop_content"];
  89.  $drop_type=$rs["drop_type"];
  90.  $drop_rate=$rs["drop_rate"];
  91.  $drop_details=$rs["drop_details"];
  92.  $agent_profit=profits($agent,1)*0.01;    //代理成数
  93.  $agent_profit_all=profits($agent,4)*0.01;//代理中总代成数
  94.  $all_agent_profits=profits($all_agent,2)*0.01;//总代成数
  95.  $all_agent_profit=$all_agent_profits-$agent_profit;
  96.  $super_agent_profits=profits($super_agent,3)*0.01;//股东成数
  97.  $pg=$agent_profit_all+$agent_profit;
  98.  $pl=$super_agent_profits-$all_agent_profits;
  99. // echo $pg;
  100.  //echo $all_agent_profits;
  101.  if($pg<>$all_agent_profits)
  102.  {
  103.    $all_agent_profit=$agent_profit_all;
  104.    $oi=$all_agent_profits-$pg;
  105.    $super_agent_profit=$pl+$oi;
  106.  }else $super_agent_profit=$super_agent_profits-$all_agent_profits;
  107.  $manage_profit=1-$super_agent_profits;  //管理员成数
  108.  $agent_cut=$rs["drop_agent_cut"];//代理退水-------
  109.  $all_agent_cut=$rs["drop_all_agent_cut"];//总代退水------------
  110.  $super_agent_cut=$rs["drop_super_agent_cut"];//股东退水-------------
  111.      $user_cut=round($drop_money*trim($drop_cut)*0.01,2);
  112.  $cut_count+=round($user_cut,2);
  113.  $agent_cuts=round(($drop_money*$drop_cut-$drop_money*(1-$agent_profit)*$agent_cut)*0.01,2);
  114.      $all_agent_cuts=round(($drop_money*(1-$agent_profit)*$agent_cut-$drop_money*(1-($all_agent_profit+$agent_profit))*$all_agent_cut)*0.01,2);
  115.      $super_agent_cuts=round(($drop_money*($super_agent_profit+$manage_profit)*$all_agent_cut-$drop_money*$manage_profit*$super_agent_cut)*0.01,2);
  116.  $manage_cuts=round((($drop_money*$super_agent_cut*$manage_profit)-($drop_money*$super_agent_cut-$drop_money*$super_agent_cut)*(1-$super_agent_profit))*0.01,2);  //管理员退水
  117.  if($deleted==0)
  118.  {
  119.  $win=win_unit($num_sign,$drop_content,$drop_type,$drop_money,$drop_rate,$drop_details,$dates,$user_cut);
  120.  }else $win=0;
  121.  $tok=$_SESSION["hnum"];//为和情况
  122.  if($tok==2)
  123.  {
  124.   $user_cut=0;
  125.   $agent_cuts=0;
  126.   $all_agent_cuts=0;
  127.   $super_agent_cuts=0;
  128.   $manage_cuts=0;
  129.  }
  130.  $win=round($win,2);
  131.  $wins+=$win;
  132.  $true_win=round($win-$user_cut,2);//实际win loser
  133.  $agent_money=round($true_win*$agent_profit,2);
  134.  $all_agent_money=round($true_win*$all_agent_profit,2);
  135.  $super_agent_money=round($true_win*$super_agent_profit,2);
  136.  $manage_money=round($true_win*$manage_profit,2);
  137.  $agent_profits=$agent_profit*100;  //代理占成
  138.  $all_agent_profits=$all_agent_profit*100;//总代占成
  139.  $super_agent_profits=$super_agent_profit*100;//股东占成
  140.  $manage_profits=$manage_profit*100;//管理员占成
  141.  $agent_result=round($agent_money+$agent_cuts,2);  //代理结果
  142.  $all_agent_result=round($all_agent_money+$all_agent_cuts,2);//总代结果
  143.  $super_agent_result=round($super_agent_money+$super_agent_cuts,2); //股东结果
  144.  $manage_result=round($manage_money+$manage_cuts,2);
  145.  $agent_submit=round($win-$agent_result,2);//交总代理
  146.  $all_agent_submit=round($agent_submit-$all_agent_result,2);//交股东
  147.  $super_agent_submit=round($all_agent_submit-$super_agent_result,2);//交管理员
  148.   if($sqlok)
  149. { $n++;
  150.  }else
  151.  { 
  152.  $s++;
  153.  } 
  154.    //公开
  155.   mysql_query("update results set deleted='0' where dates='$dates'",$conn);
  156.     ?>
  157.   <tr class="t15" onmouseover="c=this.style.backgroundColor;this.style.backgroundColor='#FFFF66'" onmouseout="this.style.backgroundColor=c" onClick="this.style.backgroundColor='#FFFF66';c='#FFFF66'">
  158.     <td nowrap><div align="center">
  159. ⊙</div></td>
  160.     <td nowrap><div align="center"><?=$ID?></div></td>
  161.     <td nowrap><div align="right"></div>
  162.         <div align="center"></div>      <div align="right"><?=$user_name?>
  163.     </div>      <div align="right"></div></td>
  164.     <td nowrap><div align="right"><?=$drop_cut?></div></td>
  165.     <td nowrap><div align="right"><?=$dates?>  
  166.     </div></td>
  167.     <td nowrap ><div align="right"><?=$drop_type?> <?=$drop_content?><?
  168. if($drop_details<>"0") echo $drop_details;?>
  169. </div></td>
  170.     <td nowrap><div align="right"><?=$drop_rate?></div></td>
  171.     <td nowrap><div align="right">
  172. <? $drop_money_count+=$drop_money;
  173. echo $drop_money;?></div></td>
  174.     <td nowrap><div align="right">
  175. <? $user_cut_count+=$user_cut;
  176. echo $user_cut;?></div></td>
  177.     <td nowrap><div align="right">
  178. <? $true_win_count+=$true_win;
  179. echo $true_win;?></div></td>
  180.     <td nowrap><div align="right">
  181. <? $win_count+=$win;
  182. echo $win;?></div></td>
  183.     <td align="right" nowrap><? 
  184. $agent_cuts_count+=$agent_cuts;
  185. echo $agent_cuts;?></td>
  186.     <td align="right" nowrap>
  187. <? $agent_money_count+=$agent_money;
  188. echo $agent_money;?></td>
  189.     <td align="right" nowrap><?=$agent_profits?></td>
  190.     <td align="right" nowrap>
  191. <? $agent_result_count+=$agent_result;
  192. echo $agent_result;?></td>
  193.     <td align="right" nowrap>
  194. <? $agent_submit_count+=$agent_submit;
  195. echo $agent_submit;?></td>
  196.     <td align="right" nowrap>
  197. <? $all_agent_cuts_count+=$all_agent_cuts;
  198. echo $all_agent_cuts;?></td>
  199.     <td align="right" nowrap> 
  200. <? $all_agent_money_count+=$all_agent_money;
  201. echo $all_agent_money;?></td>
  202.     <td align="right" nowrap><?=$all_agent_profits?></td>
  203.     <td align="right" nowrap>
  204. <? $all_agent_result_count+=$all_agent_result;
  205. echo $all_agent_result;?></td>
  206.     <td align="right" nowrap>
  207. <? $all_agent_submit_count+=$all_agent_submit;
  208. echo $all_agent_submit;?></td>
  209.     <td align="right" nowrap>
  210. <? $super_agent_cuts_count+=$super_agent_cuts;
  211. echo $super_agent_cuts;?></td>
  212.     <td align="right" nowrap>
  213. <? $super_agent_money_count+=$super_agent_money;
  214. echo $super_agent_money;?></td>
  215.     <td align="right" nowrap><? 
  216. $super_agent_profits_count+=$super_agent_profits;
  217. echo $super_agent_profits;?></td>
  218.     <td align="right" nowrap>
  219. <? $super_agent_result_count+=$super_agent_result;
  220. echo $super_agent_result;?></td>
  221.     <td align="right" nowrap>
  222. <? $super_agent_submit_count+=$super_agent_submit;
  223. echo $super_agent_submit;?></td>
  224.     <td align="right" nowrap>
  225. <? $manage_cuts_count+=$manage_cuts;
  226. echo $manage_cuts;?></td>
  227.     <td align="right" nowrap>
  228. <? $manage_money_count+=$manage_money;
  229. echo $manage_money;?></td>
  230.     <td align="right" nowrap><?=$manage_profits?></td>
  231.     <td align="right" nowrap>
  232. <? $manage_result_count+=$manage_result;
  233. echo $manage_result;?></td>
  234.   </tr><?
  235.   $i++;
  236.    }
  237.    ?>
  238.   <tr class="t13">
  239.     <td colspan="7" nowrap><div align="right"><strong>总计:</strong> 共 <strong><?=$i?></strong> 笔 成功 <strong><?=$n?></strong> 笔 失败 <strong><?=$s?></strong> 笔</div> </td>
  240.     <td align="right" nowrap><strong>
  241.       <?=$drop_money_count?>
  242.     </strong></td>
  243.     <td align="right" nowrap><strong>
  244.       <?=$user_cut_count?>
  245.     </strong></td>
  246.     <td align="right" nowrap><strong>
  247.       <?=$true_win_count?>
  248.     </strong></td>
  249.     <td align="right" nowrap><strong>
  250.       <?=$win_count?>
  251.     </strong></td>
  252.     <td align="right" nowrap><strong>
  253.       <?=$agent_cuts_count?>
  254.     </strong></td>
  255.     <td align="right" nowrap><strong>
  256.       <?=$agent_money_count?>
  257.     </strong></td>
  258.     <td align="right" nowrap>&nbsp;</td>
  259.     <td align="right" nowrap><strong>
  260.       <?=$agent_result_count?>
  261.     </strong></td>
  262.     <td align="right" nowrap><strong>
  263.       <?=$agent_submit_count?>
  264.     </strong></td>
  265.     <td align="right" nowrap><strong>
  266.       <?=$all_agent_cuts_count?>
  267.     </strong></td>
  268.     <td align="right" nowrap><strong>
  269.       <?=$all_agent_money_count?>
  270.     </strong></td>
  271.     <td align="right" nowrap>&nbsp;</td>
  272.     <td align="right" nowrap><strong>
  273.       <?=$all_agent_result_count?>
  274.     </strong></td>
  275.     <td align="right" nowrap><strong>
  276.       <?=$all_agent_submit_count?>
  277.     </strong></td>
  278.     <td align="right" nowrap><strong>
  279.       <?=$super_agent_cuts_count?>
  280.     </strong></td>
  281.     <td align="right" nowrap><strong>
  282.       <?=$super_agent_money_count?>
  283.     </strong></td>
  284.     <td align="right" nowrap><strong>
  285.     </strong></td>
  286.     <td align="right" nowrap><strong>
  287.       <?=$super_agent_result_count?>
  288.     </strong></td>
  289.     <td align="right" nowrap><strong>
  290.       <?=$super_agent_submit_count?>
  291.     </strong></td>
  292.     <td align="right" nowrap><strong>
  293.       <?=$manage_cuts_count?>
  294.     </strong></td>
  295.     <td align="right" nowrap><strong>
  296.       <?=$manage_money_count?>
  297.     </strong></td>
  298.     <td align="right" nowrap>&nbsp;</td>
  299.     <td align="right" nowrap><strong>
  300.       <?=$manage_result_count?>
  301.     </strong></td>
  302.   </tr>
  303. </table><br>
  304. <span class="fbred">------------------<?=$dates?>期 查看完毕!
  305. </span>
  306. <img src="../img/ok.gif" width="20" height="20" align="absmiddle"><br>
  307. <br><br>
  308. </body>