<!-- Main content -->
<div class="content" id="content">
  <div class='row'>
    <div class='col-lg-12'>
      <div class='panel <?= $web_box_color ?>'>
        <div class='panel-heading'>
          <h3 class='panel-title bold'>Form Kunjungan</h3>
        </div>
        <form action="<?= $action; ?>" method="post" enctype="multipart/form-data">
          <div class='panel-body'>
            <div class='row'>

              <div class='col-md-4'>
                <div class='form-group'>
                  <label for='id_card'>Id Card : </label>
                  <input type="text" class="form-control" name="id_card" id="id_card" placeholder="Id Card" value="<?= $id_card; ?>" />
                  <?= form_error('id_card') ?>
                </div>
              </div>

              <div class='col-md-4'>
                <div class='form-group'>
                  <label for='tanggal'>Tanggal : </label>
                  <div class='input-group date'>
                    <div class='input-group-prepend'>
                      <span class="input-group-text"><i class="fa fa-calendar"></i></span>
                    </div>
                    <input type="date" class="form-control" name="tanggal" id="tanggal" placeholder="Tanggal" value="<?= $tanggal; ?>" />
                  </div>
                  <?= form_error('tanggal') ?>
                </div>
              </div>

              <div class='col-md-4'>
                <div class='form-group'>
                  <label for='nik'>NIK : </label>
                  <input type="text" class="form-control" name="nik" id="nik" placeholder="NIK" value="<?= $nik; ?>" />
                  <?= form_error('nik') ?>
                </div>
              </div>

              <div class='col-md-4'>
                <div class='form-group'>
                  <label for='nama'>Nama : </label>
                  <input type="text" class="form-control" name="nama" id="nama" placeholder="Nama" value="<?= $nama; ?>" />
                  <?= form_error('nama') ?>
                </div>
              </div>

              <div class='col-md-4'>
                <div class='form-group'>
                  <label for='tempat_lahir'>Tempat Lahir : </label>
                  <input type="text" class="form-control" name="tempat_lahir" id="tempat_lahir" placeholder="Tempat Lahir" value="<?= $tempat_lahir; ?>" />
                  <?= form_error('tempat_lahir') ?>
                </div>
              </div>

              <div class='col-md-4'>
                <div class='form-group'>
                  <label for='tanggal_lahir'>Tanggal Lahir : </label>
                  <div class='input-group date'>
                    <div class='input-group-prepend'>
                      <span class="input-group-text"><i class="fa fa-calendar"></i></span>
                    </div>
                    <input type="date" class="form-control" name="tanggal_lahir" id="tanggal_lahir" placeholder="Tanggal Lahir" value="<?= $tanggal_lahir; ?>" />
                  </div>
                  <?= form_error('tanggal_lahir') ?>
                </div>
              </div>

              <div class='col-md-4'>
                <div class='form-group'>
                  <label for='jenis_kelamin'>Jenis Kelamin : </label>
                  <?= cmb_enum('jenis_kelamin', 'kunjungan', 'jenis_kelamin', $jenis_kelamin); ?>
                  <?= form_error('jenis_kelamin') ?>
                </div>
              </div>

              <div class='col-lg-12'>
                <div class='form-group'>
                  <label for='alamat'>Alamat : </label>
                  <textarea class="form-control" name="alamat" id="alamat" placeholder="Alamat" rows="3"><?= $alamat; ?></textarea>
                  <?= form_error('alamat') ?>
                </div>
              </div>

              <div class='col-md-4'>
                <div class='form-group'>
                  <label for='telepon'>Telepon : </label>
                  <input type="text" class="form-control" name="telepon" id="telepon" placeholder="Telepon" value="<?= $telepon; ?>" />
                  <?= form_error('telepon') ?>
                </div>
              </div>

              <div class='col-md-4'>
                <div class='form-group'>
                  <label for='dari'>Dari : </label>
                  <input type="text" class="form-control" name="dari" id="dari" placeholder="Dari" value="<?= $dari; ?>" />
                  <?= form_error('dari') ?>
                </div>
              </div>

              <div class='col-md-4'>
                <div class='form-group'>
                  <label for='tujuan'>Tujuan : </label>
                  <input type="text" class="form-control" name="tujuan" id="tujuan" placeholder="Tujuan" value="<?= $tujuan; ?>" />
                  <?= form_error('tujuan') ?>
                </div>
              </div>

              <div class='col-md-4'>
                <div class='form-group'>
                  <label for='sub_tujuan'>Sub Tujuan : </label>
                  <input type="text" class="form-control" name="sub_tujuan" id="sub_tujuan" placeholder="Sub Tujuan" value="<?= $sub_tujuan; ?>" />
                  <?= form_error('sub_tujuan') ?>
                </div>
              </div>

              <div class='col-lg-12'>
                <div class='form-group'>
                  <label for='keperluan'>Keperluan : </label>
                  <textarea class="form-control" name="keperluan" id="keperluan" placeholder="Keperluan" rows="3"><?= $keperluan; ?></textarea>
                  <?= form_error('keperluan') ?>
                </div>
              </div>

              <div class='col-md-4'>
                <div class='form-group'>
                  <label for='foto'>Foto : </label>
                  <div class="input-group mb-3">
                    <div class="input-group-prepend">
                      <span class="input-group-text" id="inputGroupFileAddon01"><i class="fa fa-file-alt"></i></span>
                    </div>
                    <div class="custom-file">
                      <input type="file" name="foto" class="custom-file-input" id="inputGroupFile01" aria-describedby="inputGroupFileAddon01" onchange="previewImage();">
                      <label class="custom-file-label" for="inputGroupFile01" id="teks-gambar">Choose file</label>
                    </div>
                  </div>

                  <!-- <input type="file" class="form-control" name="foto" id="foto" placeholder="Foto" value="<?= $foto; ?>" /> -->
                  <?= form_error('foto') ?>
                </div>
              </div>
              <input type="hidden" name="filelama" value="<?= $foto; ?>" />
              <input type="hidden" name="id_kunjungan" value="<?= $id_kunjungan; ?>" />

            </div>
          </div>
          <div class='panel-footer'>
            <button type="submit" class="btn btn-primary  pull-right"><?= $button ?></button>
            <a href="javascript:window.history.go(-1);" class="btn btn-default">Batal</a>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>