<?php
    include('session.php');
    
    ?>
<html lang="en">
    <head>
        <title><?php echo $s0['instansi']; ?>: User Area</title>
        <!-- Meta -->
        <meta charset="utf-8">
        <!-- <meta content="width=device-width, initial-scale=1.0" name="viewport"> -->
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, height=device-height, initial-scale=0.65, maximum-scale=1, minimum-scale=0.65">
        <meta name="theme-color" content="#272b30">
        <!-- Favicon -->
        <link rel="icon" type="image/png" href="<?php echo $urlwebs; ?><?php echo $urlwebs; ?>/upload/favicon.png">
        <!-- CSS Global Compulsory -->
        <link rel="stylesheet" href="<?php echo $urlwebs; ?>/assets/home/bootstrap.web.min.css">
        <link href="https://fonts.googleapis.com/css?family=Abel" rel="stylesheet">
        <style>
            .blink_me {
            animation: blinker 1s step-start infinite;
            }
            @keyframes blinker {
            20% {
            opacity: 0.2;
            }
            }
        </style>
        <!-- JS Global Compulsory -->
        <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
        <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
        <script src="<?php echo $urlwebs; ?>/js/4dv5.js"></script>
        <script>
            function secondtominute(d) {
                var m = Math.floor(d / (60));
                var s = d - (m * 60);
                if (s < 10) s = '0' + s;
                return m + ':' + s;
            }
        </script>
    </head>
    <?php include('uptop.php'); ?>
    <div class="clearfix"></div>
    <link rel="stylesheet" href="<?php echo $urlwebs; ?>/assets/home/m.css">
    <!-- MAIN TAB -->
    <?php include('navtab.php'); ?>
    
    
<div class="tab-content">
  <div id="games_wrap" class="tab-pane fade in ">
  </div>
  <div id="livegames_wrap" class="tab-pane fade in active">

    <!-- TAB PROVIDER -->
    <ul class="nav nav-pills grabgtab" style="font-size:16px; margin-bottom:0px; padding-bottom: 2px">
      <li class="active" id="tab_pragmatic" style="width:32%; font-weight:normal; margin-bottom:2px; margin-left:2px;">
        <a data-toggle="tab" href="#livegames_window_pragmatic">
          <span><img src="<?php echo $urlwebs; ?>/images/logopp (2).png" alt="" style="vertical-align:bottom; height:25px;">&nbsp;Pragmatic</span>
        </a>
      </li>
      <li id="tab_spribe" style="width:32%; font-weight:normal; margin-bottom:2px; margin-left:2px;">
        <a data-toggle="tab" href="#livegames_window_spribe">
          <span><img src="<?php echo $urlwebs; ?>/images/Desain_tanpa_judul_-_2025-09-16T200708.498-removebg-preview.png" alt="" style="vertical-align:bottom; height:25px;">&nbsp;Spribe</span>
        </a>
      </li>
      <li id="tab_gameart" style="width:32%; font-weight:normal; margin-bottom:2px; margin-left:2px;">
        <a data-toggle="tab" href="#livegames_window_gameart">
          <span><img src="<?php echo $urlwebs; ?>/images/gameartlogo.png" alt="" style="vertical-align:bottom; height:25px;">&nbsp;GameArt</span>
        </a>
      </li>
    </ul>

    <div style="height:10px; background-color:#FFF" class="grabgtabbottom"></div>

    <!-- TAB CONTENT -->
    <div class="tab-content">

      <!-- Pragmatic -->
      <div id="livegames_window_pragmatic" style="width:100%; margin-top:10px;" class="tab-pane fade in active">
        <div style="margin-top:0px;">
          <img src="<?php echo $urlwebs; ?>/images/logopp (2).png" height="30" alt="" style="vertical-align:text-bottom; margin-right:5px">
          <span style="font-size:16px; font-weight:bold">Pragmatic Play</span>
        </div>
        <hr style="margin-top:5px; height:2px">
        <div class="text-center">
         <?php
