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

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

  <?= $this->section('content') ?>
  <section class="section">
      <div class="section-header">
          <h1>Tambah Data Agenda</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('agenda') ?>">Agenda</a></div>
              <div class="breadcrumb-item">Tambah Agenda</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 Agenda</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('agenda') ?>" 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('agenda') ?>" method="post" enctype="multipart/form-data"
                              autocomplete="off" class="needs-validation" novalidate="">
                              <?= csrf_field() ?>
                              <div class="form-group">
                                  <label>Topik</label>
                                  <input type="text" name="tema" placeholder="Input topik agenda" class="form-control"
                                      required>
                                  <div class="invalid-feedback text-danger">Masukan topik agenda</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>Tempat</label>
                                  <input type="text" name="tempat" placeholder="Input tempat agenda"
                                      class="form-control" required>
                                  <div class="invalid-feedback text-danger">Masukan tempat agenda</div>
                              </div>
                              <div class="form-group">
                                  <label>Tanggal</label>
                                  <input type="date" name="tanggal" placeholder="Input tanggal agenda"
                                      class="form-control" required>
                                  <div class="invalid-feedback text-danger">Masukan tanggal agenda</div>
                              </div>
                              <div class="form-group">
                                  <label>Waktu</label>
                                  <input type="time" name="waktu" placeholder="Input waktu agenda" class="form-control"
                                      required>
                                  <div class="invalid-feedback text-danger">Masukan waktu agenda</div>
                              </div>
                              <div class="form-group">
                                  <label>Detail Agenda</label>
                                  <textarea placeholder="Masukan detail agenda" rows="5" name="isi"
                                      class="summernote-simple form-control" required></textarea>
                                  <div class="invalid-feedback text-danger">Masukan detail agenda</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() ?>