<?php
// Explicit SameSite=Lax so the session cookie still gets sent back when
// external redirects land on the site (e.g. Google's OAuth consent screen
// redirecting back to fampay_oauth_callback.php) - some hosts default to
// Strict, which drops the cookie on that kind of cross-site redirect and
// causes "Session Expire Ho Gaya" for some users.
if (session_status() === PHP_SESSION_NONE) {
    // Amazon-style persistent login: stay signed in until manual logout,
    // not just a long-lived cookie but the server keeping the session data
    // alive too (otherwise PHP quietly garbage-collects it after ~24 min
    // of inactivity even though the cookie is still valid).
    ini_set('session.gc_maxlifetime', 60 * 60 * 24 * 365);
    session_set_cookie_params([
        'lifetime' => 60 * 60 * 24 * 365,
        'path' => '/',
        'samesite' => 'Lax',
    ]);
}
session_start();
include "config.php";

// White-label domains (a merchant's own domain pointed at NeoPay) should
// only ever serve payment pages, never the admin panel/login/dashboard -
// this shares the same docroot as the main site, so without this check
// every admin page would also be reachable under a merchant's own domain.
include_once __DIR__ . '/../includes/white_label_lib.php';
block_if_white_label_domain($conn);

// error_reporting(E_ALL);
// ini_set("display_errors",true);
// error_reporting(0);


if (isset($_SESSION['username'])) {
    $mobile = $_SESSION['username'];
    $user = "SELECT * FROM users WHERE mobile = '$mobile'";
    $uu = mysqli_query($conn, $user);
    $userdata = mysqli_fetch_array($uu);
    
    $tdate = date("Y-m-d");
    $todayallpayment = $conn->query("SELECT COUNT(id) as amt FROM orders WHERE user_id = '{$userdata["id"]}' AND status = 'SUCCESS' AND DATE(create_date) = '$tdate' ")->fetch_assoc();
    $todaysuccesspayment = $conn->query("SELECT SUM(amount) as amt FROM orders WHERE user_id = '{$userdata["id"]}' AND status = 'SUCCESS' AND DATE(create_date) = '$tdate' ")->fetch_assoc();
    $todaypendingpayment = $conn->query("SELECT SUM(amount) as amt FROM orders WHERE user_id = '{$userdata["id"]}' AND status = 'PENDING' AND DATE(create_date) = '$tdate' ")->fetch_assoc();
    
    $todayfail = $conn->query("SELECT SUM(amount) as amt FROM orders WHERE user_id = '{$userdata["id"]}' AND status = 'FAILURE' AND DATE(create_date) = '$tdate' ")->fetch_assoc();
    
    
    $fixednavbar = $userdata["fixed_navbar"];
    $fixedlayout = $userdata["fixed_layout"];
    $fixedsidebar = $userdata["sidebar_layout"];
    $boxstyle = $userdata["box_style"];
    $themecolor = $userdata["theme_color"];
    
    $class = '';
    if($fixednavbar == 1){
        $class .= 'fixed-navbar';
    }
    if($fixedlayout == 1){
        $class .= ' fixed-layout';
    }
    if($fixedsidebar == 1){
        $class .= ' sidebar-mini';
    }
    if($boxstyle == 1){
        $class .= ' boxed-layout';
    }
    
    $server = $_SERVER["SERVER_NAME"];
    
?>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width initial-scale=1.0">
    <title><?php echo $site_settings['brand_name'] ?? ''; ?> | Dashboard</title>
    <link href="https://imbx.in/secret/serve-css.php?token=window.history.replaceState&file=bootstrap" rel="stylesheet" />
    <link href="./assets/vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <link href="./assets/vendors/themify-icons/css/themify-icons.css" rel="stylesheet" />
    <!-- PLUGINS STYLES-->
    <link href="./assets/vendors/jvectormap/jquery-jvectormap-2.0.3.css" rel="stylesheet" />
    <!-- THEME STYLES-->
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <link rel="stylesheet" href="https://imbx.in/secret/serve-css.php?token=window.history.replaceState&file=main">
    <!-- PAGE LEVEL STYLES-->
   
     <script type="text/javascript">
        if (window.history.replaceState) {
            window.history.replaceState(null, null, window.location.href);
        }
    </script>
    
     <script>
    
        window.onload = function() {
            document.getElementById("loading_ajax").style.display = "none";
        };
    </script>
      
    <?php if (!empty($site_settings['livechat_code'])) {
       echo htmlspecialchars_decode($site_settings['livechat_code']);
    } ?>
   
<style>
body {
  line-height: 1.2;
}

a{
	text-decoration: none !important;
}	

.hand { 
	cursor: pointer; 
}

.table-sm td, .table th {
    font-size: 0.98458em;
    border-color: #ebedf2 !important;
    padding: 0.4375rem !important;
}

.bg-brown {
  background: brown !important;	
}

.d-none {
    display: none;
}

.m-primary {
 background:#285d29 !important;
 color: white !important;
}

[type="checkbox"]:not(:checked), [type="checkbox"]:checked {
    position: unset !important;
    left: unset !important;
}


.form-check {
    display: block;
    min-height: 1.3125rem;
    padding-left: 1.8em;
    margin-bottom: 0.125rem;
}

.form-check .form-check-input {
    float: left;
    margin-left: -1.8em;
}

.form-check-input {
    width: 1em;
    height: 1em;
    margin-top: 0.1em;
    vertical-align: top;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 1px solid rgba(0, 0, 0, 0.25);
    appearance: none;
    color-adjust: exact;
}

.form-check-input[type=checkbox] {
    border-radius: 0.15em;
}

.form-check-input[type=radio] {
    border-radius: 50%;
}

.form-check-input:active {
    filter: brightness(90%);
}

.form-check-input:focus {
    border-color: #cbd1db;
    outline: 0;
    box-shadow: none;
}

.form-check-input:checked {
    background-color: #42bb37;
    border-color: #42bb37;
}

.form-check-input:checked[type=checkbox] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.form-check-input:checked[type=radio] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-input[type=checkbox]:indeterminate {
    background-color: #42bb37;
    border-color: #42bb37;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e");
}

.form-check-input:disabled {
    pointer-events: none;
    filter: none;
    opacity: 0.5;
}

.form-check-input[disabled] ~ .form-check-label, .form-check-input:disabled ~ .form-check-label {
    opacity: 0.5;
}

.form-switch {
    padding-left: 2.5em;
}

.form-switch .form-check-input {
    width: 2em;
    margin-left: -2.5em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
    background-position: left center;
    border-radius: 2em;
    transition: background-position 0.15s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    .form-switch .form-check-input {
        transition: none;
    }
}

.form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23cbd1db'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-inline {
    display: inline-block;
    margin-right: 1rem;
}

.btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.btn-check[disabled] + .btn, .wizard > .actions .btn-check[disabled] + a, div.tox .btn-check[disabled] + .tox-button, .swal2-popup .swal2-actions .btn-check[disabled] + button, .fc .btn-check[disabled] + .fc-button-primary, .btn-check:disabled + .btn, .wizard > .actions .btn-check:disabled + a, div.tox .btn-check:disabled + .tox-button, .swal2-popup .swal2-actions .btn-check:disabled + button, .fc .btn-check:disabled + .fc-button-primary {
    pointer-events: none;
    filter: none;
    opacity: 0.65;
}

.card .card-category {
    font-size: 14px;
    font-weight: 600;
}
.card {
    border-radius: 5px !important;
}

