-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDoctor's page.html
126 lines (106 loc) · 2.49 KB
/
Doctor's page.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
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
<!DOCTYPE html>
<!--Code By Webdevtrick ( https://webdevtrick.com )-->
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Light Javascript Table Filter</title>
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
margin-top: 150px;
font-family: 'Lato', sans-serif;
background:url(images/backg.jpg);
}
input {
width: 200px;
border-radius: 5px;
text-align: center;
border: 1px solid #212121;
height: 40px;
}
table {
margin-top: 30px;
}
tr:nth-of-type(even) {
background: #ffd98b;
}
thead {
background: #fbb016;
}
h1{
color: white;
}
</style>
</head>
<body>
<section class="container">
<h1>Patients</h2>
<input type="search" class="light-table-filter" data-table="table-info" placeholder="Search">
<table class="table-info table">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone No</th>
<th>ID</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="Add/Samples-Table/patientAdd.html">Umurerwa Charles</a></td>
<td>[email protected]</td>
<td>0123456789</td>
<td>01</td>
</tr>
<tr>
<td>Nkusi Eric</td>
<td>[email protected]</td>
<td>0155456789</td>
<td>02</td>
</tr>
<tr>
<td>Grace Jay</td>
<td>[email protected]</td>
<td>0155456789</td>
<td>02</td>
</tr>
</tbody>
</table>
</section>
</body>
<script>
(function(document) {
'use strict';
var TableFilter = (function(Arr) {
var _input;
function _onInputEvent(e) {
_input = e.target;
var tables = document.getElementsByClassName(_input.getAttribute('data-table'));
Arr.forEach.call(tables, function(table) {
Arr.forEach.call(table.tBodies, function(tbody) {
Arr.forEach.call(tbody.rows, _filter);
});
});
}
function _filter(row) {
var text = row.textContent.toLowerCase(), val = _input.value.toLowerCase();
row.style.display = text.indexOf(val) === -1 ? 'none' : 'table-row';
}
return {
init: function() {
var inputs = document.getElementsByClassName('light-table-filter');
Arr.forEach.call(inputs, function(input) {
input.oninput = _onInputEvent;
});
}
};
})(Array.prototype);
document.addEventListener('readystatechange', function() {
if (document.readyState === 'complete') {
TableFilter.init();
}
});
})(document);
</script>
</html>