-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
79 lines (77 loc) · 1.89 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
72
73
74
75
76
77
78
79
<?php
/**
* Page Name:index.php
* Author: Rutul Patel
* Student Number: 200335158
* Description of Page: This Page is Main index page for the CMS.
* Get reference from COMP1006 Lesson 12 Repository
*/
include_once('Controllers/user.php');
if (!isset($_GET["pageId"])) {
if (isUser()) {
$title = "Dashboard";
$templateString = 'Views/dashboard.php';
} else {
$title = "Home";
$templateString = 'Views/home.php';
}
} else {
switch ($_GET["pageId"]) {
case "About":
$title = "About Us";
$templateString = 'Views/content/about.php';
break;
case "Contact":
$title = "Contact Us";
$templateString = 'Views/content/contact.php';
break;
case "Login":
$title = "Login";
$templateString = 'Views/users/login.php';
break;
case "Logout":
include_once("Controllers/user.php");
Logout();
$title = "Home";
$templateString = 'Views/dashboard.php';
break;
case "Register":
$title = "Register";
$templateString = 'Views/users/register.php';
break;
case "PagesList":
$title = "Pages";
$templateString = 'Views/pages/list.php';
break;
case "PageDetails";
if ($_GET["pageID"] == 0) {
$title = "Add Page";
} else {
$title = "Edit Page";
}
$templateString = 'Views/pages/details.php';
break;
case "PageUpdate":
$title = "Update Page";
$templateString = 'Views/pages/update.php';
break;
case "PageDelete":
$title = "Delete Page";
$templateString = 'Views/pages/delete.php';
break;
case "PageView":
$title = "Page View";
$templateString = 'Views/pages/page.php';
break;
default:
$title = "404";
$templateString = "Views/errors/404.php";
break;
}
}
?>
<?php include_once('Views/partials/header.php'); ?>
<?php include_once('Scripts/pureChat.php'); ?>
<?php include_once('Views/partials/navbar.php'); ?>
<?php require($templateString); ?> <!-- Content -->
<?php include_once('Views/partials/footer.php');