-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfinalList.html
216 lines (160 loc) · 5.35 KB
/
finalList.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
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!doctype html>
<html>
<head>
<title>Final List</title>
<link rel="stylesheet" href="main.css">
<!-- Bootstrap css -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<header>
<nav>
<ul>
<li><a href="home.html">Enter Class ID</a></li>
<li><a href="attendify.html">Present Students</a></li>
<li><a href="finalList.html">Final List</a></li>
</ul>
</nav>
<div class="h1-container">
<div class="h1">
Final List
</div>
</div>
</header>
<br>
<br>
<!-- selectors for present tardy absent -->
<select id="myselect" onchange="change_myselect(this.value)">
<option value="">Choose an option:</option>
<option value="present">Present</option>
<option value="tardy">Tardy</option>
<option value="absent">Absent</option>
</select>
<!-- <script>
function change_myselect(sel) {
var obj, dbParam, xmlhttp, myObj, x, txt = "";
obj = { table: sel, limit: 20 };
dbParam = JSON.stringify(obj);
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
myObj = JSON.parse(this.responseText);
txt += "<table border='1'>"
for (x in myObj) {
txt += "<tr><td>" + myObj[x].name + "</td></tr>";
}
txt += "</table>"
document.getElementById("demo").innerHTML = txt;
}
};
xmlhttp.open("POST", "json_demo_db_post.php", true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.send("x=" + dbParam);
}
</script> -->
<!-- source code for making a xml request and parsing the data -->
<script>
var xmlhttp = new XMLHttpRequest();
var url = "http://localhost:3000/studentid";
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myArr = JSON.parse(this.responseText);
myFunction(myArr);
}
};
xmlhttp.open("GET", url, true);
xmlhttp.send();
function myFunction(arr) {
var presentppl = "present people = ";
var tardyppl = "tardy people = ";
var absentppl = "absent people = ";
var i;
var present = 'present'
var tardy = 'tardy'
var absent = 'absent'
for(i = 0; i < arr.length; i++) {
if((arr[i].attendence) == present){
presentppl += arr[i].name + "," + " ";
}
}
for(i = 0; i < arr.length; i++) {
if((arr[i].attendence) == tardy){
tardyppl += arr[i].name + "," + " ";
}
}
for(i = 0; i < arr.length; i++) {
if((arr[i].attendence) == absent){
absentppl += arr[i].name + "," + " ";
}
}
document.getElementById("id01").innerHTML = presentppl;
document.getElementById("id02").innerHTML = tardyppl;
document.getElementById("id03").innerHTML = absentppl;
}
</script>
<!-- <script type="text/Javascript">
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = JSON.parse(this.responseText);
document.getElementById("demo").innerHTML = myObj.name;
function myFunction() {
document.getElementById("studentName").innerHTML = myObj;
}
};
xmlhttp.open("GET", "http://localhost:3000/studentid", true);
xmlhttp.send();
</script> -->
<div class="studentNames">
<div style="text-align:center;">
<span id="id01"></span>
<br>
<span id="id02"></span>
<br>
<span id="id03"></span>
</div>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<div class="take-attendence-contianer">
<div class="take-attendence">
<div style="text-align:center;">
<button type="button" class="btn btn-outline-success" ><a href="home.html">Done</a></button>
</div>
</div>
</div>
<!-- <div class="list-container"> -->'
<!-- <div class="container">
<div class="row">
<div class="col-xs-12">
<table>
<tr>
<th> # </th>
<th>   Present </th>
<th>   Absent </th>
</tr>
<tr>
<td>1</td>
<td>  Sean</td>
<td>  Pooley</td>
</tr>
<tr>
<td>2</td>
<td>  Ryan</td>
<td>  Shcwulst</td>
</tr>
<tr>
<td>3</td>
<td>  Kyle</td>
<td>  Beecham</td>
</tr>
</table>
</div>
</div>
</div>
-->
<!-- Latest compiled and minified Javascript -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>