<?php
session_start();
require_once __DIR__ . "/../config/db.php";
require_once __DIR__ . "/inbox_helper.php";

header('Content-Type: application/json');

$role = $_SESSION['role'] ?? '';
$department_id = $_SESSION['department_id'] ?? null;

echo json_encode(getInboxData($conn, $role, $department_id));