-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
78 lines (72 loc) · 2.66 KB
/
index.php
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
<?php session_start(); ?>
<?php include 'header.php'; ?>
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<p id="date"></p>
<p id="time" class="bold"></p>
</div>
<div class="login-box-body">
<h4 class="login-box-msg">Enter Employee ID</h4>
<form id="attendance">
<div class="form-group">
<select class="form-control" name="status">
<option value="in">Time In</option>
<option value="out">Time Out</option>
</select>
</div>
<div class="form-group has-feedback">
<input type="text" class="form-control input-lg" id="employee" name="employee" required>
<span class="glyphicon glyphicon-calendar form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-4">
<button type="submit" class="btn btn-primary btn-block btn-flat" name="signin"><i class="fa fa-sign-in"></i> Sign In</button>
</div>
</div>
</form>
</div>
<div class="alert alert-success alert-dismissible mt20 text-center" style="display:none;">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<span class="result"><i class="icon fa fa-check"></i> <span class="message"></span></span>
</div>
<div class="alert alert-danger alert-dismissible mt20 text-center" style="display:none;">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<span class="result"><i class="icon fa fa-warning"></i> <span class="message"></span></span>
</div>
</div>
<?php include 'scripts.php' ?>
<script type="text/javascript">
$(function() {
var interval = setInterval(function() {
var momentNow = moment();
$('#date').html(momentNow.format('dddd').substring(0,3).toUpperCase() + ' - ' + momentNow.format('MMMM DD, YYYY'));
$('#time').html(momentNow.format('hh:mm:ss A'));
}, 100);
$('#attendance').submit(function(e){
e.preventDefault();
var attendance = $(this).serialize();
$.ajax({
type: 'POST',
url: 'attendance.php',
data: attendance,
dataType: 'json',
success: function(response){
if(response.error){
$('.alert').hide();
$('.alert-danger').show();
$('.message').html(response.message);
}
else{
$('.alert').hide();
$('.alert-success').show();
$('.message').html(response.message);
$('#employee').val('');
}
}
});
});
});
</script>
</body>
</html>