<?php
session_start();

if (isset($_SESSION['new_report'])) {
    echo json_encode([
        "status" => "new_report",
        "report_number" => $_SESSION['new_report']['report_number'],
        "rating" => $_SESSION['new_report']['rating']
    ]);

    // Resetta la variabile di sessione per evitare duplicati
    unset($_SESSION['new_report']);
} else {
    echo json_encode(["status" => "no_new_report"]);
}
