Browse Source

Moved mistaken data

Brendan Abolivier 9 years ago
parent
commit
eebd4e8323
2 changed files with 37 additions and 37 deletions
  1. 1
    0
      controllers/data.php
  2. 36
    37
      controllers/document.php

+ 1
- 0
controllers/data.php View File

@@ -6,6 +6,7 @@ function data()
6 6
 {
7 7
     set("title", "Titre");
8 8
     set("data", Data::getAll());
9
+    set("promos", Promo::getAll());
9 10
     
10 11
     return html("list.html.php", "layout.html.php");
11 12
 }

+ 36
- 37
controllers/document.php View File

@@ -1,37 +1,36 @@
1
-<?php
2
-
3
-require_once(dirname(__DIR__) . "/models/document.class.php");
4
-require_once(dirname(__DIR__) . "/models/promo.class.php");
5
-
6
-function document()
7
-{
8
-    set("title", "Titre");
9
-    set("data", Document::getAll());
10
-    set("promos", Promo::getAll());
11
-    
12
-    return html("list.html.php", "layout.html.php");
13
-}
14
-
15
-function add_document()
16
-{
17
-    File::addDocument($_FILES["document"], [
18
-        "rang" => $_POST["rang"],
19
-        "promo" => $_POST["promo"],
20
-        "libelle" => $_POST["libelle"]
21
-    ]);
22
-}
23
-
24
-function alter_document()
25
-{
26
-    $document = new Document($_POST["id"]);
27
-    
28
-    $document->setRang($_POST["rang"]);
29
-    $document->setPromo($_POST["promo"]);
30
-    $document->setLibelle($_POST["libelle"]);
31
-    $document->setFichier($_POST["fichier"]);
32
-}
33
-
34
-function delete_document()
35
-{
36
-    (new File($_POST["id"]))->erase();
37
-}
1
+<?php
2
+
3
+require_once(dirname(__DIR__) . "/models/document.class.php");
4
+require_once(dirname(__DIR__) . "/models/promo.class.php");
5
+
6
+function document()
7
+{
8
+    set("title", "Titre");
9
+    set("data", Document::getAll());
10
+
11
+    return html("list.html.php", "layout.html.php");
12
+}
13
+
14
+function add_document()
15
+{
16
+    File::addDocument($_FILES["document"], [
17
+        "rang" => $_POST["rang"],
18
+        "promo" => $_POST["promo"],
19
+        "libelle" => $_POST["libelle"]
20
+    ]);
21
+}
22
+
23
+function alter_document()
24
+{
25
+    $document = new Document($_POST["id"]);
26
+    
27
+    $document->setRang($_POST["rang"]);
28
+    $document->setPromo($_POST["promo"]);
29
+    $document->setLibelle($_POST["libelle"]);
30
+    $document->setFichier($_POST["fichier"]);
31
+}
32
+
33
+function delete_document()
34
+{
35
+    (new File($_POST["id"]))->erase();
36
+}