<?php
require 'session-check.php';

$stmt = $pdo->prepare("SELECT role FROM users WHERE id=?");
$stmt->execute([$_SESSION['user_id']]);
$user = $stmt->fetch();

if(!$user || $user['role'] !== 'admin'){
    header("Location: ../view/app-login.php");
    exit();
}
?>
