-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreport.php
More file actions
74 lines (68 loc) · 1.67 KB
/
Copy pathreport.php
File metadata and controls
74 lines (68 loc) · 1.67 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
<?php
require 'db.php';
session_start();
if($_SESSION['user']!='admin'){
echo "You have not enough permission to access this page.";
exit;
}
$report=("Select * from info");
$result=mysqli_query($conn, $report) or die ("Error Retrieving Timesheet".mysqli_error($conn));
while($timesheet = mysqli_fetch_array($result)){
$name = $timesheet['fullname'];
$dept=$timesheet['department'];
$clock = $timesheet['inout'];
$date = date('D, M jS, Y',strtotime($timesheet['clock_in']));
$in = date('h:i:s a',strtotime($timesheet['clock_in']));
$out = date('Y-m-d H:i:s',strtotime($timesheet['clock_out']));
/*If ($clock==1){
$in = date('H:i:s',strtotime($timesheet['timestamp']));
}else{
$in = "absent today";
}
if ($clock==0){
$out = date('H:i:s',strtotime($timesheet['timestamp']));
}else{
$out = "On duty";
}*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<link rel="stylesheet" href="table.css">
</head>
<body>
<br>
<center><a href="../unix/table.php"><button>Back to Database</button></a>
<table class="data-table">
<caption class="title">Edit Settings below as needed</caption>
<thead>
<tr>
<th>date</th>
<th>Name</th>
<th>department</th>
<th>In</th>
<th>out</th>
</tr>
</thead>
<tbody>
<tr>
<td><? echo $date; ?></td>
<td><? echo $name; ?></td>
<td><? echo $dept; ?></td>
<td><? echo $in; ?></td>
<td><? echo $out; ?></td>
</tr>
</tbody>
<tfoot>
<tr>
<th colspan="2"></th>
<th></th>
</tr>
</tfoot>
</table>
<?php
}
?>
</center>
</body>
</html>