<div class="modal" id="modal-search"></div>

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

    <div class="actions">
<!--        <a data-load-with-modal data-modal="modal-search" class="btn btn-default btn-sm" href="--><?//= admin_url_to('/orders/search') ?><!--">--><?//= __('Search') ?><!--</a>-->
    </div>
</section>

<section class="content">

    <?php if (!$total): ?>
        <div class="callout callout-warning">
            <h4>Ops!</h4>
            <p><?= __('No trackers found') ?></p>
        </div>
    <?php else: ?>

        <div class="box box-default table-responsive">
            <table data-table class="table table-condensed table-hover table-striped">
                <thead>
                    <tr>
                        <th width="60"></th>
                        <th><?= __('Account') ?></th>
                        <th><?= __('Title') ?></th>
                        <th><?= __('Up') ?></th>
                        <th><?= __('Down') ?></th>
                        <th><?= __('Category') ?></th>
                        <th><?= __('Version') ?></th>
                        <th width="180"><?= __('Created at') ?></th>
                        <th width="120"><?= __('Status') ?></th>
                        <th width="10"></th>
                    </tr>
                </thead>

                <tbody>
                    <?php foreach ($trackers as $tracker): ?>
                        <tr>
                            <td>#<?= $tracker['id'] ?></td>
                            <td><a data-ajax href="<?= admin_url_to('/accounts/edit/' . $tracker['account']) ?>"><?= $tracker['account'] ?></a></td>
                            <td><?= $tracker['title'] ?></td>
                            <td><?= $tracker['up'] ?></td>
                            <td><?= $tracker['down'] ?></td>
                            <td><?= $tracker['category'] ?></td>
                            <td><?= $tracker['version'] ?></td>
                            <td><?= util('Date')->dateTime($tracker['create_date']) ?></td>
                            <td><?= util('Tracker.Tracker')->statusName($tracker['category_id'], $tracker['status']) ?></td>
                            <td class="record-actions">
                                <a data-ajax class="btn btn-xs btn-default" href="<?= admin_url_to('/trackers/edit/' . $tracker['id']) ?>"><?= __('Edit') ?></a>
                            </td>
                        </tr>
                    <?php endforeach ?>
                </tbody>
            </table>

            <div class="paginator">
                <?= $paginator->toHtml() ?>
            </div>
        </div>
    <?php endif ?>
</section>