-
Notifications
You must be signed in to change notification settings - Fork 53
/
appliedLeaves.html
237 lines (218 loc) · 9.94 KB
/
appliedLeaves.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>List of Leaves Application</title>
<link rel="stylesheet" href="assets/css/bootstrap.css">
<link rel="stylesheet" href="assets/vendors/simple-datatables/style.css">
<script defer src="assets/fontawesome/js/all.min.js"></script>
<link rel="stylesheet" href="assets/vendors/perfect-scrollbar/perfect-scrollbar.css">
<link rel="stylesheet" href="assets/css/app.css">
<link rel="shortcut icon" href="assets/images/favicon.svg" type="image/x-icon">
</head>
<body>
<nav class="navbar navbar-default no-margin">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header fixed-brand">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" id="menu-toggle">
<span class="glyphicon glyphicon-th-large" style="margin-left:5px;" aria-hidden="true"></span>
</button>
<a class="navbar-brand" href="#"><i class="fa fa-a fa-4"></i><%= userName %></a>
</div><!-- navbar-header-->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">
<button class="navbar-toggle collapse in" data-toggle="collapse" id="menu-toggle-2"><span
class="glyphicon glyphicon-th-large" aria-hidden="true"></span></button>
</li>
<li class="navbar-brand">
<form action="/logout" method="get">
<button id="logout" type="submit" style="margin-top: -3px;" class="btn btn-default"><i
class="fa fa-user" aria-hidden="true"></i> Logout
</button>
</form>
</li>
</ul>
</div><!-- bs-example-navbar-collapse-1 -->
</nav>
<div id="wrapper">
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav nav-pills nav-stacked" id="menu">
<li class="active">
<a href="/employee/applied-leaves"><span class="fa-stack fa-lg pull-left"><i
class="fa fa-dashboard fa-stack-1x "></i></span> View Leaves</a>
</li>
<li>
<a href="/employee/apply-for-leave"><span class="fa-stack fa-lg pull-left"><i
class="fa fa-envelope-square fa-stack-1x "></i></span>Apply for Leave</a>
</li>
<li data-toggle="modal" data-target="#myModal">
<a href="#"> <span class="fa-stack fa-lg pull-left"><i class="fa fa-list-ol fa-stack-1x "></i></span>View
Attendance</a>
</li>
<li data-toggle="modal" data-target="#myModal2">
<a href="#"><span class="fa-stack fa-lg pull-left"><i
class="fa fa-check-circle fa-stack-1x "></i></span>Mark Attendance</a>
</li>
<li>
<a href="/employee/view-profile"><span class="fa-stack fa-lg pull-left"><i
class="fa fa-user fa-stack-1x "></i></span>View Profile</a>
</li>
</ul>
</div><!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container-fluid xyz">
<div class="row">
<div class="col-lg-12">
<h1>All Applied Leaves</h1><br>
<div style="height:600px; overflow: auto">
<% if(hasLeave === 1){ %>
<table id="example" class="display" cellspacing="0" style="height: 10%; overflow: auto;">
<thead>
<tr>
<th>Title</th>
<th>Type</th>
<th>Date of Application</th>
<th>Period of Leave</th>
<th>Status</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Title</th>
<th>Type</th>
<th>Applied Date</th>
<th>Period of Leave</th>
<th>Status</th>
</tr>
</tfoot>
<tbody>
<% leaves.forEach(function(item){ %>
<tr>
<td><%= item.title %></td>
<td><%= item.type %></td>
<td><%= new Date(item.appliedDate).toISOString().substring(0, 10); %></td>
<td><%= item.period %></td>
<td><%= item.adminResponse %></td>
</tr>
<% }); %>
</tbody>
</table>
<% }else{ %>
<p>You have not applied for any leave.</p>
<% } %>
</div>
</div>
</div>
</div>
</div>
<!-- /#page-content-wrapper -->
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.js" charset="UTF-8"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.js" charset="UTF-8"></script>
<script src="/javascripts/confirmation.js"></script>
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script src="/javascripts/sidebar_menu.js"></script>
<script>
$(document).ready(function () {
$('#example').dataTable({
/* No ordering applied by DataTables during initialisation */
"order": []
});
// Setup - add a text input to each footer cell
$('#example tfoot th').each(function () {
var title = $(this).text();
if (title != " ") {
$(this).html('<input type="text" class="form-control" placeholder="Search ' + title + '" />');
}
});
for (i = new Date().getFullYear(); i > 1950; i--) {
$('#year').append($('<option />').val(i).html(i));
}
$("#inc1").click(function () {
$('#current_salary').val(60000);
});
var table = $('#example').DataTable();
// Apply the search
table.columns().every(function () {
var that = this;
$('input', this.footer()).on('keyup change', function () {
if (that.search() !== this.value) {
that
.search(this.value)
.draw();
}
});
});
});
</script>
</body>
<div id="myModal2" class="modal fade" role="dialog">
<div class="modal-dialog">
<form method="post" action="/employee/mark-employee-attendance">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Mark Attendance</h4>
</div>
<div class="modal-body">
<p>Are you sure you want to mark attendance.</p>
</div>
<div class="modal-footer">
<input type="hidden" name="_csrf" value="<%= csrfToken %>">
<button type="reset" class="btn btn-default" data-dismiss="modal">No</button>
<button type="submit" class="btn btn-default">Yes</button>
</div>
</div>
</form>
</div>
</div>
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<form method="post" action="/employee/view-attendance">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Select Month/Year</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="Month">Month:</label>
<select class="form-control" id="month" name="month">
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
</div>
<div class="form-group">
<label for="year">Year:</label>
<select class="form-control" id="year" name="year">
</select>
</div>
</div>
<div class="modal-footer">
<input type="hidden" name="_csrf" value="<%= csrfToken %>">
<button type="reset" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-default">View</button>
</div>
</form>
</div>
</div>
</div>
</html>