-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocessVaccine.php
More file actions
executable file
·104 lines (85 loc) · 3.86 KB
/
processVaccine.php
File metadata and controls
executable file
·104 lines (85 loc) · 3.86 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?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>";
$OHIPNum = $_POST["OHIP"];
$_SESSION['OHIPNum'] = $OHIPNum;
$result = $connection->query("select * from Patient");
$flag = 0;
while ($row = $result->fetch()) {
if ($row["PatientOHIP"] == $OHIPNum)
{
$flag = 1;
}
}
if ($flag == 1)
{
$query = "select * from Patient where PatientOHIP = '".$OHIPNum."'";
$patient = $connection->query($query);
while ($row = $patient->fetch()) {
echo "<h2>Recording Vaccination for ".$row["PatientFirstName"]." ".$row["PatientMiddleName"]." ".$row["PatientLastName"].", OHIP # ".$row["PatientOHIP"]."</h2><br>";
$_SESSION["FirstName"] = $row["PatientFirstName"];
$_SESSION["MiddleName"] = $row["PatientMiddleName"];
$_SESSION["LastName"] = $row["PatientLastName"];
}
echo "<form action=\"processAddVaccination.php\" method=\"post\">";
echo "<p>Please Enter the Patient's Date of Vaccination:</p>";
echo "<input type=\"date\" name=\"date\">";
echo "<p>Please Enter the Patient's Time of Vaccination:</p>";
echo "<input type=\"time\" name=\"time\">";
echo "<p>Please Enter the Patient's Vaccine Lot Number:</p>";
echo "<select id=\"lotNum\" name=\"lotNum\">";
$result = $connection->query("select * from VaccineLot");
while ($row = $result->fetch())
{
echo "<option value=\"".$row["VaxLotID"]."\">".$row["VaxLotID"]."</option>";
}
echo "</select>";
echo "<p>Please Select the Location of the Vaccination:</p>";
echo "<select id=\"location\" name=\"location\">";
$result = $connection->query("select * from VaccinationSite");
while ($row = $result->fetch())
{
echo "<option value=\"".$row["VaxSiteName"]."\">".$row["VaxSiteName"]."</option>";
}
echo "</select>";
echo "<input type=\"submit\">";
echo "</form>";
}
else
{
echo "<h2>Patient ".$OHIPNum." not Found. Please Register Patient Below:</h2><br>";
echo "<form action=\"processAddPatient.php\" method=\"post\">";
echo "<p>Please Enter the Patient's Last Name:</p>";
echo "<input type=\"text\" name=\"LastName\">";
echo "<p>Please Enter the Patient's First Name:</p>";
echo "<input type=\"text\" name=\"FirstName\">";
echo "<p>Please Enter the Patient's Middle Name:</p>";
echo "<input type=\"text\" name=\"MiddleName\">";
echo "<p>Please Enter the Patient's Date of Birth:</p>";
echo "<input type=\"date\" name=\"DOB\">";
echo "<input type=\"submit\">";
echo "</form>";
}
?>
</body>
</html>