Explorar el Código

Use layout fo login and data extraction

LaurentTreguier hace 9 años
padre
commit
4b84cfb4ae
Se han modificado 7 ficheros con 23 adiciones y 23 borrados
  1. 1
    1
      .gitignore
  2. 8
    2
      controllers/data.php
  3. 3
    1
      controllers/files.php
  4. 3
    1
      controllers/login.php
  5. 3
    1
      controllers/promo.php
  6. 0
    2
      index.php
  7. 5
    15
      views/login.html.php

+ 1
- 1
.gitignore Ver fichero

@@ -1,3 +1,3 @@
1 1
 .idea/
2 2
 *.swp
3
-.tags
3
+.tags*

+ 8
- 2
controllers/data.php Ver fichero

@@ -1,13 +1,19 @@
1 1
 <?php
2 2
 
3
+include_once(dirname(__DIR__)."../models/data.class.php");
4
+
3 5
 function data()
4 6
 {
5
-    return html('data.html.php');
7
+    set("title", "Titre");
8
+    
9
+    return html("data.html.php", "layout.html.php");
6 10
 }
7 11
 
8 12
 function data_extract()
9 13
 {
10
-    // TODO
14
+    header("Content-Type: text/csv");
15
+    
16
+    echo Data::extract();
11 17
 }
12 18
 
13 19
 function alter_data()

+ 3
- 1
controllers/files.php Ver fichero

@@ -2,7 +2,9 @@
2 2
 
3 3
 function files()
4 4
 {
5
-    return html('files.html.php');
5
+    set("title", "Titre");
6
+    
7
+    return html("files.html.php", "layout.html.php");
6 8
 }
7 9
 
8 10
 function add_file()

+ 3
- 1
controllers/login.php Ver fichero

@@ -2,7 +2,9 @@
2 2
 
3 3
 function login()
4 4
 {
5
-    return html('login.html.php');
5
+    set("title", "Titre");
6
+    
7
+    return html("login.html.php", "layout.html.php");
6 8
 }
7 9
 
8 10
 function check_login()

+ 3
- 1
controllers/promo.php Ver fichero

@@ -2,7 +2,9 @@
2 2
 
3 3
 function promo()
4 4
 {
5
-    return html('promo.html.php');
5
+    set("title", "Titre");
6
+    
7
+    return html("promo.html.php", "layout.html.php");
6 8
 }
7 9
 
8 10
 function add_promo()

+ 0
- 2
index.php Ver fichero

@@ -20,5 +20,3 @@ dispatch_delete("/files/:fileid",  "delete_file");
20 20
 dispatch_delete("/promo/:promoid", "delete_promo");
21 21
 
22 22
 run();
23
-
24
-?>

+ 5
- 15
views/login.html.php Ver fichero

@@ -1,15 +1,5 @@
1
-<!DOCTYPE html>
2
-
3
-<html>
4
-    <head>
5
-        <meta charset = "utf-8">
6
-        <title>Login</title>
7
-    </head>
8
-    <body>
9
-        <form method = "POST">
10
-            <input type = "text" placeholder = "identifier"/>
11
-            <input type = "password" placeholder = "password"/>
12
-            <input type = "submit" value = "login"/>
13
-        </form>
14
-    </body>
15
-</html>
1
+<form method="POST">
2
+    <input type="text" placeholder="identifier" />
3
+    <input type="password" placeholder="password" />
4
+    <input type="submit" value="login" />
5
+</form>