<!DOCTYPE html>
<?php defined("BASEPATH") or exit("No direct script access allowed."); ?>
<?php
$start_time = microtime(TRUE); if (isset($_SESSION['user'])) {
	$check_notifications = $db->query("SELECT * FROM user_notifications WHERE username = '{$_SESSION['user']['username']}' ORDER BY created_at DESC LIMIT 5");
}
if(isset($_COOKIE['cookie_token'])) {
	$data = $db->query("SELECT * FROM users WHERE cookie_token = '{$_COOKIE['cookie_token']}'");
	if(mysqli_num_rows($data) > 0) {
	    $hasil = mysqli_fetch_assoc($data);
		$_SESSION['user'] = $hasil;
	}
}
?>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="theme-color" content="#2d3238">
    <meta http-equiv="refresh" content="90" >
    <meta name="title" content="<?= config('web','title_web');?> - Top Up Termurah Instant Buka 24 Jam">
    <meta name="description" content="<?= config('web','title_web');?> - Supplier Top Up Instant Game &amp; Voucher termurah, terpercaya, dan aman legal 100% open 24 Jam">
    <meta property="og:type" content="website">
    <meta property="og:url" content="index.html">
    <meta property="og:title" content="<?= config('web','title_web');?> - Top Up Termurah Instant Buka 24 Jam">
    <meta property="og:description" content="<?= config('web','title_web');?> - Supplier Top Up Instant Game &amp; Voucher termurah, terpercaya, dan aman legal 100% open 24 Jam">
    <meta property="og:image" content="favicon.ico">
    <meta name="robots" content="index, follow">
    <meta content="desktop" name="device">
    <meta name="author" content="<?= config('web','title_web');?>">
    <meta name="coverage" content="Worldwide">
    <meta name="apple-mobile-web-app-title" content="<?= config('web','title_web');?> - Top Up Termurah Instant Buka 24 Jam">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <link rel="icon" href="favicon.ico">
    <title><?= config('web','title_web');?> - Top Up Termurah Instant Buka 24 Jam</title>
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.1/dist/jquery.slim.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
    <link rel="stylesheet" href="/assets/scss/appp.css">
    <link rel="stylesheet" href="/assets/css/apps.css">
    <link rel="stylesheet" href="/assets/scss/chatbox.css">
    <link rel="stylesheet" href="/assets/scss/lynchstore.css">
    <link rel="stylesheet" type="text/css" href="/assets/css/buttons.bootstrap4.min.css">
	<link rel="stylesheet" type="text/css" href="/assets/css/dataTables.bootstrap4.min.css">
	<link rel="stylesheet" type="text/css" href="/assets/css/datatables.min.css">
	<link rel="stylesheet" type="text/css" href="/assets/css/extensions/dataTables.checkboxes.css">
	<link rel="stylesheet" type="text/css" href="/assets/css/responsive.bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="/assets/css/responsive.bootstrap4.min.css">
	<link rel="stylesheet" type="text/css" href="/assets/css/rowGroup.bootstrap4.min.css">
  	<link rel="shortcut icon" href="<?= opt_get('aWNvbi13ZWI=') ?>">
  	<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
  	<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> 
    <script src="https://use.fontawesome.com/6da2e1892f.js"></script>
    <script src="https://kit.fontawesome.com/99f8e55a96.js" crossorigin="anonymous"></script>
    <script src="/assets/js/app.js" type="text/javascript"></script>
    <style>
        .close {
            float: right;
            font-size: 1.5rem;
            font-weight: 700;
            line-height: 1;
            color: #000;
            text-shadow: 0 1px 0 #fff;
            opacity: .5;
            background: transparent;
            border: none;
        }
        .btn-group>.btn-group:not(:last-child)>.btn, .btn-group>.btn:not(:last-child):not(.dropdown-toggle), .input-group>.custom-file:not(:last-child) .custom-file-label, .input-group>.custom-file:not(:last-child) .custom-file-label::after, .input-group>.custom-select:not(:last-child), .input-group>.form-control:not(:last-child) {
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
        }
        .card .card-header {
            position: relative;
            display: -webkit-box;
            display: -webkit-flex;
            display: -ms-flexbox;
            display: flex;
            -webkit-box-align: center;
            -webkit-align-items: center;
            -ms-flex-align: center;
            align-items: center;
            -webkit-flex-wrap: wrap;
            -ms-flex-wrap: wrap;
            flex-wrap: wrap;
            -webkit-box-pack: justify;
            -webkit-justify-content: space-between;
            -ms-flex-pack: justify;
            justify-content: space-between;
            border-bottom: none;
        }
        .card .card-header .card-title {
            margin-bottom: 0;
        }
        .card .card-title {
            font-size: 1.285rem;
            margin-bottom: 1.53rem;
        }
        .btn, .card .card-title, .header-navbar .navbar-container .dropdown-language .selected-language {
            font-weight: 500;
        }
        .input-group>.custom-file, .input-group>.custom-select, .input-group>.form-control, .input-group>.form-control-plaintext {
            /* position: relative; */
            -webkit-box-flex: 1;
            -webkit-flex: 1 1 auto;
            -ms-flex: 1 1 auto;
            flex: 1 1 auto;
            width: 1%;
            min-width: 0;
            margin-bottom: 0;
        }
        .custom-file {
            position: relative;
            display: inline-block;
            width: 100%;
            height: 2.714rem;
        }
        .custom-file-input {
            position: relative;
            z-index: 2;
            width: 100%;
            height: 2.714rem;
            margin: 0;
            opacity: 0;
        }
        .custom-file-label {
            line-height: 1.75;
            height: 2.714rem!important;
        }
        .custom-control-label::before, .custom-file-label, .custom-select {
            -webkit-transition: background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,background 0s,border-color 0s;
            transition: background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,background 0s,border-color 0s;
        }
        .custom-file-label {
            left: 0;
            z-index: 1;
            font-weight: 400;
            background-color: #FFF;
            border: 1px solid #D8D6DE;
            border-radius: 0.357rem;
        }
        .custom-file-label, .custom-file-label::after {
            position: absolute;
            height: 2.714rem;
            padding: 0.438rem 1rem;
            line-height: 1.45;
            color: #6E6B7B;
            top: 0;
            right: 0;
        }
        .float-left {
            float: left!important;
        }
        .text-right {
            text-align: right!important;
        }
        .text-left {
            text-align: left!important;
        }
        .float-right {
            float: right!important;
        }
        .lynchstore-cek {
            font-size: 9px;
            font-style: italic;
            color: #BF3931;
        }
        a:hover {
        color: #BF3931;
        } 
        .btn-category {
        color: #ffffff !important;
        background-color: #B19973 !important;
    }

    .btn-category.active {
        color: #ffffff !important;
        background-color: #77684e !important;
    }
     .btn-category:hover {
    color: #ffffff !important;
        background-color: #ddc49c !important;
     }
    </style>
