<?php
/**
 * Prince VIP System - Notifications AJAX
 */
require_once __DIR__ . '/../config/database.php';
if (!isLoggedIn()) { echo json_encode(['success' => false]); exit; }

$db = getDB();
$action = $_GET['action'] ?? $_POST['action'] ?? '';

if ($action === 'markAllRead') {
    $db->prepare("UPDATE notifications SET is_read = 1 WHERE user_id = ?")->execute([$_SESSION['user_id']]);
    redirect('../notifications.php');
}
