-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_department.php
More file actions
60 lines (54 loc) · 1.94 KB
/
view_department.php
File metadata and controls
60 lines (54 loc) · 1.94 KB
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
<?php
include "connect.php"; // Include your database connection file
?>
<!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>View Department</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<button class="btn btn-primary my-5">
<a href="add_department.php" class="text-light"> Add Department </a>
</button>
<table class="table">
<thead class="thead-light">
<tr>
<th scope="col">DeptID</th>
<th scope="col">DeptName</th>
<th scope="col">DeptDescription</th>
<th scope="col">DeptHead</th>
<th scope="col">proff_ID</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * from Department";
$result = mysqli_query($con, $sql);
if ($result) {
while ($row = mysqli_fetch_assoc($result)) {
$dept_id = $row['DepartmentID'];
$dept_name = $row['DeptName'];
$dept_description = $row['DeptDescription'];
$dept_head = $row['DeptHead'];
$prof_id = $row['ProfessorID'];
echo '
<tr>
<th scope="row">' . $dept_id . '</th>
<td>' . $dept_name . '</td>
<td>' . $dept_description . '</td>
<td>' . $dept_head . '</td>
<td>' . $prof_id . '</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</body>
</html>