-
Notifications
You must be signed in to change notification settings - Fork 0
/
clerk.php
105 lines (86 loc) · 3.76 KB
/
clerk.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
96
97
98
99
100
101
102
103
104
105
<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./static/css/spectre.min.css">
<link rel="stylesheet" href="./static/css/spectre-exp.min.css">
<link rel="stylesheet" href="./static/css/spectre-icons.min.css">
<link rel="stylesheet" href="./static/css/main.css">
<script defer src="./static/js/alpine.min.js"></script>
<script defer src="./static/js/main.js"></script>
<title>Clerk | Cyber Tuition Saujana</title>
</head>
<body>
<?php
include './views/components/NavClerk.php';
include './views/components/NotFound.php';
include './views/ClerkUI.php';
include './auth/ProtectRoute.auth.php';
//error_reporting(0);
// $protectClerk = new ProtectRoute();
// $protectClerk->validateClerk();
// Render Navbar for clerk.php
navClerk();
//=====================================================================//
//========================= ROUTE HANDLER =========================//
//=====================================================================//
// ****
// * *
// * *
// ** **
// * *
// **
// Render Not Found message if there is
// no tab and section params in the URL
// For example: localhost/clerk.php
if (empty($_GET['tab']) || empty($_GET['section'])) {
notFound();
return;
}
// URL: localhost/clerk.php?tab=home§ion=main
if ($_GET['tab'] == 'home' && $_GET['section'] == 'main') {
$clerkUI = new ClerkUI();
$clerkUI->homePage();
// URL: localhost/clerk.php?tab=student§ion=register-list
} else if ($_GET['tab'] == 'student' && $_GET['section'] == 'register-list') {
$clerkUI = new ClerkUI();
$clerkUI->registerListPage();
// URL: localhost/clerk.php?tab=student§ion=fee-payment
} else if ($_GET['tab'] == 'student' && $_GET['section'] == 'fee-payment') {
$clerkUI = new ClerkUI();
$clerkUI->feePaymentPage();
// URL: localhost/clerk.php?tab=staff§ion=add-new
} else if ($_GET['tab'] == 'staff' && $_GET['section'] == 'add-new') {
$clerkUI = new ClerkUI();
$clerkUI->addNewPage();
// URL: localhost/clerk.php?tab=staff§ion=teacher-salary-payment
} else if ($_GET['tab'] == 'staff' && $_GET['section'] == 'teacher-salary-payment') {
$clerkUI = new ClerkUI();
$clerkUI->teacherSalaryPaymentPage();
// URL: localhost/clerk.php?tab=timetable§ion=adjust-timetable
} else if ($_GET['tab'] == 'timetable' && $_GET['section'] == 'adjust-timetable') {
$clerkUI = new ClerkUI();
$clerkUI->adjustTimetablePage();
// URL: localhost/clerk.php?tab=timetable§ion=check-teacher-availability
} else if ($_GET['tab'] == 'timetable' && $_GET['section'] == 'check-teacher-availability') {
$clerkUI = new ClerkUI();
$clerkUI->checkTeacherAvailabilityPage();
// URL: localhost/clerk.php?tab=setting§ion=about-me
} else if ($_GET['tab'] == 'setting' && $_GET['section'] == 'about-me') {
$clerkUI = new ClerkUI();
$clerkUI->aboutMePage();
// URL: localhost/clerk.php?tab=setting§ion=change-password
} else if ($_GET['tab'] == 'setting' && $_GET['section'] == 'change-password') {
$clerkUI = new ClerkUI();
$clerkUI->changePasswordPage();
// If user try to access invalid URL
} else {
notFound();
}
?>
<br>
</body>
</html>