-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocessAddVaccination.php
More file actions
executable file
·74 lines (67 loc) · 2.8 KB
/
processAddVaccination.php
File metadata and controls
executable file
·74 lines (67 loc) · 2.8 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
<!-- If the patient selected by the user is in the database or has just been added to the database, direct the user to this page -->
<?php
session_start();
?>
<!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 class="active" 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 href="employees.php">Show Employees</a>
</div>
</head>
<body>
<?php
include 'connectDB.php';
echo "<br>";
try
{
// Save all the entered information about the patient's vaccination
$DOV = $_POST["date"];
$TOV = $_POST["time"];
$OHIPNum = $_SESSION['OHIPNum'];
$lotNum = $_POST["lotNum"];
$location = $_POST["location"];
$FirstName = $_SESSION["FirstName"];
$MiddleName = $_SESSION["MiddleName"];
$LastName = $_SESSION["LastName"];
// Add the vaccination to the Vaccination table in the database
$sql = "INSERT INTO Vaccination (VaxDate, VaxTime, PatientOHIP, VaxLotID, VaxSiteName)
VALUES (\"$DOV\", \"$TOV\", \"$OHIPNum\", \"$lotNum\", \"$location\")";
$connection->exec($sql);
}
catch(PDOException $e)
{
echo $sql . "<br>" . $e->getMessage();
}
echo "<h2>Showing Vaccinations For ".$FirstName." ".$MiddleName." ".$LastName.", OHIP # ".$OHIPNum."</h2><br>";
echo "<table class=\"center\" style=\"width:80%\">
<tr>
<th>Vaccination Date</th>
<th>Vaccination Time</th>
<th>Lot ID</th>
<th>Vaccination Location</th>
</tr>";
$query = "select * from Vaccination where PatientOHIP = '".$OHIPNum."'";
$result = $connection->query($query);
while ($row = $result->fetch())
{
echo "<tr>";
echo "<td>".$row["VaxDate"]."</td>";
echo "<td>".$row["VaxTime"]."</td>";
echo "<td>".$row["VaxLotID"]."</td>";
echo "<td>".$row["VaxSiteName"]."</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>