-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocessEmployees.php
More file actions
executable file
·77 lines (69 loc) · 2.78 KB
/
processEmployees.php
File metadata and controls
executable file
·77 lines (69 loc) · 2.78 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
<link rel="stylesheet" href="styles.css">
<head>
<title>
Covid Database
</title>
<div class="topnav">
<a href="covid.html">Home</a>
<a href="about.html">About</a>
<a href="vaccine.html">Record a Vaccination</a>
<a href="location.php">Find a Vaccination Location</a>
<a href="status.php">Search Vaccination Status</a>
<a class="active" href="employees.php">Show Employees</a>
</div>
</head>
<body>
<?php
include 'connectDB.php';
$vaxSite = $_POST["vaxSite"];
echo "<h1>Showing Employees Working at ".$vaxSite." </h1><br>";
echo "<table class=\"center\" style=\"width:80%\">";
echo "<caption><h3>Doctors</h3></caption>";
echo "<tr>
<th>Name</th>
<th>ID Number</th>
</tr>";
$query = "select DoctorID from EmploysDoctor where VaxSiteName = '".$vaxSite."'";
$DoctorID = $connection->query($query);
while ($row = $DoctorID->fetch())
{
$query2 = "select DoctorLastName, DoctorFirstName, DoctorMiddleName from Doctor where DoctorID = '".$row["DoctorID"]."'";
$DoctorName = $connection->query($query2);
while ($row2 = $DoctorName->fetch())
{
echo "<tr>";
echo "<td>".$row2["DoctorFirstName"]." ".$row2["DoctorMiddleName"]." ".$row2["DoctorLastName"]."</td>";
echo "<td>".$row["DoctorID"]."</td>";
echo "</tr>";
}
}
echo "<table class=\"center\" style=\"width:80%\">";
echo "<caption><h3>Nurses</h3></caption>";
echo "<tr>
<th>Name</th>
<th>ID Number</th>
</tr>";
$query = "select NurseID from EmploysNurse where VaxSiteName = '".$vaxSite."'";
$NurseID = $connection->query($query);
while ($row = $NurseID->fetch())
{
$query2 = "select NurseLastName, NurseFirstName, NurseMiddleName from Nurse where NurseID = '".$row["NurseID"]."'";
$NurseName = $connection->query($query2);
while ($row2 = $NurseName->fetch())
{
echo "<tr>";
echo "<td>".$row2["NurseFirstName"]." ".$row2["NurseMiddleName"]." ".$row2["NurseLastName"]."</td>";
echo "<td>".$row["NurseID"]."</td>";
echo "</tr>";
}
}
?>
<style>
table, th, td {
width: 50%;
}
</style>
</body>
</html>