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

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

  <?= $this->section('content') ?>
  <section class="section">
      <div class="section-header">
          <h1>Edit Data Kontak</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('kontak') ?>">Kontak</a></div>
              <div class="breadcrumb-item">Edit Kontak</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">Edit Data Kontak</h2>
          <p class="section-lead">
              Halaman edit 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('kontak') ?>" 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('kontak') ?>" method="post" enctype="multipart/form-data"
                              autocomplete="off" class="needs-validation" novalidate="">
                              <?= csrf_field() ?>

                              <div class="form-group">
                                  <label>Telpon</label>
                                  <input type="text" name="telpon" value="<?= $kontak->telpon ?>" class="form-control"
                                      required>
                                  <div class="invalid-feedback text-danger">Masukan telpon</div>
                              </div>
                              <div class="form-group">
                                  <label>Email</label>
                                  <input type="email" name="email" value="<?= $kontak->email ?>" class="form-control"
                                      required>
                                  <div class="invalid-feedback text-danger">Masukan email</div>
                              </div>
                              <div class="form-group">
                                  <label>Alamat</label>
                                  <textarea rows="5" name="alamat" class="form-control"
                                      required><?= $kontak->alamat ?></textarea>
                                  <div class="invalid-feedback text-danger">Masukan alamat</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() ?>