<?php
session_start();
// error_reporting(0);
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);
date_default_timezone_set('Asia/Jakarta');
include '../function/connect.php';
include '../main/integration.php'; 
$queryMaintenance = mysqli_query($koneksi, "SELECT mtweb FROM tb_web");
$dataMaintenance = mysqli_fetch_array($queryMaintenance);
$statusMaintenance = $dataMaintenance['mtweb'];
if ($statusMaintenance === 'active') {
    header('Location: ../index.php');
    exit; 
}
$id_login = $_SESSION['id'];
$extplayer = $_SESSION['extplayer'];
$query1 = mysqli_query($koneksi, "SELECT active FROM tb_saldo WHERE id_user = '$extplayer' ");
$liat = mysqli_fetch_array($query1);
$query2 = mysqli_query($koneksi, "SELECT * FROM tb_user WHERE id = '$id_login' ");
$punya_user = mysqli_fetch_array($query2);
$query3 = mysqli_query($koneksi, "SELECT * FROM tb_bank WHERE id_user = '$extplayer' ");
$bank_user = mysqli_fetch_array($query3);
$query3 = mysqli_query($koneksi, "SELECT * FROM tb_bank WHERE id_user = '$extplayer' ");
$b = mysqli_fetch_array($query3);
$query1010 = mysqli_query($koneksi, "SELECT * FROM tb_contact");
$ssa = mysqli_fetch_array($query1010);
$whatsapp = $ssa['no_whatsapp'];
$id_livechat = $ssa['id_livechat'];
$cuk = mysqli_query($koneksi, "SELECT * FROM tb_web");
$cek_web = mysqli_fetch_array($cuk);
$urlweb = $cek_web['url'];
$logo = $cek_web['logo'];
$warna = $cek_web['warna'];
$min_depo = $cek_web['min_depo'];
$min_wd = $cek_web['min_wd'];
$icon = $cek_web['icon_web'];
$title = $cek_web['title'];
$deskripsi = $cek_web['deskripsi'];
$keyword = $cek_web['keyword'];
$pisah = explode('|', $title);
$judul = trim($pisah[0]);
if ($punya_user['status'] == "Suspend") {
  session_start();
  session_destroy();
  header("Location:index.php?pesan=29");
}
?>
<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0">
    <meta name="description" content="<?php echo $deskripsi ?>">
    <meta name="keywords" content="<?php echo $keyword ?>">
    <meta property="og:description" content="<?php echo $deskripsi ?>" />
    <meta property="og:image" content="<?php echo $urlweb ?>/assets/img/<?php echo $logo ?>">
    <meta property="og:type" content="website" />
    <meta property="og:url" content="<?php echo $urlweb ?>">
    <meta name="robots" content="index, follow">
    <meta name="author" content="<?php echo $urlweb ?>">
    <meta name="theme-color" content="linear-gradient(to bottom, #ebf4f9 0%, #c3c0cc 100%)">
    <meta name="msapplication-TileColor" content="linear-gradient(to bottom, #ebf4f9 0%, #c3c0cc 100%)">
    <meta name="msapplication-navbutton-color" content="linear-gradient(to bottom, #ebf4f9 0%, #c3c0cc 100%)">
    <meta name="apple-mobile-web-app-status-bar-style" content="linear-gradient(to bottom, #ebf4f9 0%, #c3c0cc 100%)">
    <!-- Favicon -->
    <link rel="icon" type="image/png" href="../assets/img/<?php echo $logo ?>">
    <meta name="robots" content="noindex, nofollow">
    <meta name="googlebot" content="noindex, nofollow">
    <meta name="googlebot-news" content="noindex">
    <!-- Canonical -->
    <link rel="canonical" href="<?php echo $urlweb ?>" />
    <!-- End Canonical -->
    <meta name="description" itemprop="description" content="<?php echo $deskripsi ?>" />
    <meta name="keywords" content="<?php echo $keyword ?>" />
    <title><?php echo $title; ?></title>
    <!-- Custom Tags -->
    <meta name="robots" content="index, follow" />
    <meta name="copyright" content="lexusmpo">
    <meta name="rating" content="general" />
    <meta name="geo.placename" content="Indonesia" />
    <meta name="geo.country" content="ID" />
    <meta name="language" content="ID" />
    <meta name="tgn.nation" content="Indonesia" />
    <meta name="rating" content="general" />
    <meta name="author" content="lexusmpo" />
    <!-- End Custom Tags -->
    <link rel="preload" as="font" href="themes/default/font/font-awesome/webfonts/fa-solid-900.woff2" type="font/woff2"
        crossorigin="anonymous">
    <link rel="preload" as="font" href="themes/default/font/font-awesome/webfonts/fa-brands-400.woff2" type="font/woff2"
        crossorigin="anonymous">
    <link rel="stylesheet" type="text/css" href="themes/default/css/global.css">
    <link rel="stylesheet" type="text/css" href="themes/default/font/font-awesome/css/all.min.css">
    <?php
  if ($warna == "biru-default") {
  ?>
    <link rel="stylesheet" id="templateStyle" type="text/css" href="biru-default/custom/css/style.css">
    <?php
  } else if ($warna == "abu-hitam") {
  ?>
    <link rel="stylesheet" id="templateStyle" type="text/css" href="abu-hitam/custom/css/style.css">
    <?php
  } else if ($warna == "merah-kuning") {
  ?>
    <link rel="stylesheet" id="templateStyle" type="text/css" href="merah-kuning/custom/css/style.css">
    <?php
  } else if ($warna == "ungu-hitam") {
  ?>
    <link rel="stylesheet" id="templateStyle" type="text/css" href="ungu-hitam/custom/css/style.css">
    <?php
  }
  ?>
