<?php
session_start();
include '../koneksi.php';

if(!isset($_SESSION['admin'])){
    echo json_encode(['success' => false]);
    exit();
}

$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;

if($id > 0){
    mysqli_query($koneksi, "UPDATE notifications SET is_read = 1 WHERE id = '$id'");
    echo json_encode(['success' => true]);
} else {
    echo json_encode(['success' => false]);
}
?>