<?php

if(core::ifGet("id")) {
    document::delete(core::getGet("id"));
    json::create("documents");
    json::create("documents-limited");

    historique::recRef("/document-" . core::getGet("id").".html");
    historique::add(array(
        "idType" => historique::getIdRef("ACTION"),
        "idUser" => session::getId(),
        "idPage" => historique::getIdRef("/document-" . core::getGet("id").".html"),
        "log" => "Supression du document"
    ));
}

header("Location: /documents.html");
exit();
