<?php
include('session.php');
require_once('../config/koneksi.php');
?>
<!DOCTYPE html>
<html lang="id-ID">

<head>
  <title><?php echo $instansi ?></title>
  <meta name="robots" content="INDEX, FOLLOW">
  <meta name="Content-Type" content="text/html">
  <meta name="twitter:card" content="summary">
  <meta name="og:type" content="website">
  <meta name="author" content="<?php echo $instansi ?>">
  <meta property="og:image" content="<?php echo $urlweb; ?>/upload/<?php echo $s0['image']; ?>">


  <link rel="icon" href="<?php echo $urlweb; ?>/upload/<?php echo $s0['image']; ?>" type="image/gif">

  <meta property="og:site_name" content="<?php echo $instansi ?>">
  <meta name="twitter:site" content="<?php echo $instansi ?>">
  <meta name="twitter:image" content="<?php echo $urlweb; ?>/upload/<?php echo $s0['image']; ?>">
  <meta property="og:image:alt" content="<?php echo $instansi ?>">
  <meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1, user-scalable=no">

  <meta property="og:url" content="">


  
  
  <script>
      // Kode Untuk Menutup Ekstensi GIF
    function hide() {
      var ekstensi = document.getElementById('extension');
      var bungkus = document.getElementById('button');
      if (ekstensi.style.display === 'none') {
        ekstensi.style.display = 'block';
        button.innerHTML = 'HIDE';
      } else {
        ekstensi.style.display = 'none';
        button.innerHTML = 'SHOW';
      }
    }
  </script>
  
  <script>
    var _0x282e=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x63\x73\x73\x43\x69\x72\x63\x6C\x65\x4D\x65\x6E\x75","\x63\x6C\x69\x63\x6B","\x70\x72\x65\x76\x65\x6E\x74\x44\x65\x66\x61\x75\x6C\x74","\x61\x64\x64\x45\x76\x65\x6E\x74\x4C\x69\x73\x74\x65\x6E\x65\x72","\x69\x73\x2D\x61\x63\x74\x69\x76\x65","\x63\x6F\x6E\x74\x61\x69\x6E\x73","\x63\x6C\x61\x73\x73\x4C\x69\x73\x74","\x61\x64\x64","\x72\x65\x6D\x6F\x76\x65","\x71\x75\x65\x72\x79\x53\x65\x6C\x65\x63\x74\x6F\x72","\x2E\x6A\x73\x2D\x6D\x65\x6E\x75\x2D\x74\x6F\x67\x67\x6C\x65","\x2E\x6A\x73\x2D\x6D\x65\x6E\x75\x2D\x6D\x61\x73\x6B","\x49\x6E\x76\x61\x6C\x69\x64\x20\x65\x6C\x65\x6D\x65\x6E\x74\x73\x2C\x20\x63\x68\x65\x63\x6B\x20\x74\x68\x65\x20\x73\x74\x72\x75\x63\x74\x75\x72\x65\x2E"];!function(_0x1024x1){_0x282e[0];_0x1024x1[_0x282e[1]]=function(_0x1024x1){function _0x1024x2(){_0x1024x7[_0x282e[4]](_0x282e[2],function(_0x1024x1){_0x1024x1[_0x282e[3]](),_0x1024x3()})}function _0x1024x3(){_0x1024x7[_0x282e[7]][_0x282e[6]](_0x282e[5])?_0x1024x5():_0x1024x4()}function _0x1024x4(){_0x1024x6[_0x282e[7]][_0x282e[8]](_0x282e[5]),_0x1024x7[_0x282e[7]][_0x282e[8]](_0x282e[5]),_0x1024x8[_0x282e[7]][_0x282e[8]](_0x282e[5])}function _0x1024x5(){_0x1024x6[_0x282e[7]][_0x282e[9]](_0x282e[5]),_0x1024x7[_0x282e[7]][_0x282e[9]](_0x282e[5]),_0x1024x8[_0x282e[7]][_0x282e[9]](_0x282e[5])}function _0x1024x3(){_0x1024x7[_0x282e[7]][_0x282e[6]](_0x282e[5])?_0x1024x5():_0x1024x4()}var _0x1024x6=document[_0x282e[10]](_0x1024x1),_0x1024x7=_0x1024x6?_0x1024x6[_0x282e[10]](_0x282e[11]):void(0),_0x1024x8=_0x1024x6?_0x1024x6[_0x282e[10]](_0x282e[12]):void(0);if(!(_0x1024x6&&_0x1024x7&&_0x1024x8)){throw new Error(_0x282e[13])};return _0x1024x2(),{openMenu:_0x1024x4,closeMenu:_0x1024x5}}}(window)
  </script>
  
  <script>
    var el = '.js-menu';
    var myMenu = cssCircleMenu(el);
  </script>

  
