<?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 class="tab-content">

    <div id="dashboard_wrap" class="tab-pane fade in active">
        <div class="row" style="margin-bottom:0px">
            <div class="col-xs-3" style="padding-right:2px">
                <a class="btn btn-default btn-block " href="index.php"><span class="glyphicon glyphicon-calendar"></span>Statement</a>
            </div>
            <div class="col-xs-3" style="padding-right:1px; padding-left: 1px;">
                <a class="btn btn-default btn-block active" href="history.php"><span class="glyphicon glyphicon-calendar"></span>History</a>
            </div>
            <div class="col-xs-3" style="padding-right:1px; padding-left: 2px;">
                <a class="btn btn-default btn-block " href="memo.php"><span class="glyphicon glyphicon-edit"></span>Memo<span class="badge badgeTotal" style="margin-left:5px; margin-right:10px; font-size:9px; font-weight:bold"></span></a>
            </div>
            <div class="col-xs-3" style="padding-left:2px">
                <a class="btn btn-default btn-block " href="refferal.php"><span class="glyphicon glyphicon-user"></span>Referal</a>
            </div>
        </div>
        <div class="row" style="margin-bottom:10px">
            <div class="col-xs-3" style="padding-right:2px">
                <a class="btn btn-default btn-block " href="deposit.php"><span class="glyphicon glyphicon-import"></span>Deposit</a>
            </div>
            <div class="col-xs-3" style="padding-left:1px; padding-right:1px;">
                <a class="btn btn-default btn-block " href="withdraw.php"><span class="glyphicon glyphicon-export"></span>Withdraw</a>
            </div>
            <div class="col-xs-3" style="padding-left:2px; padding-right:1px">
                <a class="btn btn-default btn-block " href="rekening.php"><span class="glyphicon glyphicon-briefcase"></span>Rekening<span style="position:absolute; font-size: 10px; margin-top: -8px; margin-left:-85px">⭐</span></a>
            </div>
            <div class="col-xs-3" style="padding-left:2px">
                <a class="btn btn-default btn-block " href="password.php"><span class="glyphicon glyphicon-user"></span>Password</a>
            </div>
        </div>

        <div id="transaksi">
            <div class="content" style="margin:0px !important; width:100% !important">
                <div class="panel panel-danger">
                    <div class="panel-heading"><strong><span class="glyphicon glyphicon-tasks"></span>History Transaksi</strong>
                        <span style="float:right; margin-top:-4px; width:245px; display:inline">
                            <form class="form-group-sm">
                                <label style="float:left; margin-top:5px; margin-right:10px;">Filter</label>
                                <select class="form-control" id="historyfilter" style="width:200px; float:right">
                                    <option value="">Semua</option>
                                    <option value="depowd">Deposit/Withdraw</option>
                                    <option value="log">Login/Logout/Ganti Password</option>
                                    <option value="togel">Transaksi Togel</option>
                                    <option value="pp">Transaksi Pragmatic</option>
                                    <option value="pg">Transaksi PGSoft</option>
                                    <option value="hb">Transaksi Habanero</option>
                                    <option value="jg">Transaksi Joker Gaming</option>
                                    <option value="sg">Transaksi Spade Gaming</option>
                                    <option value="jl">Transaksi JILI</option>
                                    <option value="fs">Transaksi FastSpin</option>
                                    <option value="ps">Transaksi PlayStar</option>
                                    <option value="cq">Transaksi CQ9</option>
                                    <option value="mg">Transaksi Micro Gaming</option>
                                    <option value="ttg">Transaksi TopTrend Gaming</option>
                                    <option value="ppl">Transaksi Pragmatic Live</option>
                                    <option value="ion">Transaksi ION Casino</option>
                                    <option value="evo">Transaksi Evolution</option>
                                    <option value="sx">Transaksi Sexy Gaming</option>
                                    <option value="ab">Transaksi AllBet</option>
                                    <option value="sa">Transaksi SA GAming</option>
                                    <option value="mgl">Transaksi Micro Gaming Live</option>
                                    <option value="og">Transaksi Opus Live</option>
                                    <option value="sbolc">Transaksi SBO Casino</option>
                                    <option value="sb">Transaksi Saba Sport</option>
                                    <option value="sbo">Transaksi SBO Sport</option>
                                    <option value="rtogel">Referal Togel</option>
                                    <option value="rpp">Referal Pragmatic</option>
                                    <option value="rpg">Referal PGSoft</option>
                                    <option value="rhb">Referal Habanero</option>
                                    <option value="rjg">Referal Joker Gaming</option>
                                    <option value="rsg">Referal Spade Gaming</option>
                                    <option value="rjl">Referal JILI</option>
                                    <option value="rfs">Referal FastSpin</option>
                                    <option value="rps">Referal PlayStar</option>
                                    <option value="rcq">Referal CQ9</option>
                                    <option value="rmg">Referal Micro Gaming</option>
                                    <option value="rttg">Referal TopTrend Gaming</option>
                                    <option value="rppl">Referal Pragmatic Live</option>
                                    <option value="rion">Referal ION Casino</option>
                                    <option value="revo">Referal Evolution</option>
                                    <option value="rsx">Referal Sexy Gaming</option>
                                    <option value="rab">Referal AllBet</option>
                                    <option value="rsa">Referal SA GAming</option>
                                    <option value="rmgl">Referal Micro Gaming Live</option>
                                    <option value="rog">Referal Opus Live</option>
                                    <option value="rsbolc">Referal SBO Casino</option>
                                    <option value="rsb">Referal Saba Sport</option>
                                    <option value="rsbo">Referal SBO Sport</option>

                                    <option value="dll">Bonus/Promo/Freebet</option>
                                </select>
                            </form>
                        </span>
                    </div>
                    
                    <div class="panel-body" style="font-size:11px">
                        <table class="table table-striped table-hover" width="100%">
                            <thead>
                                <tr>
                                    <th style="width:25px">No</th>
                                    <th style="width:200px">Tanggal</th>
                                    <th style="width:70px">Jenis</th>
                                    <th>Deskripsi</th>            
                                    <th style="width:70px; text-align:right">Balance</th>
                                </tr>
                            </thead>
                                <tbody>
                                <?php
                                   $counter = 1;
                                $approvedCounter = 1; // Menambahkan counter untuk baris dengan status Approved
                                $sql_transaksi = mysqli_query($conn,"SELECT * FROM `tb_transaksi` WHERE userID = '$userID' AND jenis IN(1,2,7) ORDER BY cuid DESC") or die(mysqli_error());
                                while ($st = mysqli_fetch_assoc($sql_transaksi)) {
                                    $Tanggal = $st['date'];
                                    $destination = $st['metode'];
                                    $status = $st['status'];
                                    $total = $st['total'];
                                    echo '<tr>';
                                    echo '<td>' . $counter . '</td>';
                                    echo '<td class="text-WHITE" style="vertical-align:middle">' . $Tanggal . '</td>';

                                    // Tambahkan kondisi untuk menampilkan status deposit yang sesuai
                                    if($st['jenis'] == 1){
                                      echo '<td class="text-WHITE" style="vertical-align:middle">DEPOSIT</td>';

                                  }
                                  

                              if($st['jenis'] == 1){
                                  if($st['status'] == 0){
                                    echo '<td style="vertical-align:middle"> <a href="#" class="text-white badge badge-success w-100 p-2">Menunggu</td>';
                                }
                                else if($st['status'] == 1){
                                     echo '<td style="vertical-align:middle"><a href="#" class="text-success badge badge-success w-100 p-2">Berhasil</td>';
                                }
                                else if($st['status'] == 2){
                                     echo '<td style="vertical-align:middle"><a href="#" class="text-danger badge badge-success w-100 p-2">Di Tolak</td>';
                                }
                            }
                            else {
                                echo '<td class="text-WHITE" style="vertical-align:middle">withdraw</td>';
                              if($st['status'] == 0){

                                echo '<td style="vertical-align:middle"> <a href="#" class="text-white badge badge-success w-100 p-2">Menunggus</td>';
                            }
                            else if($st['status'] == 1){
                               echo '<td style="vertical-align:middle"><a href="#" class="text-success badge badge-success w-100 p-2">Berhasil</td>';
                            }
                            else if($st['status'] == 2){
                                echo '<td style="vertical-align:middle"><a href="#" class="text-danger badge badge-success w-100 p-2">Di Tolak</td>';
                            }

                        }
                              
                        
                                   echo '<td class="text-success" style="vertical-align:middle">' . $total . '</td>';
                                    
                                    echo '</tr>';

                                    $counter++;
                                }
                                
                                ?>
                            </tbody>
                            
                          </table>
                </div>
            </li>

    </ul>
    

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



