|
@@ -12,17 +12,21 @@ function document()
|
12
|
12
|
|
13
|
13
|
function add_document()
|
14
|
14
|
{
|
15
|
|
- $options = [];
|
16
|
|
-
|
17
|
|
- foreach(["rang", "promo", "libelle"] as $field)
|
18
|
|
- $options[$field] = $_POST[$field];
|
19
|
|
-
|
20
|
|
- File::addDocument($_FILES["document"], $options);
|
|
15
|
+ File::addDocument($_FILES["document"], [
|
|
16
|
+ "rang" => $_POST["rang"],
|
|
17
|
+ "promo" => $_POST["promo"],
|
|
18
|
+ "libelle" => $_POST["libelle"]
|
|
19
|
+ ]);
|
21
|
20
|
}
|
22
|
21
|
|
23
|
22
|
function alter_document()
|
24
|
23
|
{
|
25
|
|
- // TODO
|
|
24
|
+ $document = new Document($_POST["id"]);
|
|
25
|
+
|
|
26
|
+ $document->setRang($_POST["rang"]);
|
|
27
|
+ $document->setPromo($_POST["promo"]);
|
|
28
|
+ $document->setLibelle($_POST["libelle"]);
|
|
29
|
+ $document->setFichier($_POST["fichier"]);
|
26
|
30
|
}
|
27
|
31
|
|
28
|
32
|
function delete_document()
|