-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
71 lines (58 loc) · 1.99 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Prescription Advisor</title>
<link rel="stylesheet" href="./css/style.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous"> <script src="./js/script.js"></script>
<script src="js/index.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse bg-inverse navbar-fixed-top">
<a class="navbar-brand" href="login.html" style="color:white">Prescription Advisor</a>
</nav>
<div class="row">
<div class="main col-md-9">
<div class="header">
<h1 id="name"><script>
// Pull patient name from login
var data = localStorage.getItem('_name');
if (!data){
document.location.href = 'error/404.html';
};
localStorage.removeItem('_name'); // Remove name from local storage
//convert back to readable format
data = atob(data);
let name = JSON.parse(data);
document.write("Patient: " + name.First + " " + name.Last)
</script></h1>
</div>
<div class="search">
<input id="search" type="text" class="form-control" name="search" placeholder="Medication...">
<button id="submit" type="button" class="btn" name="button" onclick="checkMedication()">Submit</button>
</div>
<div id="alerts">
<!-- Medication alerts will be generated here -->
</div>
</div>
<div class="medication col-md-3">
<h3>Current Medication</h3>
<div id="drugs">
<!-- Current medication will be generated here -->
</div>
</div>
</div>
<script type="text/javascript">
// Get json from list of medication stored from login
var drugs = localStorage.getItem('_drugs');
localStorage.removeItem('_drugs');
drugs = atob(drugs);
var medication = JSON.parse(drugs);
var id = medication.code;
medication = medication.drug
for (var i = 0; i < medication.length; i++) {
generateCard(id[i], medication[i]);
}
</script>
</body>
</html>