-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstudent.php
78 lines (73 loc) · 2.67 KB
/
student.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
<?php require_once('include/top.php');
if (!isset($_SESSION['username'])) {
header('Location: login.php');
}
$session_username = $_SESSION['username'];
$session_role4 = $_SESSION['role'];
?>
<?php require_once('server.php'); ?>
</head>
<body>
<div id="wrapper">
<?php require_once('include/header.php'); ?>
<div class="container-fluid body-section">
<div class="row">
<div class="col-md-3">
<?php require_once('include/left-sidebar.php'); ?>
</div>
<div class="col-md-9">
<h1><i class="fa fa-user" aria-hidden="true"></i> Welcome <?php echo ucfirst($session_username);?></h1><hr>
<ol class="breadcrumb">
<li><a href="home.php"><i class="fa fa-tachometer"></i> Dashboard</a></li>
<li class="active"><i class="fa fa-user"></i> Students</li>
</ol>
<?php
if ($session_role4 == 'instructor') {
?>
<h3>Students :</h3>
<?php
$query = "SELECT * FROM `users` WHERE `role` = 'student'";
$run = mysqli_query($db,$query);
if (mysqli_num_rows($run) > 0) {
?>
<table class="table table-hover table-bordered table-striped">
<thead>
<tr>
<th>Sr #</th>
<th>Student Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_array($run)) {
$student_id = $row['id'];
$student_username = $row['username'];
$student_email = $row['email'];
?>
<tr>
<td><?php echo $student_id;?></td>
<td><?php echo $student_username;?></td>
<td><?php echo $student_email;?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php
}
else{
echo "<center><h2> No Students Avaliable </h2></center>";
}
?>
<?php
}
else if ($session_role4 == 'student'){
?>
<div class="col-md-9">
<a href="view-quizzes.php" class="btn btn-primary">View Quizzes</a>
</div>
<?php } ?>
</div>
</div>
</div>
<?php require_once('include/footer.php'); ?>