123456789101112131415161718192021222324252627
  1. <?php
  2. require_once(dirname(__DIR__) . "/models/document.class.php");
  3. require_once(dirname(__DIR__) . "/models/promo.class.php");
  4. function document()
  5. {
  6. set("title", "Document");
  7. set("data", Document::getAll());
  8. set("promos", Promo::getAll());
  9. return html("list.html.php", "layout.html.php");
  10. }
  11. function add_document()
  12. {
  13. Document::addDocument($_FILES["document"], [
  14. "rang" => $_POST["rang"],
  15. "promo" => $_POST["promo"],
  16. "libelle" => $_POST["libelle"]
  17. ]);
  18. }
  19. function delete_document($fileid)
  20. {
  21. (new Document($fileid))->erase();
  22. }