result_checkp.php

来自「程序脚本为PHP+MYSQL」· PHP 代码 · 共 310 行

PHP
310
字号
<?php 
session_start();
set_time_limit(3600);
include("checks.php");
include("../inc/conn.php");
include("../inc/profit.inc.php");
include("../inc/win_unit.php");
$dates=$_GET["dates"];
$_SESSION["menus"]="查看$dates期开奖结算细节";
$sql=mysql_query("select * from drop_bill where drop_date='$dates' order by ID asc",$conn); 
?>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/css.CSS" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-size: 16px;
	font-weight: bold;
}
body {
	margin-top: 5px;
}
-->
</style>
<body>
<div align="center" class="style1"><?=$dates?>期 开奖查看总报表
</div>
[<a href="#" class="ags" onclick="document.execCommand('print','true','true')">打印</a>] [<a href="#" class="ags" onclick="javascript:window.close();">关闭窗口</a>]
<table border="0" align="center" cellpadding="2" cellspacing="1" class="t12">
  <tr class="t11">
    <td rowspan="2" nowrap><div align="center" class="fw12">状态</div></td>
    <td rowspan="2" nowrap><div align="center" class="fw12">单号</div></td>
    <td rowspan="2" nowrap><div align="center" class="fw12">账号</div></td>
    <td rowspan="2" nowrap><div align="center" class="fw12">退水</div> </td>
    <td rowspan="2" nowrap><div align="center" class="fw12">期数</div>  </td>
    <td rowspan="2" nowrap><div align="center" class="fw12">下注内容</div>  </td>
    <td rowspan="2" nowrap><div align="center"></div>      
    <div align="center" class="fw12">赔率</div>   </td>
    <td rowspan="2" nowrap><div align="center" class="fw12">下注金额</div></td>
    <td rowspan="2" nowrap><div align="center" class="fw12">退水</div></td>
    <td rowspan="2" nowrap class="fw12">实际输赢</td>
    <td rowspan="2" nowrap><div align="center" class="fw12">会员结果</div></td>
    <td colspan="4" nowrap><div align="center" class="fw12">代理商</div></td>
    <td rowspan="2" nowrap class="fw12">交总代理</td>
    <td colspan="4" nowrap><div align="center" class="fw12">总代理</div></td>
    <td rowspan="2" nowrap class="fw12">交股东</td>
    <td colspan="4" nowrap><div align="center" class="fw12">股东</div></td>
    <td rowspan="2" nowrap class="fw12">交管理员</td>
    <td colspan="4" nowrap><div align="center" class="fw12">管理员</div></td>
  </tr>
  <tr class="t11">
    <td nowrap class="fw12">退水</td>
    <td nowrap class="fw12">金额</td>
    <td nowrap class="fw12">占成</td>
    <td nowrap class="fw12">结果</td>
    <td nowrap class="fw12">退水</td>
    <td nowrap class="fw12">金额</td>
    <td nowrap class="fw12">占成</td>
    <td nowrap class="fw12">结果</td>
    <td nowrap class="fw12">退水</td>
    <td nowrap class="fw12">金额</td>
    <td nowrap class="fw12">占成</td>
    <td nowrap class="fw12">结果</td>
    <td nowrap class="fw12">退水</td>
    <td nowrap class="fw12">金额</td>
    <td nowrap class="fw12">占成</td>
    <td nowrap class="fw12">结果</td>
  </tr>
  <?php
  $deleted=0;
  $i=0;
  $n=0;
  $s=0;
   while($rs=mysql_fetch_array($sql))
   { $super_agent_profit=0; 
     $ID=$rs["ID"];
     $dates=$rs["drop_date"];
     $user_name=$rs["user_name"];
     $agent=$rs["agent"];
	 $cut_sign=$rs["cut_sign"];
	 $drop_plate=$rs["drop_plate"];
	 $all_agent=$rs["all_agent"];
	 $drop_time=$rs["drop_time"];
	 $super_agent=$rs["super_agent"];
	 $drop_money=$rs["drop_money"];
	 $drop_cut=str_replace("&nbsp;","",$rs["drop_cut"]);
	 $num_sign=$rs["num_sign"];
	 $drop_content=$rs["drop_content"];
	 $drop_type=$rs["drop_type"];
	 $drop_rate=$rs["drop_rate"];
	 $drop_details=$rs["drop_details"];
	 $agent_profit=profits($agent,1)*0.01;    //代理成数
	 $agent_profit_all=profits($agent,4)*0.01;//代理中总代成数
	 $all_agent_profits=profits($all_agent,2)*0.01;//总代成数
	 $all_agent_profit=$all_agent_profits-$agent_profit;
	 $super_agent_profits=profits($super_agent,3)*0.01;//股东成数
	 $pg=$agent_profit_all+$agent_profit;
	 $pl=$super_agent_profits-$all_agent_profits;
	// echo $pg;
	 //echo $all_agent_profits;
	 if($pg<>$all_agent_profits)
	 {
	   $all_agent_profit=$agent_profit_all;
	   $oi=$all_agent_profits-$pg;
	   $super_agent_profit=$pl+$oi;
	 }else $super_agent_profit=$super_agent_profits-$all_agent_profits;
	 $manage_profit=1-$super_agent_profits;  //管理员成数
	 $agent_cut=$rs["drop_agent_cut"];//代理退水-------
	 $all_agent_cut=$rs["drop_all_agent_cut"];//总代退水------------
	 $super_agent_cut=$rs["drop_super_agent_cut"];//股东退水-------------
     $user_cut=round($drop_money*trim($drop_cut)*0.01,2);
	 $cut_count+=round($user_cut,2);
	 $agent_cuts=round(($drop_money*$drop_cut-$drop_money*(1-$agent_profit)*$agent_cut)*0.01,2);
     $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);
     $super_agent_cuts=round(($drop_money*($super_agent_profit+$manage_profit)*$all_agent_cut-$drop_money*$manage_profit*$super_agent_cut)*0.01,2);
	 $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);  //管理员退水
	 if($deleted==0)
	 {
	 $win=win_unit($num_sign,$drop_content,$drop_type,$drop_money,$drop_rate,$drop_details,$dates,$user_cut);
	 }else $win=0;
	 $tok=$_SESSION["hnum"];//为和情况
	 if($tok==2)
	 {
	  $user_cut=0;
	  $agent_cuts=0;
	  $all_agent_cuts=0;
	  $super_agent_cuts=0;
	  $manage_cuts=0;
	 }
	 $win=round($win,2);
	 $wins+=$win;
	 $true_win=round($win-$user_cut,2);//实际win loser
	 $agent_money=round($true_win*$agent_profit,2);
	 $all_agent_money=round($true_win*$all_agent_profit,2);
	 $super_agent_money=round($true_win*$super_agent_profit,2);
	 $manage_money=round($true_win*$manage_profit,2);
	 $agent_profits=$agent_profit*100;  //代理占成
	 $all_agent_profits=$all_agent_profit*100;//总代占成
	 $super_agent_profits=$super_agent_profit*100;//股东占成
	 $manage_profits=$manage_profit*100;//管理员占成
	 $agent_result=round($agent_money+$agent_cuts,2);  //代理结果
	 $all_agent_result=round($all_agent_money+$all_agent_cuts,2);//总代结果
	 $super_agent_result=round($super_agent_money+$super_agent_cuts,2); //股东结果
	 $manage_result=round($manage_money+$manage_cuts,2);
	 $agent_submit=round($win-$agent_result,2);//交总代理
	 $all_agent_submit=round($agent_submit-$all_agent_result,2);//交股东
	 $super_agent_submit=round($all_agent_submit-$super_agent_result,2);//交管理员
	  if($sqlok)
	{ $n++;
	 }else
	 { 
	 $s++;
	 } 
	   //公开
	  mysql_query("update results set deleted='0' where dates='$dates'",$conn);
    ?>
  <tr class="t15" onmouseover="c=this.style.backgroundColor;this.style.backgroundColor='#FFFF66'" onmouseout="this.style.backgroundColor=c" onClick="this.style.backgroundColor='#FFFF66';c='#FFFF66'">
    <td nowrap><div align="center">
	⊙</div></td>
    <td nowrap><div align="center"><?=$ID?></div></td>
    <td nowrap><div align="right"></div>
        <div align="center"></div>      <div align="right"><?=$user_name?>
    </div>      <div align="right"></div></td>
    <td nowrap><div align="right"><?=$drop_cut?></div></td>
    <td nowrap><div align="right"><?=$dates?>  
    </div></td>
    <td nowrap ><div align="right"><?=$drop_type?> <?=$drop_content?><?
	if($drop_details<>"0") echo $drop_details;?>
	</div></td>
    <td nowrap><div align="right"><?=$drop_rate?></div></td>
    <td nowrap><div align="right">
	<? $drop_money_count+=$drop_money;
	echo $drop_money;?></div></td>
    <td nowrap><div align="right">
	<? $user_cut_count+=$user_cut;
	echo $user_cut;?></div></td>
    <td nowrap><div align="right">
	<? $true_win_count+=$true_win;
	echo $true_win;?></div></td>
    <td nowrap><div align="right">
	<? $win_count+=$win;
	echo $win;?></div></td>
    <td align="right" nowrap><? 
	$agent_cuts_count+=$agent_cuts;
	echo $agent_cuts;?></td>
    <td align="right" nowrap>
	<? $agent_money_count+=$agent_money;
	echo $agent_money;?></td>
    <td align="right" nowrap><?=$agent_profits?></td>
    <td align="right" nowrap>
	<? $agent_result_count+=$agent_result;
	echo $agent_result;?></td>
    <td align="right" nowrap>
	<? $agent_submit_count+=$agent_submit;
	echo $agent_submit;?></td>
    <td align="right" nowrap>
	<? $all_agent_cuts_count+=$all_agent_cuts;
	echo $all_agent_cuts;?></td>
    <td align="right" nowrap> 
	<? $all_agent_money_count+=$all_agent_money;
	echo $all_agent_money;?></td>
    <td align="right" nowrap><?=$all_agent_profits?></td>
    <td align="right" nowrap>
	<? $all_agent_result_count+=$all_agent_result;
	echo $all_agent_result;?></td>
    <td align="right" nowrap>
	<? $all_agent_submit_count+=$all_agent_submit;
	echo $all_agent_submit;?></td>
    <td align="right" nowrap>
	<? $super_agent_cuts_count+=$super_agent_cuts;
	echo $super_agent_cuts;?></td>
    <td align="right" nowrap>
	<? $super_agent_money_count+=$super_agent_money;
	echo $super_agent_money;?></td>
    <td align="right" nowrap><? 
	$super_agent_profits_count+=$super_agent_profits;
	echo $super_agent_profits;?></td>
    <td align="right" nowrap>
	<? $super_agent_result_count+=$super_agent_result;
	echo $super_agent_result;?></td>
    <td align="right" nowrap>
	<? $super_agent_submit_count+=$super_agent_submit;
	echo $super_agent_submit;?></td>
    <td align="right" nowrap>
	<? $manage_cuts_count+=$manage_cuts;
	echo $manage_cuts;?></td>
    <td align="right" nowrap>
	<? $manage_money_count+=$manage_money;
	echo $manage_money;?></td>
    <td align="right" nowrap><?=$manage_profits?></td>
    <td align="right" nowrap>
	<? $manage_result_count+=$manage_result;
	echo $manage_result;?></td>
  </tr><?
  $i++;
   }
   ?>
  <tr class="t13">
    <td colspan="7" nowrap><div align="right"><strong>总计:</strong> 共 <strong><?=$i?></strong> 笔 成功 <strong><?=$n?></strong> 笔 失败 <strong><?=$s?></strong> 笔</div> </td>
    <td align="right" nowrap><strong>
      <?=$drop_money_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$user_cut_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$true_win_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$win_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$agent_cuts_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$agent_money_count?>
    </strong></td>
    <td align="right" nowrap>&nbsp;</td>
    <td align="right" nowrap><strong>
      <?=$agent_result_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$agent_submit_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$all_agent_cuts_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$all_agent_money_count?>
    </strong></td>
    <td align="right" nowrap>&nbsp;</td>
    <td align="right" nowrap><strong>
      <?=$all_agent_result_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$all_agent_submit_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$super_agent_cuts_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$super_agent_money_count?>
    </strong></td>
    <td align="right" nowrap><strong>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$super_agent_result_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$super_agent_submit_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$manage_cuts_count?>
    </strong></td>
    <td align="right" nowrap><strong>
      <?=$manage_money_count?>
    </strong></td>
    <td align="right" nowrap>&nbsp;</td>
    <td align="right" nowrap><strong>
      <?=$manage_result_count?>
    </strong></td>
  </tr>
</table><br>
<span class="fbred">------------------<?=$dates?>期 查看完毕!
</span>
<img src="../img/ok.gif" width="20" height="20" align="absmiddle"><br>
<br><br>
</body>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?