  <?= $this->extend('layout/admin') ?>

  <?= $this->section('title') ?>
  <title>GALLERY &mdash; KUA WAY BUNGUR</title>
  <?= $this->endSection() ?>

  <?= $this->section('content') ?>
  <section class="section">
      <div class="section-header">
          <h1>Tambah Data Gallery</h1>

          <div class="section-header-breadcrumb">
              <div class="breadcrumb-item active"><a href="<?= base_url('dashboard') ?>">Dashboard</a></div>
              <div class="breadcrumb-item active"><a href="<?= base_url('gallery') ?>">Gallery</a></div>
              <div class="breadcrumb-item">Tambah Gallery</div>
          </div>
      </div>
      <?php if (session()->getFlashdata('error')) : ?>
      <div class="alert alert-danger alert-dismissible show fade">
          <div class="alert-body">
              <button class="close" data-dismiss="alert">X</button>
              <b>Error !</b>
              <?= session()->getFlashdata('error') ?>
          </div>
      </div>
      <?php endif; ?>

      <div class="section-body">
          <h2 class="section-title">Tambah Data Gallery</h2>
          <p class="section-lead">
              Halaman tambah data.
          </p>

          <div class="row">
              <div class="col-12 col-md-12 col-lg-12">
                  <div class="card">

                      <div class="card-header">
                          <div class="section-header-button">
                              <a href="<?= base_url('gallery') ?>" type="button" class="btn btn-info sm">
                                  <i class="fas fa-arrow-left"></i> Kembali
                              </a>
                          </div>
                      </div>
                      <div class="card-body">
                          <form action="<?= base_url('gallery') ?>" method="post" enctype="multipart/form-data"
                              autocomplete="off" class="needs-validation" novalidate="">
                              <?= csrf_field() ?>
                              <div class="form-group">
                                  <label>Judul Gallery</label>
                                  <input type="text" name="judul" placeholder="Input judul gallery" class="form-control"
                                      required>
                                  <div class="invalid-feedback text-danger">Masukan judul gallery</div>
                              </div>
                              <div class="form-group">
                                  <label>Foto</label>
                                  <input type="file" class="form-control" name="gambar"
                                      accept="image/png, image/jpg, image/jpeg" required>
                                  <div class="invalid-feedback text-danger">Pilih gambar</div>
                                  <p><small class="text-muted">Ukuran max 1024k.</small></p>
                              </div>

                              <div class="form-group">
                                  <label>Keterangan</label>
                                  <textarea placeholder="Masukan isi gallery" rows="5" name="keterangan"
                                      class="summernote-simple form-control" required></textarea>
                                  <div class="invalid-feedback text-danger">Masukan keterangan gallery</div>
                              </div>
                              <div class="text-right">
                                  <button type="reset" class="btn btn-secondary">Reset</button>
                                  <button type="submit" class="btn btn-primary"><i class="fas fa-paper-plane"></i>
                                      Simpan</button>

                              </div>
                          </form>
                      </div>

                  </div>
              </div>
  </section>
  <?= $this->endSection() ?>