<!---------   
=== Theme Author : Evan Ahmed EMon
=== Theme Designed By: TWG
=== Contact Whatsapp: +8801864614704
 ----------->  
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="big5">
    <base href="<?= site_url() ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?= $settings["site_name"] ?></title>
    
    
 
    
<!-- CDN Links -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.10.6/sweetalert2.css"/> 
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.8.1/css/bootstrap-select.css">
<link rel="stylesheet" href="https://itsjavi.com/fontawesome-iconpicker/dist/css/fontawesome-iconpicker.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">

<!-- Custom Admin Assets -->
<link href="<?php echo site_url('assets/admin/bootstrap.css'); ?>" rel="stylesheet">
<link href="<?php echo site_url('assets/admin/style.css'); ?>" rel="stylesheet">
<link href="<?php echo site_url('assets/admin/toastDemo.css'); ?>" rel="stylesheet">
<link href="<?php echo site_url('assets/admin/tooltip.css'); ?>" rel="stylesheet">
<link href="<?php echo site_url('assets/admin/tinytoggle.min.css'); ?>" rel="stylesheet">
<link href="<?php echo site_url('assets/admin/iziToast.min.css'); ?>" rel="stylesheet">
<link href="<?php echo site_url('assets/admin/image-picker.css'); ?>" rel="stylesheet">
<link href="<?php echo site_url('assets/admin/maint.css'); ?>" rel="stylesheet">
<link href="<?php echo site_url('assets/admin/adcustom.css'); ?>" rel="stylesheet">
<link href="<?php echo site_url('assets/admin/fontawesome5pro.css'); ?>" rel="stylesheet">

<!-- Scripts -->
<script src="https://kit.fontawesome.com/e1d6cf68d9.js" crossorigin="anonymous"></script>
<script src="<?php echo site_url('assets/admin/iziToast.min.js'); ?>"></script>

<style>
 .badge.badge-primary {
 color: white; /* Ensures the text is visible */
    
 }