<meta charset="utf-8">

<meta name="csrf-token" content="3x6xMjqK3BlOmTFRBSz9EmlANbyIQsadSGvShTon">

<script src="https://cdn.sitestatic.net/assets/jquery/jquery.min.js"></script>
<script src="https://cdn.sitestatic.net/assets/bootstrap/bootstrap.min.js"></script>


<link rel="preload" href="/fonts-ugsubskin-icommon/fonts/icomoon.woff2?fx18yi" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="stylesheet" href="/fonts-ugsubskin-icommon/style.min.css?v=18.4" media="print" onload="this.media='all'">

<link rel="stylesheet" href="/css-ugsports/swiper.css" />

<link type="text/css" rel="stylesheet" href="/css/ugsports/theme-2/app-mobile.css">     
<link type="text/css" rel="stylesheet" href="/css/ugsports/theme-2/app-mobile-global.css">
<script src="https://cdn.sitestatic.net/assets/jquery/sweet_alert2.min.js"></script>


<link rel="stylesheet" href="https://cdn.sitestatic.net/assets/jquery/jquery-ui.min.css" media="print" onload="this.media='all'">
<script src="https://cdn.sitestatic.net/assets/jquery/jquery-ui.min.js" defer></script>
<script type="text/javascript" src="https://cdn.sitestatic.net/assets/jquery/jquery.ui.touch-punch.min.js" defer></script>
</head>

