-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard-teacher.php
395 lines (364 loc) · 14.2 KB
/
dashboard-teacher.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
<!doctype html>
<html lang="en">
<head>
<title>
Your Dashboard
</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="/docs/4.0/assets/img/favicons/favicon.ico">
<title>Dashboard</title>
<link rel="canonical" href="https://getbootstrap.com/docs/4.0/examples/dashboard/">
<!-- Bootstrap core CSS -->
<link href="bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="dashboard.css" rel="stylesheet">
</head>
<body>
<?php
session_start();
$dept="";
$_SESSION['hod'] = FALSE;
if(!isset($_SESSION['FAC'])){
session_destroy();
header("Location: teacher-signin.html");
}
$faculty = $_SESSION['FAC'];
$conn = mysqli_connect('localhost','root','','test7');
if($conn->connect_error){
echo "$conn->connect_error";
die("Connection Failed : ". $conn->connect_error);
}
else {
$stmt = $conn->query("SELECT t.course_no, c.course_name, c.type, t.year, t.sem_no FROM `teacher's_subject` as t, courses as c WHERE t.faculty_id ='".$faculty."' AND t.course_no=c.course_no;");
?>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0">
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="#">University</a>
<span class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
<h1 style="color:#fff;" align="center;">
Dashboard
</h1>
</span>
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" href="signout.php">Sign out</a>
</li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<nav class="col-md-2 d-none d-md-block bg-light sidebar">
<div class="sidebar-sticky">
<ul class="nav flex-column" id="flex">
<li class="nav-item">
<a class="nav-link active" href="#">
<span data-feather="home"></span>
Dashboard <span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#info" >
<span data-feather="info"></span>
Info
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#course">
<span data-feather="book-open"></span>
Courses
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#map">
<span data-feather="plus"></span>
Course Mapping
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#student">
<span data-feather="plus"></span>
Student Performance
</a>
</li>
</ul>
</div>
</nav>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<h2 id="course">Courses Taught</h2>
<br>
<div class="table-responsive">
<table class="table table-bordered table-sm">
<thead>
<tr>
<th>Course ID</th>
<th>Course Name</th>
<th>Course Type</th>
<th>Year</th>
<th>Semester</th>
</tr>
</thead>
<tbody>
<?php
if(mysqli_num_rows($stmt)>0){
while($row = $stmt->fetch_assoc()){
echo "<tr>";
foreach($row as $i){
echo "<td>$i</td>";
}
echo "</tr>";
}
}
?>
</tbody>
</table>
</div>
<?php
$stmt = $conn->query("SELECT * from faculty WHERE faculty_id='".$faculty."';");
if(mysqli_num_rows($stmt)==1) {
if($row = $stmt->fetch_assoc()){
?>
<br><hr><br>
<h2 id="info">Faculty Information <a href="update_teacher_profile.php" class="btn btn-info" style="float:right;">Edit Profile</a></h2>
<br>
<div class="col-md-12">
<div class="card mb-3">
<div class="card-body">
<div class="row">
<div class="col-sm-3">
<h6 class="mb-0">Full Name</h6>
</div>
<div class="col-sm-9 text-secondary">
<?php
echo $row['faculty_name'];
?>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-3">
<h6 class="mb-0">Faculty ID</h6>
</div>
<div class="col-sm-9 text-secondary">
<?php
echo $row['faculty_id'];
?>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-3">
<h6 class="mb-0">Email</h6>
</div>
<div class="col-sm-9 text-secondary">
<?php
echo $row['email_id'];
?>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-3">
<h6 class="mb-0">Phone</h6>
</div>
<div class="col-sm-9 text-secondary">
<?php
echo $row['contact_number'];
?>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-3">
<h6 class="mb-0">Salary</h6>
</div>
<div class="col-sm-9 text-secondary">
<?php
echo $row['salary'];
?>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-3">
<h6 class="mb-0">Year of Joining</h6>
</div>
<div class="col-sm-9 text-secondary">
<?php
echo $row['year_of_joining'];
?>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-3">
<h6 class="mb-0">Department</h6>
</div>
<div class="col-sm-9 text-secondary">
<?php
$dept = $row['department_id'];
echo $row['department_id'];
?>
</div>
</div>
</div>
</div>
<?php
}
}
?>
<br><hr><br>
<div id="map">
<form class="form-horizontal" action="teacher-course-mapping.php" method="post">
<fieldset class="fieldset">
<h2 class="fieldset-title">Course Info</h2>
<div class="form-group">
<label class="col-md-2 col-sm-3 col-xs-12 control-label">Course Name</label>
<div class="col-md-10 col-sm-9 col-xs-12">
<?php
$query = $conn->query("SELECT course_no, course_name FROM courses;"); // Run your query
?>
<select name="course_selection" class="form-control"> <?php
// Loop through the query results, outputing the options one by one
while ($row = $query->fetch_assoc()) {
echo '<option value="'.$row['course_no'].'">'.$row['course_name'].'</option>';
}?> </select>
<p class="help-block">Select a course to teach</p>
</div>
</div>
<?php
echo "<input type='hidden' name='faculty_id' value='".$faculty."'/>";
?>
<div class="form-group">
<label class="col-md-2 col-sm-3 col-xs-12 control-label">Year</label>
<div class="col-md-10 col-sm-9 col-xs-12">
<input type="text" name="year" class="form-control" value="SpeedyBecky" pattern="^[0-9]{4}$">
<p class="help-block">Enter a year</p>
</div>
</div>
<div class="form-group">
<div class="col-md-10 col-sm-9 col-xs-12 col-md-push-2 col-sm-push-3 col-xs-push-0">
<input class="btn btn-primary" type="submit" value="Add">
</div>
</div>
</fieldset>
</form>
</div>
<div id="student">
<form class="form-horizontal" action="student_marks.php" method="post">
<fieldset class="fieldset">
<h2 class="fieldset-title">Student Marks entry</h2>
<div class="form-group">
<label class="col-md-2 col-sm-3 col-xs-12 control-label">Course Name</label>
<div class="col-md-10 col-sm-9 col-xs-12">
<?php
$year="";
$query = $conn->query("SELECT c.course_no, c.course_name, t.year, s.sem_no FROM courses as c, `teacher's_subject` AS t, semester as s WHERE c.course_no=s.course_no AND t.faculty_id='".$faculty."' AND c.course_no=t.course_no;"); // Run your query
?>
<select name="course_no" class="form-control"> <?php
// Loop through the query results, outputing the options one by one
while ($row = $query->fetch_assoc()) {
echo '<option value="'.$row['course_no'].'">'.$row['course_name']." - ".$row['year'].'</option>';
$year = $row['year'];
}
?>
</select>
<input type="hidden" name="year" class="form-control" value="<?php echo $year;?>">
<p class="help-block">Select a course to enter the marks</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-sm-3 col-xs-12 control-label">Course Name</label>
<div class="col-md-10 col-sm-9 col-xs-12">
<?php
$query = $conn->query("SELECT mis, first_name, middle_name, last_name FROM student WHERE department_Id='".$dept."' ;"); // Run your query
?>
<select name="mis" class="form-control"> <?php
// Loop through the query results, outputing the options one by one
while ($row = $query->fetch_assoc()) { // Course (Teacher's subject), semseter year -> Students, pointer
echo "<option value='".$row['mis']."'>".$row['mis']." - ".$row['first_name']." ".$row['middle_name']." ".$row['last_name']."</option>";
}?> </select>
<p class="help-block">Select a student</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-sm-3 col-xs-12 control-label">Pointer</label>
<div class="col-md-10 col-sm-9 col-xs-12">
<input class="form-control" type="text" name="pointer" placeholder="Enter Pointer"/>
<p class="help-block">Enter the pointer </p>
</div>
<div class="form-group">
<label class="col-md-2 col-sm-3 col-xs-12 control-label">Attempts</label>
<div class="col-md-10 col-sm-9 col-xs-12">
<input type="text" class="form-control" name="attempt_no" placeholder="Enter Number of Attempts">
<p class="help-block">Enter attempt number</p>
</div>
<div class="form-group">
<label class="col-md-2 col-sm-3 col-xs-12 control-label">Status</label>
<div class="col-md-10 col-sm-9 col-xs-12">
<select name="status" class="form-control">
<option value="pass"> Passed</option>
<option value="fail"> Failed</option>
</select>
<p class="help-block">Enter status</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-sm-3 col-xs-12 control-label">Semester</label>
<div class="col-md-10 col-sm-9 col-xs-12">
<select name="sem_no" class="form-control">
<?php
for($i=1;$i<9;$i++){
echo '<option value="'.$i.'"> '.$i.'</option>';
}
?>
</select>
<p class="help-block">Enter semester number</p>
</div>
</div>
<div class="form-group">
<div class="col-md-10 col-sm-9 col-xs-12 col-md-push-2 col-sm-push-3 col-xs-push-0">
<input class="btn btn-primary" type="submit" name="submit" value="Add">
</div>
</div>
</fieldset>
</form>
</div>
</main>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery-slim.min.js"><\/script>')</script>
<script src="../../assets/js/vendor/popper.min.js"></script>
<script src="../../dist/js/bootstrap.min.js"></script>
<!-- Icons -->
<script src="https://unpkg.com/feather-icons/dist/feather.min.js"></script>
<script>
feather.replace()
</script>
<script>
// Get the container element
var btnContainer = document.getElementById("flex");
// Get all buttons with class="btn" inside the container
var options = btnContainer.getElementsByClassName("nav-link");
// Loop through the buttons and add the active class to the current/clicked button
for (var i = 0; i < options.length; i++) {
options[i].addEventListener("click", function() {
var current = document.getElementsByClassName("active");
current[0].className = current[0].className.replace(" active", "");
this.className += " active";
});
}
</script>
<?php
}
$conn->close();
?>
</body>
</html>