-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmentorcommitmentview.php
More file actions
404 lines (323 loc) · 11.1 KB
/
mentorcommitmentview.php
File metadata and controls
404 lines (323 loc) · 11.1 KB
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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<?php
include "home.php";
?>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link rel="stylesheet" href="stylespagination.css">
<script>
$(document).ready(function(){
$("#myInput").on("keyup", function() {
var value = $(this).val().toLowerCase();
$("#myTable tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
</script>
<?php
$role=$_SESSION['hrrolesession'];
if(strpos($role,"mentorship") == false){
session_destroy();
exit();
}
?>
<script>
$(function() {
$( "#startDate" ).datepicker({
appendText:"(yy-mm-dd)",
changeMonth:true,
changeYear:true,
yearRange:"c-0:c+1",
dateFormat:"yy-mm-dd"
});
$( "#endDate" ).datepicker({
appendText:"(yy-mm-dd)",
changeMonth:true,
changeYear:true,
yearRange:"c-0:c+1",
dateFormat:"yy-mm-dd"
});
$( ".dateElement" ).datepicker({
appendText:"(yy-mm-dd)",
changeMonth:true,
changeYear:true,
yearRange:"c-35:c+0",
dateFormat:"yy-mm-dd"
});
});
$("#indiv").click(function(){
$("#impo").toggle();
});
</script>
<script>
$(document).ready(function(){
//$("#impo").hide();
$("#indiv").click(function(){
$("#impo").show();
$("#all"). prop("checked", false);
});
$("#all").click(function(){
$("#indiv"). prop("checked", false);
$('#impo option:first').prop('selected',true);
$("#impo").hide();
});
$("#days").click(function(){
for(var c=0,e=0,d=new Date($("#startDate").val()),a=(new Date($("#endDate").val())-d)/864E5;0<=a;a--)
{
var b=new Date(d);
b.setDate(b.getDate()+a);
1==Math.ceil(b.getDay()%6/6)?c++:e++
}
$("#days").val(c);
});
});
</script>
<style>
.tableFixHead { overflow-y: auto; height: 100px; }
.tableFixHead thead th { position: sticky; top: 0; }
</style>
<script type="text/javascript">
$(function() {
$(".tablelist tr:nth-child(even)").addClass("striped");
$(".tablelist tr:nth-child(odd)").addClass("nostriped");
});
$(document).ready(function () {
$('#dtBasicExample').DataTable();
$('.dataTables_length').addClass('bs-select');
});
</script>
<style type="text/css">
body,td {
font-size: 10pt;
}
table.tablelist {
/*background-color: black;*/
border: 1px black solid;
border-collapse: collapse;
}
th {
border: 1px outset silver;
background-color: grey;
color: white;
}
tr.nostriped {
background-color: white;
margin: 1px;
}
tr.striped {
/*background-color: #f09320;*/
background-color: whitesmoke;;
}
td {
padding: 1px 8px;
}
.normal {
font-weight: normal;
}
</style>
<style>
</style>
<h2>Skills Verification</h2>
<br/>
<?php
if(isset($_POST['editdoc'])){
include "connect.php";
include 'createEmail.php';
$fileid=$_POST['fileid'];
$contractqry=mysqli_query($conn,"SELECT *,(select concat(lastname,' ',firstname) from users where userid=arf.employeeid) as empname FROM archiving_employee_files arf where arf.fileid='$fileid'");
if(mysqli_num_rows($contractqry)) {
$row=mysqli_fetch_array($contractqry);
$fileid=$row['fileid'];
$type=$row['type'];
$employeeName=$row['empname'];
$employeeid=$row['employeeid'];
print("
<form action='uploadEmployeeDocument.php' method='post' enctype='multipart/form-data' onSubmit=\"return confirm('Are you sure, you want to save changes on Registered Supplier ?')\">
<fieldset>
<legend>Edit Employee document</legend>
<table width='100%'>
<tr>
<td>Employee:</td>
<td><input type='hidden' name='fileid' required='true' value='$fileid'><select name='employee'><option value='$employeeid' selected='true'>$employeeName</option>");
$employeesqueryActive=mysqli_query($conn,"select userid,concat(lastname,' ',firstname) as empName from users where active='YES' and userid!='$employeeid' order by lastname");
if(mysqli_num_rows($employeesqueryActive)) {
while($row=mysqli_fetch_array($employeesqueryActive)){
$mployeeId=$row['userid'];
$mployeeName=$row['empName'];
print("<option value='$mployeeId'>$mployeeName</option>");
}
}
print("</td></tr><tr><td>Type of document:</td><td> ");
print("
<select id='doctype' name='doctype'>
<option value='$type' selected='true'>$type</option>
<optgroup label='The First Patch Pocket (Applications)'>
<option value='Application letter &CV'>Application letter &CV</option>
<option value='All School certificate(s)'>All School certificate(s)</option>
<option value='Copy of ID'>Copy of ID</option>
<option value='Copy of driving license for drivers'>Copy of driving license for drivers</option>
<option value='Copy of practicing license for healthcare staf'>Copy of practicing license for healthcare staf</option>
<option value='All written and oral interview papers'>All written and oral interview papers</option>
</optgroup>
<optgroup label='Addition to those who left'>
<option value='Termination letter'>Termination letter</option>
<option value='End of contract letter'>End of contract letter</option>
<option value='Resignation letter'>Resignation letter</option>
<option value='Exit handover form'>Exit handover form</option>
<option value='Exit interview form'>Exit interview form</option>
</optgroup>
<optgroup label='The Second Patch Pocket (Contracts)'>
<option value='Employment offer(s) or Appointment letter'>Employment offer(s) or Appointment letter</option>
<option value='Contract'>Contract</option>
<option value='Contract extension letter(s)'>Contract extension letter(s)</option>
<option value='Job description(s)'>Job description(s)</option>
<option value='Drivers’ code of conduct-Drivers'>Drivers’ code of conduct-Drivers</option>
</optgroup>
<optgroup label='The Third Patch Pocket (Forms)'>
<option value='Employee details form'>Employee details form</option>
<option value='Medical insurance forms'>Medical insurance forms</option>
<option value='Employee background Check forms'>Employee background Check forms</option>
<option value='Safeguarding forms'>Safeguarding forms</option>
<option value='Conflict of interest form'>Conflict of interest form</option>
<option value='Timesheet'>Timesheet form</option>
</optgroup>
<optgroup label='The Fourth Patch Pocket (All Letters)'>
<option value='salary amendment'>salary amendment</option>
<option value='disciplinary'>disciplinary</option>
<option value='end probation & employement confirmation'>end probation & employement confirmation</option>
<option value='relocation'>relocation</option>
<option value='bank letters'>bank letters</option>
<option value='Other letters'>Other letters</option>
</optgroup>
</select>
</td></tr>");
print("
<tr>
<td>File(.jpg,.jpeg,.png,.pdf):</td>
<td><input type='file' name='filetoupload' accept='.jpg,.jpeg,.png,.pdf' required='true'></td>
</tr>
</table>
</fieldset>
<br />
<div style='text-align: center;'>
<input type='submit' name='uploadedited' value='Save document' id='uploadid' class='hrbutton''>
</div>
</form>
");
}
exit;
}
?>
<style>
.hidden {
display: none;
}
label {
font-weight: bold;
}
</style>
<!-- voiding a file -->
<?php
if(isset($_POST['deldoc'])){
include 'createEmail.php';
include "connect.php";
$creator=$_SESSION['hruseridsession'];
$fileid=$_POST['fileid'];
$datecreated=date("Y-m-d");
$savedocdetails=mysqli_query($conn,"update archiving_employee_files set voided='1',voided_by='$creator', voided_date='$datecreated' where fileid='$fileid'");
print("
<script>
alert('Document is deleted');
</script>
");
}
?>
<?php
include "connect.php";
$creator=$_SESSION['hruseridsession'];
$commitmentInfo=mysqli_query($conn,"SELECT *,(select concat(lastname,' ',firstname) from users where userid=mc.mentor_id) as mentor from hr_mentorship_commitment mc where and (voided is null or voided=0) order by id ");
if(mysqli_num_rows($commitmentInfo)) {
print("<div align='right'><span>Search: <input id='myInput' type='text' placeholder='Search..'></span></div>
<table width='100%' class='tablelist paginated-table' ><thead><tr>
<th>ID</th>
<th>Date created</th>
<th>Mentor</th>
<th>Competency</th>
<th>Are you ready to deliver this skills?</th>
<th>How the Skills Were Obtained</th>
<th>Means of verification</th>
<th>Proof</th>
<!-- <th>Edit/Delete</th> --></thead><tbody id='myTable'>");
$document="";
while($row=mysqli_fetch_array($commitmentInfo)){
$id=$row['id'];
$date_created=$row['date_created'];
$mentor=$row['mentor'];
$competency=$row['competency'];
$ready_to_deliver=$row['ready_to_deliver'];
$obtained_how=$row['obtained_how'];
$means_of_verification=$row['means_of_verification']." ".$row['means_of_verification_other'];;
$file_name_db=$row['proof'];
$dir = "mentorproof/";
if (is_dir($dir)){
if ($dh = opendir($dir)){
while (($file = readdir($dh)) !== false){
//$tmp= explode('.', $file);
$file_name=$file;
if($file_name==$file_name_db) {
$document=$file;
break;
}
}
closedir($dh);
}
}
if($document!="") {
print("<tr><td>$id</td>
<td>$date_created</td>
<td>$mentor</td>
<td>$competency</td>
<td>$ready_to_deliver</td>
<td>$obtained_how</td>
<td>$means_of_verification</td>
<td><a href='mentorproof/$document' target='_blank'>Document</a></td>
<!-- <td><form action='uploadEmployeeDocument.php' method='post' onSubmit=\"return confirm('Are you sure, you want to Edit ?')\">
<input type='hidden' name='fileid' value='$id'>
<input type='submit' name='editdoc' value='Edit Document'>
</form>
<form action='uploadEmployeeDocument.php' method='post' onSubmit=\"return confirm('Are you sure, you want to delete a document ?')\">
<input type='hidden' name='fileid' value='$id'>
<input type='submit' name='deldoc' value='Delete Document'>
</form>
</td> -->
</tr>");
}else{
print("<tr><td>$id</td>
<td>$date_created</td>
<td>$mentor</td>
<td>$competency</td>
<td>$ready_to_deliver</td>
<td>$obtained_how</td>
<td>$means_of_verification</td>
<td>Not submitted</td>
<!-- <td><form action='uploadEmployeeDocument.php' method='post' onSubmit=\"return confirm('Are you sure, you want to Edit ?')\">
<input type='hidden' name='fileid' value='$id'>
<input type='submit' name='editdoc' value='Edit Document'>
</form>
<form action='uploadEmployeeDocument.php' method='post' onSubmit=\"return confirm('Are you sure, you want to delete a document ?')\">
<input type='hidden' name='fileid' value='$id'>
<input type='submit' name='deldoc' value='Delete Document'>
</form>
</td> -->
</tr>");
}
$document="";
}
print("</tbody></table>");
}else {
print("<br> No Skills Verification recorded");
}
?>
<div id="pagination">
<!-- Pagination buttons will be dynamically added here -->
</div>
<script src="pagination.js"></script>