<?php
require_once '../includes/config.php';
requireLogin();
header('Content-Type: application/json');
$user = getCurrentUser();
$db   = getDB();
$db->prepare("UPDATE notifications SET is_read=1 WHERE user_id=? AND is_read=0")->execute([$user['id']]);
echo json_encode(['success'=>true]);
