浏览代码

Use layout fo login and data extraction

LaurentTreguier 9 年前
父节点
当前提交
4b84cfb4ae
共有 7 个文件被更改,包括 23 次插入23 次删除
  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 查看文件

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

+ 8
- 2
controllers/data.php 查看文件

1
 <?php
1
 <?php
2
 
2
 
3
+include_once(dirname(__DIR__)."../models/data.class.php");
4
+
3
 function data()
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
 function data_extract()
12
 function data_extract()
9
 {
13
 {
10
-    // TODO
14
+    header("Content-Type: text/csv");
15
+    
16
+    echo Data::extract();
11
 }
17
 }
12
 
18
 
13
 function alter_data()
19
 function alter_data()

+ 3
- 1
controllers/files.php 查看文件

2
 
2
 
3
 function files()
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
 function add_file()
10
 function add_file()

+ 3
- 1
controllers/login.php 查看文件

2
 
2
 
3
 function login()
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
 function check_login()
10
 function check_login()

+ 3
- 1
controllers/promo.php 查看文件

2
 
2
 
3
 function promo()
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
 function add_promo()
10
 function add_promo()

+ 0
- 2
index.php 查看文件

20
 dispatch_delete("/promo/:promoid", "delete_promo");
20
 dispatch_delete("/promo/:promoid", "delete_promo");
21
 
21
 
22
 run();
22
 run();
23
-
24
-?>

+ 5
- 15
views/login.html.php 查看文件

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>