<?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; ?>/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 id="games_wrap" class="tab-pane fade in active">

  <div id="launch_window" style="position:absolute; left:0px; top:0px; width:100%; height:100%; display:none">
    <iframe id="embedgameIframe" name="embedgameIframe" scrolling="no" width="100%" height="100%" src="pleaseWait.html" allowfullscreen="" frameborder="0" style="margin: 0; padding: 0; white-space: nowrap; border: 0; background-color:#272b30">
    </iframe>
  </div>

  <div id="game_window" style="width:100%;">

   <ul class="nav nav-pills grabgtab" style="padding-bottom:0px; font-size:16px; font-weight:normal; display:flex; flex-wrap:wrap; justify-content:center;">

  <li class="active" id="tab_pragmatic" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=PRAGMATIC" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/logopp (2).png" height="25" alt="">&nbsp;Pragmatic</span>
      </span>
    </a>
  </li>

  <li id="tab_pgsoft" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=PGSOFT" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/PGlogo.png" height="25" alt="">&nbsp;PGSoft</span>
    </a>
  </li>

  <li id="tab_habanero" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=HABANERO" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/hb.png" height="25" alt="">&nbsp;Habanero</span>
    </a>
  </li>

  <li id="tab_booongo" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=BOOONGO" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/booongologo.png" height="25" alt="">&nbsp;Booongo</span>
    </a>
  </li>

  <li id="tab_playson" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=PLAYSON" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/playsonlogo.png" height="25" alt="">&nbsp;Playson</span>
    </a>
  </li>

  <li id="tab_cq9" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=CQ9" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/cq9.png" height="25" alt="">&nbsp;CQ9</span>
    </a>
  </li>

  <li id="tab_evoplay" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=EVOPLAY" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/evoplaylogo.png" height="25" alt="">&nbsp;Evoplay</span>
    </a>
  </li>

  <li id="tab_toptrend" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=TOPTREND" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/ttg.png" height="25" alt="">&nbsp;TopTrend</span>
    </a>
  </li>

  <li id="tab_genesis" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=GENESIS" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/genesislogo.png" height="25" alt="">&nbsp;Genesis</span>
    </a>
  </li>

  <li id="tab_microgaming" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=MICROGAMING" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/mg.png" height="25" alt="">&nbsp;Microgaming</span>
    </a>
  </li>

  <li id="tab_redtiger" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=REDTIGER" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/redtigerlogo.png" height="25" alt="">&nbsp;RedTiger</span>
    </a>
  </li>

  <li id="tab_gmw" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=GMW" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/gmwlogo.png" height="25" alt="">&nbsp;GMW</span>
    </a>
  </li>

  <li id="tab_gameart" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=GAMEART" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/gameartlogo.png" height="25" alt="">&nbsp;GameArt</span>
    </a>
  </li>

  <li id="tab_hacksaw" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=HACKSAW" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/Desain_tanpa_judul_-_2025-09-16T195251.438-removebg-preview.png" height="25" alt="">&nbsp;Hacksaw</span>
    </a>
  </li>

  <li id="tab_naga" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=NAGA" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/Desain_tanpa_judul_-_2025-09-16T195850.293-removebg-preview (1).png" height="25" alt="">&nbsp;Naga</span>
    </a>
  </li>

  <li id="tab_spribe" style="flex:1 0 30%; margin:3px;">
    <a href="?games&head=games&provider=SPRIBE" style="padding-left:5px">
      <span><img src="<?php echo $urlwebs; ?>/images/Desain_tanpa_judul_-_2025-09-16T200708.498-removebg-preview.png" height="25" alt="">&nbsp;Spribe</span>
    </a>
  </li>

</ul>

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

        <div class="tab-content">


          <div id="games_window_pp" class="tab-pane fade in active">
            <ul class="nav nav-pills">
              <li style="width:20%" class="active"><a data-toggle="pill" href="#ppslot">✨ Slots</a></li>
              <li style="width:20%"><a data-toggle="pill" href="#pphot">🔥 Top 20</a></li>
              <li style="width:30%"><a data-toggle="pill" href="#ppspin">⭐ Fitur Beli FreeSpin</a></li>
              <li style="width:28%"><a data-toggle="pill" href="#pppoker">♣ Card &amp; Table</a></li>
            </ul>

            <div style="margin-top:10px; margin-right: 6px">
              <form method="GET" style="width:200px;  float:right;">
                <div class="input-group">

                  <label>Cari :</label>
                  <input type="text" name="cari">
                  <input type="submit" class="btn btn-primary btn-block"value="Cari">
                </div>
              </form>
              <?php 
              if(isset($_GET['cari'])){
               $cari = $_GET['cari'];
               echo '
               <div class="btn btn-primary" role="alert">
               <span class="alert-icon text-success ">
               <i class="ti ti-check ti-xs"></i>
               </span>
               Permainan yang di cari : <span> '. $cari .'</span>
               </div>
               ';
               
             }
             ?>
           </div>
           <div style="clear:both;"></div>
         </div>
         <div class="tab-content" style="margin-top:20px">
          <div id="ppslot" class="text-center tab-pane fade in active">

            <?php 
                if(isset($_GET['cari'])){
                 $cari = $_GET['cari'];
               }
            ?>

           <table border="1">
             <tr>
              <th>No</th>
              <th>Nama</th>
              <th>Spesialis</th>
              <th>Hari</th>
            </tr>
          <?php
// default ke PRAGMATIC kalau tidak ada parameter
$provider = isset($_GET['provider']) ? $_GET['provider'] : 'PRAGMATIC';

if(isset($_GET['cari'])){
  $cari = $_GET['cari'];
  $data = mysqli_query($conn,"SELECT * FROM tb_game 
                              WHERE provider_code='".mysqli_real_escape_string($conn,$provider)."' 
                              AND status=1 
                              AND game_name LIKE '%".$cari."%' 
                              ORDER BY sort ASC");
} else {
  $data = mysqli_query($conn, "SELECT * FROM tb_game 
                              WHERE provider_code='".mysqli_real_escape_string($conn,$provider)."' 
                              AND status=1 
                              ORDER BY sort ASC");  
}

while($d = mysqli_fetch_array($data)){
  if(isset($_SESSION['user'])){
    $playUrl = $urlweb.'/m/gameplay.php?provider='.$d['provider_code'].'&gamecode='.$d['game_code'];
  } else {
    $playUrl = $urlweb.'/login/';
  }
?>
  <div style="height:190px; width:170px;display:inline-block; text-align:center; vertical-align:top">
    <a href="<?php echo $playUrl; ?>">
      <img src="<?php echo $d['banner']; ?>" style="width:150px">
      <div style="text-align:center; margin-top:3px;"><?php echo $d['game_name']; ?></div>
    </a>
  </div>
<?php } ?>

        </div>
    </div>
    <div class="well well-sm container-fluid text-center" style="margin:0px; padding:5px; border-radius:0px; padding-bottom: 55px">
      © 2018 - 2024 Copyright <?php echo $s0['instansi']; ?>. All Rights Reserved.
    </div>
  }
  <?php include('footer.php'); ?>
</body>

</html>