<div class="col-md-10">
    <div class="card">
        <div class="card-header">
            <h4 class="card-title"><?= __('order_list'); ?></h4>
        </div>
        <div class="card-body">
            <div class='table-responsive'>
                <table class='table table-striped data_tables'>
                    <thead>
                        <tr>
                            <th>#</th>
                            <th><?= lang('table'); ?></th>
                            <th><?= lang('status'); ?></th>
                            <th><?= lang('action'); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($waiter_order_lists as  $key => $waiter) : ?>
                            <tr>
                                <td><?= $key + 1; ?></td>
                                <td>
                                    <div> <?= $waiter->table_name; ?></div>
                                    <div><small><?= full_time($waiter->created_at); ?></small></div>
                                </td>
                                <td>
                                    <?php if ($waiter->is_ring == 1 && $waiter->status == 0) : ?>
                                        <label class="label label-info"><i class="fa fa-spinner"></i> <?= lang('pending'); ?></label>
                                    <?php elseif ($waiter->is_ring == 0 && $waiter->status == 0) : ?>
                                        <label class="label label-warning"><i class="icofont-fork-and-knife"></i> <?= lang('there_are_customers'); ?></label>
                                    <?php elseif ($waiter->status == 1) : ?>
                                        <label class="label label-success"><i class="fa fa-check"></i> <?= lang('completed'); ?></label>
                                    <?php endif; ?>
                                    <?php if (isset($waiter->staff_id) && !empty($waiter->staff_id)) : ?>
                                        <div class="mt-3">
                                            <small><?= __staff($waiter->staff_id)->name; ?> - <?= __staff($waiter->staff_id)->uid ?? ''; ?></small>
                                        </div>
                                    <?php endif; ?>
                                </td>
                                <td>
                                    <?php if ($waiter->is_ring == 1) : ?>
                                        <a href="<?= base_url("admin/notification/accept_waiter/{$waiter->id}/0") ?>" class="btn btn-info waiterAccept btn-sm"><i class="fa fa-check"></i> <?= lang('mark_as_accepted'); ?></a>
                                    <?php endif; ?>
                                    <?php if ($waiter->is_ring == 0 && $waiter->status == 0) : ?>
                                        <a href="<?= base_url("admin/notification/accept_waiter/{$waiter->id}/1") ?>" class="btn btn-success waiterAccept btn-sm"><i class="fa fa-check"></i> <?= lang('mark_as_completed'); ?></a>
                                    <?php else : ?>
                                        <a href="javascript:;" class="btn btn-success btn-sm"><i class="fa fa-check"></i> <?= lang('completed'); ?></a>
                                    <?php endif; ?>
                                </td>
                            </tr>
                        <?php endforeach; ?>

                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>