4ksplay player index

PHOTO EMBED

Tue Apr 04 2023 11:55:07 GMT+0000 (Coordinated Universal Time)

Saved by @alyssietayp

<?php
include('../db/connect.php');
session_start();


if(!$_SESSION['user_name']){
header('location:../');
}
$user_name = $_SESSION['user_name'];
$user_id = $_SESSION['user_id'];

$resultucredit = mysqli_query($con,"SELECT * FROM sb_user where user_id = '$user_id' ");
$rowucredit = mysqli_fetch_array($resultucredit);
$usercredit = $rowucredit['user_credit'];
if(floatval($usercredit) < 20){
echo '<script>alert("Credit is below 100. Please reload immediately.");</script>';
header('location:../reload.php');
}

$get_event = $_GET['event'];
$resultevent2 = mysqli_query($con,"SELECT * FROM sb_event where event_id = '$get_event' and event_status = '1' ");
if(mysqli_num_rows($resultevent2) == 0){
header('location:../');
}

$resultfn = mysqli_query($con,"SELECT * FROM sb_fight where fight_id = '1' ");
$rowfn = mysqli_fetch_array($resultfn);
$fn = $rowfn['fight_number'];

$result4 = mysqli_query($con,"SELECT bet_fight_number,bet_selection,SUM(bet_amount) as total_meron,bet_event FROM sb_bet where bet_fight_number = '$fn' and bet_event = '$get_event' and bet_selection = 'meron'");
$row4 = mysqli_fetch_array($result4);
$total_meron = $row4['total_meron'];

$result5 = mysqli_query($con,"SELECT bet_fight_number,bet_selection,SUM(bet_amount) as total_wala,bet_event FROM sb_bet where bet_fight_number = '$fn' and bet_event = '$get_event' and bet_selection = 'wala'");
$row5 = mysqli_fetch_array($result5);
$total_wala = $row5['total_wala'];

if(empty($total_meron)){
$total_meron = 0;
}
if(empty($total_wala)){
$total_wala = 0;
}

$result44 = mysqli_query($con,"SELECT bet_fight_number,bet_selection,bet_user_id,SUM(bet_amount) as user_total_meron,bet_event FROM sb_bet where bet_fight_number = '$fn' and bet_selection = 'meron' and bet_user_id = '$user_id' and bet_event = '$get_event' ");
$row44 = mysqli_fetch_array($result44);
$user_total_meron = $row44['user_total_meron'];

$result55 = mysqli_query($con,"SELECT bet_fight_number,bet_selection,bet_user_id,SUM(bet_amount) as user_total_wala,bet_event FROM sb_bet where bet_fight_number = '$fn' and bet_selection = 'wala' and bet_user_id = '$user_id' and bet_event = '$get_event'");
$row55 = mysqli_fetch_array($result55);
$user_total_wala = $row55['user_total_wala'];

$result66 = mysqli_query($con,"SELECT bet_fight_number,bet_selection,bet_user_id,SUM(bet_amount) as user_total_draw,bet_event FROM sb_bet where bet_fight_number = '$fn' and bet_selection = 'draw' and bet_user_id = '$user_id' and bet_event = '$get_event'");
$row66 = mysqli_fetch_array($result66);
$user_total_draw = $row66['user_total_draw'];

if(empty($user_total_meron)){
$user_total_meron = 0;
}
if(empty($user_total_wala)){
$user_total_wala = 0;
}
if(empty($user_total_draw)){
$user_total_draw = 0;
}
$resultbutton = mysqli_query($con,"SELECT * FROM sb_button where button_id = '1'");
$rowbutton = mysqli_fetch_array($resultbutton);
$buttonConfig = $rowbutton['button_config'];

$resultcredit = mysqli_query($con,"SELECT * FROM sb_user where user_id = '$user_id' ");
$rowcredit = mysqli_fetch_array($resultcredit);
$user_credit = number_format($rowcredit['user_credit']);

$resultpm = mysqli_query($con,"SELECT * FROM sb_payout where payout_id = '1'");
$rowpm = mysqli_fetch_array($resultpm);
$meron_payout = floatval($rowpm['payout_rate']);

$resultpw = mysqli_query($con,"SELECT * FROM sb_payout where payout_id = '2'");
$rowpw = mysqli_fetch_array($resultpw);
$wala_payout = floatval($rowpw['payout_rate']);

$bet_payout_meron = (floatval($user_total_meron) / 100) * $meron_payout;
$bet_payout_wala = (floatval($user_total_wala) / 100) * $wala_payout;

// $bet_payout_meron = floatval($user_total_meron);
// $bet_payout_wala = floatval($user_total_wala);

if(empty($bet_payout_meron)|| $bet_payout_meron == 0){
$bet_payout_meron = 0;
}
if(empty($bet_payout_wala)|| $bet_payout_wala == 0){
$bet_payout_wala = 0;
}

if(empty($meron_payout)){
    $meron_payout = 0;
}
if(empty($wala_payout)){
    $wala_payout = 0;
}

$resultevent = mysqli_query($con,"SELECT * FROM sb_event where event_status = '1'");
$rowevent = mysqli_fetch_array($resultevent);
$event_id = $rowevent['event_id'];
$event_name = $rowevent['event_name'];

$resultlm = mysqli_query($con,"SELECT COUNT(*) FROM sb_game where game_winner = 'meron' and game_event = '$event_id' ");
$rowlm = mysqli_fetch_array($resultlm);
$legend_meron_count = $rowlm[0];