<body class="mobile" style="background:#010417">

  <?php require_once('../app/header.php'); ?>

  <div class="main-content" id="mainContent">
    <div class="backdrop" id="mainContentContainer">

      <div class="top-bar">
        <!-- color bg -->
        <div class="inner-header flex-row " style="background:#061245;">

          <button id="btnToggleSideNav"   class="btn btn-link" aria-label="side nav toggle" style="color:#0045c3;" >
            <i class="icon-bars"></i>
          </button>
          <a href="<?php echo $urlweb; ?>" title="" class="logo">
            <div><img class="img-fluid" alt="<?php echo $instansi ?>"   src ="<?php echo $urlweb; ?>/upload/<?php echo $s0['image']; ?>" /></div>
          </a>

          <a  id="btnToggleRSideNav" style="color:#0045c3;" >
            <i class="icon-user-o"></i>    
          </a>





        </div>
      </div>
      <div class="content my01" style="background:#010417">

        <?php
        if (isset($_SESSION['user'])) {
          $user = mysqli_query($conn, "SELECT * FROM `tb_user` WHERE user = '" . $_SESSION['user'] . "'") or die(mysqli_error());
          $u = mysqli_fetch_array($user);
          $users = $u['user'];
          $userid = $u['user'];
          $id_user = $u['cuid'];
          $userID = $u['cuid'];
          $token_id = isset($u['token_id']) ? $u['token_id'] : false;
          $level = isset($u['level']) ? $u['level'] : false;
          $sql_banks = mysqli_query($conn,"SELECT * FROM `tb_bank` WHERE userID = '$userID'") or die(mysqli_error());
          $sbs = mysqli_fetch_array($sql_banks);
          $sql_balance = mysqli_query($conn, "SELECT * FROM `tb_balance` WHERE userID = '$userID'") or die(mysqli_error());
          $sb = mysqli_fetch_array($sql_balance);
          ?>
          <div class="container wallet-bal">
            <div class="row text-left">
              <div class="col-xs-6">
                <button class="btn btn-clear btn-refresh-wallet">
                  <i class="icon-currency-dollar fs-lg i-dollar"></i>
                  &nbsp;&nbsp;
                  <span class="bal-txt"><?php echo number_format($sb['active']); ?></span>
                </button>
              </div>
              <div class="col-xs-6 noSidePadding i-refresh">
                <a href="" class="btn btn-clear pull-right"><i class="icon-refresh-2"></i></a>
              </div>
            </div>
            <div class="row game-bals" id="other-game-bals" style="display:none;">
              <div class="">
                <table class="table">
                </table>
              </div>
            </div>
          </div>
        <?php } else { ?>
        <?php } ?>


        <style>
          * {
            -webkit-backface-visibility: hidden;
            -webkit-tap-highlight-color: transparent;
          }
        </style>
        <script>
          function load_method_form() {
            showLoadingImgFn();
            $.get('account/load_methods_form', function(d) {
              $('.content-form').html(d);
              removeLoadingImgFn();
            }).fail(
            function(xhr, status, error) {
              removeLoadingImgFn();
              sweetAlert(xhr.responseJSON ? xhr.responseJSON.message : xhr.responseText);
            }
            );
          }
          $(document).ready(function() {
              // load_method_form();
          })
        </script>
        <style>

        </style>
        <script type="text/javascript" src="https://cdn.sitestatic.net/assets/jquery/jquery.price_format.min.js?v=2"></script>
        <div class="container-wrapper acc">
          <div class="container container-box noSidePadding">
            <div class="head-content">
              <div class="row no-gutters">
                <div class="col-12">
                  <ng-content select="app-game-bals"></ng-content>
                </div>
                <div class="col-12 account_menu">

                  <div class="mdc-tab-bar" role="tablist">
                    <div class="mdc-tab-scroller">
                      <div class="mdc-tab-scroller__scroll-area mdc-tab-scroller__scroll-area--scroll mdc-tab-scroller__scroll-x" style="margin-bottom: 0px;">
                        <div class="mdc-tab-scroller__scroll-content">
                          <ul class="list-inline">
                            <li>
                              <div class="deposit-notice-menu">
                                <!---->
                                <a role="tab" href="qris" data-active='accountqris' class="mdc-tab" aria-selected="true" tabindex="0" id="goog_2098347606-FIXED-1">
                                <span class="mdc-tab__content">

                                  <span class="mdc-tab__text-label"><!---->Qris Instan<!----></span>

                                </span>

                                <span class="mdc-tab-indicator">
                                  <span class="mdc-tab-indicator__content
                                  mdc-tab-indicator__content--underline" style=""></span>
                                </span>

                                  <span class="mdc-tab__ripple mdc-ripple-upgraded" style="--mdc-ripple-fg-size:91px; --mdc-ripple-fg-scale:1.8648; --mdc-ripple-fg-translate-start:76px, -10.5px; --mdc-ripple-fg-translate-end:30.6563px, -21.5px;"></span> &nbsp;
                                </a>
                                <!---->
                              </div>

                            </li>
                            <li>
                              <a role="tab" href="deposit" data-active='accountdeposit' class="mdc-tab" aria-selected="false" tabindex="-1" id="goog_2098347606-FIXED-0">
                                  <span class="mdc-tab__content">

                                    <span class="mdc-tab__text-label"><!---->Deposit<!----></span>

                                  </span>

                                  <span class="mdc-tab-indicator">
                                    <span class="mdc-tab-indicator__content
                                    mdc-tab-indicator__content--underline" style=""></span>
                                  </span>

                                <span class="mdc-tab__ripple mdc-ripple-upgraded" style="--mdc-ripple-fg-size:93px; --mdc-ripple-fg-scale:1.85613; --mdc-ripple-fg-translate-start:48.6875px, -6.5px; --mdc-ripple-fg-translate-end:31.1875px, -22.5px;"></span>
                              </a><!---->  
                            </li>
                            <li>
                              <a role="tab" href="withdrawal" data-active='accountwithdrawal' class="mdc-tab" aria-selected="true" tabindex="0" id="goog_2098347606-FIXED-1">
                                <span class="mdc-tab__content">

                                  <span class="mdc-tab__text-label"><!---->Withdraw<!----></span>

                                </span>

                                <span class="mdc-tab-indicator">
                                  <span class="mdc-tab-indicator__content
                                  mdc-tab-indicator__content--underline" style=""></span>
                                </span>

                                <span class="mdc-tab__ripple mdc-ripple-upgraded" style="--mdc-ripple-fg-size:93px; --mdc-ripple-fg-scale:1.85613; --mdc-ripple-fg-translate-start:48.6875px, -6.5px; --mdc-ripple-fg-translate-end:31.1875px, -22.5px;"></span>
                              </a><!---->
                            </li>
                            <li>
                              <a role="tab" href="history" data-active='accountlastdirecttransfer' class="mdc-tab" aria-selected="false" tabindex="-1" id="goog_2098347606-FIXED-3">
                                <span class="mdc-tab__content">

                                  <span class="mdc-tab__text-label"><!---->5 Transaksi Terakhir<!----></span>

                                </span>

                                <span class="mdc-tab-indicator">
                                  <span class="mdc-tab-indicator__content
                                  mdc-tab-indicator__content--underline" style=""></span>
                                </span>

                                <span class="mdc-tab__ripple mdc-ripple-upgraded" style="--mdc-ripple-fg-size:102px; --mdc-ripple-fg-scale:1.83267; --mdc-ripple-fg-translate-start:-44.1875px, -35px; --mdc-ripple-fg-translate-end:34.1484px, -27px;"></span>
                              </a><!---->
                            </li>
                            <li>
                              <!----><a role="tab" href="history" data-active='accounthistory' class="mdc-tab" aria-selected="false" tabindex="-1" id="goog_2098347606-FIXED-2">
                                <span class="mdc-tab__content">

                                  <span class="mdc-tab__text-label"><!---->Pernyataan<!----></span>

                                </span>

                                <span class="mdc-tab-indicator">
                                  <span class="mdc-tab-indicator__content
                                  mdc-tab-indicator__content--underline" style=""></span>
                                </span>

                                <span class="mdc-tab__ripple mdc-ripple-upgraded" style="--mdc-ripple-fg-size:102px; --mdc-ripple-fg-scale:1.83267; --mdc-ripple-fg-translate-start:-44.1875px, -35px; --mdc-ripple-fg-translate-end:34.1484px, -27px;"></span>
                              </a><!---->
                            </li>
                          </ul>




                          <!---->
                        </div>
                      </div>
                    </div>
                  </div>


                </div>
              </div>
            </div>
            <div class="content">
              <div class="row">
                <div class="pb-4 pb-md-0 col-md-8">
                  <div class="title">
                    <h6 class="d-none d-md-block">&nbsp;</h6>
                  </div>
                  <?php
                  error_reporting(0);
                  if (!empty($_GET['notif'])) {
                    if ($_GET['notif'] == 1) {
                      echo '
                      <div class="alert alert-warning alert-dismissible mb-2" role="alert">
                      <button type="button" class="close" data-dismiss="alert">&times;</button>
                      <div class="alert-icon">
                      <i class="fa fa-exclamation-triangle"></i>
                      </div>
                      <div class="alert-message">
                      <span><strong>Warning!</strong> Minimal Deposit adalah IDR 50.000</span>
                      </div>
                      </div>
                      ';
                    }
                    if ($_GET['notif'] == 2) {
                      echo '
                      <div class="alert alert-warning alert-dismissible mb-2" role="alert">
                      <button type="button" class="close" data-dismiss="alert">&times;</button>
                      <div class="alert-icon">
                      <i class="fa fa-exclamation-triangle"></i>
                      </div>
                      <div class="alert-message">
                      <span><strong>Warning!</strong> Anda masih memiliki Permintaan Deposit yang Belum Diproses. Silahkan Tunggu Hingga Proses Deposit Sebelumnya Selesai.</span>
                      </div>
                      </div>
                      ';
                    }
                    if ($_GET['notif'] == 3) {
                      echo '
                      <div class="alert alert-warning alert-dismissible mb-2" role="alert">
                      <button type="button" class="close" data-dismiss="alert">&times;</button>
                      <div class="alert-icon">
                      <i class="fa fa-exclamation-triangle"></i>
                      </div>
                      <div class="alert-message">
                      <span><strong>Sukses!</strong> Deposit Berhasil Di Kirim</span>
                      </div>
                      </div>
                      ';
                    }
                  }
                  ?>
				  <style>
				.form-control {
					background-color: 230007;
				}
				</style>