</div>
</div>


<div style="margin-top:20px">

    <div class="well well-sm" style="padding-top: 5px; padding-bottom:2px;">
        <marquee><span class="broadcast" style="color: #white; width: 100%"><?php echo $s0['news']; ?></span></marquee>
    </div>
    <div class="well well-sm bankOnline" style="margin-top:-10px; text-align:center"><span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>BCA</strong> : <span class="text-success">ONLINE</span></span>
        <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>Mandiri</strong> : <span class="text-success">ONLINE</span></span>
        <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>BNI</strong> : <span class="text-success">ONLINE</span></span>
        <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>BRI</strong> : <span class="text-success">ONLINE</span></span>
        <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>CIMB</strong> : <span class="text-success">ONLINE</span></span>
        <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>PANIN</strong> : <span class="text-success">ONLINE</span></span>
        <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>DANA</strong> : <span class="text-success">ONLINE</span></span>
        <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>OVO</strong> : <span class="text-success">ONLINE</span></span>
        <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>GOPAY</strong> : <span class="text-success">ONLINE</span></span>
        <span style="margin-left:10px; margin-right:10px; white-space:nowrap"><strong>LinkAja</strong> : <span class="text-success">ONLINE</span></span>
    </div>
   <div class="well well-sm" style="margin-top:-10px; padding-bottom:2px;">  
  <marquee>
    <span class="listkeluaran" style="white-space:nowrap">
      <span style="margin-left:30px;">
        <span style="color:#FC0">HK SIANG </span>
        <span class="tgl" style="color:#CCC"></span>
        <strong>2757</strong>
      </span>

      <span style="margin-left:30px;">
        <span style="color:#FC0">SG METRO </span>
        <span class="tgl" style="color:#CCC"></span>
        <strong>5708</strong>
      </span>

      <span style="margin-left:30px;">
        <span style="color:#FC0">SYDNEY </span>
        <span class="tgl" style="color:#CCC"></span>
        <strong>4454</strong>
      </span>

      <span style="margin-left:30px;">
        <span style="color:#FC0">HAIPHONG </span>
        <span class="tgl" style="color:#CCC"></span>
        <strong>7076</strong>
      </span>

      <span style="margin-left:30px;">
        <span style="color:#FC0">SINGAPORE </span>
        <span class="tgl" style="color:#CCC"></span>
        <strong>1263</strong>
      </span>

      <span style="margin-left:30px;">
        <span style="color:#FC0">MALAYSIA </span>
        <span class="tgl" style="color:#CCC"></span>
        <strong>7084</strong>
      </span>

      <span style="margin-left:30px;">
        <span style="color:#FC0">MACAU </span>
        <span class="tgl" style="color:#CCC"></span>
        <strong>5292</strong>
      </span>

      <span style="margin-left:30px;">
        <span style="color:#FC0">QATAR </span>
        <span class="tgl" style="color:#CCC"></span>
        <strong>2516</strong>
      </span>

      <span style="margin-left:30px;">
        <span style="color:#FC0">HONGKONG </span>
        <span class="tgl" style="color:#CCC"></span>
        <strong>6022</strong>
      </span>

      <div style="clear:both"></div>
    </span>
  </marquee>
</div>

<script>
  // Ambil tanggal hari ini
  const today = new Date();
  const dd = String(today.getDate()).padStart(2, '0');
  const mm = String(today.getMonth() + 1).padStart(2, '0');
  const formattedDate = dd + "/" + mm;

  // Update semua span class="tgl"
  document.querySelectorAll(".tgl").forEach(el => {
    el.textContent = formattedDate + " ";
  });
</script>

</div>

<a class="btn btn-danger btn-block" href="/" role="button" style="font-weight:bold; margin-top:20px"><span class="glyphicon glyphicon-menu-left"></span>Log out</a>

</div>





<div id="games_wrap" class="tab-pane fade in ">

</div>
<div class="well well-sm container-fluid text-center" style="margin:0px; padding:5px; border-radius:0px; padding-bottom: 55px">
   © 2018 - 2025 Copyright <?php echo $s0['instansi']; ?>. All Rights Reserved.
</div>
<?php include('footer.php'); ?>
<script>
  $(document).ready(function() {
      //Default data table
      $('.default-datatable').DataTable();
  });
</script>
</body>
</html>


