-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathview-patients.php
53 lines (49 loc) · 1.45 KB
/
view-patients.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
<?php
session_start();
include_once("helpers/db.php");
if(!isset($_SESSION['username'])){
header("Location: login.php");
}
$page_title = "View all patients";
include("inc/header.php");
?>
<link rel="stylesheet" href="assets/css/custom.css">
</head>
<body class="text-center">
<?php include("inc/menu.php"); ?>
<div class="container">
<br><br>
<table class="table">
<tr>
<th>Patient's name</th>
<th>Mobile no.</th>
<th>Sex</th>
<th>Date of birth</th>
<th>Blood group</th>
<th>Added by</th>
</tr>
<?php
$query = "SELECT * FROM patient";
$query_run=mysqli_query($con,$query);
while($data = mysqli_fetch_array($query_run)){
$staff_id = $data['staff_id'];
$staff_details = mysqli_fetch_array(mysqli_query($con, "SELECT staff_name from staff where id=$staff_id"));
$staff_name = $staff_details['staff_name'];
?>
<tr>
<td><?php echo $data['name']?></td>
<td><?php echo $data['phone'] ?></td>
<td><?php echo $data['sex']?></td>
<td><?php echo $data['dob']?></td>
<td><?php echo $data['blood_group']?></td>
<td><?php echo $staff_name?></td>
</tr>
<?php
}
?>
</table>
</div>
<?php
include_once("inc/bootstrap.php");
include_once("inc/footer.php");
?>