-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
index.php
51 lines (43 loc) · 1.39 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
<?php
if (!isset($_SESSION)) {
session_start();
}
// Signed In User check
if (!isset($_SESSION['st']['userId'])) {
header('Location: sign-in.php');
exit;
}
// Include Settings
include 'includes/config.php';
// Include Functions
include 'includes/functions.php';
// Include Sessions & Localizations
include 'includes/sessions.php';
// Account Sign Out
if (isset($_GET['action']) && $_GET['action'] == 'signout') {
session_destroy();
header('Location: sign-in.php');
}
// Link to the Page
if (isset($_GET['page']) && $_GET['page'] == 'newTask') {
$page = 'newTask';
} elseif (isset($_GET['page']) && $_GET['page'] == 'viewTask') {
$page = 'viewTask';
} elseif (isset($_GET['page']) && $_GET['page'] == 'notes') {
$page = 'notes';
} elseif (isset($_GET['page']) && $_GET['page'] == 'newNote') {
$page = 'newNote';
} elseif (isset($_GET['page']) && $_GET['page'] == 'viewNote') {
$page = 'viewNote';
} elseif (isset($_GET['page']) && $_GET['page'] == 'profile') {
$page = 'profile';
} else {
$page = 'dashboard';
}
if (file_exists('pages/'.$page.'.php')) {
// Load the Page
include 'pages/'.$page.'.php';
} else {
echo '<h3>Error — Page Not Found.</h3>';
}
include 'includes/footer.php';