-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnits.php
73 lines (59 loc) · 1.52 KB
/
Units.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
<?php
session_start();
if(!isset($_SESSION['id']))
{
header("Location: http://localhost/Login.html");
}
?>
<!DOCTYPE html>
<html>
<head>
<link
href = "./style.css"
type = "text/css"
rel = "stylesheet">
<title>MCS-Desktop</title>
<script type="text/javascript" src="jquery.js"></script>
<script>
$(document).ready(function() {
$('#Units tr').click(function() {
var href = $(this).find("a").attr("href");
if(href) {
window.location = href;
}
});
});
</script>
</head>
<body bgcolor="#BFF1EF">
<form action = "Logout.php">
<input type="submit" value="Logout">
</form>
<div id="User">
<?php
$USER = $_SESSION["uName"];
echo "Signed in as: $USER";
?>
<div>
<?php
include("config.php");
$sql = "SELECT * FROM Unit;";
$result = mysqli_query($db,$sql);
echo "<table id='Units'>"; // start a table tag in the HTML
echo "<tr>
<td>Medical Care System</td>
</tr>";
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{ //Creates a loop to loop through results
echo "<tr>
<td><a class='not-active' href='/PatientList.php?Units=" . $row['unitCode'] . "'>Unit " . $row['unitCode'] . "</a></td>
<td>" . $row['unitName'] . "</td>
</tr>";
}
echo "</table>"; //Close the table in HTML*/
?>
<form class="logout" action="PatientSearch.html">
<input type="submit" value="Patient Search">
</form>
</body>
</html>