$resultlw = mysqli_query($con,"SELECT COUNT(*) FROM sb_game where game_winner = 'wala' and game_event = '$event_id' ");
$rowlw = mysqli_fetch_array($resultlw);
$legend_wala_count = $rowlw[0];

$resultldraw = mysqli_query($con,"SELECT COUNT(*) FROM sb_game where game_winner = 'draw' and game_event = '$event_id' ");
$rowldraw = mysqli_fetch_array($resultldraw);
$legend_draw_count = $rowldraw[0];

$resultlc = mysqli_query($con,"SELECT COUNT(*) FROM sb_game where game_winner = 'cancel' and game_event = '$event_id' ");
$rowlc = mysqli_fetch_array($resultlc);
$legend_cancel_count = $rowlc[0];



 $resultah =mysqli_query($con,"SELECT * FROM bg_announce_history where ah_id = '1' ");
 $rowah = mysqli_fetch_array($resultah);
 $announcement = $rowah['ah_text'];
?>

<!doctype html>
<html lang="en">

<head>
    <title>4ksplay.com</title>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<meta http-equiv='cache-control' content='no-cache'>
	<meta http-equiv='expires' content='0'>
	<meta http-equiv='pragma' content='no-cache'>

    <!-- Bootstrap CSS -->
    <link href="https://vjs.zencdn.net/7.19.2/video-js.css" rel="stylesheet" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
        crossorigin="anonymous">
    <script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;800&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="css/style.css">
    <link rel="icon" type="image/x-icon" href=".. /favicon.ico">
    <!-- <script src="client/client_button.js"></script>
    <script src="client/client_fight.js"></script>
    <script src="client/client_credit.js"></script>
    <script src="client/client_meron.js"></script>
    <script src="client/client_wala.js"></script> -->
    <!-- <script src="client/client_payout_meron.js"></script>
    <script src="client/client_payout_wala.js"></script> -->
    <script src="../socket.io.js"></script>
    <script>
    localStorage.setItem('sessID', '<?php echo $user_id; ?>');
    localStorage.setItem('sessName', '<?php echo $user_name; ?>');
    </script>
    <script>
    document.onkeydown = function(e) {
        if (event.keyCode == 123) {
            return false;
        }
        if (e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) {
            return false;
        }
        if (e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)) {
            return false;
        }
        if (e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) {
            return false;
        }
        if (e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) {
            return false;
        }
    }
    document.addEventListener('contextmenu', function(e) {
        e.preventDefault();
    });
    </script>
    <style>
    /* body {
        background: #111;
    } */
    body {
        background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../bg1.jpg');
    }

    .bg-light-dark {
        background: #1f1f1f;
    }

    .bg-black {
        background: rgba(0, 0, 0, 0);
    }

    .card {
        border: 0;
    }

    .card-body {
        background: #111;
    }

    .bg-dark {
        background-color: #222 !important;
    }

    ul li {
        font-weight: bold;
    }

    .meron-wala {
        font-size: 25px;
        padding: 1px !important;
        border-radius: 0;
    }

    .text-yellow {
        color: #FFFF00;
    }

    .yellow-md {
        font-size: 30px;
    }

    .yellow-lg {
        font-size: 35px;
    }

    .font-size-md {
        font-size: 20px;
    }

    .font-size-lg {
        font-size: 25px;
    }

    .bet-meron-wala {
        font-size: 20px;
        /* padding: 1px !important; */
        border-radius: 0;
    }

    .table td {
        text-align: center;
        color: #f1f1f1;
        font-weight: bold;
        font-size: 20px;
        padding: 2px !important;

    }

    .bet-amount {
        font-size: 20px;
        padding: 1px !important;
    }

    @media(max-width:720px) {
        .bet-amount {
            font-size: 12px;
        }

        iframe {
            height: 250px;
        }

        .font-size-md {
            font-size: 17px;
        }

        .font-size-lg {
            font-size: 22px;
        }
    }

    .tab-pane {
        overflow-x: scroll;
    }

    .reglahan {
        overflow-x: scroll;

    }

    table tr td .circleRed {
        height: 30px;
        width: 30px;
        background-color: #1f1f1f;
        border-radius: 1.2rem;
        border: 8px solid #f34141;

    }

    table tr td .circleCancel {
        height: 30px;
        width: 30px;
        background-color: #1f1f1f;
        border-radius: 1.2rem;
        border: 8px solid #fff;

    }

    table tr td .circleBlue {
        height: 30px;
        width: 30px;
        background-color: #1f1f1f;
        border-radius: 1.2rem;
        border: 8px solid #1d81f1;
    }

    table tr td .circleGreen {
        height: 30px;
        width: 30px;
        background-color: #1f1f1f;
        border-radius: 1.2rem;
        border: 8px solid #23b04b;
    }

    table tr td .circleRedAll {
        height: 30px;
        width: 30px;
        background-color: #f34141;
        border-radius: 1.2rem;
        text-align: center;
        color: #fff;
        font-weight: 700;
    }

    table tr td .circleBlueAll {
        height: 30px;
        width: 30px;
        background-color: #1d81f1;
        border-radius: 1.2rem;
        text-align: center;
        color: #fff;
        font-weight: 700;
    }

    table tr td .circleGreenAll {
        height: 30px;
        width: 30px;
        background-color: #23b04b;
        border-radius: 1.2rem;
        text-align: center;
        color: #fff;
        font-weight: 700;
    }

    table tr td .circleCancelAll {
        height: 30px;
        width: 30px;
        background-color: rgba(0, 0, 0, 0.178);
        border-radius: 1.2rem;
        text-align: center;
        color: #000;
        font-weight: 700;
    }

    table tr td .mw_circleRed {
        height: 30px;
        width: 30px;
        background-color: #f34141;
        border-radius: 1.2rem;
        border: 8px solid #f34141;

    }

    table tr td .mw_circleBlue {
        height: 30px;
        width: 30px;
        background-color: #1d81f1;
        border-radius: 1.2rem;
        border: 8px solid #1d81f1;
    }

    table tr td .mw_circleGreen {
        height: 30px;
        width: 30px;
        background-color: #23b04b;
        border-radius: 1.2rem;
        border: 8px solid #23b04b;
    }

    table tr td .mw_circleRedAll {
        height: 30px;
        width: 30px;
        background-color: #f34141;
        border-radius: 1.2rem;
        text-align: center;
        color: #fff;
        font-weight: 700;
    }

    table tr td .mw_circleBlueAll {
        height: 30px;
        width: 30px;
        background-color: #1d81f1;
        border-radius: 1.2rem;
        text-align: center;
        color: #fff;
        font-weight: 700;
    }

    table tr td .mw_circleGreenAll {
        height: 30px;
        width: 30px;
        background-color: #23b04b;
        border-radius: 1.2rem;
        text-align: center;
        color: #fff;
        font-weight: 700;
    }

    table tr td .mw_circleCancelAll {
        height: 30px;
        width: 30px;
        background-color: rgba(0, 0, 0, 0.178);
        border-radius: 1.2rem;
        text-align: center;
        color: #000;
        font-weight: 700;
    }

    .table td div {
        height: 30px;
        width: 30px;
    }

    .wrapper-bg {
        margin-top: 30px;
        z-index: 9999;
        background: #111;
        display: block;
        position: absolute;
        top: 140;
        right: 150;

    }

    .cover-content {
        padding: 10px;
        width: 120px;
    }

    @media(max-width:720px) {
        .wrapper-bg {
            margin-top: 50px;
        }

        .cover-content {
            display: none;
        }
    }



    /* @media(max-width:720px) {
            .betting-section {
                margin-top: -50px;
            }

            iframe {
                height: 270px;
            }
        } */
    marquee {
        background: #D22B2B;
    }

    .alert-danger {
        background: #D22B2B;
    }

    .blinktext {
        animation: blinker 1.5s linear infinite;
    }

    @keyframes blinker {
        50% {
            opacity: 0;
        }
    }
    body {
      background-image: url(../images/glow.jpg);
          /* padding-top: 100px; */
          height: 100vh;
          width: 100%;
          -webkit-background-size: cover;
          -moz-background-size: cover;
          -o-background-size: cover;
          background-size: cover;
    }
    nav.navbar.navbar-expand-md.navbar-dark.fixed-top.bg-dark {
    z-index: 999999;
}
    </style>
