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

    <div class="actions">
        <a data-ajax class="btn btn-success btn-sm" href="<?= admin_url_to('/vote-reward/providers/add') ?>"><?= __('Add') ?></a>
    </div>
</section>

<section class="content">
    <?php if (empty($providers)): ?>
        <div class="callout callout-warning">
            <h4>Ops!</h4>
            <p><?= __('No providers found') ?></p>
        </div>
    <?php else: ?>
        <div class="box box-default table-responsive">
            <table id="slides-table" class="table table-condensed table-hover table-striped">
                <thead>
                <tr>
                    <th><?= __('Name') ?></th>
                    <th><?= __('URL') ?></th>
                    <th><?= __('Pingback/Postback') ?></th>
                    <th width="80"></th>
                </tr>
                </thead>

                <tbody>
                <?php foreach ($providers as $provider): ?>
                    <tr class="<?= $provider['active'] ? 'border-success' : 'border-error' ?>">
                        <td><?= $provider['name'] ?></td>
                        <td><?= $provider['url'] ?></td>
                        <td><?= url_to('/vote/' . $provider['id'] . '/pingback', true) ?></td>
                        <td class="record-actions">
                            <a data-ajax class="btn btn-xs btn-default" href="<?= admin_url_to('/vote-reward/providers/edit/' . $provider['id']) ?>"><?= __('Edit') ?></a>
                            <a data-ajax-delete class="btn btn-danger btn-xs" href="<?= admin_url_to('/vote-reward/providers/delete/' . $provider['id']) ?>"><?= __('Delete') ?></a>
                        </td>
                    </tr>
                <?php endforeach ?>
                </tbody>
            </table>
        </div>
    <?php endif ?>
</section>
