<!----------------------------------Login------------------------------------>
<?php

include 'php/db_connection.php';

// শুধুমাত্র লগইন করা ইউজার পেজ দেখতে পারবে
if (!isset($_SESSION['user_id'])) {
    header("Location: login.php");
    exit();
}

$userName = $_SESSION['user_name'];
$role = $_SESSION['role']; // ✅ এখানে role সেভ করা হচ্ছে
$userId = $_SESSION['user_id'];


$isAdmin = ($_SESSION['role'] == 'admin');

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Custom Dashboard</title>
     <!-- <head> Due pageএর মধ্যে -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!--Due Page </body> এর আগে -->
     <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <!-- Bootstrap CSS -->
    <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome for icons -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <!-- Include Bootstrap Icons -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
    <!-- Custom CSS -->
   
    <style>
        /* Sidebar styling */
        .sidebar {
            background-color: #343a40;
            color: #ffffff;
            min-height: 100vh;
            position: fixed;
            width: 250px;
            padding-top: 20px;
        }
        .sidebar .logo {
            font-size: 1.5rem;
            font-weight: bold;
            color: #ffffff;
            text-align: center;
            padding-bottom: 20px;
        }
        .sidebar .nav-link {
            color: #adb5bd;
            padding: 10px 20px;
            display: block;
            font-size: 1rem;
        }
        .sidebar .nav-link.active, .sidebar .nav-link:hover {
            color: #ffffff;
            background-color: #495057;
        }
        
        /* Dashboard content styling */
        .dashboard-content {
            margin-left: 250px;
            padding: 20px;
            background-color: #f8f9fa;
            min-height: 100vh;
        }
        .dashboard-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 20px;
            background-color: #6c757d;
            color: #ffffff;
            border-radius: 0 0 10px 10px;
        }
        
        /* Box styling */
        .boxes .box {
            background-color: #ffffff;
            border-radius: 5px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            padding: 20px;
            text-align: center;
        }
        .boxes .box i {
            font-size: 2rem;
            color: #6c757d;
            margin-bottom: 10px;
        }
        .boxes .box .number {
            font-size: 1.5rem;
            font-weight: bold;
            color: #333333;
        }
        
        /* Responsive adjustments */
        @media (max-width: 992px) {
            .sidebar {
                width: 100%;
                position: relative;
                min-height: auto;
            }
            .dashboard-content {
                margin-left: 0;
            }
        }
    </style>
</head>
<body>


    
    <!-- Sidebar -->
    <div class="sidebar">
        <div class="logo">
            <i class="fas fa-camera-retro"></i> Vai Vai Digital Studio
        </div>
        <nav class="nav flex-column">
            <a href="index.php" class="nav-link active"><i class="fas fa-home"></i> Dashboard</a>
            <a href="sail_product.php" class="nav-link"><i class="fas fa-shopping-cart"></i> Pos Product</a>
            <a href="add_new_scen.php" class="nav-link"><i class="fas fa-shopping-cart"></i> Pos</a>
            <a href="scan.php" class="nav-link"><i class="fas fa-shopping-cart"></i> Pos</a>
            <a href="add_product_name.php" class="nav-link"><i class="fas fa-box"></i> Add Product</a>
            <a href="products_expiration.php" class="nav-link"><i class="fas fa-box"></i> Products Expiration</a>
            <a href="stock_alerts.php" class="nav-link"><i class="fas fa-box"></i> StockAlerts</a>
            <a href="Customer.php" class="nav-link"><i class="fas fa-users"></i> Customer</a>
            <a href="php/customar_due/due_collections_list.php" class="nav-link"><i class="fas fa-users"></i>Due</a>
            <a href="customer_search_summary.php" class="nav-link"><i class="fas fa-users"></i>customer summary</a>
            <a href="suppliers.php" class="nav-link"><i class="fas fa-user"></i> suppliers</a>
            <a href="suppliers_bill.php" class="nav-link"><i class="fas fa-user"></i> suppliers Bill</a>
            <a href="sales_all_data.php" class="nav-link"><i class="fas fa-chart-line"></i> Sales All</a>
            <a href="sailes.php" class="nav-link"><i class="fas fa-chart-line"></i>sailes</a>
            <a href="return_page.php" class="nav-link"><i class="fas fa-chart-line"></i>Return</a>
            <a href="fetch_invoice_products.php" class="nav-link"><i class="fas fa-chart-line"></i>Return Products</a>
            <a href="daily_report.php?days=30" class="nav-link"><i class="fas fa-chart-line"></i>Day Reprot</a>
            <a href="monthly_report.php" class="nav-link"><i class="fas fa-chart-line"></i>Monthly Reprot</a>
            <a href="cost_detelis.php" class="nav-link"><i class="fas fa-wallet"></i> Cost Management</a>
            <a href="manage_users.php" class="nav-link"><i class="fas fa-user"></i> User</a>
        </nav>
    </div>
      <!-- Main Dashboard Content -------------------------ড্যার্বোড বন্ধ করা হলো-------------------------------->
      <div class="dashboard-content">
        <div class="dashboard-header1">
            
        </div><!-----এই ডিভ কাটা যাবে না-------------------------------->
    <!-- Main Dashboard Content -->
    <!-----------------------------------------ইউজারের প্রফাল কোড------------------------------------- -->
  <style>
    .profile-img {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      object-fit: cover;
    }
    .topbar {
      background-color: #f8fafc;
      padding: 10px 20px;
    }
    .search-box {
      max-width: 250px;
    }
    .icon-btn {
      background: none;
      border: none;
      margin-left: 10px;
    }
    .username {
      font-weight: bold;
    }
    .profile-section {
      display: flex;
      align-items: center;
      gap: 10px;
    }
  </style>
</head>
<body>

<div class="topbar d-flex justify-content-between align-items-center">
  <!-- Search -->
  <div class="search-box input-group">
    <input type="text" class="form-control" placeholder="Search">
    <button class="btn btn-outline-secondary" type="button">
      <i class="bi bi-search"></i>
    </button>
  </div>

  
  <div class="d-flex align-items-center">
    <!-- Right side --
     Info Icon --
    <button class="icon-btn text-primary" title="Info">
      <i class="bi bi-info-circle-fill fs-5"></i>
    </button>

    <!-- Language Flag --
    <img src="https://flagcdn.com/16x12/bd.png" class="ms-2" alt="EN">

    <!-- Bell Icon ---------
    <button class="icon" title="Notifications">
      <i class="bi bi-bell-fill fs-5"></i>
    </button>-->

    <!-- Profile Section -->
    <div class="profile-section ms-3">
      <div>
        <div class="username"><strong><?php echo htmlspecialchars($userName); ?></strong></div>
        <small class="text-muted"><?php echo ucfirst($role); ?></small>
      </div>
      <img src="https://www.svgrepo.com/show/384674/account-avatar-profile-user-11.svg" class="profile-img" alt="Profile">
    </div>

   <!-- লগআউট আইকন -->
      <a href="logout.php" title="Logout">
        <button class="icon">
          <i class="bi bi-power"></i>
        </button>
      </a>
  </div>
</div>
 <hr class="my-3">
</body>
</html>


    
    <!-------------------------------------------উপরে ইউজারের প্রফাইল কোড----------------------------->
    <!-- Optional JavaScript -->
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>