$sql = mysqli_query($conn,"SELECT * FROM tb_game WHERE provider_code='PRAGMATIC' AND status=1 ORDER BY sort ASC") or die(mysqli_error($conn));
while($s = mysqli_fetch_array($sql)){
  $playUrl = isset($_SESSION['user']) ? $urlweb.'/m/gameplay.php?provider='.$s['provider_code'].'&gamecode='.$s['game_code'] : $urlweb.'/login/';
?>
  <div style="height:145px; width:175px; display:inline-block; text-align:center; margin:5px;">
    <a href="<?php echo $playUrl; ?>">
      <img src="<?php echo $s['banner']; ?>" style="width:165px">
      <div style="margin-top:5px;"><?php echo $s['game_name']; ?></div>
    </a>
  </div>
<?php } ?>
        </div>
      </div>

     <!-- Spribe -->
<div id="livegames_window_spribe" style="width:100%; margin-top:10px;" class="tab-pane fade">
  <div style="margin-top:0px;">
    <img src="<?php echo $urlwebs; ?>/images/Desain_tanpa_judul_-_2025-09-16T200708.498-removebg-preview.png" height="30" alt="" style="vertical-align:text-bottom; margin-right:5px">
    <span style="font-size:16px; font-weight:bold">Spribe</span>
  </div>
  <hr style="margin-top:5px; height:2px">
  <div class="text-center">
    <?php
      // Ambil semua game Spribe yang aktif
     $sql = mysqli_query($conn,"SELECT * FROM tb_game WHERE provider_code='SPRIBE' AND status=1 ORDER BY sort ASC") 
    or die(mysqli_error($conn));
      
      if(mysqli_num_rows($sql) == 0){
          echo "<p>Tidak ada game Spribe tersedia</p>";
      }
      
     while($s = mysqli_fetch_array($sql)){
    $playUrl = isset($_SESSION['user']) ? 
        $urlweb.'/m/gameplay.php?provider='.$s['provider_code'].'&gamecode='.$s['game_code'] 
        : $urlweb.'/login/';
?>
<div style="height:145px; width:175px; display:inline-block; text-align:center; margin:5px;">
  <a href="<?php echo $playUrl; ?>">
    <img src="<?php echo $s['banner']; ?>" style="width:165px">
    <div style="margin-top:5px;"><?php echo $s['game_name']; ?></div>
  </a>
</div>
<?php } ?>
  </div>
</div>

      <!-- GameArt -->
<div id="livegames_window_gameart" style="width:100%; margin-top:10px;" class="tab-pane fade">
  <div style="margin-top:0px;">
    <img src="<?php echo $urlwebs; ?>/images/gameartlogo.png" height="30" alt="" style="vertical-align:text-bottom; margin-right:5px">
    <span style="font-size:16px; font-weight:bold">GameArt</span>
  </div>
  <hr style="margin-top:5px; height:2px">
  <div class="text-center">
    <?php
      // Ambil semua game GameArt yang aktif dari tb_game
      $sql = mysqli_query($conn,"SELECT * FROM tb_game WHERE provider_code='GAMEART' AND status=1 ORDER BY sort ASC") 
          or die(mysqli_error($conn));

      if(mysqli_num_rows($sql) == 0){
          echo "<p>Tidak ada game GameArt tersedia</p>";
      }

      while($s = mysqli_fetch_array($sql)){
        $playUrl = isset($_SESSION['user']) ? 
            $urlweb.'/m/gameplay.php?provider='.$s['provider_code'].'&gamecode='.$s['game_code'] 
            : $urlweb.'/login/';
    ?>
      <div style="height:145px; width:175px; display:inline-block; text-align:center; margin:5px;">
        <a href="<?php echo $playUrl; ?>">
          <img src="<?php echo $s['banner']; ?>" style="width:165px">
          <div style="margin-top:5px;"><?php echo $s['game_name']; ?></div>
        </a>
      </div>
    <?php } ?>
  </div>
</div>


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






    <div class="well well-sm container-fluid text-center" style="margin:0px; padding:5px; border-radius:0px; padding-bottom: 55px">
        © 2018 - 2023 Copyright <?php echo $s0['instansi']; ?>. All Rights Reserved.
    </div>
    <!--tampilan /m/ versi mobile bawah trakhir alias footer--><!--next halaman footer-->
    <?php include('footer.php'); ?>
</html>