</head>
<body class="d-flex2 flex-column min-vh-100  text-white" style="background-color: rgb(45, 50, 56) !important">
    <header class="mb-5">
        <nav class="navbar navbar-expand-lg fixed-top text-white bg-dark navbar-dark shadow">
            <div class="container">
                <div class="d-flex">
                    <a class="navbar-brand" href="<?= base_url('id');?>">
                        <img src="<?= opt_get('aWNvbi13ZWI=') ?>" alt="LynchStore" class="logo-atas" style="border-radius:50%;">
                    </a>
                </div>
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo03" aria-controls="navbarTogglerDemo03" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse" id="navbarTogglerDemo03">
                    <ul class="navbar-nav ms-auto nav-stacked mt-2">
                        <li class="nav-item">
                            <a href="<?= base_url('id');?>" class="nav-link ">
                                <i class="fa fa-home"></i>
                                Home</a>
                        </li>
                        <li class="nav-item dropdown">
                        	<a href="#" class="nav-link dropdown-toggle" id="navUser" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                        		<i class="fas fa-cog"></i>
                        		<span id="header_username">Settings</span>
                        	</a>
                        	<ul class="dropdown-menu dropdown-menu-dark shadow mb-2" aria-labelledby="navUser">
                        	    <li><a class="dropdown-item text-white" href="/admin/setting/"><i class=" fa-regular fa-circle"></i> Umum</a></li>
                        	    <li><a class="dropdown-item text-white" href="/admin/setting/provider"><i class=" fa-regular fa-circle"></i> Provider</a></li>
                                <li><a class="dropdown-item text-white" href="/admin/setting/payment"><i class=" fa-regular fa-circle"></i> Payment Gateway</a></li>
                                <li><a class="dropdown-item text-white" href="/admin/setting/input"><i class=" fa-regular fa-circle"></i> Form Input</a></li>
                                <li><a class="dropdown-item text-white" href="/admin/setting/smtp"><i class=" fa-regular fa-circle"></i> Mailler Setting</a></li>
                        	</ul>
                        </li>
                        <li class="nav-item dropdown">
                        	<a href="#" class="nav-link dropdown-toggle" id="navUser" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                        		<i class="fas fa-cog"></i>
                        		<span id="header_username"> Mutasi</span>
                        	</a>
                        	<ul class="dropdown-menu dropdown-menu-dark shadow mb-2" aria-labelledby="navUser">
                        	    <li><a class="dropdown-item text-white" href="/admin/mutasi/account"><i class=" fa-regular fa-circle"></i> Account</a></li>
                        	    <li><a class="dropdown-item text-white" href="/admin/mutasi/"><i class=" fa-regular fa-circle"></i> Riwayat</a></li>
                        	    <li><a class="dropdown-item text-white" href="/admin/mutasi/mutasi"><i class=" fa-regular fa-circle"></i> Riwayat Saldo Member</a></li>
                        	</ul>
                        </li>
                        <li class="nav-item dropdown">
                        	<a href="#" class="nav-link dropdown-toggle" id="navUser" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                        		<i class="fas fa-gamepad"></i>
                        		<span id="header_username"> Produk</span>
                        	</a>
                        	<ul class="dropdown-menu dropdown-menu-dark shadow mb-2" aria-labelledby="navUser">
                        	    <li><a class="dropdown-item text-white" href="/admin/guest/harga"><i class=" fa-regular fa-circle"></i> Kelola Harga</a></li>
                        	    <li><a class="dropdown-item text-white" href="/admin/guest/layanan"><i class=" fa-regular fa-circle"></i> Kelola Layanan</a></li>
                        	    <li><a class="dropdown-item text-white" href="/admin/guest/product/"><i class=" fa-regular fa-circle"></i> Kelola Produk</a></li>
                        	    <li><a class="dropdown-item text-white" href="/admin/guest/gambar-produk"><i class=" fa-regular fa-circle"></i> Kelola Gambar</a></li>
                        	</ul>
                        </li>
                        <li class="nav-item">
                            <a href="/admin/guest/metode" class="nav-link ">
                                <i class="fas fa-credit-card"></i> Metode</a>
                        </li>
                        <li class="nav-item">
                            <a href="/admin/user/deposit/" class="nav-link ">
                                <i class="fas fa-dollar-sign"></i> Kelola Deposit</a>
                        </li>
                        <li class="nav-item">
                            <a href="/admin/guest/transaksi.php" class="nav-link ">
                                <i class="fa-solid fa-cart-shopping"></i> Kelola Transaksi</a>
                        </li>
                        <li class="nav-item">
                            <a href="/admin/setting/gift-skin" class="nav-link ">
                                <i class="fa-solid fa-cart-shopping"></i> Kelola Jadwal Gift</a>
                        </li>
                        <li class="nav-item">
                            <a href="/admin/user/" class="nav-link ">
                                <i class="fas fa-user"></i> Kelola User</a>
                        </li>
                        <?php if ($_SESSION['user']['level'] == "Admin" || $_SESSION['user']['level'] == "Member" || $_SESSION['user']['level'] == "Reseller" || $_SESSION['user']['level'] == "Vip"):?>
                      	<li class="nav-item dropdown">
                        	<a href="#" class="nav-link text-white dropdown-toggle" id="navUser" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                        		<i class="fas fa-user-circle"></i>
                        		<span id="header_username"><?= $_SESSION['user']['username'];?></span>
                        	</a>
                        	<ul class="dropdown-menu dropdown-menu-dark shadow mb-2" aria-labelledby="navUser">
                        	    <li><a class="dropdown-item text-white" href="/account/"><i class=" fa-regular fa-circle"></i> Dashboard</a></li>
                        	    <li><a class="dropdown-item text-white" href="/account/aktivitas-login"><i class=" fa-regular fa-circle"></i> Aktivitas Login</a></li>
                        	    <li><a class="dropdown-item text-white" href="/page/api"><i class=" fa-regular fa-circle"></i> Api Dokumentasi</a></li>
                        	    <?php if($_SESSION['user']['level'] == "Member" || $_SESSION['user']['level'] == "Reseller"):?>
                        	    <li><a class="dropdown-item text-white" href="/account/upgrade-level"><i class=" fa-regular fa-circle"></i> Upgrade Level</a></li>
                        	    <?php endif;?>
                                <li><a class="dropdown-item text-white" href="/account/deposit"><i class=" fa-regular fa-circle"></i> Rp <?= number_format($_SESSION['user']['saldo'],0,',','.');?> </a></li>
                                <li>
                                 	<hr class="dropdown-divider">
                                </li>
                        		<li>
                                  	<a class="dropdown-item text-white" href="/auth/logout"><i class="fas fa-sign-out-alt"></i> Logout</a>
                                </li>
                        	</ul>
                        </li>
                        <?php endif;?>
                    </ul>
                </div>
            </div>
        </nav>
    </header>
    <div class="wrapper pt-4">
        <div class="container">
            <br>
            <?php if (isset($_SESSION['alert'])) { ?>
            <div class="row justify-content-center">
                <div class="col-12">
                    <div class="alert alert-<?= $_SESSION['alert'][0] ?> p-2" role="alert">
                        <h4 class="alert-heading mb-0"><?= $_SESSION['alert'][1] ?></h4>
                        <hr>
                        <p class="mb-0"><?= $_SESSION['alert'][2] ?></p>
                    </div>
                </div>
			</div>
			<?php unset($_SESSION['alert']); } ?>