File: /home/bigisxfd/public_html/cowork/usage_report.php
<?php
// Include necessary files
include_once("header.php");
include_once("sidebar.php");
include_once("functions.php");
// Get the selected date from the form
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (isset($_POST["selectedDate"])) {
$selectedDate = $_POST["selectedDate"];
$usageForDate = getUsageByDate($selectedDate);
}
}
?>
<section>
<div class="column">
<h2>Usage for <?php echo $selectedDate; ?></h2>
<table>
<thead>
<tr>
<th>Booking ID</th>
<th>Member ID</th>
<th>Package Name</th>
<th>Time In</th>
</tr>
</thead>
<tbody>
<?php if (!empty($usageForDate)) : ?>
<?php foreach ($usageForDate as $booking) : ?>
<tr>
<td><?php echo $booking['bookingid']; ?></td>
<td><?php echo $booking['firstname'] . ' ' . $booking['lastname']; ?></td>
<td><?php echo $booking['packagename']; ?></td>
<td><?php echo date("h:i:s A", strtotime($booking['startdate'])); ?></td>
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr>
<td colspan="4">No usage found for the selected date.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</section>
</body>
</html>