⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 win_unit.php

📁 六和投注系统
💻 PHP
字号:
<?php


function win_unit( $num_sign, $drop_content, $drop_type, $drop_money, $drop_rate, $drop_details, $dates, $cuts )
{
    $rok = rcheck( $num_sign, $drop_content, $drop_type, $drop_details, $dates );
    if ( $rok == 2 )
    {
        $_SESSION['hnum'] = 2;
    }
    else
    {
        $_SESSION['hnum'] = 1;
    }
    if ( $num_sign != 5 )
    {
        if ( $rok == 1 )
        {
            $winp = $drop_rate * $drop_money - $drop_money + $cuts;
        }
        else if ( $rok == 0 )
        {
            $win = 0 - ( $drop_money - $cuts );
            $winp = $win;
        }
        else if ( $rok == 2 )
        {
            $winp = $win;
        }
    }
    else
    {
        $znum = among_num( $drop_content, $drop_details );
        if ( $drop_content == "三全中" || $drop_content == "二全中" || $drop_content == "特串" )
        {
            if ( $rok == 0 )
            {
                $win = 0 - ( $drop_money - $cuts );
                $winp = $win;
            }
            else
            {
                $winp = $drop_money / $znum * $rok * $drop_rate + $cuts - $drop_money;
            }
        }
        else if ( $drop_content == "三中二" || $drop_content == "二中特" )
        {
            $sps = split( ",", $drop_rate );
            $rt1 = $sps[0];
            $rt2 = $sps[1];
            $zm = split( ",", $rok );
            $rm1 = $zm[0];
            $rm2 = $zm[1];
            $winp = $drop_money / $znum * $rm1 * $rt1 + $drop_money / $znum * $rm2 * $rt2;
            if ( $winp != 0 )
            {
                $win = $winp + $cuts - $drop_money;
                $winp = $win;
            }
            else
            {
                $win = 0 - ( $drop_money - $cuts );
                $winp = $win;
            }
        }
    }
    return $winp;
}

function count_cut( $cut_sign, $drop_cut, $drop_money, $agent, $drop_plate )
{
    global $conn;
    $sqlct = mysql_query( "select * from agent_cut where user_account='{$agent}' and sign='{$cut_sign}' and cut_plate='{$drop_plate}' ", $conn );
    if ( mysql_num_rows( $sqlct ) != 0 )
    {
        $cutp = mysql_result( $sqlct, 0, "cut_num" ) - $drop_cut;
        $cutp = $drop_money * $cutp * 0.01;
    }
    else
    {
        $cutp = 0;
    }
    return $cutp;
}

function count_cuts( $cut_sign, $drop_cut, $drop_money, $agent )
{
    global $conn;
    $sqlct = mysql_query( "select * from agent_cut where user_account='{$agent}' and sign='{$cut_sign}'", $conn );
    if ( mysql_num_rows( $sqlct ) != 0 )
    {
        $cutp = mysql_result( $sqlct, 0, "cut_num" ) - $drop_cut;
        $cutp = $drop_money * $cutp * 0.01;
    }
    else
    {
        $cutp = 0;
    }
    return $cutp;
}

function all_cut( $agent, $all_agent, $dates, $start_time, $end_time )
{
    global $conn;
    if ( $date_num == "no" )
    {
        $sq = " and open_date>='{$start_time}' and open_date<='{$end_time}'";
    }
    else
    {
        $sq = " and drop_date='{$dates}'";
    }
    $cuta = 0;
    $sqlts = mysql_query( "select * from drop_bill where agent='{$agent}' {$sq}", $conn );
    while ( $rs = mysql_fetch_array( $sqlts ) )
    {
        $signs = $rs['cut_sign'];
        $drop_plate = $rs['drop_plate'];
        $sqlall = mysql_query( "select * from agent_cut where user_account='{$all_agent}' and sign='{$signs}' and cut_plate='{$drop_plate}'", $conn );
        $sqlagt = mysql_query( "select * from agent_cut where user_account='{$agent}' and sign='{$signs}' and cut_plate='{$drop_plate}'", $conn );
        if ( mysql_num_rows( $sqlall ) != 0 && mysql_num_rows( $sqlagt ) != 0 )
        {
            $cutse = mysql_result( $sqlall, 0, "cut_num" ) - mysql_result( $sqlagt, 0, "cut_num" );
            $cuta += $rs['drop_money'] * $cutse * 0.01;
        }
        else
        {
            $cuta = 0;
        }
    }
    return $cuta;
}

function sup_cut( $super_agent, $all_agent, $dates, $start_time, $end_time )
{
    global $conn;
    if ( $date_num == "no" )
    {
        $sq = " and open_date>='{$start_time}' and open_date<='{$end_time}'";
    }
    else
    {
        $sq = " and drop_date='{$dates}'";
    }
    $cuta = 0;
    $sqlts = mysql_query( "select * from drop_bill where all_agent='{$all_agent}' {$sq}", $conn );
    while ( $rs = mysql_fetch_array( $sqlts ) )
    {
        $signs = $rs['cut_sign'];
        $drop_plate = $rs['drop_plate'];
        $sqlall = mysql_query( "select * from agent_cut where user_account='{$super_agent}' and sign='{$signs}' and cut_plate='{$drop_plate}'", $conn );
        $sqlagt = mysql_query( "select * from agent_cut where user_account='{$all_agent}' and sign='{$signs}' and cut_plate='{$drop_plate}'", $conn );
        if ( mysql_num_rows( $sqlall ) != 0 && mysql_num_rows( $sqlagt ) != 0 )
        {
            $cutse = mysql_result( $sqlall, 0, "cut_num" ) - mysql_result( $sqlagt, 0, "cut_num" );
            $cuta += $rs['drop_money'] * $cutse * 0.01;
        }
        else
        {
            $cuta = 0;
        }
    }
    return $cuta;
}

echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n";
include( "../inc/num.inc.php" );
echo "\r\n\r\n";
?>

⌨️ 快捷键说明

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