-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_log_up.php
51 lines (47 loc) · 1.52 KB
/
user_log_up.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
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<?php
session_start();
//Connect to database
require'connectDB.php';
if (isset($_POST['log_date'])) {
if ($_POST['date_sel'] != 0) {
$_SESSION['seldate'] = $_POST['date_sel'];
}
else{
$_SESSION['seldate'] = date("Y-m-d");
}
}
if ($_POST['select_date'] == 1) {
$_SESSION['seldate'] = date("Y-m-d");
}
else if ($_POST['select_date'] == 0) {
$seldate = $_SESSION['seldate'];
}
$sql = "SELECT * FROM users_logs WHERE checkindate='$seldate' ORDER BY id DESC";
$result = mysqli_stmt_init($conn);
if (!mysqli_stmt_prepare($result, $sql)) {
echo '<p class="error">SQL Error</p>';
}
else{
mysqli_stmt_execute($result);
$resultl = mysqli_stmt_get_result($result);
if (mysqli_num_rows($resultl) > 0){
while ($row = mysqli_fetch_assoc($resultl)){
?>
<TR>
<TD><?php echo $row['id'];?></TD>
<TD><?php echo $row['username'];?></TD>
<TD><?php echo $row['serialnumber'];?></TD>
<TD><?php echo $row['fingerprint_id'];?></TD>
<TD><?php echo $row['checkindate'];?></TD>
<TD><?php echo $row['timein'];?></TD>
<TD><?php echo $row['timeout'];?></TD>
</TR>
<?php
}
}
}
?>
</tbody>
</table>