<!DOCTYPE html>
<html>
<head>
  <title>SOLO POOLS Admin</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/css/all.min.css" rel="stylesheet">
  <style>
    body {
      display: flex;
    }

    #sidebar {
      width: 250px;
      background: #343a40;
      color: white;
      min-height: 100vh;
      padding-top: 1rem;
      transition: all 0.3s;
    }

    #sidebar a {
      color: white;
      display: block;
      padding: 10px 20px;
      text-decoration: none;
    }

    #sidebar a:hover {
      background: #495057;
    }

    #content {
      flex-grow: 1;
      padding: 20px;
    }

    #sidebarToggle {
      background: none;
      border: none;
      color: white;
      font-size: 1.5rem;
      margin-left: 10px;
    }

    .submenu {
      padding-left: 20px;
      display: none;
    }

    .submenu a {
      font-size: 0.9rem;
    }

    .dropdown-toggle::after {
      float: right;
      margin-top: 5px;
    }
  </style>
</head>
<body>
  <!-- Sidebar -->
<div id="sidebar">
      <h1>Selamat datang, <?= htmlspecialchars($_SESSION['username']) ?></h1>
    <div class="d-flex justify-content-between align-items-center px-3">
      <h4 class="mt-2">☘ SOLO POOLS</h4>
      <button id="sidebarToggle" onclick="toggleSidebar()"><i class="fas fa-times"></i></button>
    </div>
    <a href="index.php"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
    <a href="add_result.php"><i class="fas fa-store"></i> Result</a>
    <a href="manage_admin.php"><i class="fas fa-user-shield"></i> Kelola Admin</a>
    <a href="manage_markets.php"><i class="fas fa-list"></i> Kelola Pasaran</a>
    <a href="admin_logs.php"><i class="fas fa-list"></i> Admin Logs</a>
    <?php if ($unreadCount > 0): ?>
        <span class="badge badge-danger float-right"><?= $unreadCount ?></span>
    <?php endif; ?>
</a>
    <a href="logout.php"><i class="fas fa-sign-out-alt"></i> Logout</a>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.4/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
  </div>

  <script>
    function toggleSidebar() {
      const sidebar = document.getElementById("sidebar");
      sidebar.style.display = sidebar.style.display === "none" ? "block" : "none";
    }

    function toggleSubmenu(id) {
      const submenu = document.getElementById(id);
      submenu.style.display = submenu.style.display === "block" ? "none" : "block";
    }
  </script>
  
  
</body>
</html>
