-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.php
95 lines (72 loc) · 2.14 KB
/
app.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
class app
{
public $func;
public $model;
public $cont;
function __construct(){
$this->controller = new main();
}
function run($contName){
switch($contName){
case '/':
$this->index();
break;
case 'login':
$this->login();
break;
case 'profile':
$this->profile();
break;
case 'board':
$this->board();
break;
case 'user':
$this->user();
break;
case '404':
$this->no();
break;
}
}
public function index(){
require_once("conts/index.php");
$this->cont = new indexController();
$this->cont->main();
}
public function login(){
require_once("conts/login.php");
$this->cont = new loginController();
if(isset($_POST['signin']) && $_POST['signin'] == 'login'){
$this->cont->login();
}else
$this->cont->main();
$this->cont->main();
}
public function profile(){
require_once("conts/profile.php");
$this->cont = new profileController();
if(isset($_GET['action']) AND $_GET['action'] == 'logout'){
$this->cont->logout();
}else{
$this->cont->main();
}
}
public function board(){
require_once("conts/board.php");
$this->cont = new boardController();
if(isset($_GET['id']) AND is_numeric($_GET['id']))
$this->cont->main($_GET['id']);
else{
$this->cont->main();
}
}
public function user(){
require_once("conts/user.php");
$this->cont = new userController();
}
public function no(){
require_once("conts/no.php");
$this->cont = new noController();
}
}