<?php 
include 'header.php';
    $id = $_GET['id'];
      $sql1 = mysqli_query($koneksi, "SELECT nama,jabatan FROM karyawan WHERE id='$id'");
          list($nama,$jabatan) = mysqli_fetch_array($sql1);
?>

<div class="container">

  <div class="my-4 border-bottom">
    <h2 class="fw-semibold fs-3">Edit Data Kelengkapan Karyawan</h2>
  </div>

  <section class="content">
    <div class="row justify-content-center">
      <section class="col-lg-5">       
        <div class="card card-info">

          <div class="card-header justify-content-between d-flex">
            <span class="card-title fw-semibold"><?php echo $nama ?> - <?php echo $jabatan ?></span>
            <a href="b_karyawan_data.php" class="btn btn-primary btn-sm pull-right"><i class="bi bi-reply"></i> &nbsp; Kembali</a> 
          </div>
          <div class="card-body">
            <form action="b_karyawan_data_update.php" method="post" enctype="multipart/form-data">
              <?php 
                            
              $data = mysqli_query($koneksi, "select * from karyawan_iden where id='$id'");
              while($d = mysqli_fetch_array($data)){

                ?>
                            <div class="form-group mb-2">
                              <label>Nomor Induk Pegawai </label>
                              <input type="hidden" class="form-control" name="id" value="<?php echo $d['id'] ?>" required="required">
                              <input type="text" name="nip" required="required" class="form-control" placeholder="......" value="<?php echo $d['nip']; ?>" style="width:100%">
                            </div>            
                            <div class="form-group mb-2">
                              <label>No. Kontak / HP / WA </label>
                              <input type="text" name="hp" required="required" class="form-control" placeholder="......" value="<?php echo $d['hp']; ?>" style="width:100%">
                            </div>                            
                            <div class="form-group mb-2">
                              <label>Golongan </label>
                              <input type="text" name="gol" required="required" class="form-control" placeholder="......" value="<?php echo $d['gol']; ?>" style="width:100%">
                            </div>                            
                            <div class="form-group mb-2">
                              <label>Nomor Rekening </label>
                              <input type="text" name="norek" required="required" class="form-control" placeholder="......" value="<?php echo $d['norek']; ?>" style="width:100%">
                            </div>                            
                            <div class="form-group mb-2">
                              <label>Tanggal Gabung </label>
                              <input type="date" name="tanggal" required="required" class="form-control" placeholder="......" value="<?php echo $d['tanggal']; ?>" style="width:100%">
                            </div>                            
                            <div class="form-group mb-2">
                              <label>Status </label>
                              <input type="text" name="status" required="required" class="form-control" placeholder="......" value="<?php echo $d['status']; ?>" style="width:100%">
                            </div>  
                            <div class="form-group mb-2">
                              <label>G-map Latitude </label>
                              <input type="text" name="k_latitude" required="required" class="form-control" placeholder="......" value="<?php echo $d['k_latitude']; ?>" style="width:100%">
                            </div>  
                            <div class="form-group mb-2">
                              <label>G-map Longitude </label>
                              <input type="text" name="k_longitude" required="required" class="form-control" placeholder="......" value="<?php echo $d['k_longitude']; ?>" style="width:100%">
                            </div>                              

                <div class="form-group mb-2">
                  <input type="submit" class="btn btn-primary" value="Simpan">
                </div>
                <?php
              }

              ?>
              
            </form>
          </div>

        </div>
      </section>
    </div>
  </section>

</div>
<?php include 'footer.php'; ?>