<?php
//db connection file
include('inc/db_conf.php');
//keep page protected from visitor
include('inc/user_page_access.php');
//get last 30 registered users
$get_last_30_users=$con->query("SELECT * FROM ODSPRegisretion ORDER BY id DESC LIMIT 30");
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
table, th, td {
border: 1px solid black;
}
<!--
#apDiv1 {
position:absolute;
width:1101px;
height:auto;
z-index:1;
}
-->
</style>
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.js"></script>
</head>
<body>
<div id="apDiv1">
<table id="table_id" style="width:100%">
<thead>
<tr>
<th>ID</th>
<th>FIRST NAME</th>
<th>LAST NAME</th>
<th>EMAIL address</th>
<th>Active</th>
<th>Reg. Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
while($user = mysqli_fetch_assoc($get_last_30_users)){
?>
<tr>
<td><?=$no++?></td>
<td><?=$user['Fname']?></td>
<td><?=$user['Lname']?></td>
<td><?=$user['Emailaddress']?></td>
<td bgcolor="#B7FFB7"><?=$user['active']?></td>
<td><?=date('l jS F Y', strtotime($user['RegistrationDate']));?></td>
<td style="text-align: center;"><a href="Edit-User-2021.php?id=<?=$user['id']?>"><i style="color: #000000" class="fas fa-edit"></i></a> | <a href="send-email.php?id=<?=$user['id']?>"><i style="color: #000000" class="far fa-envelope"></i></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<script>
$(document).ready( function () {
$('#table_id').DataTable({
"ordering": false
});
$("#table_id_length").css("margin-bottom", "15px");
$("#table_id_filter").css("margin-bottom", "15px");
});
</script>
</body>
</html>