-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.php
67 lines (62 loc) · 3.19 KB
/
menu.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
<?php
$path = $_SERVER["SCRIPT_NAME"];
$file = basename($path, ".php");
if(!empty($_SESSION['role'])){
$role = $_SESSION['role'];
} else {
$role = "GUEST";
}
if ($role == "STUDENT") {
?>
<ul>
<li><a href="student.php" <?php if($file == "student") echo 'class = active' ; ?> >Home</a></li>
<ul style="float:right;list-style-type:none;">
<li><a href="logout.php">Logout</a></li>
</ul>
</ul>
<?php
} else if ($role == "PROFESSOR") {
?>
<ul>
<li><a href="professor.php" <?php if($file == "professor") echo 'class = active' ; ?> >Home</a></li>
<li><a href="manageGrades.php" <?php if($file == "manageGrades") echo 'class = active' ; ?>>Insert Grades</a></li>
<ul style="float:right;list-style-type:none;">
<li><a href="logout.php">Logout</a></li>
</ul>
</ul>
<?php
}
else if ($role == "SECRETARY") {
?>
<ul>
<li><a href="secretary.php" <?php if($file == "secretary") echo 'class = active' ; ?> >Home</a></li>
<li><a href="manageProfessors.php" <?php if($file == "manageProfessors") echo 'class = active' ; ?> >Professors</a></li>
<li><a href="manageStudents.php" <?php if($file == "manageStudents") echo 'class = active' ; ?> >Students</a></li>
<li><a href="manageCourses.php" <?php if($file == "manageCourses") echo 'class = active' ; ?> >Courses</a></li>
<li><a href="manageClasses.php" <?php if($file == "manageClasses") echo 'class = active' ; ?> >Classes</a></li>
<li><a href="manageGrades.php" <?php if($file == "manageGrades") echo 'class = active' ; ?> >Grades</a></li>
<ul style="float:right;list-style-type:none;">
<li><a href="logout.php">Logout</a></li>
</ul>
</ul>
<?php
} else if ($role == "ADMIN") {
?>
<ul>
<li><a href="administrator.php" <?php if($file == "administrator") echo 'class = active' ; ?>>Home</a></li>
<li><a href="manageUniversities.php" <?php if($file == "manageUniversities") echo 'class = active' ; ?>>Universities</a></li>
<li><a href="manageDepartments.php" <?php if($file == "manageDepartments") echo 'class = active' ; ?>>Departments</a></li>
<li><a href="manageProfessors.php" <?php if($file == "manageProfessors") echo 'class = active' ; ?>>Professors</a></li>
<li><a href="manageStudents.php" <?php if($file == "manageStudents") echo 'class = active' ; ?>>Students</a></li>
<li><a href="manageCourses.php" <?php if($file == "manageCourses") echo 'class = active' ; ?>>Courses</a></li>
<li><a href="manageClasses.php" <?php if($file == "manageClasses") echo 'class = active' ; ?>>Classes</a></li>
<li><a href="manageGrades.php" <?php if($file == "manageGrades") echo 'class = active' ; ?>>Grades</a></li>
<ul style="float:right;list-style-type:none;">
<li><a href="logout.php">Logout</a></li>
</ul>
</ul>
<?php
} else {
// menu is not available for guest users
}
?>