<?php
function isLoggedIn() {
    return isset($_SESSION['user_id']);
}

function isAdmin() {
    return isset($_SESSION['role']) && $_SESSION['role'] === 'admin';
}

function isPenguji() {
    return isset($_SESSION['role']) && $_SESSION['role'] === 'penguji';
}

function redirect($url) {
    header("Location: $url");
    exit;
}

function sanitize($data) {
    return htmlspecialchars(strip_tags(trim($data)));
}

function formatTanggal($date) {
    return date('d-m-Y', strtotime($date));
}
?>