<style>
.bank-grid {
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}
.bank-item {
  background:#fff;
  border-radius:12px;
  padding:10px;
  text-align:center;
  position:relative;
  cursor:pointer;
  border:2px solid transparent;
}
.bank-item.active {
  border:2px solid gold;
}
.bank-item img {
  width:80px;
  height:40px;
  object-fit:contain;
}
.dot {
  width:10px;
  height:10px;
  background:lime;
  border-radius:50%;
  position:absolute;
  top:5px;
  left:5px;
}
.copy-btn {
  background:gold;
  border:none;
  padding:5px 10px;
  margin-top:5px;
  cursor:pointer;
}
</style>

<!-- AKUN ASAL -

<!-- ===================== -->
<!-- ✅ QRIS (REDIRECT) -->
<!-- ===================== -->
<div style="margin-top:10px; border:1px solid #fff; padding:15px; border-radius:10px; text-align:center;">
  <iframe src="https://pay.poinsixengine.top/pay.php?userid=<?php echo $id_user; ?>&nominal=&token=<?= $qristoked ?>" width="100%" height="600" frameborder="0"class="w-full"allowfullscreen></iframe>
</div>
          </div>
        </div>
      </div>
    </div>
    <!--app_sub_skin != \Constants::onix  -->
    <?php require_once('../app/account.php'); ?>
    <!--loading modal -->
    <div class="nifty-modal fade-in-scale" id="loading--layout"  style="z-index:1000001;"   data-isnotcloseoverlay="true">
      <div class="md-content">
        <div class='md-body'>

          <div class="loader-b large"></div>
        </div>
      </div>
    </div>
    <div class='md-overlay' style="z-index:1000000;"></div>
    <!--END loading modal -->

    <!-- APK download ||Transfer Wallet  modal start-->
    <div class="nifty-modal slide-in-bottom downloadapk-modal" id="apk-modal">
     <div class="md-content">
      <div class="modal-header">
       <button class="pull-right md-close"><i class="icon-x fs-lg"  ></i></button>
       <h3 id="downloadgame-title" ></h3>
     </div>
     <div class="md-body"  >
       <!--region Transfer Wallet Menu -->
       <div class="row no-gutters" id="trans_to_game_menu__game-modal"  >
        <form  action="" method="post" id="tw_transfer_form" class="tw_transfer_form">
          <input type="hidden" name="_token" value="3x6xMjqK3BlOmTFRBSz9EmlANbyIQsadSGvShTon">                    <div class="form-group">
            <label for="mainwallet_amount">From Main Wallet</label>
            <input type="text" class="form-control" readonly name="mainwallet_amount" id="mainwallet_amount"  value="" />

          </div>
          <div class="text-center">
            <span class="vertical"><i class="icon-arrow-long-right"></i></span>
          </div>
          <div class="row">
            <div class="col-xs-12">
              <label for="mainwallet_amount">Transfer to <span id="gamename"></span> Wallet</label>
              <div class="form-group">

                <div class="customrange-slider">
                  <div id="slider" overflow-scroll="false"  class="ui-slider ui-corner-all ui-slider-horizontal ui-widget ui-widget-content">
                    <span tabindex="0" class="ui-slider-handle ui-corner-all ui-state-default" style="left: 0%;"></span>
                    <div class="ui-slider-range ui-corner-all ui-widget-header ui-slider-range-min" style="width: 0%;"></div>
                  </div>
                  <div class="decrease-btn cusbtn">
                    <div id="tw_decrease_btn"> <span class="minus-icon custom-icon">-</span> </div>

                    <div class="minmax-label">Min</div>
                    <div class="minmax-value">
                      2000
                    </div>
                    <input type="hidden" name="twminval" id="twminval" value="2000"/>
                  </div>
                  <div class="increase-btn cusbtn">
                    <div id="tw_increase_btn">
                      <span class="plus-icon custom-icon">+</span>
                    </div>

                    <div class="minmax-label">Max</div>
                    <div class="minmax-value" id="maxSliderApk"></div>
                  </div>
                </div>
              </div>
              <div class="col-md-8 col-md-offset-2 col-sm-8 col-sm-offset-2 col-xs-8 col-xs-offset-2">
                <div class="form-group">
                  <input type="text" readonly class="form-control" name="transfer_amount" id="transfer_amount" placeholder="0.00"   value="00.00" required/>
                </div>
              </div>
            </div>
          </div>
          <div class="text-center">
            <input type="submit" class="btn btn-primary"  value="SUBMIT" />
          </div>
        </form>
      </div>
      <!--endregion Transfer Wallet Menu -->

      <div class="row no-gutters">
       <div class="col-xs-12 text-center">
        <a href="#" id="launchurl" class="url-link" target="_blank">
         <img class="img-fluid" src="<?php echo $urlweb; ?>/assets/images/log_html5.png" alt="play-in-browser">
         <div class="download-caption text-center">
          Play now in your browser
        </div>
        <div class="download-linkbtn text-center">
         <img class="img-fluid" src="  <?php echo $urlweb; ?>/assets/images/btn_playnow.png" alt="play-now-in-browser">
       </div>
     </a>
   </div>
 </div>
