<?php
// Function to verify if Notification System is active
function sendNotification($pdo, $user_id, $type, $title, $message, $link = null) {
    try {
        $sql = "INSERT INTO notifications (user_id, type, title, message, link) VALUES (?, ?, ?, ?, ?)";
        $stmt = $pdo->prepare($sql);
        $stmt->execute([$user_id, $type, $title, $message, $link]);
        return true;
    } catch (Exception $e) {
        // Log error but don't break main flow
        error_log("Notification Error: " . $e->getMessage());
        return false;
    }
}
?>
