HEX
Server: LiteSpeed
System: Linux server214.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: bigisxfd (746)
PHP: 8.4.15
Disabled: NONE
Upload Files
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>