<?= $this->extend($viewDatas['layout']['layout']) ?>
<?= $this->section('content') ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : ""; ?>
<div id="container" class="content">
  <div class="form_top"><?= $this->include("{$viewDatas['layout']['template']}/form_content_top"); ?></div>
  <?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
  <table class="table table-bordered">
    <tr>
      <th class="bg-light" colspan="2"><?= $viewDatas['title'] ?></th>
    </tr>
    <?php foreach ($viewDatas['formFields'] as $field => $label): ?>
      <tr>
        <th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
        <td nowrap class="text-start">
          <?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?>
          <div><?= validation_show_error($field); ?></div>
        </td>
      </tr>
    <?php endforeach; ?>
  </table>
  <div class="text-center"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></div>
  <?= form_close(); ?>
  <div class="form_bottom"><?= $this->include("{$viewDatas['layout']['template']}/form_content_bottom"); ?></div>
</div>
<?= $this->endSection() ?>