
<!----------------------------------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');

?>

<!---------------------------------কন্টেন------------------------------------>
<?php

/*---------------------------------Customar-----------------------------*/
// Fetch customer data
$query = "SELECT * FROM customer";
$result = mysqli_query($con, $query);

// Get total number of customers
$total_customers_query = "SELECT COUNT(*) AS total_customers FROM customer";
$total_customers_result = mysqli_query($con, $total_customers_query);
$total_customers_row = mysqli_fetch_assoc($total_customers_result);
$total_customers = $total_customers_row['total_customers'];



/*---------------------------------Echo- Total Customar-----------------------------*/


/*---------------------------------Customar-----------------------------*/
// Fetch customer data
$query = "SELECT * FROM suppliers";
$result = mysqli_query($con, $query);

// Get total number of customers
$total_suppliers_query = "SELECT COUNT(*) AS total_suppliers FROM suppliers";
$total_suppliers_result = mysqli_query($con, $total_suppliers_query);
$total_suppliers_row = mysqli_fetch_assoc($total_suppliers_result);
$total_suppliers = $total_suppliers_row['total_suppliers'];
?>
