-
Notifications
You must be signed in to change notification settings - Fork 0
/
AsearchByDate.html
264 lines (207 loc) · 8.34 KB
/
AsearchByDate.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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>BoB 0x10</title>
<meta content="" name="descriptison">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="assets/img/favicon.png" rel="icon">
<link href="assets/img/logo.jpg" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Roboto:300,300i,400,400i,500,500i,700,700i&display=swap" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/animate.css/animate.min.css" rel="stylesheet">
<link href="assets/vendor/icofont/icofont.min.css" rel="stylesheet">
<link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
<link href="assets/vendor/venobox/venobox.css" rel="stylesheet">
<link href="assets/vendor/owl.carousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="assets/vendor/aos/aos.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="assets/css/searchByDate.css" rel="stylesheet">
<!-- calendar
<link href='assets/fullcalendar-5.3.2/lib/main.css' rel='stylesheet' />
<script src='assets/fullcalendar-5.3.2/lib/main.js'></script>
// <script src = "assets/js/calendar.js"></script>
-->
<link rel="shortcut icon" href="assets/img/icon_temp.ico" type="image/x-icon" />
</head>
<body >
<div id="BB" style="background-color: #f3f8fa;">
<!-- ======= Header ======= -->
<header id="header" class="fixed-top ">
<div class="container">
<div class="logo float-left">
<h1 class="text-light"><a href="index.html"><img src="assets/img/whiteicon.png" alt="" class="img-fluid"></a><a href="index.html"><span> BoB 0x10</span></a></h1>
</div>
<nav class="nav-menu float-right d-none d-lg-block">
<ul>
<li><a href="index.html">Home</a></li>
<li class="active"><a href="AsearchByDate.html">Date</a></li>
<li><a href="AsearchByMonth.html">Month</a></li>
<li><a href="AsearchByPerson.html">Name</a></li>
<li><a href="AsearchByMAC.html">MAC</a></li>
<li><a href="AviewAll.html">View All</a></li>
<li><a href="Amap.html">Map</a></li>
<li><a href="Aregister.html">REGISTER</a></li>
<li><a id="topUserId" href= "BackendConn_out.html" style="color:whitesmoke; font-style: italic; font-size: 15px;"></a></li>
</ul>
</nav><!-- .nav-menu -->
</div>
</header><!-- End Header -->
<main id="main">
<!-- ======= Intro Section ======= -->
<section class="breadcrumbs">
<div class="container">
<div class="d-flex justify-content-between align-items-center">
<h2>Search By Date</h2>
<ol>
<li><a href="Aindex.html">Home</a></li>
<li>By Date</li>
</ol>
</div>
</div>
</section><!-- End Intro Section -->
<!-- ======= Search Section ======= -->
<section class="pricing section-bg" data-aos="fade-up">
<div class="container">
<div class="section-title">
<h2>Choose Date to Search</h2>
<p>You can check everyone's attendance at a glance on that date.</p>
</div>
<div class="input-group">
<input type="text" id = "inputdate" class="form-control" placeholder="Enter Date to Search !" style="margin-bottom: 20px; margin-top: 20px;">
<button onclick="input()" style="margin-bottom: 20px; margin-top: 20px;">SEARCH</button>
</div>
<div class="M2">
<table id="target" class="list-table" style="margin: auto;">
<tr class="list-info">
<th>Name</th>
<th>Attendance</th>
<th>Room Number</th>
<th>Enter Time</th>
<th>Exit Time</th>
</table>
</div>
</div>
</section>
</main>
</div>
<!-- ======= Footer ======= -->
<footer id="footer" data-aos-easing="ease-in-out" data-aos-duration="500" >
<div class="container">
<div class="credits">
BEST OF THE BEST <a href="https://www.kitribob.kr">KITRI</a>
</div>
</div>
</footer><!-- End Footer -->
<a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>
<!-- Vendor JS Files -->
<script src="assets/vendor/jquery/jquery.min.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/jquery.easing/jquery.easing.min.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<script src="assets/vendor/venobox/venobox.min.js"></script>
<script src="assets/vendor/waypoints/jquery.waypoints.min.js"></script>
<script src="assets/vendor/counterup/counterup.min.js"></script>
<script src="assets/vendor/owl.carousel/owl.carousel.min.js"></script>
<script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
<script src="assets/vendor/aos/aos.js"></script>
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/Chart.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<!--datepicker-->
<link rel = "stylesheet" href="assets/jquery-ui/jquery-ui.css" type ="text/css"/>
<script src="assets/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript">
var searchdate;
var tempheight = String ( window.innerHeight || document.body.clientHeight ) + 'px';
//console.log(tempheight);
$('#BB').css("height",tempheight);
function input(){
var inputdate = document.getElementById("inputdate").value;
var progID = localStorage.getItem("progID");
var searchurl = 'https://'+ progID + '/api/date/';
searchdate = inputdate;
var finalURL = searchurl + searchdate;
$.getJSON(finalURL,function(data){
$('#target').css("visibility", "visible").css("border", "1px solid black");
$("#target > tbody > tr > td").remove();
$("#target").append("<tbody>");
for(var i = 0; i < data.length; i++){
console.log(data[i].name);
if(data[i].status == true){
var h = String(parseInt(data[i].entertime/3600))
var m = String(parseInt((data[i].entertime%3600)/60))
var s = String(((data[i].entertime%3600)%60))
var entertime = h + "h " + m + "m " + s + "s";
var h = String(parseInt(data[i].exittime/3600))
var m = String(parseInt((data[i].exittime%3600)/60))
var s = String(((data[i].exittime%3600)%60))
var exittime = h + "h " + m + "m " + s + "s";
$('#target').append("<tr><td>"+data[i].name+ "</td><td>"
+"O"+ "</td><td>"
+data[i].roomdid+"</td><td>"
+entertime+"</td><td>"
+exittime+"</td><tr>"
);
}
else{
$('#target').append("<tr><td>"+data[i].name+ "</td><td>"
+"X"+ "</td><td>"
+"-"+"</td><td>"
+"-"+"</td><td>"
+"-"+"</td><tr>"
);
}
}
$('#target').append("</tbody>");
}).fail(function(){
alert("There is no attendance record on that date.")
console.log("can not found this url");
history.go(0);
})
}
//다이얼로그
$(function(){
$("#inputdate").datepicker({
showButtonPannel: true,
currentText: 'today',
closeText: 'exit',
dateFormat: "yymmdd"
});
});
//로그인되어있는지 확인
console.log(localStorage.getItem("progID"))
var progID = localStorage.getItem("progID");
if(!localStorage.getItem("proID")){ //새로고침 방지
localStorage.setItem("progID", progID);
}
function logoutProcess(){
console.log("logoutProcess");
localStorage.removeItem("progID");
alert('Logout!');
location.replace('BackendConn.html');
}
function checkStatus(){
console.log("checkStatus");
if(progID == 'null'){ //null 인 아이디 사용불가!
alert('Invalid access. Please connect again');
location.replace('BackendConn.html');
}
}
function init(){
checkStatus();
}
init();
$(document).ready(function() {
var progID = localStorage.getItem("progID");
$('#topUserId').text("Accessed ");
});
</script>
</body>
</html>