-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathupload.html
367 lines (311 loc) · 8.09 KB
/
upload.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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="static/css/responsive.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'>
<link rel='stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Roboto:100,300'>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel='stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Roboto:100,300'>
<link rel="stylesheet" href="static/css/style.css">
<style>
svg {
font: 10px sans-serif;
}
path.line {
fill: none;
stroke: #126ac2;
stroke-width: 1.5px;
}
path.area {
fill: #fff;
}
.axis {
shape-rendering: crispEdges;
}
.x.axis line {
stroke: #000;
}
.x.axis path {
fill: none;
stroke: #000;
}
.y.axis line,
.y.axis path {
fill: none;
stroke: #000;
}
.card {
/* Add shadows to create the "card" effect */
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;
height: 75vh;
width: 500px;
background-color: white;
}
/* On mouse-over, add a deeper shadow */
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
}
/* Add some padding inside the card container */
.container {
padding: 70px 40px;
}
#slide-up {
animation: 1s slide-up;
margin-top:0%;
}
@keyframes slide-up {
from {
margin-top: 100%;
height: 200%;
}
to {
margin-top: 0%;
height: 100%;
}
}
.column1 {
float: left;
width: 50%;
padding-left: 60px;
}
.column{
float: left;
width: 50%;
padding-left: 50px;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
#sub {
display: inline-block;
padding: 10px 30px;
border-radius: 50px;
color: #ffffff;
background-color: #2f60c3;
-webkit-transition: 0.3s;
transition: 0.3s;
border: none;
-webkit-box-shadow: 2px 5px 20px -5px rgba(0, 0, 0, 0.1);
box-shadow: 2px 5px 20px -5px rgba(0, 0, 0, 0.1);
}
.w3-display-left {
padding-left: 20px;
}
.button {
display: inline-block;
border-radius: 12px;
background-color: #138fc2;
border: none;
color: #FFFFFF;
text-align: center;
font-size: 20px;
padding: 20px;
width: 200px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 25px;
color: white;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
form{
padding-bottom: 20px;
}
</style>
<body>
<div class="row">
<div class="column1">
<div class="upload">
<div class="upload-files">
<header>
<p>
<i class="fa fa-cloud-upload" aria-hidden="true"></i>
<span class="up">up</span>
<span class="load">load</span>
</p>
</header>
<form method="POST" action="/upload" enctype="multipart/form-data" onsubmit="return checkForm(this);">
<div class="body" id="drop">
<i class="fa fa-file-text-o pointer-none" aria-hidden="true"></i>
<p class="pointer-none"><b>Drag and drop</b> files here <br /> or <a href="" id="triggerFile">browse</a> to begin the upload</p>
<input type="file" multiple="multiple" name="file"/>
</div>
<center>
<table>
<tr>
<td><label>Date:</label></td>
<td><input type="text" size="12" required pattern="\d{1,2}/\d{1,2}/\d{4}" placeholder="dd/mm/yyyy" name="date"></td>
</tr>
<br><br>
<tr>
<td><label>Start Time: </label></td>
<td><input type="text" size="12" required pattern="\d{1,2}:\d{2}([ap]m)?" name="start_time"></td>
</tr>
<br><br>
<tr>
<td><label>End Time: </label></td>
<td><input type="text" size="12" required pattern="\d{1,2}:\d{2}([ap]m)?" name="end_time"></td>
</tr>
<br><br>
<tr>
<td><label>Room Name: </label></td>
<td><input type="text" size="12" name="room_name"></td>
</tr>
</table>
<br>
<p><input type="submit" id="sub"></p>
</form></center>
<script type="text/javascript">
function checkForm(form)
{
// regular expression to match required date format
re = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/;
if(form.date.value != '') {
if(regs = form.date.value.match(re)) {
// day value between 1 and 31
if(regs[1] < 1 || regs[1] > 31) {
alert("Invalid value for day: " + regs[1]);
form.date.focus();
return false;
}
// month value between 1 and 12
if(regs[2] < 1 || regs[2] > 12) {
alert("Invalid value for month: " + regs[2]);
form.date.focus();
return false;
}
// year value between 1902 and 2018
if(regs[3] < 1902 || regs[3] > (new Date()).getFullYear()) {
alert("Invalid value for year: " + regs[3] + " - must be between 1902 and " + (new Date()).getFullYear());
form.date.focus();
return false;
}
} else {
alert("Invalid date format: " + form.date.value);
form.date.focus();
return false;
}
}
// regular expression to match required time format
re = /^(\d{1,2}):(\d{2})([ap]m)?$/;
if(form.start_time.value != '') {
if(regs = form.start_time.value.match(re)) {
if(regs[3]) {
// 12-hour value between 1 and 12
if(regs[1] < 1 || regs[1] > 12) {
alert("Invalid value for hours: " + regs[1]);
form.start_time.focus();
return false;
}
} else {
// 24-hour value between 0 and 23
if(regs[1] > 23) {
alert("Invalid value for hours: " + regs[1]);
form.start_time.focus();
return false;
}
}
// minute value between 0 and 59
if(regs[2] > 59) {
alert("Invalid value for minutes: " + regs[2]);
form.start_time.focus();
return false;
}
} else {
alert("Invalid time format: " + form.start_time.value);
form.start_time.focus();
return false;
}
}
if(form.end_time.value != '') {
if(regs = form.end_time.value.match(re)) {
if(regs[3]) {
// 12-hour value between 1 and 12
if(regs[1] < 1 || regs[1] > 12) {
alert("Invalid value for hours: " + regs[1]);
form.end_time.focus();
return false;
}
} else {
// 24-hour value between 0 and 23
if(regs[1] > 23) {
alert("Invalid value for hours: " + regs[1]);
form.end_time.focus();
return false;
}
}
// minute value between 0 and 59
if(regs[2] > 59) {
alert("Invalid value for minutes: " + regs[2]);
form.end_time.focus();
return false;
}
} else {
alert("Invalid time format: " + form.endtime.value);
form.end_time.focus();
return false;
}
}
if(form.room_name.value == '')
{
alert("Enter the name of the room");
return false;
}
alert("All input fields have been validated!");
return true;
}
</script>
<footer>
<div class="divider">
<span><AR>FILES</AR></span>
</div>
<div class="list-files">
<!-- template -->
</div>
<br>
<button class="importar">UPDATE FILES</button>
</footer>
</div>
</div>
</div>
</div>
</div>
<script src="static/js/index.js"></script>
<div class="column" id="slide-up">
<div class="container">
<div class="card" id="here">
<h4 style="padding: 40px 15px; color: #515656; font-family: sans-serif";><center> Data Visualisation of the total footfalls in individual room </center></h4>
<!--a href="vis_line 2.html" class="btn btn-primary">Visualise</a-->
<div class="w3-display-middle">
<button class="button" style="vertical-align:middle;"><a href="/visualise-file"><span>Visualise </span></a></button>
</div>
</div>
</div>
</div>
</body>
</html>