-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocessLocation.php
More file actions
executable file
·61 lines (53 loc) · 2.23 KB
/
processLocation.php
File metadata and controls
executable file
·61 lines (53 loc) · 2.23 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
<!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 class="active" href="location.php">Find a Vaccination Location</a>
<a href="status.php">Search Vaccination Status</a>
<a href="employees.php">Show Employees</a>
</div>
</head>
<body>
<?php
include 'connectDB.php';
echo "<br>";
$vaxType = $_POST["vaxType"];
echo "<h1>Showing Locations Offering the ".$vaxType." Vaccine</h1>";
echo "<table class=\"center\" style=\"width:80%\">";
echo "<tr>
<th>Vaccination Site</th>
<th>Address</th>
<th>Number of Doses</th>
</tr>";
$query = "select distinct VaxSiteName from VaccineLot where CompanyName = '".$vaxType."'";
$vaxSiteName = $connection->query($query);
while ($row = $vaxSiteName->fetch())
{
$query2 = "select VaxLotNumDoses from VaccineLot where VaxSiteName = '".$row["VaxSiteName"]."' and CompanyName = '".$vaxType."'";
$vaxLotNums = $connection->query($query2);
$query3 = "select distinct * from VaccinationSite where VaxSiteName = '".$row["VaxSiteName"]."'";
$vaxSiteAddress = $connection->query($query3);
$count = 0;
while($row2 = $vaxLotNums->fetch())
{
$count = $count + $row2["VaxLotNumDoses"];
}
while ($row3 = $vaxSiteAddress->fetch())
{
echo "<tr>";
echo "<td>".$row3["VaxSiteName"]."</td>";
echo "<td>".$row3["VaxSiteStreetNum"]." ".$row3["VaxSiteStreet"].", ".$row3["VaxSiteCity"].", ".$row3["VaxSiteProvince"].", ".$row3["VaxSitePostalCode"]."</td>";
echo "<td>".$count."</td>";
echo "</tr>";
}
}
?>
</body>
</html>