<?php
session_start();
include('../include/connect.php');
if (isset($_SESSION['username']) && $_GET['Action'] == 'SANG-HR') {
    $Manv = "[" . $_SESSION['username'] . "];";

    // $ids = implode(",",$_POST["id"]);
    $ids = $_GET['id'];
    // $deactive = "UPDATE inf SET active=0 where n_id IN(".$ids.")";
    $deactive = "UPDATE notice SET seen = IF(seen IS NULL OR seen = '', '" . $Manv . "', CONCAT(seen, '" . $Manv . "')) WHERE n_id = '" . $ids . "'";

    $result = mysqli_query($link, $deactive);
    header('Content-Type: application/json');
    echo json_encode(mysqli_error($link));
} else {
    header('location:../template/index.php?mod=error');   //redirect đến trang error.php
    exit();
}
