<section class="content-header">
    <h1><?= __('Items') ?></h1>

    <div class="actions">
        <a data-ajax class="btn btn-success btn-sm" href="<?= admin_url_to('/webshop/kits/items/add?kit_id=' . $kit['id']) ?>"><?= __('Add') ?></a>
    </div>
</section>

<section class="content">
    <div class="nav-tabs-custom">
        <ul class="nav nav-tabs">
            <li><a data-ajax href="<?= admin_url_to('/webshop/kits/edit/' . $kit['id']) ?>"><?= __('Kit') ?></a></li>
            <li class="active"><a href="#"><?= __('Items') ?></a></li>
        </ul>

        <?php if (empty($items)): ?>
            <div class="tab-content" style="padding:10px">

                <div class="callout callout-warning" style="margin:0">
                    <h4>Ops!</h4>
                    <p><?= __('No items found') ?></p>
                </div>
            </div>
        <?php else: ?>
            <div class="tab-content" style="padding:0">
                <div class="box box-default table-responsive">
                    <table id="products-table" class="table table-condensed table-hover table-striped">
                        <thead>
                            <tr>
                                <th><?= __('Product') ?></th>
                                <th width="10"></th>
                            </tr>
                        </thead>

                        <?php foreach ($items as $product): ?>
                            <tr>
                                <td><?= $product['name'] ?></td>
                                <td class="record-actions">
                                    <a data-ajax class="btn btn-default btn-xs" href="<?= admin_url_to('/webshop/kits/items/edit/' . $product['id']) ?>"><?= __('Edit') ?></a>
                                    <a data-ajax-delete class="btn btn-danger btn-xs" href="<?= admin_url_to('/webshop/kits/items/delete/' . $product['id']) ?>"><?= __('Delete') ?></a>
                                </td>
                            </tr>
                        <?php endforeach ?>
                    </table>
                </div>
            <?php endif ?>
        </div>
    </div>
</section>
