<?php
session_start();
include '../db.php';
include '../config.php';

if (isset($_SESSION['ADMINID'])) {
  $adminid = $_SESSION['ADMINID'];
  $select = mysqli_query($link, "SELECT * FROM admin WHERE id = '$adminid' ");
  $row = mysqli_fetch_assoc($select);
  $password = $row['password'];
  $username = $row['username'];
} else {
  // header("location: ");
  echo "<script>window.location.href = 'signin.php' </script>";
}
?>

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

<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>Admin Dashboard</title>
  <!-- base:css -->
  <link rel="stylesheet" href="vendors/mdi/css/materialdesignicons.min.css">
  <link rel="stylesheet" href="vendors/base/vendor.bundle.base.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
  <link rel="stylesheet" href="css/style.css?v=<?php echo uniqid(); ?>">
  <!-- endinject -->
  <link rel="shortcut icon" href="../uploads/<?php echo $site_logo; ?>" />


  <style>
    .table-dark thead th {
      background: #152A47;
    }

    .table-dark tbody td {
      background: #152A47;
    }
  </style>
</head>

<body>
  <div class="container-scroller">
    <!-- partial:partials/_horizontal-navbar.html -->
    <div class="horizontal-menu">
      <nav class="navbar top-navbar col-lg-12 col-12 p-0">
        <div class="container-fluid">
          <div class="navbar-menu-wrapper d-flex align-items-center justify-content-between">
            <ul class="navbar-nav navbar-nav-left">


            </ul>
            <div class="text-center navbar-brand-wrapper d-flex align-items-center justify-content-center">
              <a class="navbar-brand brand-logo" href="dashboard.php"><img src="../uploads/<?php echo $site_logo; ?>" alt="logo" /></a>
              <a class="navbar-brand brand-logo-mini" href="dashboard.php"><img src="../uploads/<?php echo $site_logo; ?>" alt="logo" /></a>
            </div>
            <ul class="navbar-nav navbar-nav-right">



              <li class="nav-item nav-profile dropdown">
                <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" id="profileDropdown">
                  <span class="nav-profile-name">Admin</span>
                  <span class="online-status"></span>
                  <img src="images/faces/face28.png" alt="profile" />
                </a>
                <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="profileDropdown">
                  <a href="settings.php" class="dropdown-item">
                    <i class="mdi mdi-settings text-primary"></i>
                    Settings
                  </a>
                  <a href="logout.php" class="dropdown-item">
                    <i class="mdi mdi-logout text-primary"></i>
                    Logout
                  </a>
                </div>
              </li>
            </ul>
            <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="horizontal-menu-toggle">
              <span class="mdi mdi-menu"></span>
            </button>
          </div>
        </div>
      </nav>
      <nav class="bottom-navbar">
        <div class="container">
          <ul class="nav page-navigation">
            <li class="nav-item">
              <a class="nav-link" href="dashboard.php">
                <i class="mdi mdi-file-document-box menu-icon"></i>
                <span class="menu-title">Dashboard</span>
              </a>
            </li>
            <li class="nav-item">
              <a href="add-tracking.php" class="nav-link">
                <i class="mdi mdi-grid menu-icon"></i>
                <span class="menu-title">Add Tracking</span>
                <i class="menu-arrow"></i>
              </a>
            </li>
            <li class="nav-item">
              <a href="account.php" class="nav-link">
                <i class="mdi mdi-account menu-icon"></i>
                <span class="menu-title">Account</span>
                <i class="menu-arrow"></i>
              </a>
            </li>
            <li class="nav-item">
              <a href="settings.php" class="nav-link">
                <i class="mdi mdi-settings menu-icon"></i>
                <span class="menu-title">Settings</span>
                <i class="menu-arrow"></i>
              </a>
            </li>
            <li class="nav-item">
              <a href="logout.php" class="nav-link">
                <i class="mdi mdi-close menu-icon"></i>
                <span class="menu-title">Logout</span>
                <i class="menu-arrow"></i>
              </a>

            </li>



          </ul>
        </div>
      </nav>
    </div>
    <!-- partial -->
    <div class="container-fluid page-body-wrapper">
      <div class="main-panel">
        <div class="content-wrapper">