-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditFacility.php
189 lines (169 loc) · 8.1 KB
/
editFacility.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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?php
require('db.php');
$Name=$_REQUEST['Name'];
$query = "Select * from gdc353_1.Personnel P WHERE P.ID =".$id.";";
$result = mysqli_query($conn, $query) or die ( mysqli_error($conn));
$facility = mysqli_fetch_assoc($result);
$name = $facility['Name'];
$address = $facility['Address'];
$postal = $facility['PostalCode'];
$city = $facility['City'];
$province = $facility['Province'];
$webaddress = $facility['WebAddress'];
$phonenumber = $facility['phoneNumber'];
$type = $facility['Type'];
$capacity = $facility['Capacity'];
$query = "Select * from gdc353_1.Facility F;";
$facility = mysqli_query($conn, $query) or die ( mysqli_error($conn));
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>View Facility</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div class="form">
<nav><a href="Employees.php">Employees</a>
<a href="Students.php">Students</a>
<a href="Facilities.php">Facilities</a>
<a href="Infections.php">Infections</a>
<a href="Vaccines.php">Vaccines</a>
<a href="Emails.php">Email Log</a>
</nav>
</div>
<div>
<div class="centreContainer">
<h1>Edit Facility</h1>
</div>
<div class="centreContainer">
<form action="SaveFacility.php" name="form" method="post">
<p>
Card Number <input name="ID" value="<?php echo $id ?>" required />
Expiry <input type="date" name="CardExpiry" placeholder="card expiry" required value="<?php echo $expiry;?>" /></p>
<p>
<input type="text" name="FirstName" placeholder="Enter first name" required value="<?php echo $person['FirstName'];?>" />
<input type="text" name="LastName" placeholder="last name" required value="<?php echo $person['LastName'];?>" />
<input type="text" name="Email" placeholder="email" required value="<?php echo $person['Email'];?>" />
</p>
<p><input type="tel" name="Phone" placeholder="phone number" required value="<?php echo $phone;?>" />
<input type="text" name="Address" placeholder="address" required value="<?php echo $address;?>" />
<input type="text" name="PostalCode" placeholder="postal code" required value="<?php echo $postal;?>" />
</p>
<p><input type="text" name="City" placeholder="city" required value="<?php echo $city;?>" />
<input type="text" name="Province" placeholder="province" required value="<?php echo $province;?>" />
<input type="text" name="citizenship" placeholder="citizenship" required value="<?php echo $citizen;?>" />
</p>
<p>Birth date <input type="date" name="DateOfBirth" placeholder="date of birth" required value="<?php echo $bday;?>" /></p>
<input class="button purple_bg" name="submit" type="submit" value="Save Changes" />
<p><a href="DeletePerson.php?id=<?php echo $person["ID"]; ?>" class="dark_bg">Delete Employee</a></p>
</form>
</div>
<h3>Vaccine History</h3>
<table style="border: 1px solid;" width="50%" border="1" style="border-collapse:collapse;">
<thead>
<tr>
<th><strong>Type</strong></th>
<th><strong>Dose</strong></th>
<th><strong>Date</strong></th>
</tr>
</thead>
<tbody>
<?php
$sel_query="Select * from gdc353_1.Vaccine V
WHERE V.PatientID = ".$id.";";
$result = mysqli_query($conn,$sel_query);
while($row = mysqli_fetch_assoc($result)) { ?>
<tr>
<td align="center"><?php echo $row["Type"]; ?></td>
<td align="center"><?php echo $row["Dose"]; ?></td>
<td align="center"><?php echo $row["Date"]; ?></td>
<td align="center">
<a href="deleteVaccine.php?dose=<?php echo $row["Dose"]; ?>" class="dark_bg">Delete</a>
</td>
</tr>
<?php } ?>
<form action="saveVaccine.php" name="form" method="post">
<tr>
<input type="hidden" name="ID" value="<?php echo $id ?>" />
<td><input type="text" name="Type" placeholder="Type" /></td>
<td><input type="text" name="Dose" placeholder="Dose" /></td>
<td><input type="date" name="Date" placeholder="Date" /></td>
<tr>
<tr>
<td>
<input type="submit" class="purple_bg button"></input>
</td>
</tr>
</form>
</tbody>
</table>
<h3>Infection History</h3>
<input type="hidden" name="ID" value="<?php echo $id ?>" />
<table style="border: 1px solid;" width="50%" border="1" style="border-collapse:collapse;">
<thead>
<tr>
<th><strong>Type</strong></th>
<th><strong>Date</strong></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$sel_query="Select * from gdc353_1.Infection I
WHERE I.PatientID = ".$id.";";
$result = mysqli_query($conn,$sel_query);
while($row = mysqli_fetch_assoc($result)) { ?>
<tr>
<td align="center"><?php echo $row["Type"]; ?></td>
<td align="center"><?php echo $row["Date"]; ?></td>
<td align="center">
<a href="deleteVaccine.php?date=<?php echo $row["Date"]; ?>" class="dark_bg">Delete</a>
</td>
</tr>
<?php } ?>
<form action="saveInfection.php" name="form" method="post">
<tr>
<td><input type="text" name="Type" placeholder="Type" /></td>
<td><input type="date" name="Date" placeholder="Date" /></td>
<td>
<input type="submit" class="purple_bg button"></input>
</td>
</tr>
</form>
</tbody>
</table>
<div class="centreContainer">
<h2> Contracts </h2>
<?php if(!$contracts) {echo "<p style='color: red;'>*Employee is missing contract details</p>";} ?>
<?php
while($contracts) { ?>
<div>
<p>Facility: <?php echo $contracts['facility'];?></p>
<p>Position: <?php echo $contracts['position'];?></p>
<p>Start date :<?php echo $contracts['startDate'];?></p>
<p>End date :<?php echo $contracts['endDate'];?></p>
<?php
$date = $contracts['startDate'];
$url = "id={$id}&startDate={$date}";
?>
<a href="deleteContract.php?<?=$url?>">Delete</a>
<br>
</div>
<?php
$contracts = mysqli_fetch_assoc($employee);
}?>
<form action="SaveContract.php" name="form" method="post">
<input name="ID" value="<?php echo $id ?>" readonly />
<p><input type="text" name="position" placeholder="Position" /></p>
<p><input type="date" name="startDate" placeholder="Start date" /></p>
<p><input type="date" name="endDate" placeholder="End date" /></p>
<input type="radio" name="type" <?php if (isset($type) && $type=="Management") echo "checked";?> value="Management">Management
<input type="radio" name="type" <?php if (isset($level) && $level=="Educational") echo "checked";?> value="Educational">Educational
<p><input name="submit" type="submit" value="Submit new contract" /></p>
</form>
</div>
</div>
</body>
</html>