-
Notifications
You must be signed in to change notification settings - Fork 0
/
studentdashboard.php
189 lines (155 loc) · 5.87 KB
/
studentdashboard.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?php
//include auth_session.php file on all user panel pages
include("auth_session.php");
?>
<!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">
<title>Student Dashboard</title>
<!-- <link rel="stylesheet" href="css/bg.css"/> -->
<link rel="stylesheet" href="faculty/index.css">
</head>
<body>
<script src="faculty/index.js"></script>
<nav>
<div class="logo-name">
<div class="logo-image">
<img src="images/logo.png" alt="">
</div>
<span class="logo_name">Easy Assessment</span>
</div>
<div class="menu-items">
<ul class="nav-links">
<li><a href="?page=home">
<i class="uil uil-estate"></i>
<span class="link-name">Dahsboard</span>
</a></li>
<li>
<i class="uil uil course"></i>
<button class="dropdown-btn">
<p>COURSE</p>
</button>
<div class="dropdown-container">
<!-- <a href="?page=addcourse">
<i class="uil uil student"></i>
<span class="link-name linkin">Add Course</span>
</a> -->
<a href="?page=courselist">
<i class="uil uil student"></i>
<span class="link-name linkin">Course list</span>
</a>
</div>
</li>
<li>
<i class="uil uil course"></i>
<button class="dropdown-btn">
<p>EXAM</p>
</button>
<div class="dropdown-container">
<a href="?page=activeexam">
<i class="uil uil student"></i>
<span class="link-name linkin">Pending Exam</span>
</a>
<a href="?page=upcomingexam">
<i class="uil uil student"></i>
<span class="link-name linkin">Upcoming Exam</span>
</a>
<a href="?page=oldexam">
<i class="uil uil student"></i>
<span class="link-name linkin">Old Exam</span>
</a>
</div>
</li>
</ul>
<ul class="logout-mode">
<li><a href="logout.php">
<i class="uil uil-signout"></i>
<span class="link-name">Logout</span>
</a></li>
<li class="mode">
<a href="#">
<i class="uil uil-moon"></i>
<span class="link-name ">Dark Mode</span>
</a>
<div class="mode-toggle">
<span class="switch"></span>
</div>
</li>
</ul>
</div>
</nav>
<section class="dashboard">
<div class="top">
<i class="uil uil-bars sidebar-toggle"></i>
<p>Hey, <?php echo $_SESSION['username']; ?></p>
</div>
<div class="dash-content">
<br>
<?php
if (!isset($_GET['page'])) {
include "student/home.php";
} else {
switch ($_GET['page']) {
case "home":
include "student/home.php";
break;
// case "facultylist":
// include "faculty/facultylist.php";
// break;
case "upcomingexam":
include "student/upcomingexam.php";
break;
case "courselist":
include "faculty/courselist.php";
break;
case "activeexam":
include "student/activeexam.php";
break;
case "giveexam":
include "student/giveexam.php";
break;
case "oldexam":
// $eno=$_GET['eno'];
include "student/oldexam.php";
break;
default:
include "student/home.php";
};
}
?>
</div>
</div>
</div>
</section>
<script src="faculty/script.js"></script>
</body>
</html>
<script>
/* Loop through all dropdown buttons to toggle between hiding and showing its dropdown content - This allows the user to have multiple dropdowns without any conflict */
var dropdown = document.getElementsByClassName("dropdown-btn");
var i;
for (i = 0; i < dropdown.length; i++) {
dropdown[i].addEventListener("click", function () {
this.classList.toggle("active");
var dropdownContent = this.nextElementSibling; if (dropdownContent.style.display === "block") { dropdownContent.style.display = "none"; }
else { dropdownContent.style.display = "block"; }
});
}
</script>
<?php
if (isset($_GET['suserid'])) {
include_once 'db.php';
include("auth_session.php");
$a=$_GET['suserid'];
$sql = "DELETE FROM student WHERE username ='$a'";
if (mysqli_query($con, $sql)=='true') {
echo "<script> ;
window.location.href = 'admindashboard.php?page=studentlist'; </script>" ;
} else {
echo "Error deleting record: " . mysqli_error($conn);
}
}
?>