<link rel="stylesheet" type="text/css" href="themes/default/sass/custom.css">
</head>
<body>
    <div class="header-mobile">
        <div id="mobilePageLoadingBar" class="progress-bar progress-bar-success" role="progressbar"
            style="height:4px;width:1%;position:absolute;z-index:999;display:none;"></div>
        <div class="header-mobile__marquee">
            <i class="fas fa-bullhorn"></i>
            <marquee class="marquee"><?php echo $title; ?></marquee>
        </div>
        <?php
            if ($id_login == false) {
                ?>
        <div class="header-mobile__top">
            <div class="mobile-help">
                <a href="?page=event">
                    <i class="fas fa-trophy"></i>
                </a>
            </div>
            <?php
          } else {
          ?>
            <div class="header-mobile__top">
                <div class="mobile-balance">
                    <div class="balance-number" data-toggle="modal" data-target="#accountBalance"><a
                            class="wallet-amount"
                            id="wallet-amount">IDR <?php echo number_format($liat['active'] / 1000, 2, '.', ''); ?><span
                                name="mainBalance"></span></a></div>
                    <a href="#" name="refreshWallet" onclick='tarikSaldo()'><span><i class="fa fa-sync"></i></span></a>
                </div>
                <?php
                        }
                        ?>

                <div class="mobile-logo">
                    <a href="../mobile/index.php?page=home">
                        <img src="../assets/img/<?php echo $logo ?>" alt="WebsiteLogo" width="125" height="27">
                    </a>
                </div>
                <?php
            if ($id_login == false) {
                ?>
                <div class="mobile-right">
                    <div class="mobile-menu sidenav-toggle" class="mobile-menu">
                        <div class="mobile-menu--line">
                            <img src="../assets/img/icon/mobile-nav.svg">
                        </div>
                    </div>
                </div>
                <?php
          } else {
          ?>
                <div class="mobile-right">
                    <div class="mobile-help">
                        <a href="?page=bantuan">
                            <i class="fas fa-info"></i>
                        </a>
                    </div>
                    <div class="mobile-menu sidenav-toggle">
                        <div class="mobile-menu--line">
                            <img src="../assets/img/icon/mobile-nav.svg">
                        </div>
                    </div>
                </div>
                <?php
          }
          ?>
            </div>
            <div class="header-mobile__nav">
                <div class="swiper-container header-mobile-swiper">
                    <div class="swiper-wrapper">
                        <div class="swiper-slide">
                            <img src="https://images.linkcdn.cloud/global/nav-addons/promo_category.png" width="45"
                                height="10"
                                style="position: absolute; z-index:9; animation: 0.25s ease 0s infinite alternate none running beat;">
                            <a href="?page=slot">
                                <div class="header-mobile__item" id="header-mobile-item-slot">
                                    <img src="../assets/img/icon/slot.svg">
                                    <span>SLOT</span>
                                </div>
                            </a>
                        </div>
                        <div class="swiper-slide">
                            <img src="https://images.linkcdn.cloud/global/nav-addons/hot_category.png" width="30"
                                height="10"
                                style="position: absolute; z-index:9; animation: 0.25s ease 0s infinite alternate none running beat;">
                            <a href="?page=livegames">
                                <div class="header-mobile__item" id="header-mobile-item-livegames">
                                    <img src="../assets/img/icon/livegames.svg">
                                    <span>LIVEGAMES</span>
                                </div>
                            </a>
                        </div>
                        <div class="swiper-slide">
                            <a href="?page=casino">
                                <div class="header-mobile__item" id="header-mobile-item-casino">
                                    <img src="../assets/img/icon/casino.svg">
                                    <span>CASINO</span>
                                </div>
                            </a>
                        </div>
                        <div class="swiper-slide">
                            <a href="?page=sport">
                                <div class="header-mobile__item" id="header-mobile-item-sportsbook">
                                    <img src="../assets/img/icon/sport.svg">
                                    <span>SPORT</span>
                                </div>
                            </a>
                        </div>
                        <div class="swiper-slide">
                            <a href="?page=lottery">
                                <div class="header-mobile__item" id="header-mobile-item-lottery">
                                    <img src="../assets/img/icon/lottery.svg">
                                    <span>LOTTERY</span>
                                </div>
                            </a>
                        </div>
                        <div class="swiper-slide">
                            <a href="?page=poker">
                                <div class="header-mobile__item" id="header-mobile-item-poker">
                                    <img src="../assets/img/icon/poker.svg">
                                    <span>POKER</span>
                                </div>
                            </a>
                        </div>
                        <div class="swiper-slide">
                            <a href="?page=arcade">
                                <div class="header-mobile__item" id="header-mobile-item-arcade">
                                    <img src="../assets/img/icon/arcade.svg">
                                    <span>ARCADE</span>
                                </div>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="overlay"></div>
        <?php include 'template/sidenav.php'; ?>
        <?php
  if ($_GET['page'] == "home") {
    include 'template/page/home.php';
  } else if ($_GET['page'] == "promosi") {
    include 'template/page/promosi.php';
  } else if ($_GET['page'] == "daftar") {
    include 'template/page/daftar.php';
  } else if ($_GET['page'] == "popular") {
    include 'template/page/popular.php';
  } else if ($_GET['page'] == "slot") {
    include 'template/page/slot.php';
  } else if ($_GET['page'] == "livegame") {
    include 'template/page/livegame.php';
  } else if ($_GET['page'] == "casino") {
    include 'template/page/casino.php';
  } else if ($_GET['page'] == "sport") {
    include 'template/page/sport.php';
  } else if ($_GET['page'] == "lottery") {
    include 'template/page/lottery.php';
  } else if ($_GET['page'] == "poker") {
    include 'template/page/poker.php';
  } else if ($_GET['page'] == "arcade") {
    include 'template/page/arcade.php';
  } else if ($_GET['page'] == "arcade_jdb") {
    include 'template/page/menu_game/arcade/jdb.php';
  } else if ($_GET['page'] == "arcade_joker") {
    include 'template/page/menu_game/arcade/joker.php';
  } else if ($_GET['page'] == "arcade_spadegaming") {
    include 'template/page/menu_game/arcade/spadegaming.php';
  } else if ($_GET['page'] == "arcade_jili") {
    include 'template/page/menu_game/arcade/jili.php';
  } else if ($_GET['page'] == "arcade_cq9") {
    include 'template/page/menu_game/arcade/cq9.php';
  } else if ($_GET['page'] == "contact") {
    include 'template/page/contact.php';
  } else if ($_GET['page'] == "transaksi") {
    include 'template/page/transaksi.php';
  } else if ($_GET['page'] == "refferal") {
    include 'template/page/refferal.php';
  } else if ($_GET['page'] == "profile") {
    include 'template/page/profil.php';
  } else if ($_GET['page'] == "slot_pragmatic") {
    include 'template/page/menu_game/slot/pragmaticPlay.php';
  } else if ($_GET['page'] == "slot_microgaming") {
    include 'template/page/menu_game/slot/microgaming.php';
  } else if ($_GET['page'] == "slot_habanero") {
    include 'template/page/menu_game/slot/habanero.php';
  } else if ($_GET['page'] == "slot_jdb") {
    include 'template/page/menu_game/slot/jdb.php';
  } else if ($_GET['page'] == "slot_jili") {
    include 'template/page/menu_game/slot/jili.php';
  }else if ($_GET['page'] == "slot_wazdan") {
    include 'template/page/menu_game/slot/wazdan.php';
  } else if ($_GET['page'] == "slot_redtiger") {
    include 'template/page/menu_game/slot/redtiger.php';
  } else if ($_GET['page'] == "slot_pgsoft") {
    include 'template/page/menu_game/slot/pgsoft.php';
  } else if ($_GET['page'] == "slot_playngo") {
    include 'template/page/menu_game/slot/playngo.php';
  } else if ($_GET['page'] == "slot_playngo") {
    include 'template/page/menu_game/slot/playngo.php';
  } else if ($_GET['page'] == "slot_scientific_games") {
    include 'template/page/menu_game/slot/slot_scientific_games.php';
  } else if ($_GET['page'] == "slot_firekirin") {
    include 'template/page/menu_game/slot/firekirin.php';
  } else if ($_GET['page'] == "slot_rubyplay") {
    include 'template/page/menu_game/slot/rubyplay.php';
  } else if ($_GET['page'] == "slot_novomatic") {
    include 'template/page/menu_game/slot/novomatic.php';
  } else if ($_GET['page'] == "slot_apollo") {
    include 'template/page/menu_game/slot/apollo.php';
  }else if ($_GET['page'] == "slot_amatic") {
    include 'template/page/menu_game/slot/amatic.php';
  }else if ($_GET['page'] == "slot_kajot") {
    include 'template/page/menu_game/slot/kajot.php';
  }else if ($_GET['page'] == "slot_ainsworth") {
    include 'template/page/menu_game/slot/ainsworth.php';
  }else if ($_GET['page'] == "slot_quickspin") {
    include 'template/page/menu_game/slot/quickspin.php';
  }else if ($_GET['page'] == "slot_netent") {
    include 'template/page/menu_game/slot/netent.php';
  }else if ($_GET['page'] == "slot_igt") {
    include 'template/page/menu_game/slot/igt.php';
  }else if ($_GET['page'] == "slot_aristocrat") {
    include 'template/page/menu_game/slot/aristocrat.php';
  }else if ($_GET['page'] == "slot_igrosoft") {
    include 'template/page/menu_game/slot/igrosoft.php';
  }else if ($_GET['page'] == "slot_apex") {
    include 'template/page/menu_game/slot/apex.php';
  }else if ($_GET['page'] == "slot_merkur") {
    include 'template/page/menu_game/slot/merkur.php';
  }else if ($_GET['page'] == "slot_egt") {
    include 'template/page/menu_game/slot/egt.php';
  }else if ($_GET['page'] == "memo") {
    include 'template/page/memo.php';
  }else if ($_GET['page'] == "bonus") {
    include 'template/page/bonus.php';
  }else if ($_GET['page'] == "event") {
    include 'template/page/event.php';
  }else if ($_GET['page'] == "berita") {
    include 'template/page/berita.php';
  }else if ($_GET['page'] == "bantuan") {
    include 'template/page/bantuan.php';
  }else if ($_GET['page'] == "popup") {
    include 'template/page/popup.php';
  }else if ($_GET['page'] == "slot_playstar") {
    include 'template/page/menu_game/slot/playstar.php';
  }else if ($_GET['page'] == "slot_nolimitcity") {
    include 'template/page/menu_game/slot/nolimitcity.php';
  }else if ($_GET['page'] == "slot_cq9") {
    include 'template/page/menu_game/slot/cq9.php';
  }else if ($_GET['page'] == "slot_joker") {
    include 'template/page/menu_game/slot/slot_joker.php';
  }else if ($_GET['page'] == "slot_spadegaming") {
    include 'template/page/menu_game/slot/spadegaming.php';
  }else if ($_GET['page'] == "slot_advantplay") {
    include 'template/page/menu_game/slot/advantplay.php';
  }else if ($_GET['page'] == "slot_evoplay") {
    include 'template/page/menu_game/slot/evoplay.php';
  }else if ($_GET['page'] == "slot_fungaming") {
    include 'template/page/menu_game/slot/fungaming.php';
  }else if ($_GET['page'] == "sports_afb") {
    include 'template/page/menu_game/sports/afb.php';
  }else if ($_GET['page'] == "lottery_nex4d") {
    include 'template/page/menu_game/lottery/nex4d.php';
  }else if ($_GET['page'] == "lottery_keno") {
    include 'template/page/menu_game/lottery/keno.php';
  }else if ($_GET['page'] == "lottery_4d") {
    include 'template/page/menu_game/lottery/4d.php';
  }else if ($_GET['page'] == "poker_FunGamingPoker") {
    include 'template/page/menu_game/poker/FunGamingPoker.php';
  }else if ($_GET['page'] == "arcade_fishing") {
    include 'template/page/menu_game/arcade/fishing.php';
  }else if ($_GET['page'] == "livegames") {
    include 'template/page/livegame.php';
  }else if ($_GET['page'] == "casino_ezugi") {
    include 'template/page/menu_game/casino/ezugi.php';
  }else if ($_GET['page'] == "casino_evolution") {
    include 'template/page/menu_game/casino/evolution.php';
  }




  else if ($_GET['page'] == "casino_pragmatic") {
    include 'template/page/menu_game/casino/pragmatic_play.php';
  } 

  else if ($_GET['page'] == "poker_amatic") {
    include 'template/page/menu_game/poker/amatic.php';
  } 

  else if ($_GET['page'] == "arcade_fishing") {
    include 'template/page/menu_game/arcade/arcade_fishing.php';
  } else if ($_GET['page'] == "detail_promo") {
    include 'template/page/menu_promosi/detail.php';
  } else {
    include 'template/page/home.php';
  }
  ?>
        <?php
            if ($id_login == false) {
                ?>
        <div class="footer-mobile">
            <div class="footer-mobile__login">
                <button class="login-button" type="button" type="button" data-toggle="modal"
                    data-target="#loginModal">Masuk</button>
                <button class="register-button" onclick="window.location.href = '?page=daftar'">Daftar</button>
            </div>
        </div>

        <a target="_blank" rel="noreferrer" href="https://direct.lc.chat/<?php echo $id_livechat ?>/">
            <div class="footer-chat">
                <img src="../assets/img/icon/feedback.svg">
            </div>
        </a>

        <!-- Modal -->
        <div class="modal fade custom-popup" id="loginModal" tabindex="-1" role="dialog"
            aria-labelledby="exampleModalLabel" aria-hidden="true">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <i class="fas fa-times"></i>
                    </button>

                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel">Formulir Login</h5>
                    </div>

                    <div class="modal-body">
                        <div class="modal-body-form">
                            <form name="login-form" action="function/cek_login.php" method="POST">
                                <div class="form-item">
                                    <div class="item-title">Nama Pengguna*</div>
                                    <input class="form-control input-custom" value="" minlength="1" maxlength="25"
                                        name="username" style="text-transform: lowercase" type="text"
                                        placeholder="Nama Pengguna*" autocomplete="off" required>
                                </div>
                                <div class="form-item">
                                    <div class="item-title">Kata Sandi*</div>
                                    <input class="form-control input-custom" value="" minlength="5" maxlength="50"
                                        name="password" type="password" placeholder="Kata Sandi*" autocomplete="off"
                                        required>
                                </div>
                                <div class="form-button">
                                    <button name="submit" type="submit" class="btn-custom">Masuk</button>
                                </div>
                                <div class="form-register">
                                    <span>Belum punya akun?, <a href="?page=daftar">Daftar!</a></span>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="modal fade" id="AgeCheck" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
            aria-hidden="true" style="background: rgba(0, 0, 0, 0.51);padding-top: 150px;">
            <div class="modal-dialog">
                <div class="modal-content p-2" style="border-radius: 0;">
                    <div class="row">
                        <div class="col-md-12 text-center">
                            <img alt="WebsiteLogo" src=https://images.linkcdn.cloud/V2/42/logo/logo-1251293185.webp
                                width="250" class="d-block mx-auto" style="filter: drop-shadow(2px 2px 2px black);">
                        </div>
                    </div>
                    <div class="modal-body">
                        <div class="announcement-content">
                            <div class="row">
                                <div class="col-md-12">
                                    <h3 class="text-center font-weight-bold">VERIFICATION NOTICE</h3>
                                    <p class="text-justify">
                                    <ul>
                                        <p>By entering this website, you acknowledge and confirm: </p>
                                        <li>I am over the age of 21 and will comply with the above statement.</li>
                                    </ul>
                                    </p>
                                </div>
                                <a href="#" class="d-block mx-auto"><img
                                        src="https://images.linkcdn.cloud/global/default/contact/keppitfun.webp"
                                        alt="game responsibly" class="w-100"></a>
                            </div>
                            <div class="row">
                                <div class="col-12 mt-5">
                                    <button type="button" class="btn btn-success btn-block"
                                        data-dismiss="modal">Enter</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <?php
  } else {
?>
        <div class="footer-mobile">
            <div class="footer-mobile__nav">
                <a class="nav-link active" href="?page=home">
                    <div class="nav-item">
                        <div class="nav-icon">
                            <img src="../assets/img/icon/home.svg" width="80">
                        </div>
                        <div class="nav-label">Home</div>
                    </div>
                </a>
                <a class="nav-link " href="?page=memo">
                    <div class="nav-item">
                        <div class="nav-icon">
                            <i class="fas fa-bell"></i>
                        </div>
                        <div class="nav-label">Memo</div>
                    </div>
                </a>
                <a class="nav-link " href="?page=transaksi#nav-deposit">
                    <div class="nav-item">
                        <div class="nav-icon">
                            <i class="fas fa-plus"></i>
                        </div>
                        <div class="nav-label">Transaksi</div>
                    </div>
                </a>
                <a class="nav-link " href="?page=bonus">
                    <div class="nav-item">
                        <div class="nav-icon">
                            <img src="../assets/img/icon/bonus.svg" width="80">
                        </div>
                        <div class="nav-label">Bonus</div>
                    </div>
                </a>
                <a class="nav-link " href="?page=profile">
                    <div class="nav-item">
                        <div class="nav-icon member-icon">
                            <img src="../assets/img/icon/New Player.svg" alt="">
                        </div>
                        <div class="nav-label">Akun Saya</div>
                    </div>
                </a>
            </div>
        </div>
        <a target="_blank" rel="noreferrer" href="https://direct.lc.chat/<?php echo $id_livechat ?>/">
            <div class="footer-chat">
                <img src="../assets/img/icon/feedback.svg">
            </div>
        </a>
        <?php
            }
            ?>

        <!-- Account Balance -->
        <div class="modal custom-popup fade" id="accountBalance" tabindex="-1" aria-labelledby="accountBalanceLabel"
            aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <i class="fas fa-times"></i>
                    </button>
                    <div class="modal-body">
                        <div class="popup-account-balance">
                            <div class="balance-header">
                                <h6>DOMPET</h6>
                                <div class="acc-balance"><span name="mainBalance"></span></div>
                            </div>
                            <div class="balance-category d-flex align-items-center">
                                <div class="category-name m-0">DOMPET UTAMA</div>
                                <div class="acc-balance ml-auto"><span
                                        id="balance-common-total"><?php echo number_format($liat['active'] / 1000, 2, '.', ''); ?></span>
                                </div>
                            </div>


                        </div>
                        <div class="balance-button">
                            <a href="?page=transaksi" id="depositModal" type="button" class="btn-custom">Tambah Dana</a>
                            <a href="?page=transaksi" id="withdrawModal" type="button" class="btn-custom">Tarik Dana</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>


    </div>
    <div class="floating-contact" id="floating-contact-widget">
        <div class="floating-contact__item">
            <a href="https://api.whatsapp.com/send?phone=6281400787168&text=Hallo." target="_blank" rel="noreferrer">
                <span class="whatsapp"><i class="fab fa-whatsapp"></i></span>
                WhatsApp
            </a>
            <a href="<?php echo $urlweb ?>" target="_blank" rel="noreferrer">
                <span class="website"><i class="fa fa-globe"></i></span>
                Website
            </a>
            </a>
            <a href="https://pub-d8fbadbadffb491985f60c957f55140c.r2.dev/index.html" target="_blank" rel="noreferrer">
                <span class="RTP"><i class="fa fa-trophy" style="color: black;"></i></span>
                RTP
            </a>
        </div>
        <div class="floating-contact__button">
            <div class="static">
                <i class="fas fa-comment-alt"></i>
                <p>Kontak Kami</p>
            </div>
            <div class="icons">
                <div class="icons-line">
                    <span><i class="fab fa-facebook-messenger"></i></span>
                    <span><i class="fab fa-whatsapp"></i></span>
                    <span><i class="fab fa-telegram-plane"></i></span>
                    <span><i class="fab fa-skype"></i></span>
                    <span><i class="fas fa-comments"></i></span>
                    <span><i class="fas fa-phone-alt"></i></span>
                    <span><i class="fa fa-globe"></i></span>
                </div>
            </div>
            <div class="btn-close">
                <i class="fas fa-times"></i>
            </div>
