-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_view_student.php
97 lines (86 loc) · 2.18 KB
/
user_view_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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
error_reporting(0);
session_start();
if(!isset($_SESSION['username']))
{
header("location:index.php");
}
elseif($_SESSION['usertype']=='admin')
{
header("location:index.php");
}
$host="localhost";
$user="root";
$password="";
$db="sgs";
$conn=mysqli_connect($host,$user,$password,$db);
$sql="SELECT * FROM studentlist WHERE usertype='student' ORDER BY enroll";
$result=mysqli_query($conn,$sql);
?>
<html>
<head>
<title>Admin panel</title>
<link rel="stylesheet" type="text/css" href="css/admin-style.css">
<style type="text/css">
table
{
border-radius: 10px;
}
.table_th
{
padding: 20px;
font-size: 20px;
background-color: #de3163;
border-radius: 10px;
}
.table_td
{
padding: 20px;
background-color: #fcf4a3;
border-radius: 10px;
}
</style>
</head>
<body>
<!----------------------------------------sidebar code------------------------------------->
<?php
include 'teacher_sidebar.php';
?>
<!------------------------------------------------------------------------------------------>
<div class="content">
<center>
<h1>Student List</h1>
<?php
if($_SESSION['message'])
{
echo $_SESSION['message'];
}
unset($_SESSION['message']);
?>
<br>
<table >
<tr>
<th class="table_th">Enrollment No</th>
<th class="table_th">First Name</th>
<th class="table_th">Last Name</th>
<th class="table_th">Email</th>;
<th class="table_th">Phone</th>
</tr>
<?php
while ($info=$result->fetch_assoc()) {
?>
<tr>
<td class="table_td"><?php echo "{$info['enroll']}"; ?></td>
<td class="table_td"><?php echo "{$info['firstname']}"; ?></td>
<td class="table_td"><?php echo "{$info['lastname']}"; ?></td>
<td class="table_td"><?php echo "{$info['email']}"; ?></td>
<td class="table_td"><?php echo "{$info['phone']}"; ?></td>
</tr>
<?php
}
?>
</center>
</table>
</div>
</body>
</html>