<?php

$this->load->model('Queries');
$member_information = $this->Queries->getMembers(); 
?>

<?php

$this->load->model('Queries_staff');
$employee_information = $this->Queries_staff->getStaff(); 
?>

<div class="card mb-4">
    <div class="card-header">
        <i class="fas fa-table me-1"></i>
        DATA TABLES
    </div>
    <div class="card-body">
        <div class="table-responsive">
             <h2>Member Information</h2>
            

        <div class="table-responsive">
            <table class="table table-striped table-hover">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>First Name</th>
                        <th>Last Name</th>
                        <th>Gender</th>
                        <th>Email</th>
                        <th>Contact Number</th>
                    </tr>
                </thead>
                <tbody>
                    <?php if (!empty($member_information)): ?>
                        <?php foreach ($member_information as $crud): ?>
                            <tr>
                                <td><?php echo $crud->member_id; ?></td>
                                <td><?php echo $crud->firstname; ?></td>
                                <td><?php echo $crud->lastname; ?></td>
                                <td><?php echo $crud->gender; ?></td>
                                <td><?php echo $crud->email; ?></td>
                                <td><?php echo $crud->contact_no; ?></td>
                                </tr>
                        <?php endforeach; ?>
                    <?php else: ?>
                        <tr>
                            <td colspan="6" class="text-center">No members found.</td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
        </div>
    </div>

    <div class="card-body">
        <div class="table-responsive">
             <h2>Employee Information</h2>
            

        <div class="table-responsive">
            <table class="table table-striped table-hover">
                <thead>
                    <tr>
                        <th>Staff ID</th>
                        <th>First Name</th>
                        <th>Last Name</th>
                        <th>Gender</th>
                        <th>Email</th>
                        <th>Contact Number</th>
                    </tr>
                </thead>
                <tbody>
                    <?php if (!empty($employee_information)): ?>
                        <?php foreach ($employee_information as $staff_crud): ?>
                            <tr>
                                <td><?php echo $staff_crud['staff_id']; ?></td>
                                <td><?php echo $staff_crud['firstname']; ?></td>
                                <td><?php echo $staff_crud['lastname']; ?></td>
                                <td><?php echo $staff_crud['gender']; ?></td>
                                <td><?php echo $staff_crud['email']; ?></td>
                                <td><?php echo $staff_crud['contact_no']; ?></td>
                            </tr>
                        <?php endforeach; ?>
                    <?php else: ?>
                        <tr>
                            <td colspan="6" class="text-center">No staff found.</td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
        </div>
    </div>

    
</div>

                    