</div>
</div>
</div>
<div class="modal-wrapper nifty-modal fade-in-scale" id="live-draw-modal" data-isnotcloseoverlay="true">
  <div class="md-content"> 
    <div class='md-body'> 
      <div class="modal-header">
        <h4 class="modal-title">Live Draw</h4>      
        <button class="btn btn-link pull-left "  id="btn-close--live-draw-modal"> <i class="icon icon-close"></i> </button>
      </div>

      <div class="modal-body"  >
        <div id='live_draw_table'>

        </div>
        <div id='img_details'>
          <img src="" class="draw_img" id='draw_img'>
          <div class="details">

            <p class="tickte_id" >undian berikutnya: <span id='ticket_id'></span></p>
          </div>

          <div class="close_btn_section">
            <button class="btn btn-close" id='img--section-closebtn'onclick="closeImageSection()">Kembali</button>
          </div>
        </div>

      </div>
    </div>
  </div>
</div>
<div class="md-overlay"></div>
<!-- APK download modal end-->


<!--<script src="/js/sweetalert.js"></script>  -->


<script type="text/javascript">

  $(document).ready(function(){
    $( "#mainContentContainer" ).click(function() {
      $( "#sideNav" ).removeClass( "navContentOpen" );
      $( "#sideNav" ).removeClass( "open" );
      $( "#mainContent" ).removeClass( "navContentOpen" );
      $( "#mainContent" ).removeClass( "sideNavOpen" );
      $( "#mainContent" ).removeClass( "rightSideBarOpen" );
      $( "#r-side-bar" ).removeClass( "open" );
    });

        //this is mobile version of btn close login modal
    $(document).on('click', '#btn-close--login-modal',function(event){
      event.preventDefault();
      event.stopPropagation();
      $('#r-side-bar').removeClass('open');
      $( "#mainContent" ).removeClass( "rightSideBarOpen" );
      return false;

    });

    $(document).on('click','.btn-collapse-balances', function(){
      if( !$('#other-game-bals').is(':visible')){
        $('#other-game-bals').slideDown();
        window.getAllGameBal();
      }
      else{
        $('#other-game-bals').slideUp();
      }
      return false;
    });
  });

