-
Notifications
You must be signed in to change notification settings - Fork 0
/
student-list.php
61 lines (54 loc) · 1.69 KB
/
student-list.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
<?php
include('config.php');
include('check-login.php');
$sql = "SELECT student.*, department.name AS department_id FROM student INNER JOIN department ON student.department_id=department.id ORDER BY student.id DESC";
$sql_query = mysqli_query($con, $sql) or die('Something went wrong!');
?>
<!doctype html>
<html>
<head>
<title>Admission List</title>
<link rel="stylesheet" href="assets/css/style.css"/>
<style>
td, th {
border: 1px solid #000;
border-collapse: collapse;
}
th {
background-color: #ddd;
}
</style>
</head>
<body>
<?php include('includes/header.php') ?>
<div class="container">
<div>
<?php include('includes/left-sidebar.php') ?>
<main>
<table style="font-size: 20px; border:1px solid #ddd;padding-bottom:70px; border-collapse: collapse;">
<tr>
<th>SID</th>
<th>FULL NAME</th>
<th>DATE OF BIRTH</th>
<th>Gender</th>
<th>Department</th>
<th>PROFILE</th>
</tr>
<?php while($student = $sql_query->fetch_assoc()){ ?>
<tr>
<td><?php echo $student['id']; ?></td>
<td><?php echo $student['first_name']." ".$student['last_name']; ?></td>
<td><?php echo $student['date_of_birth']; ?></td>
<td><?php echo $student['gender'] == 'F' ? "Female":"Male"; ?></td>
<td><?php echo $student['department_id']; ?></td>
<td><a href="student-profile.php?student_id=<?php echo $student['id']; ?>">Profile</a></td>
</tr>
<?php } ?>
<h2>Student List: <?php echo $sql_query->num_rows; ?></h2>
</table>
</main>
</div>
</div>
<?php include('includes/footer.php') ?>
</body>
</html>