.far {
    font-family: "Font Awesome 5 Pro";
    font-weight: 400;
}
.fa,.fas {
    font-family: "Font Awesome 5 Pro";
    font-weight: 900
}
/* Mobile responsive fixes for reports toolbar */
@media (max-width: 768px) {
  .nav-tabs > li.pull-right {
    float: none !important;
    display: block;
    width: 100%;
    margin-bottom: 5px;
  }
  .nav-tabs > li.pull-right .btn-group {
    display: flex;
    flex-wrap: wrap;
  }
  .nav-tabs > li.pull-right .btn-group .btn {
    flex: 1;
    min-width: auto;
  }
  .nav-tabs > li.pull-right .bootstrap-select {
    width: 100% !important;
  }
  .nav-tabs {
    display: block;
  }
  .report-table {
    font-size: 11px;
  }
  .report-table th, .report-table td {
    padding: 4px 2px;
    white-space: nowrap;
  }
}
</style>
<style>
/* ===== Modern Admin Navbar ===== */
.navbar.modern-admin-nav {
    background: #ffffff;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 2px 20px rgba(0,0,0,0.04);
    margin-bottom: 0;
    min-height: 50px;
    transition: all 0.3s ease;
}
.navbar.modern-admin-nav .navbar-nav > li > a {
    color: #555;
    font-size: 13px;
    font-weight: 500;
    padding: 15px 14px;
    border-radius: 8px;
    margin: 2px 2px;
    transition: all 0.25s ease;
    letter-spacing: 0.2px;
}
.navbar.modern-admin-nav .navbar-nav > li > a:hover {
    background: linear-gradient(135deg, rgba(47,128,237,0.08), rgba(86,204,242,0.08));
    color: #2F80ED;
    transform: translateY(0);
}
.navbar.modern-admin-nav .navbar-nav > li.active > a,
.navbar.modern-admin-nav .navbar-nav > li.active > a:hover,
.navbar.modern-admin-nav .navbar-nav > li.active > a:focus {
    background: linear-gradient(135deg, #2F80ED, #56CCF2);
    color: #fff !important;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(47,128,237,0.3);
}
.navbar.modern-admin-nav .navbar-nav > li > a > i {
    margin-right: 4px;
    font-size: 14px;
}
/* Dropdown menus */
.navbar.modern-admin-nav .dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    padding: 8px;
    margin-top: 4px;
    animation: fadeInDown 0.2s ease;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.navbar.modern-admin-nav .dropdown-menu > li > a {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 6px;
    color: #555;
    transition: all 0.2s ease;
}
.navbar.modern-admin-nav .dropdown-menu > li > a:hover {
    background: linear-gradient(135deg, rgba(47,128,237,0.08), rgba(86,204,242,0.08));
    color: #2F80ED;
}
.navbar.modern-admin-nav .dropdown-menu > li.active > a {
    background: linear-gradient(135deg, #2F80ED, #56CCF2);
    color: #fff;
}
/* Badges in nav */
.navbar.modern-admin-nav .badge {
    border-radius: 20px;
    font-size: 10px;
    padding: 3px 7px;
    font-weight: 600;
    vertical-align: middle;
}
/* Hamburger toggle */
.navbar.modern-admin-nav .navbar-toggle {
    border: none;
    border-radius: 8px;
    padding: 10px;
    margin-top: 8px;
}
.navbar.modern-admin-nav .navbar-toggle .icon-bar {
    background-color: #555;
    border-radius: 3px;
    height: 3px;
}
/* Profile caret */
.navbar.modern-admin-nav .caret {
    margin-left: 3px;
}

/* ===== Dark Mode Navbar ===== */
body.dark-mode .navbar.modern-admin-nav {
    background: #1e2028;
    border-bottom-color: rgba(255,255,255,0.06);
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
body.dark-mode .navbar.modern-admin-nav .navbar-nav > li > a {
    color: #b0b8c8;
}
body.dark-mode .navbar.modern-admin-nav .navbar-nav > li > a:hover {
    background: rgba(47,128,237,0.12);
    color: #56CCF2;
}
body.dark-mode .navbar.modern-admin-nav .navbar-nav > li.active > a,
body.dark-mode .navbar.modern-admin-nav .navbar-nav > li.active > a:hover {
    background: linear-gradient(135deg, #2F80ED, #56CCF2);
    color: #fff !important;
}
body.dark-mode .navbar.modern-admin-nav .dropdown-menu {
    background: #2a2c33;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
body.dark-mode .navbar.modern-admin-nav .dropdown-menu > li > a {
    color: #b0b8c8;
}
body.dark-mode .navbar.modern-admin-nav .dropdown-menu > li > a:hover {
    background: rgba(47,128,237,0.15);
    color: #56CCF2;
}
body.dark-mode .navbar.modern-admin-nav .dropdown-menu > li.active > a {
    background: linear-gradient(135deg, #2F80ED, #56CCF2);
    color: #fff;
}
body.dark-mode .navbar.modern-admin-nav .navbar-toggle .icon-bar {
    background-color: #b0b8c8;
}
body.dark-mode .navbar.modern-admin-nav .dropdown-menu .divider {
    background-color: #3f424c;
}
</style>



</head>


 


<body class="<?php if(is_array($admin) && ($admin["mode"] ?? '') =="dark" ): echo "dark-mode" ; endif; ?>">

<nav class="navbar navbar-static-top navbar-default modern-admin-nav">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
              aria-expanded="false" aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
    <div id="navbar" class="collapse navbar-collapse">

      <ul class="nav navbar-nav navbar-left-block">
        <?php if ($admin["access"]["admin_access"] && $_SESSION["msmbilisim_adminlogin"]) : ?>

          <?php if ($admin["access"]["admin_access"]): ?>
            <li class="<?php if(route(1) == "index"): echo 'active' ; endif; ?>">
              <a class="ajax-link" href="<?php echo site_url("admin") ?>"><i class="bi bi-house-door"></i> Dashboard </a>
            </li>
          <?php endif; ?>

          <?php if ($admin["access"]["admin_access"] && $admin["access"]["users"]): ?>
  <li class="<?php if (route(1) == "clients") : echo 'active' ; endif; ?>">
        <a class="ajax-link" href="<?php echo site_url("admin/clients") ?>">
          <i class="bi bi-person-lines-fill"></i><span> Clients</span>
        </a>
      </li>

<?php endif; ?>

<?php if ($admin["access"]["admin_access"]): ?>
  <li class="<?php if (route(1) == "fund-add-history") : echo 'active' ; endif; ?>">
    <a class="ajax-link" href="<?php echo site_url("admin/fund-add-history"); ?>">
      <i class="bi bi-cash-stack"></i> Payments
    </a>
  </li>
<?php endif; ?>

          <?php if ($admin["access"]["admin_access"] && $admin["access"]["services"]): ?>
    <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> 
            <i class="bi bi-list-task"></i> Services <span class="caret"></span>
        </a>
        <ul class="dropdown-menu dropdown-max-height">
            <li class="<?php if (route(1) == "services") : echo 'active'; endif; ?>">
                <a class="ajax-link" href="<?php echo site_url("admin/services") ?>">
                    <i class="bi bi-list-columns"></i><span> Services</span>
                </a>
            </li>
            <li class="<?php if (route(1) == "update-prices") : echo 'active'; endif; ?>">
                <a class="ajax-link" href="<?php echo site_url("admin/update-prices") ?>">
                    <i class="bi bi-cloud-upload"></i><span> Update Prices</span>
                </a>
            </li>
            <li class="<?php if (route(1) == "bulk") : echo 'active'; endif; ?>">
                <a class="ajax-link" href="<?php echo site_url("admin/bulk") ?>">
                    <i class="bi bi-file-earmark-spreadsheet"></i><span> Bulk Services Editor</span>
                </a>
            </li>
                <!-- Newly Added Menu Items -->
            <li class="<?php if (route(1) == "bulkc") : echo 'active'; endif; ?>">
                <a class="ajax-link" href="<?php echo site_url("admin/bulkc") ?>">
                    <i class="fa fa-list-ol"></i><span> Bulk Category Editor</span>
                </a>
            </li>
            <li class="<?php if (route(1) == "category-sort") : echo 'active'; endif; ?>">
                <a class="ajax-link" href="<?php echo site_url("admin/category-sort") ?>">
                    <i class="bi bi-sort-alpha-down"></i><span> Category Sort</span>
                </a>
            </li>
        
        
        </ul>
    </li>
<?php endif; ?>

          <?php if ($admin["access"]["admin_access"] && $admin["access"]["orders"]): ?>
    <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
            <i class="bi bi-bag-check"></i> Orders 
            <span class='badge' style='background-color: #6d47bb'><?= countRow(['table' => 'tasks', 'where' => ['task_status' => 'inprogress']]); ?></span>
        </a>
        <ul class="dropdown-menu dropdown-max-height">
            <li class="<?php if (route(1) == "orders") : echo 'active'; endif; ?>">
                <a class="ajax-link" href="<?php echo site_url("admin/orders") ?>">
                    <i class="bi bi-bag"></i><span> Orders</span>
                </a>
            </li>
            <li>
                <a href="<?php echo site_url('admin/tasks') ?>">
                    <i class="bi bi-x-circle"></i> Cancel 
                    <span class='badge' style='background-color: #6d47bb'>
                        <?= countRow(['table' => 'tasks', 'where' => ['task_status' => 'inprogress']]); ?>
                    </span>
                </a>
            </li> 
        </ul>
    </li>
<?php endif; ?>



          <?php if ($admin["access"]["admin_access"] && $admin["access"]["tickets"]): ?>
            <li class="<?php if (route(1) == "tickets") : echo 'active' ; endif; ?>"><a class="ajax-link" href="<?php echo site_url("admin/tickets") ?>"><i class="bi bi-headset"></i><span> Tickets 
            <?php if(countRow(["table"=>"tickets","where"=>["client_new"=>2]])>0){ ?>
            <span class="badge" style="background: linear-gradient(to right, #ff0000, #ff4d4d);"><?=countRow(["table"=>"tickets","where"=>["client_new"=>2]]);?></span>
            <?php } ?></span></a></li>
          <?php endif; ?>

<?php if ($admin["access"]["admin_access"] && $admin["access"]["additionals"]): ?>
  <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
      <i class="bi bi-question-circle"></i> Additionals <span class="caret"></span>
    </a>
    <ul class="dropdown-menu dropdown-max-height">
      <li class="<?php if (route(1) == "referrals") : echo 'active' ; endif; ?>">
        <a class="ajax-link" href="<?php echo site_url("admin/referrals") ?>"><i class="bi bi-award"></i><span> Affiliates</span></a>
      </li>
      <li class="<?php if (route(1) == "earn") : echo 'active' ; endif; ?>">
        <a class="ajax-link" href="<?php echo site_url("admin/earn") ?>"><i class="bi bi-graph-up"></i><span> Statistics</span></a>
      </li>
      <li class="<?php if (route(1) == "broadcasts") : echo 'active' ; endif; ?>">
        <a class="ajax-link" href="<?php echo site_url("admin/broadcasts") ?>"><i class="bi bi-megaphone"></i><span> Broadcasts</span></a>
      </li>
      <li class="<?php if (route(1) == "logs") : echo 'active' ; endif; ?>">
        <a class="ajax-link" href="<?php echo site_url("admin/logs") ?>"><i class="bi bi-file-earmark-text"></i><span> Panel Logs</span></a>
      </li>

      <li class="<?php if (route(1) == "reports") : echo 'active' ; endif; ?>">
        <a class="ajax-link" href="<?php echo site_url("admin/reports") ?>"><i class="bi bi-bar-chart-line"></i><span> Reports</span></a>
      </li>
      <!-- Added Updates option -->
      <li class="<?php if (route(1) == "updates") : echo 'active' ; endif; ?>">
        <a class="ajax-link" href="<?php echo site_url("admin/updates") ?>"><i class="bi bi-cloud-arrow-down"></i><span> Updates</span></a>
      </li>
      <li class="<?php if (route(1) == "child-panels") : echo 'active' ; endif; ?>">
        <a class="ajax-link" href="<?php echo site_url("admin/child-panels") ?>"><i class="bi bi-ui-checks-grid"></i><span> Child Panels</span></a>
      </li>
    </ul>
  </li>
<?php endif; ?>


          <?php if ($admin["access"]["admin_access"] && $admin["access"]["appearance"]): ?>
            <li class="<?php if (route(1) == "appearance") : echo 'active' ; endif; ?>"><a class="ajax-link" href="<?php echo site_url("admin/appearance") ?>"><i class="bi bi-sun"></i><span> Appearance</span></a></li>
          <?php endif; ?>

          <?php if ($admin["access"]["admin_access"] && $admin["access"]["settings"]): ?>
            <li class="<?php if (route(1) == "settings") : echo 'active' ; endif; ?>"><a class="ajax-link" href="<?php echo site_url("admin/settings") ?>"><i class="bi bi-gear"></i><span> Settings</span></a></li>
          <?php endif; ?>

          <?php if ($admin["access"]["admin_access"] && $admin["access"]["feedback"]): ?>
            <li class="<?php if (route(1) == "feedback") : echo 'active' ; endif; ?>"><a class="ajax-link" href="<?php echo site_url("admin/feedback") ?>"><i class="bi bi-chat-left-dots"></i><span> Feedback</span></a></li>
          <?php endif; ?>


 
 <?php if ($admin["mode"] == "dark") : ?>

<li><a id="enable-light-mode" href="javascript:void(0)"><i class="bi bi-sun"></i><span> Light Mode</span></a></li>

<?php else: ?>

<li><a id="enable-dark-mode" href="javascript:void(0)"><i class="bi bi-moon"></i><span> Dark Mode</span></a></li>

<?php endif; ?>


<li class="dropdown">
  <a class="ajax-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">
    <i class="bi bi-person-circle"></i><span class="caret"></span>
  </a>
  <ul class="dropdown-menu">

    <?php if ($admin["access"]["admin_access"] && $admin["access"]["manager"]): ?>
    <li class="<?php if(route(1) == "manager") : echo "active" ; endif;?>">
      <a href="<?php echo site_url("admin/manager"); ?>" class="ajax-link"><i class="bi bi-shield-lock"></i> Manager</a>
    </li>
    <?php endif; ?>

    <li role="separator" class="divider"></li>
    <li class="<?php if (route(1) == "account") : echo 'active' ; endif; ?>">
      <a class="ajax-link" href="<?php echo site_url("admin/account") ?>"><i class="bi bi-person"></i><span> Account</span></a>
    </li>
    <li>
      <a class="ajax-link" href="admin/logout"><i class="bi bi-box-arrow-right"></i> Logout</a>
    </li>
  </ul>
</li>


<?php endif; ?>






</ul>
    </div>

</div>
</nav>