<div class="form-head d-md-flex mb-sm-4 mb-3 align-items-start">
    <div class="me-auto d-lg-block d-block">
        <h2 class="text-black font-w600">Dashboard</h2>
        <p class="mb-0">Welcome to Dashboard</p>
    </div>
</div>
<style>
    .card {
        height: auto;
    }
</style>
<div class="card">
    <div class="card-header">
        <h4 class="card-title">Latest Contact Enquiries</h4>
    </div>
    <div class="card-body">
        <div class="table-responsive">
            <table class="display table" style="min-width: 850px">
                <thead>
                    <tr>
                        <th>Name</th>
                        <th>Email </th>
                        <th>Mobile No</th>
                        <th>Message</th>
                        <th>Enquiry Date</th>
                    </tr>
                </thead>
                <tbody>
                    <?php if (count($enquiry_res) > 0) { ?>
                        <?php foreach ($enquiry_res as $ev) { ?>
                            <tr>
                                <td><?php echo $ev['name']; ?></td>
                                <td><?php echo $ev['email']; ?></td>
                                <td><?php echo $ev['mobile']; ?></td>
                                <td><?php echo $ev['message']; ?></td>
                                <td><?php echo !empty($ev['created_at']) ? date('d,M Y h:s A', strtotime($ev['created_at'])) : ''; ?></td>
                            </tr>
                        <?php } ?>
                    <?php } else { ?>
                        <tr>
                            <td colspan="5" class="text-center">No Records Found</td>
                        </tr>
                    <?php } ?>
                </tbody>
            </table>
        </div>
    </div>
</div>

<div class="card">
    <div class="card-header">
        <h4 class="card-title">Latest Properties Enquiries</h4>
    </div>
    <div class="card-body">
        <div class="table-responsive">
            <table class="display table" style="min-width: 850px">
                <thead>
                    <tr>
                        <th>Name</th>
                        <th>Email </th>
                        <th>Mobile No</th>
                        <th>Address</th>
                        <th>Check In</th>
                        <th>Check Out</th>
                        <th>Guest</th>
                        <th>Enquiry Date</th>
                    </tr>
                </thead>
                <tbody>
                    <?php if (count($pro_enquiry_res) > 0) { ?>
                        <?php foreach ($pro_enquiry_res as $ev) { ?>
                            <tr>
                                <td><?php echo $ev['name']; ?></td>
                                <td><?php echo $ev['email']; ?></td>
                                <td><?php echo $ev['phone']; ?></td>
                                <td><?php echo $ev['address']; ?></td>
                                <td><?php echo date('d,M Y', strtotime($ev['checkin'])); ?></td>                                
                                <td><?php echo date('d,M Y', strtotime($ev['checkout'])); ?></td>
                                <td><?php echo $ev['adults']; ?></td>
                                <td><?php echo !empty($ev['added_date']) ? date('d,M Y h:s A', strtotime($ev['added_date'])) : ''; ?></td>
                            </tr>
                        <?php } ?>
                    <?php } else { ?>
                        <tr>
                            <td colspan="8" class="text-center">No Records Found</td>
                        </tr>
                    <?php } ?>
                </tbody>
            </table>
        </div>
    </div>
</div>