<script src="themes/default/js/vendor.js"></script>
<script src="themes/default/js/global.js"></script>
<script src="themes/default/js/index.js"></script>
<script src="themes/default/vendor/jquery-validate/jquery.validate.min.js"></script>            
<script>
$(document).ready(function () {
    $(this).scrollTop(0);
    $('#homePopup').modal('hide');
    $('#AgeCheck').modal('hide');
});
$('#mobilePageLoadingBar').hide()
window.onpopstate = function () {
    let path = window.location.pathname;
    routeNav(path);
}
function handler(e) {
    e.stopPropagation();
    e.preventDefault();
}
function routeNav(path) {
    if (path == window.location.pathname) return;
    history.pushState(null, null, path);
    $(".sidenav").removeClass('sidenav-open');
    $(".modal").modal("hide");
    $("#overlay").hide();
    let url = "" + window.location.pathname;
    if (path == '/') {
        window.location.replace("")
        return false;
    }
    $(".header-form>a").removeClass('active')
    let elem = document.getElementById("mobilePageLoadingBar");
    let width = 1;
    $.ajax({
        type: "GET",
        url: url,
        beforeSend: () => {
            $('#mobilePageLoadingBar').show()
            document.addEventListener("click", handler, true);
            let id = setInterval(frame, 100);

            function frame() {
                if (width >= 100) {
                    clearInterval(id);
                } else {
                    width++;
                    elem.style.width = width + '%';
                }
            }
        },
        success: function (page) {
            document.removeEventListener("click", handler, true);
            width = 100;
            elem.style.width = width + '%';
            $("main[id=main-route]").empty().append(page);
            $("title").text($("#title-seo").text());
            const script = $("scope-script").html()
            $("scope-script").remove()
            setTimeout(() => {
                $("html, body").animate({
                    scrollTop: "0"
                }, 1000);
                $('#mobilePageLoadingBar').hide()
                elem.style.width = '1%';
                $("custom-script").empty().append(script);
                filterGameSelection('all')
            }, 500);
        },
        error: function (e) {
            window.location.replace("")
            return false;
        }
    });
}
$('.show-popup-language').click(function () {
    $('.sidenav').removeClass('sidenav-open');
    document.getElementById("overlay").style.display = "none";
});
$('.show-popup-currency').click(function () {
    $('.sidenav').removeClass('sidenav-open');
    document.getElementById("overlay").style.display = "none";
});
$('.voucher-button').click(function () {
    $('.sidenav').removeClass('sidenav-open');
    document.getElementById("overlay").style.display = "none";
});
$('.sidenav__close').click(function () {
    $('.sidenav').removeClass('sidenav-open');
    document.getElementById("overlay").style.display = "none";
});
function customScrollbar() {
    const categoryContainerSwiper = new Swiper('.header-mobile-swiper', {
        direction: "horizontal",
        slidesPerView: "auto",
        freeMode: true,
        spaceBetween: 5,
    });
}
customScrollbar()
function jackpotHome() {
    var amount = document.getElementById('amount-jackpot');
    var start = new Date("July 30, 2000 00:00:00");
    var current;
    update();
    setInterval(update, 900);
    function update() {
        var current = ((new Date() - start) / (24 * 3600 * 500)); 
        var num2 = Math.floor((Math.random() * 2) + 1);
        current = current * 10000 + num2;
        if (amount) amount.innerText = formatMoney(current);
    }
    function formatMoney(amount, decimalCount = 2, decimal = ".", thousands = ",") {
        try {
            decimalCount = Math.abs(decimalCount);
            decimalCount = isNaN(decimalCount) ? 2 : decimalCount;
            const negativeSign = amount < 0 ? "-" : "";
            let i = parseInt(amount = Math.abs(Number(amount) || 0).toFixed(decimalCount)).toString();
            let j = (i.length > 3) ? i.length % 3 : 0;

            return negativeSign +
                (j ? i.substr(0, j) + thousands : '') +
                i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousands) +
                (decimalCount ? decimal + Math.abs(amount - i).toFixed(decimalCount).slice(2) : "");
        } catch (e) {
            console.log(e)
        }
    }
}
jackpotHome();
</script>
            <script>
    autoTarik();
    function autoTarik() {
      var username = '<?= $_SESSION["username"] ?>';
      $.ajax({
        url: 'function/getBalances.php',
        data: {
          username
        },
        type: "POST",
        success: function(data) {}
      })
    }
    
    function tarikSaldo() {
      var username = '<?= $_SESSION["username"] ?>';
      $.ajax({
        url: 'function/getBalances.php',
        data: {
          username
        },
        type: "POST",
        success: function(data) {
          Swal.fire({
            icon: 'success',
            title: 'Saldo berhasil ditarik',
            text: 'Saldo Anda telah berhasil ditarik.',
            showCancelButton: true,
            confirmButtonText: 'OK',
            cancelButtonText: 'Tutup',
          }).then((result) => {
            if (result.isConfirmed) {
              location.reload(true);
            }
          });
        },
        error: function(xhr, status, error) {
          console.error("Error:", error);
          Swal.fire({
            icon: 'error',
            title: 'Saldo gagal ditarik',
            text: 'Penarikan saldo anda gagal.',
            timerProgressBar: true,
            timer: 5000,
          });
        }
      });
    }
  </script>
  <script>
    $(document).ready(function() {
      $(this).scrollTop(0);

      $('#homePopup').modal('hide');


    });

    function handler(e) {
      e.stopPropagation();
      e.preventDefault();
    }
  </script>
  <script>
    window.showError = (title, message) => {
      return Swal.fire({
        icon: 'info',
        title: title,
        html: message,
        timerProgressBar: true,
        timer: 5000,
      });
    }

    $(".game-search>.form-control-sm").on("focus", function() {
      if ($(this).val().length == 0) {
        $(".game-search").width('100%');
        $(".form-control-sm").width('100%');
      }
    })

    $(".game-search>.form-control-sm").on("focusout", function() {
      if ($(this).val().length == 0) {
        $(".game-search").width('');
        $(".form-control-sm").width('');
      }
    })


    function gameAlert() {
      return Swal.fire({
        icon: 'info',
        title: "Perhatian.",
        html: "Silakan login untuk bermain!",
        timerProgressBar: true,
        timer: 5000,
      });
    }

    function gamemaintenance() {
      return Swal.fire({
        icon: 'info',
        title: "Opps.",
        html: "Provider Ini Sedang Dalam Proses Maintenance!",
        timerProgressBar: true,
        timer: 5000,
      });
    }

    function deposit() {
      return Swal.fire({
        icon: 'error',
        title: "Opps.",
        html: "Saldo kamu tidak cukup harap lakukan deposit",
        timerProgressBar: true,
        timer: 5000,
      });
    }
  </script>

  <?php
  if (!empty($_GET['pesan'])) {
    if ($_GET['pesan'] == 1) {
  ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Email Sudah Digunakan',
          text: 'Silakan coba email lain.'
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 2) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Captcha Anda Salah',
          text: 'Periksa Kembali Captcha Yang Anda Masukkan.',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 3) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'success',
          title: 'Selamat!',
          text: 'Akun Anda Berhasil Dibuat',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 4) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Password Dan Konfirmasi Harus Sama.',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 5) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Daftar Akun Gagal.',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 6) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Akun Anda Di Suspend Oleh Admin.',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 7) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Username Dan Password Anda Salah.',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 8) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'success',
          title: 'Selamat!',
          text: 'Anda Berhasil Logout',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 9) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'success',
          title: 'Selamat!',
          text: 'Deposit Berhasil Silahkan Menghubungi Admin Untuk Proses Konfirmasi',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 10) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Gagal Mengupload Gambar.',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 11) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Ukuran File Terlalu Besar.',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 12) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Ekstensi Gambar Harus Jpg atau png.',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 13) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Anda Masih Memiliki Proses Deposit Yang Belum Selesai.',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 14) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Maaf Promo ini hanya berlaku untuk New Member.',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 15) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Maaf Nominal Deposit Tidak Sesuai Dengan Ketentuan Bonus.',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 16) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'info',
          title: 'Opps',
          text: 'Deposit Minimal <?php echo $min_depo; ?> Ya',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 17) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'info',
          title: 'Opps',
          text: 'Maaf Anda belum mencapai Target Turn Over yg sudah di tentukan, silahkan bermain kembali untuk menyelesaikan targetturn over anda',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 18) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Saldo Anda Tidak Mencukupi Untuk Melakukan Withdraw',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 19) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'info',
          title: 'Opps',
          text: 'Withdraw Minimal <?php echo $min_wd; ?> Ya',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 20) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'success',
          title: 'Selamat!',
          text: 'Withdraw Berhasil Silahkan Menghubungi Admin Untuk Proses Konfirmasi',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 21) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Anda Masih Memiliki Proses Withdraw Yang Belum Selesai.',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 22) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'info',
          title: 'Opps',
          text: 'Segera Hubungi Admin',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 23) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Anda Harus Login Terlebih Dahulu',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 24) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Sorry!',
          text: 'Ubah Password Gagal',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 25) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Sorry!',
          text: 'Password Lama Anda Salah',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 26) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'info',
          title: 'Opps!',
          text: 'Password Baru Dan Konfirmasi Harus sama',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }
    if ($_GET['pesan'] == 27) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'success',
          title: 'Selamat!',
          text: 'Password Anda Berhasil Di Ubah',
          timerProgressBar: true,
          timer: 5000,
        });
      </script>
    <?php
    }

    if ($_GET['pesan'] == 28) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'info',
          title: 'Opps',
          text: 'Silakan Login Untuk Bermain'
        });
      </script>
    <?php
    }


    if ($_GET['pesan'] == 29) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Maaf Akun Anda Telah Disuspend Oleh Admin'
        });
      </script>

    <?php
    }
    if ($_GET['pesan'] == 30) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Username Telah Di Gunakan, Silahkan Buat Username Lain'
        });
      </script>

    <?php
    }
    if ($_GET['pesan'] == 31) {
    ?>
      <script type="text/javascript">
        Swal.fire({
          icon: 'error',
          title: 'Opps',
          text: 'Username Telah Di Gunakan, Silahkan Buat Username Lain'
        });
      </script>
  <?php
    }
  }
  ?>
  <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
        console.error = function() {};
    function reloadBalance() {
        $.ajax({
            url: 'function/saldo.php',
            type: 'GET',
            dataType: 'json',
            success: function(response) {
                var newBalance = response.saldo;
                $('#wallet-amount span[name="mainBalance"]').text(newBalance);
                alert("Balance reloaded!");
            },
            error: function(xhr, status, error) {
                console.error(error);
            }
        });
    }
</script>

</body>

</html>