<?php
session_start();
require "../database/connect.php";
$user_id = $_SESSION['user_id'];
$db_sql = "SELECT * FROM users WHERE user_id = '$user_id'";
$db_result = $connection->query($db_sql);
while ($row = $db_result->fetch_assoc()) {
  $full_name = $row['full_name'];
  $role = $row['role'];
  $email = $row['email'];
  $password = $row['password'];
  $image = $row['image'];
  $username = $row['username'];

}

if ($role != 'admin') {
    echo "<script>
            window.location.href = 'logout.php'
        </script>";
}

?>