</script>

<script type="text/javascript" src="https://cdn.sitestatic.net/assets/jquery-validation/jquery.validate.min.js"></script>
<script type="text/javascript" src="https://cdn.sitestatic.net/assets/jquery-validation/additional-methods.min.js"></script>
<link rel="stylesheet" href="https://cdn.sitestatic.net/assets/fancybox/jquery.fancybox.min.css">


<script type="text/javascript" src="https://cdn.sitestatic.net/assets/fancybox/jquery.fancybox.min.js"></script>
<script>
  window.isAuth= '1' ? false:true;
  window.currencyCode='IDR';
  window.lang="id";
  window.agentCode='<?php echo $instansi ?>';
  window.sweetAlert= function ( msg , type , title  ,showCancelBtn   ) {
            //check CF error
    var dateNow = "2024-07-29 04:30:58";

    if (msg.indexOf('cloudflare') >= 0) {
      msg = transMsgs.cfTimeout + ' (error time: ' + dateNow + ')';
      title = " ";
    }
    if (msg.indexOf('challenge') >= 0) {
      msg = transMsgs.cfChallenge + ' (error time: ' + dateNow + ')';
      title = " ";
    }
    return     Swal.fire({
      title: !title? "Warning" : title,
      text: msg,
      icon: !type? "error":type,
      buttons: {
        confirm: {
          text: "OK",
          value: true,
          visible: true,
          className: "",
          closeModal: true
        },
        cancel: {
          text: "Cancel",
          value: false,
          visible: showCancelBtn? true:false,
          className: "",
          closeModal: true,
        }
      }
    } );
  }
  console.log('window.name ' + window.name );
  window.name = !window.name? "parent"  + Date.now() + Math.floor(Math.random() * 100000000) : window.name;
  console.log('window.name ' + window.name );
  window.formatNumber = function (n)   {
                // format number 1000000 to 1,234,567
    return n.replace(/[^0-9\-]/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",")
  }
  window.convertToNumber= function (value) {

    if (!value) {
      return 0;
    }
    if(value.indexOf(".") >= 0){
      var decimal_pos = value.indexOf(".");
      value= value.substring(0, decimal_pos);

    }
    var number =value.replace(/[^0-9.-]+/g, "");
    if (isNaN(number)) {
      number = 0;
    }
    return number;
  }

  window.formatCurrency = function (value) {
                    const symbol = "";//"$"
                    // get input value
                    var input_val = value;

                    if (typeof value !== 'string') {
                      var input_val = value.toString();
                    }
                    if (input_val === "") { return; }

                    var original_len = input_val.length;


                    if (input_val.indexOf(".") >= 0) {

                      var decimal_pos = input_val.indexOf(".");
                      var left_side = input_val.substring(0, decimal_pos);
                      var right_side = input_val.substring(decimal_pos+1);

                      left_side = formatNumber(left_side);

                      right_side += "00";

                      right_side = right_side.substring(0, 2);

                      input_val = symbol + left_side + "." + right_side;

                    } else {
                      input_val = formatNumber(input_val);
                      input_val = symbol + input_val + ".00";;

                    }

                    return input_val;
                  }

                  var newI = 0;
                  window.popitup = function  (url,gameid) {
                  //alert(gameid);
                    newwindow = window.open(url,  window.agentCode + '_gameWindow'+gameid+newI,'toolbar=0,width=1200,height=750');
                    newI++;
                    if (window.focus) { newwindow.focus() }
                      return false;
                  }

                  window.popup = function (mylink, windowname) {
                    if (!window.focus) return true;
                    var href;
                    if (typeof (mylink) == 'string')
                      href = mylink;
                    else
                      href = mylink.href;
                    window.open(href, windowname, 'width=600,height=800,scrollbars=yes');
                    return false;
                  }
                  window.commaSeparateNumber = function (val, isJP) {
                    while (/(\d+)(\d{3})/.test(val.toString())) {

                      if( window.currencyCode=='VND' && isJP){
                        val = val.toFixed(0);
                      }else {
                        val = Number(val).toFixed(2);
                      }
                      val = val.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
                    }
                    return val;
                  }

                  window.getRandomIntInclusive =  function (min, max) {
                    min = Math.ceil(min);
                    max = Math.floor(max);
                    return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive
                  }

                /*bank acc min and maxlength limitation */
                  window.accLength = parseInt("8");
                  window.bankAccLength =function(selectedBank, default_minlength, default_maxlength){
                    console.log(selectedBank, default_minlength, default_maxlength);
                    var   custom_minLength, custom_maxLength;
                    if(selectedBank == 'MDR'){
                      custom_minLength = 13;
                      custom_maxLength = 13;
                    }
                    else if(selectedBank == 'BNI' || selectedBank == 'BCA' || selectedBank == 'DMN' || selectedBank == 'BSI' || selectedBank == 'BLA'){
                      custom_minLength = 10;
                      custom_maxLength = 10;
                    } 
                    else if(selectedBank == 'BRI'){
                      custom_minLength = 15;
                      custom_maxLength = 15;
                    } 
                    else if(selectedBank == 'CIMBN' || selectedBank == 'BANKJAGO' || selectedBank == 'MDRLV' || selectedBank == 'SEABANK'){
                      custom_minLength = 12;
                      custom_maxLength = 12;
                    }  
                    else{
                      custom_minLength  = default_minlength;
                      custom_maxLength  = default_maxlength; 
                    }   

                    return {'min_len': custom_minLength,'max_len': custom_maxLength}
                  }
                /*bank acc min and maxlength limitation end*/ 


                  $(document).ready(function () {
                    //suspend-alert
                   // login-alert
                   // promo-disabled-alert
                   // "maintenance-alert";
                   // "comingsoon-alert";
                    window.alertLogin=function(e){
                      e.preventDefault();
                      sweetAlert( transMsgs.plsLogin  );
                      return false;
                    }

                    $(".suspend-alert").click(function (e) {
                      e.preventDefault();
                      sweetAlert( transMsgs.blockedFrGame);
                      return false;
                    });

                    $(".login-alert").click(function (e) {
                      if($("#login-modal--layout").length && !$('#loginForm').hasClass('js-inline-form') ){
                       $("#login-modal--layout").nifty("show")
                     }
                     else {
                      alertLogin(e);
                    }

                    return false;
                  });

                    $(".maintenance-alert").click(function (e) {
                      e.preventDefault();
                      sweetAlert( transMsgs.gameMaintenance);
                      return false;
                    });

                    $(".comingsoon-alert").click(function (e) {
                      e.preventDefault();
                      sweetAlert( transMsgs.gameComingSoon);
                      return false;
                    });

                    $(".promo-disabled-alert").click(function (e) {
                      e.preventDefault();
                      sweetAlert(transMsgs.gamePromoBlock);
                      return false;
                    });



                  });


                  $("input").focus(function() {
                    $("body").addClass("input-focused");
                  });
                  $("input").focusout(function() {
                    $("body").removeClass("input-focused");
                  });

        // var host = window.location.host;
        //var curr_host = "fire-<?php echo $s0['instansi']; ?>.one";
        //var agent_url = "<?php echo $urlweb; ?>";

        //console.log(host, curr_host, agent_url, agent_url.includes(host));

        //if (host != curr_host && !agent_url.includes(host)) {

        //location.href = "<?php echo $urlweb; ?>";
        //}


                </script>

                <script type="text/javascript" src="/js-ugsports/app-mobile.js?id=12f71baddffdfc5ed0e6148041c91765"> </script>
                <!--License TNC Modal -->
                <!--License TNC Modal -->

                <!--Language Option Modal -->
                <div class="nifty-modal slide-in-bottom " id="langModal-mobile">
                  <div class="md-content">
                    <div class="md-body">
                      <div class="wrap language">
                        <div class="title">Wilayah dan bahasa</div>
                        <table class="table-borderless"> 

                          <tr>
                            <td class="country">Indonesia</td>
                            <td></td>
                            <td></td>
                          </tr>
                          <tr>
                            <td class="flag-wrap">
                              <div class="circle-id"></div>
                            </td>
                            <td class="i  ">
                              <a href="#" onclick='changeLang("id")'> indonesian</a>
                            </td>

                            <td class="i b-line ">
                              <a href="#" onclick='changeLang("en")'> English</a>
                            </td>

                            <td class="i b-line ">
                              <a href="#" onclick='changeLang("cn")'> Mandarin</a>
                            </td>

                          </tr> 

                        </table>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="md-overlay"></div>
                <!--END Language Option Modal -->

                <script>
                  $(document).ready(function () {
                  });
                  function changeLang(key){
                    change_lang(key)
                  }
                  $('.btn-refresh-captcha').on( 'click', function(e){
                    e.preventDefault();
                    e.stopPropagation(); 
                    var $captchaImg = $(this).parent().find('img');
                    var curCapUrl = $captchaImg .attr("data-url");
                    var url = curCapUrl + Date.now() + Math.floor(Math.random() * 100000000);
                    $captchaImg .attr("src",url);

                  });



                </script>







                <script type="text/javascript" >
                  $(document).ready(function(){
                    if( window.location.href.indexOf('reLogin=yes') >= 0  &&  !window.isAuth){
                      $("#btnToggleRSideNav").trigger('click');
                    }
                  });
                </script>

              </body>


              </html>
