<form id="formBiodata" method="POST" action="<?= base_url('Akun/Biodata') ?>">
  <div class="row my-3">
    <div class="col-6 col-lg-6">
      <label for="koreg">Kode Registrasi</label>
      <input type="text" class="form-control form-control-sm form-control-custum" name="koreg" id="koreg" value="<?= $user['koreg'] ?>" readonly>
    </div>
    <div class="col-6 col-lg-6">
      <label for="koreg">Nomor Urut Daftar</label>
      <input type="text" class="form-control form-control-sm form-control-custum" name="noDaftar" value="<?= $user['noDaftar'] ?>" readonly>
    </div>
  </div>
  <div class="row my-3">
    <div class="col-6 col-lg-6">
      <label for="nama">Nama Pendaftar</label>
      <input type="text" class="form-control form-control-sm form-control-custum" value="<?= $user['nama'] ?>" name="nama" id="nama" placeholder="Nama Pendaftar" readonly>
    </div>
    <div class="col-6 col-lg-6">
      <label for="nik">NIK</label>
      <input type="text" class="form-control form-control-sm form-control-custum" name="nik" id="nik" value="<?= $user['nik'] ?>" readonly>
    </div>
  </div>

  <div class="row my-3">
    <div class="col-6 col-lg-6">
      <label for="nisn">NISN</label>
      <input type="text" class="form-control form-control-sm form-control-custum" name="nisn" id="nisn" value="<?= $user['nisn'] ?>" readonly>
    </div>
    <div class="col-6 col-lg-6">
      <label for="email">Email</label>
      <input type="text" class="form-control form-control-sm form-control-custum" name="email" id="email" value="<?= $user['email'] ?>" readonly>
    </div>
  </div>

  <div class="row my-3">
    <div class="col-6 col-lg-6">
      <label for="tempatLahir">Tempat Lahir</label>
      <input type="text" class="tempatLahir form-control form-control-sm form-control-custum" name="tempatLahir" id="tempatLahir" value="<?= $user['tempatLahir'] ?>" placeholder="Tempat lahir">
    </div>
    <div class="col-6 col-lg-6">
      <label for="tglLahir">Tanggal Lahir</label>
      <input type="text" class="tglLahir form-control form-control-sm form-control-custum" id="tglLahir" name="tglLahir" value="<?= $user['tglLahir'] ?>" placeholder="Tanggal lahir">
    </div>
  </div>

  <div class="row my-3">
    <?php
    $provinsiOld = $dataUser['provinsi'];
    $kecamatanOld = $dataUser['kecamatan'];
    $desaOld = $dataUser['desa'];
    $kotaOld = $dataUser['kota'];
    $jk = $dataUser['jk'];
    var_dump($dataUser);
    ?>
    <div class="col-6 col-lg-6">
      <label for="jk">Jenis Kelamin</label>
      <select name="jk" id="jk" class="jk form-control form-control-sm">

        <option value="L">Laki-laki</option>
        <option value="P">Perempuan</option>
      </select>
    </div>
    <div class="col-6 col-lg-6">
      <label for="noHp">Nomor Telepon</label>
      <input type="number" id="noHp" class="noHp form-control form-control-sm form-control-custum" name="noHp" value="<?= $user['noHp'] ?>" placeholder="No Handphone">
    </div>
    <div class="col-6 col-lg-6">
      <label for="tinggiBadan">Tinggi Badan</label>
      <input type="number" class="form-control form-control-sm form-control-custum" id="tinggiBadan" name="tinggiBadan" value="<?= $user['tinggiBadan'] ?>" placeholder="Tinggi Badan">
    </div>
    <div class="col-6 col-lg-6">
      <label for="beratBadan">Berat badan</label>
      <input type="number" class="tinggiBadan form-control form-control-sm form-control-custum" id="beratBadan" name="beratBadan" value="<?= $user['beratBadan'] ?>" placeholder="Berat Badan">
    </div>
  </div>

  <div class="row my-3">
    <div class="col-6 col-lg-6">
      <label for="sekolahAsal">Asal Sekolah Dasar</label>
      <input type="text" class="sekolahAsal form-control form-control-sm form-control-custum" name="sekolahAsal" value="<?= $user['sekolahAsal'] ?>" placeholder="Asal Sekolah">
    </div>
    <div class="col-6 col-lg-6">
      <label for="npsn">NPSN Asal Sekolah Dasar</label>
      <input type="text" class="npsn form-control form-control-sm form-control-custum" name="npsn" value="<?= $user['npsn'] ?>" placeholder="NPSN Asal Sekolah">
    </div>
  </div>
  <section class="alamat">
    <fieldset>
      <legend>Alamat</legend>

      <div class="row my-3">
        <div class="col-6 col-lg-6">
          <label for="kk">No Kartu Keluarga</label>
          <input type="number" class="kk form-control form-control-sm form-control-custum" id="kk" name="kk" value="<?= $user['kk'] ?>" placeholder="No Kartu Keluarga">
        </div>
        <div class="col-6 col-lg-6">
          <label for="provinsi">Provinsi</label>
          <select name="provinsi" id="provinsi" class="provinsi form-control form-control-sm">
            <option value="<?= $provinsiOld['id'] ?>"><?= $provinsiOld['name'] ?></option>
            <?php foreach ($provinsi as $prov) : ?>
              <option value="<?= $prov['id'] ?>"> <?= $prov['name'] ?></option>
            <?php endforeach ?>
          </select>
        </div>
      </div>
      <div class="row my-3">
        <div class="col-6 col-lg-6">
          <label for="kota">Kota/Kabupaten</label>
          <select name="kota" id="kota" class="kota form-control form-control-sm">
            <option value="<?= $kotaOld['id'] ?>"><?= $kotaOld['name'] ?></option>
          </select>
        </div>
        <div class="col-6 col-lg-6">
          <label for="kecamatan">Kecamatan</label>
          <select name="kecamatan" id="kecamatan" class="kecamatan form-control form-control-sm">
            <option value="<?= $kecamatanOld['id'] ?>"><?= $kecamatanOld['name'] ?></option>
          </select>
        </div>
      </div>
      <div class="row my-3">
        <div class="col-6 col-lg-6">
          <label for="desa">Kelurahan/Desa</label>
          <select name="desa" id="desa" class="desa form-control form-control-sm">
            <option value="<?= $desaOld['id'] ?>"><?= $desaOld['name'] ?></option>
          </select>
        </div>
        <div class="col-6 col-lg-6">
          <label for="rt">RT</label>
          <input type="number" class="form-control form-control-sm form-control-custum" name="rt" id="rt" value="<?= $user['rt'] ?>" placeholder="Rt">
        </div>
      </div>
      <div class="row my-3">
        <div class="col-6 col-lg-6">
          <label for="rw">RW</label>
          <input type="number" class="form-control form-control-sm form-control-custum" id="rw" name="rw" value="<?= $user['rw'] ?>" placeholder="RW">
        </div>
        <div class="col-6 col-lg-6">
          <label for="kodePos">Kode Pos</label>
          <input type="number" class="form-control form-control-sm form-control-custum" id="kodePos" name="kodePos" value="<?= $user['kodePos'] ?>" placeholder="Kode Pos contoh 16110">
        </div>
      </div>
      <div class="row my-3">
        <div class="col-12 col-lg-6">
          <label for="alamat">Alamat Lengkap</label>
          <textarea name="alamat" class="alamat form-control" id="alamat" row="200" required>
                          <?= $user['alamat'] ?>
                        </textarea>
        </div>
        <div class="col-6 col-lg-6">
          <label for="longitude">Longitude</label>
          <input type="text" class="form-control form-control-sm form-control-custum longitude" id="longitude" name="longitude" value="<?= $user['longitude'] ?>" placeholder="Longitude contoh 16110">
        </div>
      </div>
      <div class="row my-1">
        <div class="col-12 col-md-4 offset-md-6">

          <!-- <div id="map" style="width:10px; height: 10em; margin-top: 4px;"></div> -->
        </div>
      </div>
    </fieldset>
  </section>
  <button type="submit" class="btn-next">Berikutnya</button>
</form>