if(isset($_GET[‘from_date’]) && isset($_GET[‘to_date’]))
{
$from_date = $_GET[‘from_date’];
$to_date = $_GET[‘to_date’];
$query = "SELECT * FROM tbl_attendance INNER JOIN tbl_user ON tbl_user.IDNUMBER = tbl_attendance.IDNUMBER WHERE AttendDate BETWEEN '$from_date' AND '$to_date' ORDER BY LASTNAME DESC" ;
$query_run = mysqli_query($con, $query);
if(mysqli_num_rows($query_run) > 0)
{
foreach($query_run as $row)
{
?>
<tr>
<td><?= $row['IDNUMBER']; ?></td>
<td><?= $row['FIRSTNAME']; ?></td>
<td><?= $row['TimeInAM']; ?></td>
<td><?= $row['TimeOutPM']; ?></td>
<td><?= $row['AttendDate']; ?></td>
</tr>
<?php
}
}
else
{
echo "No Record Found";
}
}
`