<?= $this->extend('layouts/admin') ?>
<?= $this->section('content') ?>
<?= $this->include('templates/admin/header'); ?>
<div class="indexTable_wrapper">
  <div class="indexTable_head">
    <?= form_open(current_url(), array("method" => "get")) ?>
    <ul class="nav">
      조건검색:<?php foreach ($fieldFilters as $field) : ?><li class="nav-item"><?= getFieldForm_AuthHelper($field, $$field, $fieldFormOptions) ?></li><?php endforeach; ?>
    <?= $this->include('templates/admin/index_head'); ?>
    </ul>
    <?= form_close(); ?>
  </div>
  <div class="indexTable_body">
    <table class="table table-bordered table-hover table-striped indexTable ">
      <tr>
        <td>번호</td>
        <?php foreach ($fields as $field) : ?><td><?= getFieldIndex_Column_AuthHelper($field, $order_field, $order_value) ?></td><?php endforeach; ?>
      </tr>
      <?php $i = 0; ?>
      <?php foreach ($rows as $row) : ?>
        <tr id="<?= $row['uid'] ?>" <?= $row['status'] != 'use' ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this);">
          <td>
            <?= anchor(current_url() . '/update/' . $row['uid'], $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?>
          </td>
          <?php foreach ($fields as $field) : ?>
            <td nowrap><?= getFieldIndex_Row_AuthHelper($field, $row, $fieldFilters, $fieldFormOptions) ?></td>
          <?php endforeach; ?>
        </tr>
        <?php $i++; ?>
      <?php endforeach; ?>
    </table>
    <div style="text-align:center;"><?= anchor(current_url() . '/insert', '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?></div>
  </div>
  <div class="indexTable_tail">
    <?= $pagination ?>
  </div>
</div>
<?= $this->include('templates/admin/footer'); ?>
<?= $this->endSection() ?>