<div class="row">
    <div class="col-12">
        <div class="card glass-card">
            <div class="card-header"><h5 class="card-title">Commissions Report</h5></div>
            <div class="card-body">
                <?php $this->include('Reports/partials/filter_date') ?>
                <div class="table-responsive mt-3">
                    <table class="table table-hover">
                        <thead>
                            <tr><th>Employee</th><th class="text-center">Transactions</th><th class="text-end">Total Sales</th><th class="text-end">Commission</th><th class="text-end">Rate</th></tr>
                        </thead>
                        <tbody>
                            <?php if (empty($data)): ?>
                            <tr><td colspan="5" class="text-center py-4 text-muted">No data available.</td></tr>
                            <?php else: ?>
                                <?php foreach ($data as $row): ?>
                                <tr>
                                    <td><?= e($row->employee_name) ?></td>
                                    <td class="text-center"><?= $row->total_transactions ?></td>
                                    <td class="text-end"><?= currency($row->total_sales) ?></td>
                                    <td class="text-end"><?= currency($row->total_commission) ?></td>
                                    <td class="text-end"><?= $row->commission_rate ?>%</td>
                                </tr>
                                <?php endforeach; ?>
                            <?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