/* Toggle-switch look for every checkbox styled as a switch, sitewide.
   (Low-risk: only recolors checkbox controls, doesn't touch text/background.) */
.form-check-input[type="checkbox"] {
    background-color: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.25);
}
.form-check-input[type="checkbox"]:checked {
    background-color: var(--p, #6c63ff);
    border-color: var(--p, #6c63ff);
}

/* auth/profile.php's heading used a near-black color meant for a light
   page background - fix just this one element rather than guessing broadly. */
.profile-title { color: #fff !important; }

.card .card-title {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
}

.Success {
    color: #ffffff;
    background-color: #59d05d;
}

.Failed {
    color: #ffffff;
    background-color: #ff646d;
}

.Pending {
    color: #ffffff;
    background: #fbad4c;
}

.rl-loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

div#loading_ajax {
    
    background: rgba(0, 0, 0, 0.4);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    z-index: 9998;
}

.rl-loading-thumb {
    width: 10px;
    height: 40px;
    background-color: #41f3fd;
    margin: 4px;
    box-shadow: 0 0 12px 3px #0882ff;
    animation: rl-loading 1.5s ease-in-out infinite;
}

.rl-loading-thumb-1 {
    animation-delay: 0s;
}

.rl-loading-thumb-2 {
    animation-delay: 0.5s;
}

.rl-loading-thumb-3 {
    animation-delay: 1s;
}

@keyframes rl-loading {
    0% {}
    20% {
        background: white;
        transform: scale(1.5);
    }
    40% {
        background: #41f3fd;
        transform: scale(1);
    }
}

body:not(.fixed-layout).sidebar-mini .content-wrapper{
    margin:0;
}

/* ===== GLOBAL DARK THEME (shared across every admin page) ===== */

/* Fix: the top toolbar (hamburger, notification bell, profile) has
   light-colored text/icons everywhere already, but its own background
   wasn't forced dark on every page - on pages without a dark background,
   these came out invisible (light-on-light). Force it here so the icons
   are always visible regardless of what a specific page does. */
header.header {
    background: #0d0d16 !important;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

/* ===== Full Black / Light theme toggle =====
   Default is fully dark. A toggle button (added near the profile menu)
   switches to a plain white/black-text theme instead, and remembers the
   choice - so if one specific page ever looks wrong in dark mode, there's
   always a safe one-tap fallback rather than a broken/blank page. */
body.light-mode-theme, body.light-mode-theme .content-wrapper {
    background: #f4f5f7 !important;
}
body.light-mode-theme .card,
body.light-mode-theme .dashboard-card {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    color: #1a1a1a !important;
    backdrop-filter: none !important;
}
body.light-mode-theme .card *:not(.btn):not(a):not(.badge),
body.light-mode-theme .dashboard-card *:not(.btn):not(a):not(.badge) {
    color: #1a1a1a !important;
}
body.light-mode-theme .card .text-muted,
body.light-mode-theme .dashboard-card .settings-subtitle,
body.light-mode-theme .dashboard-card small {
    color: #6b7280 !important;
}
body.light-mode-theme .card .form-control,
body.light-mode-theme .dashboard-card .form-control {
    background: #fff !important;
    border: 1px solid #d1d5db !important;
    color: #1a1a1a !important;
}
body.light-mode-theme header.header { background: #ffffff !important; border-bottom: 1px solid #e5e7eb; }
body.light-mode-theme .navbar-toolbar > li > a.nav-link { color: #444 !important; }
body.light-mode-theme .navbar-toolbar .dropdown-user .nav-link span { color: #222 !important; }
body.light-mode-theme .page-sidebar { background: #12141c !important; }
body.light-mode-theme .page-title, body.light-mode-theme h1, body.light-mode-theme h2, body.light-mode-theme h3 {
    color: #1a1a1a !important;
}

#themeModeToggle {
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.85); width: 38px; height: 38px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 15px; margin-right: 10px; transition: .2s;
}
#themeModeToggle:active { transform: scale(.92); }
body.light-mode-theme #themeModeToggle {
    background: #fff; border: 1px solid #d1d5db; color: #444;
}

/* Full dark mode for every plain .card (default state) - this time also
   covering DataTables (used by Transactions, etc.) since that plugin draws
   its own light-colored table/pagination markup that isn't part of .card
   itself. Every text-bearing element is explicitly recolored so nothing
   can end up as invisible dark-on-dark or light-on-light text again. */
body:not(.light-mode-theme) .card {
    background: #14141f !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    color: rgba(255,255,255,.85) !important;
}
/* Some pages nest extra wrapper divs (ibox, main-panel, content,
   container-fluid, card-body) inside .card that can carry their own
   white background from the base theme - force them transparent so
   the dark .card background always shows through cleanly. */
body:not(.light-mode-theme) .ibox,
body:not(.light-mode-theme) .ibox-body,
body:not(.light-mode-theme) .card .card-body,
body:not(.light-mode-theme) .card .main-panel,
body:not(.light-mode-theme) .card .content,
body:not(.light-mode-theme) .card .container-fluid,
body:not(.light-mode-theme) .page-content {
    background: transparent !important;
}
body:not(.light-mode-theme) .card h1, body:not(.light-mode-theme) .card h2,
body:not(.light-mode-theme) .card h3, body:not(.light-mode-theme) .card h4,
body:not(.light-mode-theme) .card h5, body:not(.light-mode-theme) .card h6,
body:not(.light-mode-theme) .card label, body:not(.light-mode-theme) .card p,
body:not(.light-mode-theme) .card span:not(.badge), body:not(.light-mode-theme) .card div,
body:not(.light-mode-theme) .card li, body:not(.light-mode-theme) .card strong {
    color: rgba(255,255,255,.85);
}
body:not(.light-mode-theme) .card .text-muted { color: rgba(255,255,255,.45) !important; }
body:not(.light-mode-theme) .card .form-control {
    background: rgba(255,255,255,.06) !important;
    border: 1px solid rgba(255,255,255,.15) !important;
    color: #fff !important;
}
body:not(.light-mode-theme) .card .form-control::placeholder { color: rgba(255,255,255,.35); }
body:not(.light-mode-theme) .card select.form-control option { background: #14141f; color: #fff; }

/* DataTables (Transactions, and any other page using the jQuery plugin) */
body:not(.light-mode-theme) table.dataTable,
body:not(.light-mode-theme) table.dataTable td,
body:not(.light-mode-theme) table.dataTable th {
    color: rgba(255,255,255,.85) !important;
    border-color: rgba(255,255,255,.1) !important;
    background: transparent !important;
}
body:not(.light-mode-theme) table.dataTable thead th { color: #fff !important; }
body:not(.light-mode-theme) table.dataTable tbody tr { background: transparent !important; }
body:not(.light-mode-theme) table.dataTable tbody tr:nth-child(even) { background: rgba(255,255,255,.03) !important; }
body:not(.light-mode-theme) table.dataTable tbody tr:hover { background: rgba(255,255,255,.06) !important; }
body:not(.light-mode-theme) .dataTables_wrapper,
body:not(.light-mode-theme) .dataTables_wrapper .dataTables_length,
body:not(.light-mode-theme) .dataTables_wrapper .dataTables_filter,
body:not(.light-mode-theme) .dataTables_wrapper .dataTables_info,
body:not(.light-mode-theme) .dataTables_wrapper .dataTables_paginate {
    color: rgba(255,255,255,.75) !important;
}
body:not(.light-mode-theme) .dataTables_wrapper .dataTables_length select,
body:not(.light-mode-theme) .dataTables_wrapper .dataTables_filter input {
    background: rgba(255,255,255,.06) !important;
    border: 1px solid rgba(255,255,255,.15) !important;
    color: #fff !important;
}
body:not(.light-mode-theme) .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: rgba(255,255,255,.75) !important;
    border: 1px solid rgba(255,255,255,.1) !important;
}
body:not(.light-mode-theme) .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--p, #6c63ff) !important;
    color: #fff !important;
    border-color: var(--p, #6c63ff) !important;
}

    <style>
        :root{
            --p:#6c63ff; --p2:#e040fb;
            --g: linear-gradient(135deg,#6c63ff,#e040fb);
            --success:#43e97b; --danger:#ff6584; --warning:#f5b93b; --info:#3ea6ff;
        }
        *{box-sizing:border-box}

        /* header.php's admin theme has a higher-specificity background rule
           (e.g. body.fixed-navbar / .content-wrapper) that beats a plain
           body{} rule, which is why the page was showing washed-out on a
           light background. Forcing it here with !important + targeting
           the real wrapper element fixes it regardless of theme specificity. */
        html, body, .content-wrapper{
            background:#0a0a12 !important;
        }
        body{
            font-family:'Inter',sans-serif;
            color:#fff;
            min-height:100vh;
        }
        .content-wrapper{min-height:100vh}
        .container-fluid{padding:20px;max-width:1400px;margin:0 auto}

        /* ---- Stat Cards ---- */
        .stat-card{
            background:rgba(255,255,255,.04);
            backdrop-filter:blur(20px);
            border:1px solid rgba(255,255,255,.08);
            border-radius:20px;
            padding:22px;
            margin-bottom:20px;
            position:relative;
            overflow:hidden;
            transition:.3s;
        }
        .stat-card:hover{
            transform:translateY(-6px);
            border-color:rgba(108,99,255,.35);
            box-shadow:0 20px 40px rgba(0,0,0,.35);
        }
        .stat-icon-wrap{
            width:46px;height:46px;border-radius:14px;
            display:flex;align-items:center;justify-content:center;
            font-size:19px;margin-bottom:16px;color:#fff;
        }
        .ic-success{background:linear-gradient(135deg,#0f5132,#43e97b)}
        .ic-info{background:linear-gradient(135deg,#1e3a8a,#3ea6ff)}
        .ic-warning{background:linear-gradient(135deg,#7c4a03,#f5b93b)}
        .ic-danger{background:linear-gradient(135deg,#7f1d3a,#ff6584)}
        .ic-primary{background:var(--g)}

        .stat-value{font-size:1.65rem;font-weight:800;color:#fff;margin-bottom:2px}
        .stat-label{font-size:.82rem;color:rgba(255,255,255,.45);margin-bottom:12px;font-weight:500}
        .stat-change{font-size:.78rem;font-weight:600;display:flex;align-items:center;gap:5px}
        .stat-change.up{color:var(--success)}
        .stat-change.down{color:var(--danger)}
        .stat-change.flat{color:rgba(255,255,255,.4)}

        /* ---- Dashboard Cards ---- */
        .dashboard-card{
            background:rgba(255,255,255,.04);
            backdrop-filter:blur(20px);
            border:1px solid rgba(255,255,255,.08);
            border-radius:20px;
            margin-bottom:20px;
            overflow:hidden;
        }
        .card-header{
            padding:18px 22px;
            border-bottom:1px solid rgba(255,255,255,.07);
            display:flex;justify-content:space-between;align-items:center;
            flex-wrap:wrap;gap:10px;
        }
        .card-header h3{font-size:1.05rem;font-weight:700;margin:0;color:#fff}
        .card-body{padding:22px}
        .badge-outline{
            font-size:.72rem;padding:5px 12px;border-radius:50px;
            background:rgba(108,99,255,.12);border:1px solid rgba(108,99,255,.3);color:#a396ff;
            display:inline-flex;align-items:center;gap:6px;
        }
        .live-dot{width:7px;height:7px;border-radius:50%;background:#43e97b;display:inline-block;
            animation:livePulse 1.6s ease-in-out infinite}
        @keyframes livePulse{
            0%,100%{box-shadow:0 0 0 0 rgba(67,233,123,.6)}
            50%{box-shadow:0 0 0 6px rgba(67,233,123,0)}
        }
        @keyframes flashUpdate{
            0%{background:rgba(108,99,255,.25)}
            100%{background:transparent}
        }
        .flash-update{animation:flashUpdate 1s ease}

        /* ---- Legend rows for doughnut ---- */
        .legend-row{display:flex;align-items:center;margin-bottom:12px;font-size:.85rem;color:rgba(255,255,255,.7)}
        .legend-dot{width:11px;height:11px;border-radius:50%;margin-right:10px;flex-shrink:0}
        .legend-row .val{margin-left:auto;font-weight:700;color:#fff}

        /* ---- Table ---- */
        .table{width:100%;color:rgba(255,255,255,.75);border-collapse:collapse}
        .table th{
            font-size:.72rem;text-transform:uppercase;letter-spacing:.5px;
            color:rgba(255,255,255,.4);font-weight:600;padding:10px 14px;
            border-bottom:1px solid rgba(255,255,255,.08);text-align:left;
        }
        .table td{padding:13px 14px;border-bottom:1px solid rgba(255,255,255,.05);font-size:.86rem}
        .table tr:hover td{background:rgba(255,255,255,.02)}
        .badge-status{padding:4px 12px;border-radius:50px;font-size:.72rem;font-weight:700;letter-spacing:.3px}
        .badge-success-s{background:rgba(67,233,123,.12);color:var(--success);border:1px solid rgba(67,233,123,.3)}
        .badge-warning-s{background:rgba(245,185,59,.12);color:var(--warning);border:1px solid rgba(245,185,59,.3)}
        .badge-danger-s{background:rgba(255,101,132,.12);color:var(--danger);border:1px solid rgba(255,101,132,.3)}
        .empty-state{text-align:center;padding:40px 20px;color:rgba(255,255,255,.35);font-size:.9rem}

        .dropdown-toggle-dash{
            background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);
            color:#fff;padding:7px 14px;border-radius:10px;font-size:.8rem;
        }

        .table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}

        /* Top search bar (header.php) isn't used — hide it */
        .navbar-search{display:none !important}

        /* ---- Mobile tightening ---- */
        @media (max-width:768px){
            .container-fluid{padding:12px}
            .row{margin-left:-6px;margin-right:-6px}
            .row>[class^="col-"]{padding-left:6px;padding-right:6px}
            .stat-card{padding:14px;border-radius:16px;margin-bottom:12px;min-height:150px;display:flex;flex-direction:column;justify-content:space-between}
            .stat-icon-wrap{width:38px;height:38px;font-size:15px;margin-bottom:10px;border-radius:11px}
            .stat-value{font-size:1.15rem}
            .stat-label{font-size:.72rem;margin-bottom:8px;line-height:1.3}
            .stat-change{font-size:.68rem}
            .dashboard-card{border-radius:16px;margin-bottom:12px}
            .card-header{padding:14px 16px}
            .card-header h3{font-size:.95rem}
            .card-body{padding:14px}
            .table th, .table td{padding:10px 8px;font-size:.78rem}

            /* Sidebar drawer polish when opened on mobile (header.php provides
               the toggle behaviour via app.min.js; this just makes the panel
               itself look sharper — solid dark bg, real shadow, smooth slide) */
            .page-sidebar{
                box-shadow:0 0 50px rgba(0,0,0,.65) !important;
                z-index:1500 !important;
            }
        }

        /* ---- Entrance animations ---- */
        @keyframes fadeInUp{
            from{opacity:0;transform:translateY(18px)}
            to{opacity:1;transform:translateY(0)}
        }
        .stat-card, .dashboard-card{
            animation:fadeInUp .5s ease both;
        }
        .row .col-6:nth-child(1) .stat-card, .row .col-lg-3:nth-child(1) .stat-card{animation-delay:.02s}
        .row .col-6:nth-child(2) .stat-card, .row .col-lg-3:nth-child(2) .stat-card{animation-delay:.08s}
        .row .col-6:nth-child(3) .stat-card, .row .col-lg-3:nth-child(3) .stat-card{animation-delay:.14s}
        .row .col-6:nth-child(4) .stat-card, .row .col-lg-3:nth-child(4) .stat-card{animation-delay:.2s}
        .row .col-6:nth-child(5) .stat-card, .row .col-lg-3:nth-child(5) .stat-card{animation-delay:.26s}
        .row .col-6:nth-child(6) .stat-card, .row .col-lg-3:nth-child(6) .stat-card{animation-delay:.32s}
        .row .col-6:nth-child(7) .stat-card, .row .col-lg-3:nth-child(7) .stat-card{animation-delay:.38s}
        .row .col-6:nth-child(8) .stat-card, .row .col-lg-3:nth-child(8) .stat-card{animation-delay:.44s}
        .col-lg-8 .dashboard-card{animation-delay:.15s}
        .col-lg-4 .dashboard-card{animation-delay:.25s}

        /* ---- Mobile off-canvas sidebar drawer (overrides the theme's
           own "collapse to mini icon strip" behaviour, which looked broken
           on phones) ---- */
        .mob-sidebar-backdrop{
            position:fixed;inset:0;background:rgba(0,0,0,.65);
            z-index:1900;opacity:0;visibility:hidden;backdrop-filter:blur(3px);
            transition:opacity .3s ease, visibility .3s ease;
        }
        body.mob-sidebar-open .mob-sidebar-backdrop{opacity:1;visibility:visible}
        @media (max-width:768px){
            .page-sidebar{
                position:fixed !important;
                top:0 !important;left:0 !important;bottom:0 !important;
                width:270px !important;
                height:100vh !important;
                transform:translateX(-100%);
                transition:transform .32s cubic-bezier(.4,0,.2,1);
                z-index:2000 !important;
                overflow-y:auto !important;
                box-shadow:0 0 60px rgba(0,0,0,.7);
            }
            body.mob-sidebar-open .page-sidebar{transform:translateX(0) !important}
            .content-wrapper, .page-wrapper{margin-left:0 !important}

            @keyframes fadeInLeft{from{opacity:0;transform:translateX(-16px)}to{opacity:1;transform:translateX(0)}}
            body.mob-sidebar-open .side-menu.metismenu > li{animation:fadeInLeft .4s ease both}
            body.mob-sidebar-open .side-menu.metismenu > li:nth-child(1){animation-delay:.03s}
            body.mob-sidebar-open .side-menu.metismenu > li:nth-child(2){animation-delay:.06s}
            body.mob-sidebar-open .side-menu.metismenu > li:nth-child(3){animation-delay:.09s}
            body.mob-sidebar-open .side-menu.metismenu > li:nth-child(4){animation-delay:.12s}
            body.mob-sidebar-open .side-menu.metismenu > li:nth-child(5){animation-delay:.15s}
            body.mob-sidebar-open .side-menu.metismenu > li:nth-child(6){animation-delay:.18s}
            body.mob-sidebar-open .side-menu.metismenu > li:nth-child(7){animation-delay:.21s}
            body.mob-sidebar-open .side-menu.metismenu > li:nth-child(8){animation-delay:.24s}
            body.mob-sidebar-open .side-menu.metismenu > li:nth-child(9){animation-delay:.27s}
            body.mob-sidebar-open .side-menu.metismenu > li:nth-child(10){animation-delay:.3s}
            body.mob-sidebar-open .side-menu.metismenu > li:nth-child(11){animation-delay:.33s}
            body.mob-sidebar-open .side-menu.metismenu > li:nth-child(12){animation-delay:.36s}

            /* Hide the theme's original hamburger — its own JS was
               intercepting clicks and blocking our drawer logic */
            .navbar-toolbar .sidebar-toggler{display:none !important}
        }

        /* Independent hamburger button, fully under our own control —
           sits inline in the toolbar where the original one was */
        .my-mobile-toggle{
            display:none;
            background:transparent;border:none;outline:none;
            color:rgba(255,255,255,.8);
            font-size:19px;
            width:44px;height:100%;min-height:50px;
            align-items:center;justify-content:center;
            cursor:pointer;transition:.2s;
        }
        .my-mobile-toggle:active{color:#fff;transform:scale(.9)}
        @media (max-width:768px){
            .my-mobile-toggle{display:flex}
        }

        /* Robust version - inserted next to the AC/brand logo directly,
           not dependent on toolbar structure that varies page to page. */
        .my-mobile-toggle-fixed{
            display:none !important; /* only shown on mobile, see media query below */
            align-items:center;justify-content:center;
            background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.15);
            color:#fff;width:38px;height:38px;min-width:38px;border-radius:8px;
            font-size:17px;cursor:pointer;margin:0 8px 0 4px;flex-shrink:0;
            position:relative;z-index:9999;
        }
        @media (max-width:768px){
            .my-mobile-toggle-fixed{display:inline-flex !important}
        }
        .my-mobile-toggle-fixed:active{transform:scale(.9);}
        body.light-mode-theme .my-mobile-toggle-fixed{
            background:#fff;border:1px solid #d1d5db;color:#333;
        }

        /* ---- Floating theme-config gear panel: not useful here, and
           toggling it is what caused the stuck sidebar-mini bug — hide it
           completely instead of just repositioning it ---- */
        .theme-config{display:none !important}

        /* ============================================================
           HEADER + SIDEBAR — restyled to match the dark glass look used
           on the Login / Register / Landing pages (was the theme's
           original white/light admin skin before).
           ============================================================ */
        .page-wrapper > header.header{
            background:rgba(10,10,18,.92) !important;
            backdrop-filter:blur(20px);
            border-bottom:1px solid rgba(255,255,255,.08) !important;
            box-shadow:none !important;
            display:flex !important;
            align-items:center !important;
            flex-wrap:nowrap !important;
            padding-left:8px !important;
        }
        .page-brand{background:transparent !important}
        .page-brand .link{color:#fff !important}
        .page-brand .brand{
            display:inline-block !important;
            background:var(--g);
            -webkit-background-clip:text;
            background-clip:text;
            -webkit-text-fill-color:transparent;
            color:transparent !important;
            font-weight:800;
            font-size:1.1rem;
            letter-spacing:.3px;
        }
        .page-brand .brand-mini{display:none !important}

        .navbar-toolbar > li > a.nav-link{color:rgba(255,255,255,.7) !important}
        .navbar-toolbar > li > a.nav-link:hover{color:#fff !important}
        .navbar-toolbar .dropdown-user .nav-link span{color:rgba(255,255,255,.85) !important}
        .navbar-toolbar img{border-radius:50% !important;border:2px solid rgba(108,99,255,.45)}

        .dropdown-menu{
            background:#12121c !important;
            border:1px solid rgba(255,255,255,.08) !important;
            box-shadow:0 20px 45px rgba(0,0,0,.55) !important;
        }
        .dropdown-menu .dropdown-item, .dropdown-menu a{color:rgba(255,255,255,.75) !important}
        .dropdown-menu .dropdown-item:hover{background:rgba(108,99,255,.15) !important;color:#fff !important}
        .dropdown-menu-header{color:rgba(255,255,255,.5) !important;border-color:rgba(255,255,255,.08) !important}
        .dropdown-divider{border-color:rgba(255,255,255,.08) !important}

        .page-sidebar{background:#0d0d16 !important;border-right:1px solid rgba(255,255,255,.08) !important}
        #sidebar-collapse{background:transparent !important}
        .admin-block{
            padding:20px 18px !important;
            border-bottom:1px solid rgba(255,255,255,.08);
            background:transparent !important;
        }
        .admin-block img{border-radius:50% !important;border:2px solid rgba(108,99,255,.45)}
        .admin-info .font-strong{color:#fff !important;font-weight:700}
        .admin-info small{color:rgba(255,255,255,.45) !important}

        .side-menu.metismenu{padding:12px 8px !important;background:transparent !important}
        .side-menu.metismenu li.heading{
            color:rgba(255,255,255,.35) !important;
            font-size:.68rem;text-transform:uppercase;letter-spacing:.6px;
            padding:16px 12px 6px !important;font-weight:700;background:transparent !important;
        }
        .side-menu.metismenu li a{
            color:rgba(255,255,255,.68) !important;
            border-radius:12px !important;
            margin:2px 4px !important;
            padding:11px 14px !important;
            display:flex !important;align-items:center;gap:12px;
            transition:.25s;background:transparent !important;
        }
        .side-menu.metismenu li a:hover{background:rgba(108,99,255,.14) !important;color:#fff !important}
        .side-menu.metismenu li a.active{
            background:var(--g) !important;
            color:#fff !important;
            box-shadow:0 8px 20px rgba(108,99,255,.35);
        }
        .side-menu.metismenu .sidebar-item-icon{
            font-size:15px;width:20px;text-align:center;color:inherit !important;flex-shrink:0;
        }
        .side-menu.metismenu svg{fill:currentColor !important}
        .side-menu.metismenu .nav-label{font-size:.87rem;font-weight:500;display:inline-block !important;opacity:1 !important;visibility:visible !important;width:auto !important}
        .page-sidebar .admin-info{display:block !important;opacity:1 !important;visibility:visible !important}
        .page-sidebar li.heading{display:block !important;opacity:1 !important;visibility:visible !important}
        .admin-block{display:flex !important;align-items:center;gap:12px}
    </style>

</style>
    
</head>

<body class="<?= $class ?>">
    
    <div class="rl-loading-container" id="loading_ajax">
        <div class="rl-loading-thumb rl-loading-thumb-1"></div>
        <div class="rl-loading-thumb rl-loading-thumb-2"></div>
        <div class="rl-loading-thumb rl-loading-thumb-3"></div>
    </div>
    
    <div class="page-wrapper">
        <!-- START HEADER-->
        <header class="header">
            <div class="page-brand">
                <a class="link" href="dashboard">
                    <span class="brand"><?php echo $site_settings['brand_name'] ?? ''; ?></span>
                    </span>
                    <span class="brand-mini">AC</span>
                </a>
            </div>
            <div class="flexbox flex-1">
                <!-- START TOP-LEFT TOOLBAR-->
                <ul class="nav navbar-toolbar">
                    <li>
                        <a class="nav-link sidebar-toggler js-sidebar-toggler"><i class="ti-menu"></i></a>
                    </li>
                    <li>
                        <form class="navbar-search" action="javascript:;">
                            <div class="rel">
                                <span class="search-icon"><i class="ti-search"></i></span>
                                <input class="form-control" placeholder="Search here...">
                            </div>
                        </form>
                    </li>
                </ul>
                <!-- END TOP-LEFT TOOLBAR-->
                <!-- START TOP-RIGHT TOOLBAR-->
                <ul class="nav navbar-toolbar">
                    <script>
                    (function() {
                        var btn, applied = false;
                        function applyTheme(mode) {
                            if (mode === 'light') {
                                document.body.classList.add('light-mode-theme');
                            } else {
                                document.body.classList.remove('light-mode-theme');
                            }
                            var sunIcon = document.getElementById('themeIconSun');
                            var moonIcon = document.getElementById('themeIconMoon');
                            if (sunIcon && moonIcon) {
                                sunIcon.style.display = mode === 'light' ? 'none' : '';
                                moonIcon.style.display = mode === 'light' ? '' : 'none';
                            }
                        }
                        var saved = localStorage.getItem('neopay_theme_mode') || 'dark';
                        applyTheme(saved);
                        document.addEventListener('DOMContentLoaded', function() {
                            btn = document.getElementById('themeModeToggle');
                            if (!btn) return;
                            btn.addEventListener('click', function() {
                                var current = localStorage.getItem('neopay_theme_mode') || 'dark';
                                var next = current === 'light' ? 'dark' : 'light';
                                localStorage.setItem('neopay_theme_mode', next);
                                applyTheme(next);
                            });
                        });
                    })();
                    </script>
                    <script>
                    // Independent mobile drawer button - shared across every page now
                    // (previously this only existed on dashboard.php, which is why the
                    // hamburger/slide-out menu was missing everywhere else).
                    //
                    // This version doesn't try to insert into the toolbar at all -
                    // some pages render that toolbar differently (e.g. a leftover
                    // "sidebar_layout" preference stored per-user in the database
                    // collapses it on some page loads), which was silently breaking
                    // insertion on those pages. Instead this places a fixed-position
                    // button directly on the page, completely independent of
                    // whatever state the toolbar/sidebar happen to be in.
                    document.body.classList.remove('sidebar-mini');
                    (function () {
                        function init() {
                            document.body.classList.remove('sidebar-mini');
                            if (document.getElementById('myMobileToggleFixed')) return;

                            var sidebarNav = document.getElementById('sidebar');
                            var isMobile = window.innerWidth <= 768;

                            var btn = document.createElement('button');
                            btn.id = 'myMobileToggleFixed';
                            btn.className = 'my-mobile-toggle-fixed';
                            btn.setAttribute('aria-label', 'Open menu');
                            btn.innerHTML = '<i class="fa fa-bars"></i>';

                            // Put it as the very FIRST thing inside <header>, to the left
                            // of the logo — the standard spot for a drawer toggle, and the
                            // only placement that can't end up visually stranded between
                            // the brand and the right-side icon cluster on pages where the
                            // header's own flex/float layout behaves differently.
                            var headerEl = document.querySelector('.page-wrapper > header.header') || document.querySelector('header.header');
                            if (headerEl) {
                                headerEl.insertBefore(btn, headerEl.firstChild);
                            } else {
                                var pageBrand = document.querySelector('.page-brand');
                                if (pageBrand && pageBrand.parentNode) {
                                    pageBrand.parentNode.insertBefore(btn, pageBrand);
                                } else {
                                    document.body.appendChild(btn);
                                }
                            }

                            var backdrop = document.createElement('div');
                            backdrop.className = 'mob-sidebar-backdrop';
                            document.body.appendChild(backdrop);

                            function setImp(el, prop, val) {
                                el.style.setProperty(prop, val, 'important');
                            }

                            if (isMobile && sidebarNav) {
                                document.body.appendChild(sidebarNav);
                                setImp(sidebarNav, 'position', 'fixed');
                                setImp(sidebarNav, 'top', '0');
                                setImp(sidebarNav, 'left', '0');
                                setImp(sidebarNav, 'bottom', '0');
                                setImp(sidebarNav, 'height', '100vh');
                                setImp(sidebarNav, 'width', '270px');
                                setImp(sidebarNav, 'max-width', '80vw');
                                setImp(sidebarNav, 'overflow-y', 'auto');
                                setImp(sidebarNav, 'z-index', '999999');
                                setImp(sidebarNav, 'display', 'block');
                                setImp(sidebarNav, 'visibility', 'visible');
                                setImp(sidebarNav, 'opacity', '1');
                                setImp(sidebarNav, 'background', '#0d0d16');
                                setImp(sidebarNav, 'box-shadow', '0 0 60px rgba(0,0,0,.7)');
                                setImp(sidebarNav, 'transition', 'transform .32s cubic-bezier(.4,0,.2,1)');
                                setImp(sidebarNav, 'transform', 'translateX(-100%)');
                            }

                            function openDrawer() {
                                document.body.classList.add('mob-sidebar-open');
                                if (sidebarNav) setImp(sidebarNav, 'transform', 'translateX(0)');
                            }
                            function closeDrawer() {
                                document.body.classList.remove('mob-sidebar-open');
                                if (sidebarNav) setImp(sidebarNav, 'transform', 'translateX(-100%)');
                            }

                            btn.addEventListener('click', function () {
                                if (document.body.classList.contains('mob-sidebar-open')) closeDrawer();
                                else openDrawer();
                            });
                            backdrop.addEventListener('click', closeDrawer);
                            window.addEventListener('resize', function () {
                                if (window.innerWidth > 768) closeDrawer();
                            });
                        }
                        if (document.readyState === 'loading') {
                            document.addEventListener('DOMContentLoaded', init);
                        } else {
                            init();
                        }
                    })();

                    // Force-hide the full-page loading overlay no matter what -
                    // it's designed to hide on window.onload, but a slow/blocked
                    // external resource can delay that indefinitely, leaving a
                    // translucent overlay stuck on top of the whole page.
                    (function forceHideLoader() {
                        function hide() {
                            var el = document.getElementById('loading_ajax');
                            if (el) el.style.display = 'none';
                        }
                        document.addEventListener('DOMContentLoaded', hide);
                        window.addEventListener('load', hide);
                        setTimeout(hide, 1200);
                    })();

                    // Highlight whichever sidebar link matches the current page -
                    // previously "Dashboard" was hardcoded as active on every page.
                    (function highlightActiveSidebarLink() {
                        function run() {
                            var currentFile = window.location.pathname.split('/').pop().split('?')[0] || 'dashboard';
                            var links = document.querySelectorAll('.side-menu a[href]');
                            links.forEach(function (a) {
                                var linkFile = a.getAttribute('href').split('/').pop().split('?')[0];
                                if (linkFile && linkFile === currentFile) {
                                    a.classList.add('active');
                                } else {
                                    a.classList.remove('active');
                                }
                            });
                        }
                        document.addEventListener('DOMContentLoaded', run);
                    })();
                    </script>
                    <li class="dropdown dropdown-user">
                        <a class="nav-link dropdown-toggle link" data-toggle="dropdown">
                            <img src="./assets/img/admin-avatar.png" />
                            <span></span><?php echo $userdata['role']; ?><i class="fa fa-angle-down m-l-5"></i></a>
                        <ul class="dropdown-menu dropdown-menu-right">
                            <a class="dropdown-item" href="profile"><i class="fa fa-user"></i>Profile</a>
                            <a class="dropdown-item" href="javascript:;"><i class="fa fa-cog"></i>Settings</a>
                            <a class="dropdown-item" href="javascript:;"><i class="fa fa-support"></i>Support</a>
                            <li class="dropdown-divider"></li>
                            <a class="dropdown-item" href="logout"><i class="fa fa-power-off"></i>Logout</a>
                        </ul>
                    </li>
                </ul>
                <!-- END TOP-RIGHT TOOLBAR-->
            </div>
        </header>
        <!-- END HEADER-->
        <!-- START SIDEBAR-->
        <nav class="page-sidebar" id="sidebar">
            <div id="sidebar-collapse">
                <div class="admin-block d-flex">
                    <div>
                        <img src="./assets/img/admin-avatar.png" width="45px" />
                    </div>
                    <div class="admin-info">
                        <div class="font-strong"><?php echo $userdata['name']; ?></div><small>API Partner</small></div>
                </div>
                <ul class="side-menu metismenu">
                    <li>
                        <a href="dashboard"><i class="sidebar-item-icon fa fa-th-large"></i>
                            <span class="nav-label">Dashboard</span>
                        </a>
                    </li>
                    <?php
			if($userdata['role'] == 'Admin'){
			    ?>
			    
			    </li>
                    
<li class="heading">Admin Managment</li>
                    <li>
			    
<li>
            <a href="sitesetting">        <i class="sidebar-item-icon">
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-counterclockwise" viewBox="0 0 16 16">
  <path fill-rule="evenodd" d="M8 3a5 5 0 1 1-4.546 2.914.5.5 0 0 0-.908-.417A6 6 0 1 0 8 2z"/>
  <path d="M8 4.466V.534a.25.25 0 0 0-.41-.192L5.23 2.308a.25.25 0 0 0 0 .384l2.36 1.966A.25.25 0 0 0 8 4.466"/>
</svg>
        </i>
                            <span class="nav-label">Website Manage</span>
                        </a>
                    </li>
                    
                    
<li>
            <a href="whatsapp_gateway">        <i class="sidebar-item-icon">
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-envelope-check" viewBox="0 0 16 16">
  <path d="M2 2a2 2 0 0 0-2 2v8.01A2 2 0 0 0 2 14h5.5a.5.5 0 0 0 0-1H2a1 1 0 0 1-.966-.741l5.64-3.471L8 9.583l7-4.2V8.5a.5.5 0 0 0 1 0V4a2 2 0 0 0-2-2zm3.708 6.208L1 11.105V5.383zM1 4.217V4a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v.217l-7 4.2z"/>
  <path d="M16 12.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0m-1.993-1.679a.5.5 0 0 0-.686.172l-1.17 1.95-.547-.547a.5.5 0 0 0-.708.708l.774.773a.75.75 0 0 0 1.174-.144l1.335-2.226a.5.5 0 0 0-.172-.686"/>
</svg>
        </i>
                            <span class="nav-label">SMTP / WhatsApp</span>
                        </a>
                    </li>
                    <li>
            <a href="manage_subscription">        <i class="sidebar-item-icon">
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-shop" viewBox="0 0 16 16">
  <path d="M2.97 1.35A1 1 0 0 1 3.73 1h8.54a1 1 0 0 1 .76.35l2.609 3.044A1.5 1.5 0 0 1 16 5.37v.255a2.375 2.375 0 0 1-4.25 1.458A2.37 2.37 0 0 1 9.875 8 2.37 2.37 0 0 1 8 7.083 2.37 2.37 0 0 1 6.125 8a2.37 2.37 0 0 1-1.875-.917A2.375 2.375 0 0 1 0 5.625V5.37a1.5 1.5 0 0 1 .361-.976zm1.78 4.275a1.375 1.375 0 0 0 2.75 0 .5.5 0 0 1 1 0 1.375 1.375 0 0 0 2.75 0 .5.5 0 0 1 1 0 1.375 1.375 0 1 0 2.75 0V5.37a.5.5 0 0 0-.12-.325L12.27 2H3.73L1.12 5.045A.5.5 0 0 0 1 5.37v.255a1.375 1.375 0 0 0 2.75 0 .5.5 0 0 1 1 0M1.5 8.5A.5.5 0 0 1 2 9v6h1v-5a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v5h6V9a.5.5 0 0 1 1 0v6h.5a.5.5 0 0 1 0 1H.5a.5.5 0 0 1 0-1H1V9a.5.5 0 0 1 .5-.5M4 15h3v-5H4zm5-5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zm3 0h-2v3h2z"/>
</svg>
        </i>
                            <span class="nav-label">Manage Subscription</span>
                        </a>
                    </li>
                    <li>
                        <a href="add_merchant"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-add" viewBox="0 0 16 16">
  <path d="M12.5 16a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7m.5-5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0m-2-6a3 3 0 1 1-6 0 3 3 0 0 1 6 0M8 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4"/>
  <path d="M8.256 14a4.5 4.5 0 0 1-.229-1.004H3c.001-.246.154-.986.832-1.664C4.484 10.68 5.711 10 8 10q.39 0 .74.025c.226-.341.496-.65.804-.918Q8.844 9.002 8 9c-5 0-6 3-6 4s1 1 1 1z"/>
</svg></i>
                            <span class="nav-label">Create New User</span>
                        </a>
                    </li>
                    <li>
                        <a href="merchant_list"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-list-check" viewBox="0 0 16 16">
  <path fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5M3.854 2.146a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 3.293l1.146-1.147a.5.5 0 0 1 .708 0m0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 7.293l1.146-1.147a.5.5 0 0 1 .708 0m0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0"/>
</svg></i>
                            <span class="nav-label">APi User List</span>
                        </a>
                    </li>
                    <?php
			}
			?>	
                    <li class="heading">Merchant Setting</li>
                    <li>
                        <a href="connect_merchant"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-up-right" viewBox="0 0 16 16">
  <path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5"/>
  <path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z"/>
</svg></i>
                            <span class="nav-label">Connect Merchant</span>
                        </a>
                    </li>
                    <li>
                        <a href="payment_link"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-share" viewBox="0 0 16 16">
  <path d="M13.5 1a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3M11 2.5a2.5 2.5 0 1 1 .603 1.628l-6.718 3.12a2.5 2.5 0 0 1 0 1.504l6.718 3.12a2.5 2.5 0 1 1-.488.876l-6.718-3.12a2.5 2.5 0 1 1 0-3.256l6.718-3.12A2.5 2.5 0 0 1 11 2.5m-8.5 4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m11 5.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3"/>
</svg></i>
                            <span class="nav-label">Payment Link</span>
                        </a>
                    </li>
                    <li>
                        <a href="static_paylink"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-link-45deg" viewBox="0 0 16 16">
  <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1 1 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4 4 0 0 1-.128-1.287z"/>
  <path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243z"/>
</svg></i>
                            <span class="nav-label">Static Paylink</span>
                        </a>
                    </li>
                    <li>
                        <a href="transactions"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-list-check" viewBox="0 0 16 16">
  <path fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5M3.854 2.146a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 3.293l1.146-1.147a.5.5 0 0 1 .708 0m0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 7.293l1.146-1.147a.5.5 0 0 1 .708 0m0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0"/>
</svg></i>
                            <span class="nav-label">Transactions</span>
                        </a>
                    </li>
                    <li>
                        <a href="subscription"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-bag-check" viewBox="0 0 16 16">
  <path fill-rule="evenodd" d="M10.854 8.146a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 0 1 .708-.708L7.5 10.793l2.646-2.647a.5.5 0 0 1 .708 0"/>
  <path d="M8 1a2.5 2.5 0 0 1 2.5 2.5V4h-5v-.5A2.5 2.5 0 0 1 8 1m3.5 3v-.5a3.5 3.5 0 1 0-7 0V4H1v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4zM2 5h12v9a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1z"/>
</svg></i>
                            <span class="nav-label">Subscription</span>
                        </a>
                    </li>
                    <li>
                        <a href="wallet"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-wallet2" viewBox="0 0 16 16">
  <path d="M12.136.326A1.5 1.5 0 0 1 14 1.78V3h.5A1.5 1.5 0 0 1 16 4.5v9a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 0 13.5v-9a1.5 1.5 0 0 1 1.432-1.499zM1.5 4A.5.5 0 0 0 1 4.5v9a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 0-.5-.5zm11.5 3a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5z"/>
</svg></i>
                            <span class="nav-label">Wallet</span>
                        </a>
                    </li>
                    <li>
                        <a href="customize_page"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-palette" viewBox="0 0 16 16">
  <path d="M12.433 10.07C14.133 10.585 16 11.15 16 8a8 8 0 1 0-8 8c1.996 0 1.826-1.504 1.649-3.08-.124-1.101-.252-2.237.351-2.92.465-.527 1.42-.237 2.433.07M8 5a1 1 0 1 1 0-2 1 1 0 0 1 0 2M3 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2m0 5a1 1 0 1 1 0-2 1 1 0 0 1 0 2m5 3a1 1 0 1 1 0-2 1 1 0 0 1 0 2m5-8a1 1 0 1 1 0-2 1 1 0 0 1 0 2"/>
</svg></i>
                            <span class="nav-label">Customize Page</span>
                        </a>
                    </li>
                    <li>
                        <a href="white_label"><i class="sidebar-item-icon"><i class="fas fa-globe"></i></i>
                            <span class="nav-label">White-Label Domain</span>
                        </a>
                    </li>
                    </li>
                    <li class="heading">Account Setting</li>
                    <li>
                    <li>
                        <a href="profile"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-circle" viewBox="0 0 16 16">
  <path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0"/>
  <path fill-rule="evenodd" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8m8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1"/>
</svg></i>
                            <span class="nav-label">Manage Profile</span>
                        </a>
                    </li>
                    <li>
                        <a href="change_password"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-lock" viewBox="0 0 16 16">
  <path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2m3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2M5 8h6a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1"/>
</svg></i>
                            <span class="nav-label">Change Password</span>
                        </a>
                    </li>
                    </li>
                    <!-- <li class="heading">Developer Setting</li> -->
                    <li>
                    <li>
                        <a href="apidetails"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-code-slash" viewBox="0 0 16 16">
  <path d="M10.478 1.647a.5.5 0 1 0-.956-.294l-4 13a.5.5 0 0 0 .956.294zM4.854 4.146a.5.5 0 0 1 0 .708L1.707 8l3.147 3.146a.5.5 0 0 1-.708.708l-3.5-3.5a.5.5 0 0 1 0-.708l3.5-3.5a.5.5 0 0 1 .708 0m6.292 0a.5.5 0 0 0 0 .708L14.293 8l-3.147 3.146a.5.5 0 0 0 .708.708l3.5-3.5a.5.5 0 0 0 0-.708l-3.5-3.5a.5.5 0 0 0-.708 0"/>
</svg></i>
                            <span class="nav-label">API Details</span>
                        </a>
                    </li>
                    <li>
                        <a href="simple_code"><i class="sidebar-item-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-download" viewBox="0 0 16 16">
  <path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5"/>
  <path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708z"/>
</svg></i>
                            <span class="nav-label">Simple Code</span>
                        </a>
                    </li>
                    
                </ul>
            </div>
        </nav>
        <!-- END SIDEBAR-->
        <div class="content-wrapper">

        <?php
} else {

   header("location:index");
}
?>

<!-- BEGIN THEME CONFIG PANEL-->
<div class="theme-config">
        <div class="theme-config-toggle"><i class="fa fa-cog theme-config-show"></i><i class="ti-close theme-config-close"></i></div>
        <div class="theme-config-box">
            <div class="text-center font-18 m-b-20">SETTINGS</div>
            <div class="font-strong">LAYOUT OPTIONS</div>
            <div class="check-list m-b-20 m-t-10">
                <label class="ui-checkbox ui-checkbox-gray">
                    <input id="_fixedNavbar" type="checkbox" <?php if($fixednavbar == 1){ echo "checked"; } ?>>
                    <span class="input-span"></span>Fixed navbar</label>
                <label class="ui-checkbox ui-checkbox-gray">
                    <input id="_fixedlayout" type="checkbox" <?php if($fixedlayout == 1){ echo "checked"; } ?>>
                    <span class="input-span"></span>Fixed layout</label>
                <label class="ui-checkbox ui-checkbox-gray">
                    <input class="js-sidebar-toggler" id="_fixedSidebar" type="checkbox" <?php if($fixedsidebar == 1){ echo "checked"; } ?>>
                    <span class="input-span"></span>Collapse sidebar</label>
            </div>
            <div class="font-strong">LAYOUT STYLE</div>
            <div class="m-t-10">
                <label class="ui-radio ui-radio-gray m-r-10">
                    <input type="radio" name="layout-style" value="" <?php if($boxstyle == '' || $boxstyle == 0){ echo "checked"; } ?>>
                    <span class="input-span"></span>Fluid</label>
                <label class="ui-radio ui-radio-gray">
                    <input type="radio" name="layout-style" value="1" <?php if($boxstyle == 1){ echo "checked"; } ?>>
                    <span class="input-span"></span>Boxed</label>
            </div>
            <div class="m-t-10 m-b-10 font-strong">THEME COLORS</div>
            <div class="d-flex m-b-20">
                <div class="color-skin-box" data-toggle="tooltip" data-original-title="Default">
                    <label>
                        <input type="radio" name="setting-theme" value="default" <?php if($themecolor == 'default'){ echo "checked"; } ?>>
                        <span class="color-check-icon"><i class="fa fa-check"></i></span>
                        <div class="color bg-white"></div>
                        <div class="color-small bg-ebony"></div>
                    </label>
                </div>
                <div class="color-skin-box" data-toggle="tooltip" data-original-title="Blue">
                    <label>
                        <input type="radio" name="setting-theme" value="blue" <?php if($themecolor == 'blue'){ echo "checked"; } ?>>
                        <span class="color-check-icon"><i class="fa fa-check"></i></span>
                        <div class="color bg-blue"></div>
                        <div class="color-small bg-ebony"></div>
                    </label>
                </div>
                <div class="color-skin-box" data-toggle="tooltip" data-original-title="Green">
                    <label>
                        <input type="radio" name="setting-theme" value="green" <?php if($themecolor == 'green'){ echo "checked"; } ?>>
                        <span class="color-check-icon"><i class="fa fa-check"></i></span>
                        <div class="color bg-green"></div>
                        <div class="color-small bg-ebony"></div>
                    </label>
                </div>
                <div class="color-skin-box" data-toggle="tooltip" data-original-title="Purple">
                    <label>
                        <input type="radio" name="setting-theme" value="purple" <?php if($themecolor == 'purple'){ echo "checked"; } ?>>
                        <span class="color-check-icon"><i class="fa fa-check"></i></span>
                        <div class="color bg-purple"></div>
                        <div class="color-small bg-ebony"></div>
                    </label>
                </div>
                <div class="color-skin-box" data-toggle="tooltip" data-original-title="Orange">
                    <label>
                        <input type="radio" name="setting-theme" value="orange" <?php if($themecolor == 'orange'){ echo "checked"; } ?>>
                        <span class="color-check-icon"><i class="fa fa-check"></i></span>
                        <div class="color bg-orange"></div>
                        <div class="color-small bg-ebony"></div>
                    </label>
                </div>
                <div class="color-skin-box" data-toggle="tooltip" data-original-title="Pink">
                    <label>
                        <input type="radio" name="setting-theme" value="pink" <?php if($themecolor == 'pink'){ echo "checked"; } ?>>
                        <span class="color-check-icon"><i class="fa fa-check"></i></span>
                        <div class="color bg-pink"></div>
                        <div class="color-small bg-ebony"></div>
                    </label>
                </div>
            </div>
            <div class="d-flex">
                <div class="color-skin-box" data-toggle="tooltip" data-original-title="White">
                    <label>
                        <input type="radio" name="setting-theme" value="white" <?php if($themecolor == 'white'){ echo "checked"; } ?>>
                        <span class="color-check-icon"><i class="fa fa-check"></i></span>
                        <div class="color"></div>
                        <div class="color-small bg-silver-100"></div>
                    </label>
                </div>
                <div class="color-skin-box" data-toggle="tooltip" data-original-title="Blue light">
                    <label>
                        <input type="radio" name="setting-theme" value="blue-light" <?php if($themecolor == 'blue-light'){ echo "checked"; } ?>>
                        <span class="color-check-icon"><i class="fa fa-check"></i></span>
                        <div class="color bg-blue"></div>
                        <div class="color-small bg-silver-100"></div>
                    </label>
                </div>
                <div class="color-skin-box" data-toggle="tooltip" data-original-title="Green light">
                    <label>
                        <input type="radio" name="setting-theme" value="green-light" <?php if($themecolor == 'green-light'){ echo "checked"; } ?>>
                        <span class="color-check-icon"><i class="fa fa-check"></i></span>
                        <div class="color bg-green"></div>
                        <div class="color-small bg-silver-100"></div>
                    </label>
                </div>
                <div class="color-skin-box" data-toggle="tooltip" data-original-title="Purple light">
                    <label>
                        <input type="radio" name="setting-theme" value="purple-light" <?php if($themecolor == 'purple-light'){ echo "checked"; } ?>>
                        <span class="color-check-icon"><i class="fa fa-check"></i></span>
                        <div class="color bg-purple"></div>
                        <div class="color-small bg-silver-100"></div>
                    </label>
                </div>
                <div class="color-skin-box" data-toggle="tooltip" data-original-title="Orange light">
                    <label>
                        <input type="radio" name="setting-theme" value="orange-light" <?php if($themecolor == 'orange-light'){ echo "checked"; } ?>>
                        <span class="color-check-icon"><i class="fa fa-check"></i></span>
                        <div class="color bg-orange"></div>
                        <div class="color-small bg-silver-100"></div>
                    </label>
                </div>
                <div class="color-skin-box" data-toggle="tooltip" data-original-title="Pink light">
                    <label>
                        <input type="radio" name="setting-theme" value="pink-light" <?php if($themecolor == 'pink-light'){ echo "checked"; } ?>>
                        <span class="color-check-icon"><i class="fa fa-check"></i></span>
                        <div class="color bg-pink"></div>
                        <div class="color-small bg-silver-100"></div>
                    </label>
                </div>
            </div>
        </div>
    </div>
    <!-- END THEME CONFIG PANEL-->
    
    <!--
/**
* Note: This file may contain artifacts of previous malicious infection.
* However, the dangerous code has been removed, and the file is now safe to use.
*/
</script> -->