</head>

<body>

  <header class="pb-5">
      <!-- Fixed navbar -->
      <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
          <a class="navbar-brand" href="#">        <img src="../images/Logo2-01.png" style="width: 100px;"></a>
          <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
              <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="navbarCollapse">
              <ul class="navbar-nav ml-auto">
                <li class="nav-item">
                    <a style="color: #FC4C47; font-weight: bold;" class="nav-link text-uppercase" href="#">Hi <?php echo $_SESSION['user_name']; ?> !</a>
                </li>
                  <li class="nav-item active">
                      <a class="nav-link text-uppercase" href="../home.php">Home <span class="sr-only">(current)</span></a>
                  </li>
                  <!-- <li class="nav-item">
                             <a class="nav-link text-uppercase" href="#">CashIn</a>
                         </li> -->
                  <li class="nav-item">
                      <a class="nav-link text-uppercase" href="cashout.php">CashOut</a>
                  </li>
                  <li class="nav-item">
                      <a class="nav-link text-uppercase" href="history.php">History</a>
                  </li>
                  <li class="nav-item">
                      <a class="nav-link text-uppercase" href="change_password.php">Change Password</a>
                  </li>

                  <li class="nav-item">
                      <a class="nav-link text-uppercase" href="logout.php">Logout</a>
                  </li>
              </ul>

          </div>
      </nav>
  </header>




    <section class="content">
        <div class="container mt-4">

            <div class="row mb-3">
                <div class="col-lg-7">
                   <div class="wrapper-bg">
                              <img src="../images/Logo2-01.png" style="width: 100px;" class="cover-content"  />
                        </div>
                    <div>
                        <iframe class="video_md video_sm video_xs video_lg" width="100%" height="450" src="https://stream-embed.pages.dev/?name=stream&amp;playOrder=hls&controls=0" frameborder="0"
                            allowfullscreen="true">

                        </iframe>
                        <marquee class="li" direction=”right”>
                            <div class="text-light font-weight-bold" id="announcement" style="font-size:18px;">
                                <?php echo $announcement; ?>
                            </div>
                        </marquee>
                        <!-- <iframe width="100%" height="800" src="https://stream-embed.pages.dev/" frameborder="0"
                                allowfullscreen=""></iframe> -->

                    </div>

                    <!-- <div class="card bg-dark">
                        <div class="card-header font-weight-bold p-2 text-center">
                            <span class="text-light"><?php //echo $date_today; ?></span>
                        </div>
                        <div class="card-body p-0">
                            <iframe class="video_md video_sm video_xs video_lg" style="width:100%;height:400px;"
                                src="https://media.bet178.live:5443/bet178/play.html?name=stream&amp;playOrder=hls"
                                frameborder="0" allowfullscreen="true"></iframe>
                        </div>
                    </div> -->

                    <!-- <iframe width="560" height="315"
                        src="https://ams07d.odaztech.com:/LiveApp/play.html?name=ams07&playOrder=hls"
                        frameborder="0" allowfullscreen></iframe> -->
                    <!-- <iframe width="100%" height="100%" src="https://iframe.hermes-streaming-live.online/"
                        frameborder="0" allowfullscreen=""></iframe> -->

                </div>

                <div class="col-lg-5 betting-section">
                    <div class="card p-0">
                        <div class="card-body text-light p-0">
                            <div class="row">
                                <div class="col-6">
                                    <div class="header-title text-center text-light font-weight-bold">BETTING</div>
                                    <div class="bet_status d-flex justify-content-center align-content-center" id="bet_status">
                                        <input type="hidden" id="button_config" value="<?php echo $buttonConfig; ?>">
                                        <button type="button" class="btn btn-success font-weight-bold p-2" id="btnopen">
                                            OPEN
                                        </button>
                                        <button type="button" class="btn btn-danger font-weight-bold p-2" id="btnclose">
                                            CLOSED
                                        </button>
                                    </div>

                                </div>
                                <div class="col-6">
                                    <div class="header-title text-center text-light font-weight-bold">FIGHT #</div>
                                    <div class="fight_number font-weight-bold text-center text-yellow yellow-md" id="fight_number"><?php echo $fn; ?>
                                    </div>
                                    <input type="hidden" id="event_id_input" value="<?php echo $event_id; ?>">
                                    <input type="hidden" id="fight_number_input" value="<?php echo $fn; ?>">
                                </div>
                            </div>
                            <div class="row bg-black pt-2 pb-2">
                                <div class="col-6">
                                    <button type="button" class="btn btn-danger meron-wala btn-block font-weight-bold p-2" id="meron_blink">
                                        MERON
                                    </button>
                                </div>
                                <div class="col-6">
                                    <button type="button" class="btn btn-primary meron-wala btn-block font-weight-bold p-2" id="wala_blink">
                                        WALA
                                    </button>
                                </div>
                            </div>
                            <div class="row ">
                                <div class="col-6">
                                    <div class="meron_bet font-weight-bold text-center text-yellow yellow-lg" id="total_meron"><?php echo number_format($total_meron); ?>
                                    </div>
                                </div>
                                <div class="col-6">
                                    <div class="wala_bet font-weight-bold text-center text-yellow yellow-lg" id="total_wala"><?php echo number_format($total_wala); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-6">
                                    <div class="meron_bet font-weight-bold text-center font-size-md text-light">
                                        PAYOUT = <span id="payout_meron"><?php echo number_format($meron_payout,2); ?></span>
                                    </div>
                                </div>
                                <div class="col-6">
                                    <div class="wala_bet font-weight-bold text-center font-size-md text-light">
                                        PAYOUT = <span id="payout_wala"><?php echo number_format($wala_payout,2); ?></span>
                                    </div>
                                </div>
                            </div>
                            <div class="row mt-1">
                                <div class="col-6">
                                    <table class="table table-meron table-bordered p-0 m-0" width="100%">
                                        <tr>
                                            <!-- <td></td> -->
                                            <td class="font-size-lg">
                                                BET<br>
                                                <span id="total_bet_meron"><?php echo number_format($user_total_meron); ?></span>=<span
                                                    id="bet_payout_meron"><?php echo number_format($bet_payout_meron,2);  ?> ss</span>
                                            </td>
                                        </tr>
                                    </table>
                                    <button type="button" class="btn btn-success bet-meron-wala btn-block font-weight-bold p-2" id="bet-meron" disabled>
                                        BET MERON
                                    </button>
                                </div>
                                <div class="col-6">
                                    <table class="table table-wala table-bordered p-0 m-0" width="100%">
                                        <tr>
                                            <!-- <td></td> -->
                                            <td class="font-size-lg">
                                                BET<br>
                                                <span id="total_bet_wala"><?php echo number_format($user_total_wala); ?></span>=<span
                                                    id="bet_payout_wala"><?php echo number_format($bet_payout_wala,2); ?></span>
                                            </td>
                                        </tr>
                                    </table>
                                    <button type="button" class="btn btn-success bet-meron-wala btn-block font-weight-bold p-2" id="bet-wala">
                                        BET WALA
                                    </button>
                                </div>
                            </div>

                            <div class="alert alert-danger mt-2 blinktext text-center text-light" role="alert">PAYOUT WITH 120 AND BELOW SHALL BE CANCELLED</div>

                            <div class="row d-flex justify-content-center align-items-center bg-light-dark mb-2">
                                <div class="col-6">
                                    <div class="text-yellow yellow-md text-center font-weight-bold font-size-md">
                                        POINTS</div>
                                    <div class="text-yellow yellow-md text-center font-weight-bold font-size-lg" id="user_credit"><?php echo $user_credit; ?>
                                    </div>
                                </div>
                                <div class="col-6">
                                    <input type="number" id="input-bet" class="form-control font-weight-bold text-center font-size-md" placeholder="ENTER AMOUNT" min="20">
                                </div>
                                <div class="col-12 mt-2">
                                    <div class="row">
                                        <div class="col-3">
                                            <button type="button" class="btn btn-info bet-amount btn-block font-weight-bold p-2" id="bet-20">
                                                20
                                            </button>
                                        </div>
                                        <div class="col-3">
                                            <button type="button" class="btn btn-info bet-amount btn-block font-weight-bold p-2" id="bet-100">
                                                100
                                            </button>
                                        </div>
                                        <div class="col-3">
                                            <button type="button" class="btn btn-info bet-amount btn-block font-weight-bold p-2" id="bet-500">
                                                500
                                            </button>
                                        </div>
                                        <div class="col-3">
                                            <button type="button" class="btn btn-info bet-amount btn-block font-weight-bold p-2" id="bet-1k">
                                                1,000
                                            </button>
                                        </div>
                                        <div class="col-3 mt-2">
                                            <button type="button" class="btn btn-info bet-amount btn-block font-weight-bold p-2" id="bet-5k">
                                                5,000
                                            </button>
                                        </div>
                                        <div class="col-3 mt-2">
                                            <button type="button" class="btn btn-info bet-amount btn-block font-weight-bold p-2" id="bet-10k">
                                                10,000
                                            </button>
                                        </div>
                                        <div class="col-3 mt-2">
                                            <button type="button" class="btn btn-info bet-amount btn-block font-weight-bold p-2" id="bet-20k">
                                                20,000
                                            </button>
                                        </div>
                                        <div class="col-3 mt-2">
                                            <button type="button" class="btn btn-info bet-amount btn-block font-weight-bold p-2" id="bet-50k">
                                                50,000
                                            </button>
                                        </div>
                                    </div>
                                    <div class="row mt-4">
                                        <div class="col-12">
                                            <div class="text-yellow yellow-md text-center font-weight-bold font-size-md text-center">
                                                DRAW BET | x8 Winnings</div>
                                        </div>
                                    </div>
                                    <div class="row mt-1 bg-dark mb-3">
                                        <div class="col-6">
                                            <button type="button" class="btn btn-success bet-meron-wala btn-block font-weight-bold p-2" id="bet-draw">
                                                BET DRAW
                                            </button>
                                        </div>
                                        <div class="col-6">
                                            <div id="user_total_draw" class="font-weight-bold font-size-lg text-center text-light d-flex justify-content-center align-items-center">
                                                <?php echo $user_total_draw; ?>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-lg-12">
                                            <div class="reglahan" id="reglahan">
                                                <?php include('reglahan.php'); ?>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row d-flex justify-content-between align-content-center p-3">
                                        <div class="col-xs-2" style="color: #f8f9fa;">
                                            <center>
                                                <div style="background: url(../images/red.png);width: 31px;height: 31px;text-align: center;padding-top: 5px;" id="legend_meron_count">
                                                    <?php echo $legend_meron_count; ?></div>
                                                <span style="font-size:.7em;text-align:center">MERON</span>
                                            </center>
                                        </div>
                                        <div class="col-xs-2" style="color:#f8f9fa;">
                                            <center>
                                                <div style="background: url(../images/blue.png);width: 31px;height: 31px;text-align: center;padding-top: 5px;" id="legend_wala_count">
                                                    <?php echo $legend_wala_count; ?></div>
                                                <span style="font-size:.7em;text-align:center">WALA </span>
                                            </center>
                                        </div>
                                        <div class="col-xs-2" style="color: #f8f9fa;">
                                            <center>
                                                <center>
                                                    <div style="background: url(../images/green.png);width: 31px;height: 31px;text-align: center;padding-top: 5px;" id="legend_draw_count">
                                                        <?php echo $legend_draw_count; ?>
                                                    </div><span style="font-size:.7em;text-align:center">DRAW
                                                    </span>
                                                </center>
                                            </center>
                                        </div>
                                        <div class="col-xs-2" style="color: #fff;">
                                            <center>
                                                <center>
                                                    <div style="background: url(../images/white.png);width: 31px;height: 31px;text-align: center;padding-top: 5px;" id="legend_cancel_count">
                                                        <?php echo $legend_cancel_count; ?>
                                                    </div><span style="font-size:.7em;text-align:left">CANCELLED</span>
                                                </center>
                                            </center>
                                        </div>
                                        <div class="col-xs-2" style="color: #fff;">
                                            <center>
                                                <center>
                                                    <div style="background: url(../images/llamado.png);width: 31px;height: 31px;text-align: center;padding-top: 5px;" id="legend_llamado_count">0</div>
                                                    <span style="font-size:.7em;text-align:right">LLAMADO</span>
                                                </center>
                                            </center>
                                        </div>
                                        <div class="col-xs-2" style="color: #fff;">
                                            <center>
                                                <center>
                                                    <div style="background: url(../images/dehado.png);width: 31px;height: 31px;text-align: center;padding-top: 5px;" id="legend_dehado_count">0</div>
                                                    <span style="font-size:.7em;text-align:right">DEHADO</span>
                                                </center>
                                            </center>
                                        </div>

                                    </div>
                                    <div class="row">
                                        <div class="col-lg-12">
                                            <ul class="nav nav-tabs flex-column flex-sm-row" id="myTab" role="tablist">
                                                <li class="nav-item flex-sm-fill" role="presentation">
                                                    <a class="nav-link active text-center" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home"
                                                        aria-selected="true">MERON/WALA</a>
                                                </li>
                                                <li class="nav-item flex-sm-fill" role="presentation">
                                                    <a class="nav-link text-center" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile"
                                                        aria-selected="false">LLAMADO/DEHADO</a>
                                                </li>

                                            </ul>
                                            <div class="tab-content" id="myTabContent">
                                                <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
                                                    <div class="meron_wala_tantos" id="meron_wala_tantos" style="color:#fff;margin-top:5px;background:transparent;width: 1000px;">
                                                        <?php include('meron_wala_table.php'); ?>
                                                    </div>
                                                </div>
                                                <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
                                                    <div id="llamado_dehado" style="color:#fff;margin-top:5px;background:transparent;width: 1000px; ">
                                                        <?php include('llamado_dehado.php'); ?>
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <script>
    $(document).ready(function() {
        var socketIO = io("https://4ksplay.com");
        socketIO.on("newConfig", function(arg) {
            $('#button_config').val(arg);
            if (arg == "1") {
                $("#bet-meron").prop("disabled", false);
                $("#bet-wala").prop("disabled", false);
                $("#bet-draw").prop("disabled", false);
                $("#btnopen").removeClass("d-none");
                $("#btnclose").addClass("d-none");
            } else if (arg == "0") {
                $("#bet-meron").prop("disabled", true);
                $("#bet-wala").prop("disabled", true);
                $("#bet-draw").prop("disabled", true);
                $("#btnopen").addClass("d-none");
                $("#btnclose").removeClass("d-none");
            }
            // showButtonConfig();

        });

        socketIO.on("newFight", function(args) {
            $('#fight_number_input').val(args);
            $('#fight_number').html(args);

        });
        socketIO.on("newGame", function(result) {
            $('#total_bet_meron').html(result);
            $('#total_bet_wala').html(result);
            $('#total_meron').html(result);
            $('#total_wala').html(result);

        });
        socketIO.on("totalMeron", function(result2) {
            $('#total_meron').html(result2);

        });
        socketIO.on("totalWala", function(result3) {
            $('#total_wala').html(result3);

        });
        socketIO.on("meronPayout", function(result4) {
            $('#payout_meron').html(result4);

        });
        socketIO.on("walaPayout", function(result5) {
            $('#payout_wala').html(result5);

        });
        socketIO.on("betPayoutMeron", function(result6) {
            var user_id = '<?php echo $user_id; ?>';
            var user_name = '<?php echo $user_name; ?>';
            var fight_number = $('#fight_number_input').val();
            $.ajax({
                url: "api/betPayoutMeron.php",
                type: "post",
                dataType: "json",
                data: {
                    user_id: user_id,
                    user_name: user_name,
                    fight_number: fight_number
                },
                success: function(data) {
                    $('#bet_payout_meron').html(data.bet_meron_payout);
                    //$('#bet_payout_wala').html(data.bet_wala_payout);
                }
            })

        });
        socketIO.on("betPayoutWala", function(result7) {
            var user_id = '<?php echo $user_id; ?>';
            var user_name = '<?php echo $user_name; ?>';
            var fight_number = $('#fight_number_input').val();
            $.ajax({
                url: "api/betPayoutMeron.php",
                type: "post",
                dataType: "json",
                data: {
                    user_id: user_id,
                    user_name: user_name,
                    fight_number: fight_number
                },
                success: function(data) {
                    //$('#bet_payout_meron').html(data.bet_meron_payout);
                    $('#bet_payout_wala').html(data.bet_wala_payout);
                }
            })

        });
        socketIO.on("refreshCredit", function(result8) {
            var uID = localStorage.getItem('sessID');
            $.ajax({
                url: "api/refresh_credit.php",
                type: "post",
                dataType: "json",
                data: {
                    uID: uID
                },
                success: function(data) {
                    $('#user_credit').html(data.new_credit);
                }
            });
            // alert(result8);

        });
        socketIO.on("userTotalDraw", function(result9) {
            $('#user_total_draw').html(result9);
        });
        socketIO.on("refreshTables", function(result10) {
            $("#meron_wala_tantos").load(location.href + " #meron_wala_tantos>*", "");
            $("#llamado_dehado").load(location.href + " #llamado_dehado>*", "");
            // $("#reglahan").load(location.href + " #reglahan>*", "");
            reglahanResult();

        });
        socketIO.on("refreshAnnouncement", function(result11) {
            $('#announcement').html(result11);

        });
        socketIO.on("refreshBlink", function(result12) {
            if (result12 == 'meron') {
                $('#meron_blink').addClass('blinktext');
                $('#wala_blink').removeClass('blinktext');

            }
            if (result12 == 'wala') {
                $('#meron_blink').removeClass('blinktext');
                $('#wala_blink').addClass('blinktext');

            }
            if (result12 == 'tabla') {
                $('#meron_blink').removeClass('blinktext');
                $('#wala_blink').removeClass('blinktext');

            }

        });

		 socketIO.on("stopBlink", function(result13) {
                $('#meron_blink').removeClass('blinktext');
                $('#wala_blink').removeClass('blinktext');

        });


    })
    </script>
    <script>
    $(document).ready(function() {
        var buttonConfig = $('#button_config').val();
        if (buttonConfig == "1") {
            $("#bet-meron").prop("disabled", false);
            $("#bet-wala").prop("disabled", false);
            $("#bet-draw").prop("disabled", false);
            $("#btnopen").removeClass("d-none");
            $("#btnclose").addClass("d-none");
        } else if (buttonConfig == "0") {
            $("#bet-meron").prop("disabled", true);
            $("#bet-wala").prop("disabled", true);
            $("#bet-draw").prop("disabled", true);
            $("#btnopen").addClass("d-none");
            $("#btnclose").removeClass("d-none");
        }
    });
    </script>


    <script>
    $(document).ready(function() {
        $('#bet-20').click(function() {
            $('#input-bet').val('20');
        })
        $('#bet-100').click(function() {
            $('#input-bet').val('100');
        })
        $('#bet-500').click(function() {
            $('#input-bet').val('500');
        })
        $('#bet-1k').click(function() {
            $('#input-bet').val('1000');
        })
        $('#bet-5k').click(function() {
            $('#input-bet').val('5000');
        })
        $('#bet-10k').click(function() {
            $('#input-bet').val('10000');
        })
        $('#bet-20k').click(function() {
            $('#input-bet').val('20000');
        })
        $('#bet-50k').click(function() {
            $('#input-bet').val('50000');
        })
    });
    </script>

    <script>
    $(document).ready(function() {
        var socketIO = io("https://4ksplay.com");
        // $('#total_bet_meron').html('0');
        // $('#total_bet_wala').html('0');
        $('#bet-meron').click(function() {
            var bet_amount = $('#input-bet')
                .val();
            var bet = 'meron';
            var sessID =
                '<?php echo $user_id; ?>';
            var sessName =
                '<?php echo $user_name; ?>';
            var fight_number = $(
                '#fight_number_input').val();
            var event_id = $(
                '#event_id_input').val();
            Swal.fire({
                title: 'Bet on meron?',
                text: "You won't be able to revert this!",
                icon: 'warning',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Confirm'
            }).then((result) => {
                if (result.isConfirmed) {
                    $.ajax({
                        url: "api/place_bet.php",
                        type: "POST",
                        dataType: "json",
                        data: {
                            bet_amount: bet_amount,
                            bet: bet,
                            sessID: sessID,
                            fight_number: fight_number,
                            sessName: sessName,
                            event_id: event_id
                        },
                        success: function(
                            data) {
                            console.log(data.total_meron);
                            console.log(data.total_wala);
                            if (parseInt(data.total_meron) > parseInt(data.total_wala)) {
                                $('#meron_blink').addClass('blinktext');
                                $('#wala_blink').removeClass('blinktext');
                                var llamado = 'meron';
                            }
                            if (parseInt(data.total_meron) < parseInt(data.total_wala)) {
                                $('#meron_blink').removeClass('blinktext');
                                $('#wala_blink').addClass('blinktext');
                                var llamado = 'wala';
                            }
                            if (parseInt(data.total_meron) == parseInt(data.total_wala)) {
                                $('#meron_blink').removeClass('blinktext');
                                $('#wala_blink').removeClass('blinktext');
                                var llamado = 'tabla';
                            }
                            socketIO.emit('refreshBlink', llamado);
                            if (data
                                .status ==
                                '1') {
                                // alert('bet has been placed');
                                $('#input-bet')
                                    .val(
                                        '');
                                $('#total_meron')
                                    .html(
                                        data
                                        .total_meron
                                    );
                                $('#total_wala')
                                    .html(
                                        data
                                        .total_wala
                                    );
                                $('#total_bet_meron')
                                    .html(
                                        data
                                        .user_bet_meron
                                    );
                                $('#total_bet_wala')
                                    .html(
                                        data
                                        .user_bet_wala
                                    );
                                $('#user_credit')
                                    .html(
                                        data
                                        .new_credit
                                    );
                                $('#payout_meron')
                                    .html(
                                        data
                                        .meron_payout
                                    );
                                $('#payout_wala')
                                    .html(
                                        data
                                        .wala_payout
                                    );
                                socketIO
                                    .emit(
                                        "totalMeron",
                                        data
                                        .total_meron
                                    );
                                socketIO
                                    .emit(
                                        "betPayoutMeron",
                                        data
                                        .bet_payout_meron
                                    );
                                socketIO
                                    .emit(
                                        "betPayoutWala",
                                        data
                                        .bet_payout_wala
                                    );
                                socketIO
                                    .emit(
                                        "meronPayout",
                                        data
                                        .meron_payout
                                    );
                                socketIO
                                    .emit(
                                        "walaPayout",
                                        data
                                        .wala_payout
                                    );

                            } else if (data.status == '2') {
                                Swal.fire({
                                    icon: 'error',
                                    title: 'Betting is closed',
                                    text: 'Nice try lods',
                                    showConfirmButton: true

                                })
                            } else if (data.status == '3') {
                                Swal.fire({
                                    icon: 'error',
                                    title: 'Not enough balance',
                                    text: 'Please reload your account',
                                    showConfirmButton: true

                                })
                            }

                        }
                    });
                }
            })

        });

        $('#bet-wala').click(function() {
            var bet_amount = $('#input-bet')
                .val();
            var bet = 'wala';
            var sessID =
                '<?php echo $user_id; ?>';
            var sessName =
                '<?php echo $user_name; ?>';
            var fight_number = $(
                '#fight_number_input').val();
            var event_id = $(
                '#event_id_input').val();
            Swal.fire({
                title: 'Bet on wala?',
                text: "You won't be able to revert this!",
                icon: 'warning',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Confirm'
            }).then((result) => {
                if (result.isConfirmed) {
                    $.ajax({
                        url: "api/place_bet.php",
                        type: "POST",
                        dataType: "json",
                        data: {
                            bet_amount: bet_amount,
                            bet: bet,
                            sessID: sessID,
                            fight_number: fight_number,
                            sessName: sessName,
                            event_id: event_id
                        },
                        success: function(
                            data) {
                            console.log(data.total_meron);
                            console.log(data.total_wala);
                            if (parseInt(data.total_meron) > parseInt(data.total_wala)) {
                                $('#meron_blink').addClass('blinktext');
                                $('#wala_blink').removeClass('blinktext');
                                var llamado = 'meron';
                            }
                            if (parseInt(data.total_meron) < parseInt(data.total_wala)) {
                                $('#meron_blink').removeClass('blinktext');
                                $('#wala_blink').addClass('blinktext');
                                var llamado = 'wala';
                            }
                            if (parseInt(data.total_meron) == parseInt(data.total_wala)) {
                                $('#meron_blink').removeClass('blinktext');
                                $('#wala_blink').removeClass('blinktext');
                                var llamado = 'tabla';
                            }
                            socketIO.emit('refreshBlink', llamado);

                            if (data
                                .status ==
                                '1') {
                                // alert('bet has been placed');
                                $('#input-bet')
                                    .val(
                                        '');
                                $('#total_meron')
                                    .html(
                                        data
                                        .total_meron
                                    );
                                $('#total_wala')
                                    .html(
                                        data
                                        .total_wala
                                    );
                                $('#total_bet_meron')
                                    .html(
                                        data
                                        .user_bet_meron
                                    );
                                $('#total_bet_wala')
                                    .html(
                                        data
                                        .user_bet_wala
                                    );
                                $('#user_credit')
                                    .html(
                                        data
                                        .new_credit
                                    );
                                $('#payout_meron')
                                    .html(
                                        data
                                        .meron_payout
                                    );
                                $('#payout_wala')
                                    .html(
                                        data
                                        .wala_payout
                                    );
                                socketIO
                                    .emit(
                                        "totalWala",
                                        data
                                        .total_wala
                                    );
                                socketIO
                                    .emit(
                                        "betPayoutMeron",
                                        data
                                        .bet_payout_meron
                                    );
                                socketIO
                                    .emit(
                                        "betPayoutWala",
                                        data
                                        .bet_payout_wala
                                    );
                                socketIO
                                    .emit(
                                        "meronPayout",
                                        data
                                        .meron_payout
                                    );
                                socketIO
                                    .emit(
                                        "walaPayout",
                                        data
                                        .wala_payout
                                    );
                            } else if (data.status == '2') {
                                Swal.fire({
                                    icon: 'error',
                                    title: 'Betting is closed',
                                    text: 'Nice try lods',
                                    showConfirmButton: true

                                })
                            } else if (data.status == '3') {
                                Swal.fire({
                                    icon: 'error',
                                    title: 'Not enough balance',
                                    text: 'Please reload your account',
                                    showConfirmButton: true

                                })
                            }
                        }
                    });
                }
            })

        });
        $('#bet-draw').click(function() {
            var bet_amount = $('#input-bet')
                .val();
            var bet = 'draw';
            var sessID =
                '<?php echo $user_id; ?>';
            var sessName =
                '<?php echo $user_name; ?>';
            var fight_number = $(
                '#fight_number_input').val();
            var event_id = $(
                '#event_id_input').val();
            Swal.fire({
                title: 'Bet on draw?',
                text: "You won't be able to revert this!",
                icon: 'warning',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Confirm'
            }).then((result) => {
                if (result.isConfirmed) {
                    $.ajax({
                        url: "api/place_bet.php",
                        type: "POST",
                        dataType: "json",
                        data: {
                            bet_amount: bet_amount,
                            bet: bet,
                            sessID: sessID,
                            fight_number: fight_number,
                            sessName: sessName,
                            event_id: event_id
                        },
                        success: function(
                            data) {
                            console.log(
                                data);
                            if (data
                                .status ==
                                '1') {
                                // alert('bet has been placed');
                                $('#input-bet')
                                    .val(
                                        '');
                                $('#total_meron')
                                    .html(
                                        data
                                        .total_meron
                                    );
                                $('#total_wala')
                                    .html(
                                        data
                                        .total_wala
                                    );
                                $('#total_bet_meron')
                                    .html(
                                        data
                                        .user_bet_meron
                                    );
                                $('#total_bet_wala')
                                    .html(
                                        data
                                        .user_bet_wala
                                    );
                                $('#user_total_draw')
                                    .html(
                                        data
                                        .user_bet_draw
                                    );
                                $('#user_credit')
                                    .html(
                                        data
                                        .new_credit
                                    );
                                $('#payout_meron')
                                    .html(
                                        data
                                        .meron_payout
                                    );
                                $('#payout_wala')
                                    .html(
                                        data
                                        .wala_payout
                                    );
                                socketIO
                                    .emit(
                                        "totalMeron",
                                        data
                                        .total_meron
                                    );
                                socketIO
                                    .emit(
                                        "betPayoutMeron",
                                        data
                                        .bet_payout_meron
                                    );
                                socketIO
                                    .emit(
                                        "betPayoutWala",
                                        data
                                        .bet_payout_wala
                                    );
                                socketIO
                                    .emit(
                                        "meronPayout",
                                        data
                                        .meron_payout
                                    );
                                socketIO
                                    .emit(
                                        "walaPayout",
                                        data
                                        .wala_payout
                                    );
                            } else if (data.status == '0') {
                                Swal.fire({
                                    icon: 'error',
                                    title: 'Betting is closed',
                                    text: 'Nice try lods',
                                    showConfirmButton: true

                                })
                            } else if (data.status == '2') {
                                Swal.fire({
                                    icon: 'error',
                                    title: 'Max bet reached!',
                                    text: 'Bet cannot exceed to 500',
                                    showConfirmButton: true

                                })
                            } else if (data.status == '3') {
                                Swal.fire({
                                    icon: 'error',
                                    title: 'Not enough balance',
                                    text: 'Please reload your account',
                                    showConfirmButton: true

                                })
                            }
                        }
                    });
                }
            })

        });
    });
    </script>



    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
    </script> -->
    <!-- <script src="http://sabong.xgitcorp.com/player/client/client_button.js"></script> -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
    </script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
    </script>
</body>

</html>
content_copyCOPY