-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewAttendance.html
206 lines (192 loc) · 5.96 KB
/
viewAttendance.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
<!DOCTYPE html>
<html>
<head>
<title>
View - Attendance-Manager
</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="assets/css/view.css">
<link rel="icon" type="x-type/image" href="assets/imgs/favicon.png">
</head>
<body>
<!-- Header -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img class="logo" src="assets/imgs/favicon.png">
Attendance Manager
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="index.html">
<i class="fas fa-home"></i> Home
</a>
</li>
<li class="nav-item" onclick="showTab('searchByDate')">
<a class="nav-link" href="#">
<i class="fas fa-calendar"></i> Search By Date
</a>
</li>
<li class="nav-item" onclick="showTab('searchByClass')">
<a class="nav-link" href="#">
<i class="fas fa-pen"></i> Fetch By Class
</a>
</li>
<li class="nav-item" onclick="showTab('customSearch')">
<a class="nav-link" href="#">
<i class="fas fa-database"></i> Custom By Search
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<i class="fas fa-info-circle"></i> About
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Container -->
<!-- div class="main-container">
<div class="btn-container">
<button class="btn btn-success" id="btn">View By Date</button>
<button class="btn btn-primary" id="btn2">View Full Attendance</button>
</div>
</div> -->
<!-- View by date form -->
<style>
body {
}
.row {
width: 100%;
margin: 0px auto;
}
</style>
<main class="row container d-flex justify-content-center">
<div class="col-12 col-xs-12 col-sm-12 col-md-8 col-lg-9">
<div id="searchByDate" class="tab" style="display: block">
<h2 class="">Search By Date</h2>
<fieldset>
<label>Date</label>
<input type="date" id="date" class="form-control">
</fieldset>
<button class="btn btn-warning" id="viewByDateBtn"><i class="fas fa-search"></i> View</button>
<table class="table table-bordered text-white container">
<thead class="table-dark">
<th>Total</th>
<th>Present</th>
<th>Absent</th>
<th>Date</th>
</thead>
<tbody id="table-body"></tbody>
</table>
</div>
<!-- Viw by full attendance form -->
<div id="searchByClass" class="tab">
<h2 class="">Search By Class</h2>
<fieldset>
<label>Class</label>
<select class="form-control">
<option>Select</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>
</fieldset>
<button class="btn btn-warning"><i class="fas fa-search"></i> View</button>
<table class="table table-bordered text-white container">
<thead class="table-dark">
<th>Date</th>
<th>Total</th>
<th>Present</th>
<th>Absent</th>
</thead>
<tbody id="table-body"></tbody>
</table>
</div>
<!-- View by date form -->
<div id="customSearch" class="tab">
<h2 class="">Custom Search</h2>
<fieldset>
<label>Class</label>
<select class="form-control">
<option>Select</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>
</fieldset>
<fieldset>
<label>Date</label>
<input type="date" name="" class="form-control">
</fieldset>
<button class="btn btn-warning"><i class="fas fa-search"></i> View</button>
<table class="table table-bordered text-white container">
<thead class="table-dark">
<th>Total</th>
<th>Present</th>
<th>Absent</th>
<th>Date</th>
</thead>
<tbody id="table-body"></tbody>
</table>
</div>
</div>
</main>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.bundle.min.js"></script>
<script src="https://kit.fontawesome.com/de41999cf3.js"></script>
<script>
function hideAllTabs() {
$('.tab').hide();
}
function showTab(tab) {
hideAllTabs();
$("#"+tab).show();
}
//FetchSubmissionsByDate
$(document).ready(()=> {
$('#viewByDateBtn').click(() => {
let date = $('#date').val();
let rawData = { date:date };
let data = JSON.stringify(rawData);
$.ajax({
url: 'https://alphacoders.ga/projects/attendance-manager-api/fetchSubmissionsByDate.php',
method: 'POST',
data: data,
dataType: "json",
success: function(res) {
console.log(res);
}
else {
alert(res.msg);
window.location = "index.html";
sessionStorage.setItem('loginStatus', 'false');
}
}
})
})
});
</script>
</body>
</html>