-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
71 lines (50 loc) · 1.37 KB
/
index.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
<?php
/* MAIN SCRIPTS */
include "./main/database.php";
include "./main/authenticate.php";
include './main/helpers.php';
/* FILE ROUTING */
// Action Router
if (!empty($_GET['action'])) {
include './actions/' . $_GET['action'] . ".php";
mysqli_close($conn);
exit();
// Parameter Router
} else if (empty($_GET['view'])) {
$url = $_SERVER['REQUEST_URI'];
$url .= (parse_url($url, PHP_URL_QUERY) ? '&' : '?') . 'view=main';
header("Location: $url");
mysqli_close($conn);
exit();
// View Router
} else {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Title and Favicon -->
<title>PayPartner</title>
<!-- Bootstrap CSS -->
<link href="./assets/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="./assets/custom.css" rel="stylesheet">
<!-- jQuery -->
<script src="./assets/jquery.min.js"></script>
<!-- Custom JS -->
<script src="./assets/custom.js"></script>
</head>
<body class="container">
<?php
include "./views/" . $_GET['view'] . ".php";
?>
<!-- Bootstrap Bundle -->
<script src="./assets/bootstrap.bundle.min.js"></script>
</body>
</html>
<?php
}
mysqli_close($conn);
?>