<?php
require 'vendor/autoload.php';

use PhpOffice\PhpSpreadsheet\Spreadsheet;
?>
<?php if ($_GET[act] == '') { ?>
  <div class="col-xs-12">

    <div class="box box-warning">
      <div class="box-header with-border">
        <h3 class="box-title">Semua Data Guru </h3>

        <a class='pull-right btn btn-primary btn-sm' href='index.php?view=guru&act=tambahguru'>Tambahkan Data Guru</a>
        <a style='margin-right:5px' class='pull-right btn btn-danger btn-sm' href='index.php?view=guru&act=imports'>
          <i class='fa fa-file-excel-o'></i> Import Data Guru
        </a>

      </div><!-- /.box-header -->
      <div class="table-responsive">
        <table id="example1" class="table table-bordered table-striped">
          <thead>
            <tr>
              <th>No</th>
              <th>NIP</th>
              <th>Nama Lengkap</th>
              <th>Jenis Kelamin</th>
              <th>Jenis Absen</th>
              <th>Status Pegawai</th>
              <th>Jenis PTK</th>
              <th>Tugas Tambahan</th>
              <th>Action</th>
            </tr>
          </thead>
          <tbody>
            <?php
            $tampil = mysqli_query($conn, "SELECT * FROM rb_guru a 
                                          LEFT JOIN rb_jenis_kelamin b ON a.id_jenis_kelamin=b.id_jenis_kelamin 
                                            LEFT JOIN rb_status_kepegawaian c ON a.id_status_kepegawaian=c.id_status_kepegawaian 
                                              LEFT JOIN rb_jenis_ptk d ON a.id_jenis_ptk=d.id_jenis_ptk
                                              ORDER BY a.nip DESC");
            $no = 1;
            while ($r = mysqli_fetch_array($tampil)) {
              $tanggal = tgl_indo($r[tgl_posting]);
              if ($r['page_absen'] == 'T') {
                $a = 'Y';
                $icon = "fa-close";
                $btn = "btn-danger ";
                $alt = "Aktifkan";
                $onoff = "<a class='btn $btn btn-xs' title='$alt' href='?view=guru&act=onoff&id=$r[nip]&a=$a'><span class='fa $icon'></span> Radius Tidak Aktif</a>";
              } else {
                $a = 'T';
                $icon = "fa-map-marker";
                $btn = "btn-warning";
                $alt = "Non Aktifkan";
                $onoff = "<a class='btn $btn btn-xs' title='$alt' href='?view=guru&act=onoff&id=$r[nip]&a=$a'><span class='fa $icon'></span> Radius Aktif</a>";
              }
              echo "<tr><td>$no</td>
                              <td>$r[nip]</td>
                              <td>$r[nama_guru]</td>
                              <td>$r[jenis_kelamin]</td>
                              <td>$onoff</td>
                              
                              <td>$r[status_kepegawaian]</td>
                              <td>$r[jenis_ptk]</td>
                              <td>$r[nmTugas]</td>";
              if ($_SESSION[level] != 'kepala') {
                echo "<td><center>
                                <a class='btn btn-info btn-xs' title='Lihat Detail' href='?view=guru&act=detailguru&id=$r[nip]'><span class='glyphicon glyphicon-search'></span></a>
                                <a class='btn btn-success btn-xs' title='Edit Data' href='?view=guru&act=editguru&id=$r[nip]'><span class='glyphicon glyphicon-edit'></span></a>
                                <a class='btn btn-danger btn-xs' title='Delete Data' href='?view=guru&hapus=$r[nip]'><span class='glyphicon glyphicon-remove'></span></a>
                              </center></td>";
              } else {
                echo "<td><center>
                                <a class='btn btn-info btn-xs' title='Lihat Detail' href='?view=guru&act=detailguru&id=$r[nip]'><span class='glyphicon glyphicon-search'></span></a>
                              </center></td>";
              }
              echo "</tr>";
              $no++;
            }
            if (isset($_GET[hapus])) {
              mysqli_query($conn, "DELETE FROM rb_guru where nip='$_GET[hapus]'");
              echo "<script>document.location='index.php?view=guru';</script>";
            }

            ?>
          </tbody>
        </table>
      </div><!-- /.box-body -->
    </div><!-- /.box -->
  </div>
<?php
} elseif ($_GET[act] == 'onoff') {
  $a = $_GET['a'];
  $query = mysqli_query($conn, "UPDATE rb_guru SET page_absen='$a' where nip = '$_GET[id]'");

  if ($query) {
    echo "<script>document.location='index.php?view=guru';</script>";
  } else {
    echo "<script>document.location='index.php?view=guru';</script>";
  }
} elseif ($_GET[act] == 'imports') {
?>
  <div class="col-xs-12">

    <div class="box box-warning">


      <!-- /.box-header -->
      <div class="box-body">
        <h3 class="box-title"> Import Data Guru</h3>
        <?php
        //jika tombol import ditekan
        if (isset($_POST['prosesimport'])) {

          $target = "temp/" . uniqid() . '.xlsx';
          move_uploaded_file($_FILES['fileSiswa']['tmp_name'], $target);

          $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
          $excel = $reader->load($target);
          $excelData = $excel->getActiveSheet()->toArray();
          unset($excelData[0]);

          foreach ($excelData as $item) {
            // setelah data dibaca, masukkan ke tabel pegawai sql
            $hasil = mysqli_query($conn, "INSERT INTO rb_guru(nip,password,nama_guru,id_jenis_kelamin,nuptk,id_jenis_ptk,id_agama,id_status_keaktifan) VALUES('$item[0]','$item[1]','$item[2]','$item[3]','$item[4]','$item[5]','1','1')");
          }

          if (!$hasil) {
            //          jika import gagal

            echo "<div class='alert alert-danger' role='alert'>
              Data Gagal Diimport....!<br>" . die(mysql_error()) . "
              </div>";
          } else {
            //          jika impor berhasil
            echo "<div class='alert alert-success' role='alert'>
              Data Berhasil Diimport....!
              </div>";
          }
          //hapus file xls yang udah dibaca
          unlink($target);
          // echo '1';

          // require_once 'config/excel_reader.php';

          // echo '2';

          // $data = new Spreadsheet_Excel_Reader($target);

          // echo '3';
          // echo $data->dump(true, true);
          //  menghitung jumlah baris file xls
          // $baris = $data->rowcount($sheet_index = 0);

          //    import data excel mulai baris ke-2 (karena tabel xls ada header pada baris 1)
          // for ($i = 2; $i <= $baris; $i++) {


          //   // membaca data (kolom ke-1 sd terakhir)
          //   $nis     = $data->val($i, 1);
          //   $nisn     = $data->val($i, 2);
          //   $username  = $data->val($i, 3);
          //   $ubah    = $data->val($i, 4);
          //   $nama      = $data->val($i, 5);
          //   $jk      = $data->val($i, 6);



          //   // setelah data dibaca, masukkan ke tabel pegawai sql
          //   $hasil = mysqli_query($conn, "INSERT INTO rb_guru(nip,password,nama_guru,id_jenis_kelamin,nuptk,id_jenis_ptk) 
          // 		VALUES('$nis','$nisn','$username','$ubah','$nama','$jk')");
          // }

          // if (!$hasil) {
          //   //          jika import gagal

          //   echo "<div class='alert alert-danger' role='alert'>
          // 	Data Gagal Diimport....!<br>" . die(mysql_error()) . "
          // 	</div>";
          // } else {
          //   //          jika impor berhasil
          //   echo "<div class='alert alert-success' role='alert'>
          // 	Data Berhasil Diimport....!
          // 	</div>";
          // }
          //    hapus file xls yang udah dibaca
          // unlink("temp/" . $_FILES['fileSiswa']['name']);
          // unlink("temp/formatdataguru.xls");
        }
        ?>

        <form method="POST" action="" class="form-horizontal" onSubmit="return validateForm()" enctype="multipart/form-data">
          <div class="form-group">

            <label for="" class="col-sm-4 control-label">Download Format Data Guru</label>
            <div class="col-sm-8">
              <a href="./files/formatdataguru.xlsx" class="btn btn-info"><span class="fa fa-file-excel-o"></span> formatdataguru.xlsx</a>
            </div>
          </div>
          <div class="form-group">
            <label for="" class="col-sm-4 control-label">Pilih File Excel </label>
            <div class="col-sm-8">
              <input type="file" name="fileSiswa" class="form-control" id="fileSiswa" placeholder="" required>
            </div>
          </div>
          <div class="form-group">
            <label for="" class="col-sm-4 control-label"></label>
            <div class="col-sm-8">
              <input type="submit" name="prosesimport" value="Proses Import" class="btn btn-success">
              <a href="index.php?view=guru" class="btn btn-default">Cancel</a>

            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
  <script type="text/javascript">
    //    validasi form (hanya file .xls yang diijinkan)
    function validateForm() {
      function hasExtension(inputID, exts) {
        var fileName = document.getElementById(inputID).value;
        return (new RegExp('(' + exts.join('|').replace(/\./g, '\\.') + ')$')).test(fileName);
      }

      if (!hasExtension('fileSiswa', ['.xlsx'])) {
        alert("Hanya file XLS (Excel 2003) yang diizinkan.");
        return false;
      }
    }
  </script>
<?php
} elseif ($_GET[act] == 'tambahguru') {
  if (isset($_POST[tambah])) {
    $rtrw = explode('/', $_POST[al]);
    $rt = $rtrw[0];
    $rw = $rtrw[1];
    $dir_gambar = 'foto_pegawai/';
    $filename = basename($_FILES['ax']['name']);
    $filenamee = date("YmdHis") . '-' . basename($_FILES['ax']['name']);
    $uploadfile = $dir_gambar . $filenamee;
    if ($filename != '') {
      if (move_uploaded_file($_FILES['ax']['tmp_name'], $uploadfile)) {
        mysqli_query($conn, "INSERT INTO rb_guru VALUES('$_POST[aa]','$_POST[ab]','$_POST[ac]','$_POST[af]','$_POST[ad]',
                           '$_POST[ae]','$_POST[ba]','$_POST[xx]','$_POST[bv]','$_POST[aq]','$_POST[au]','$_POST[as]','$_POST[ar]', 
                           '$_POST[ag]','$_POST[ak]','$rt','$rw','$_POST[am]','$_POST[an]','$_POST[ao]','$_POST[ap]',
                           '$_POST[ai]','$_POST[ah]','$_POST[aj]','$_POST[at]','$_POST[av]','$_POST[bb]','$_POST[bc]', 
                           '$_POST[bd]','$_POST[be]','$_POST[bf]','$_POST[bg]','$_POST[bi]','$_POST[bh]','$_POST[bj]',
                           '$_POST[aw]','$_POST[bk]','$_POST[bl]','$_POST[bm]','$_POST[bn]','$_POST[bo]','$_POST[bp]',
                           '$_POST[bq]','$_POST[br]','$_POST[bs]','$_POST[bt]','$_POST[bw]','$_POST[bu]','$filenamee')");
      }
    } else {
      mysqli_query($conn, "INSERT INTO rb_guru VALUES('$_POST[aa]','$_POST[ab]','$_POST[ac]','$_POST[af]','$_POST[ad]',
                           '$_POST[ae]','$_POST[ba]','$_POST[xx]','$_POST[bv]','$_POST[aq]','$_POST[au]','$_POST[as]','$_POST[ar]', 
                           '$_POST[ag]','$_POST[ak]','$rt','$rw','$_POST[am]','$_POST[an]','$_POST[ao]','$_POST[ap]',
                           '$_POST[ai]','$_POST[ah]','$_POST[aj]','$_POST[at]','$_POST[av]','$_POST[bb]','$_POST[bc]', 
                           '$_POST[bd]','$_POST[be]','$_POST[bf]','$_POST[bg]','$_POST[bi]','$_POST[bh]','$_POST[bj]',
                           '$_POST[aw]','$_POST[bk]','$_POST[bl]','$_POST[bm]','$_POST[bn]','$_POST[bo]','$_POST[bp]',
                           '$_POST[bq]','$_POST[br]','$_POST[bs]','$_POST[bt]','$_POST[bw]','$_POST[bu]','')");
    }
    echo "<script>document.location='index.php?view=guru&act=detailguru&id=" . $_POST[aa] . "';</script>";
  }

  echo "<div class='col-md-12'>
              <div class='box box-warning'>
                <div class='box-header with-border'>
                  <h3 class='box-title'>Tambah Data Guru</h3>
                </div>
              <div class='box-body'>
              <form method='POST' class='form-horizontal' action='' enctype='multipart/form-data'>
                <div class='col-md-6'>
                  <table class='table table-condensed table-bordered'>
                  <tbody>
                    <input type='hidden' name='id' value='$s[nip]'>
                    <tr><th width='120px' scope='row'>Nip</th>      <td><input type='text' class='form-control' name='aa'></td></tr>
                    <tr><th scope='row'>Password</th>               <td><input type='text' class='form-control' name='ab'></td></tr>
                    <tr><th scope='row'>Nama Lengkap</th>           <td><input type='text' class='form-control' name='ac'></td></tr>
                    <tr><th scope='row'>Tempat Lahir</th>           <td><input type='text' class='form-control' name='ad'></td></tr>
                    <tr><th scope='row'>Tanggal Lahir</th>          <td><input type='text' class='form-control' name='ae'></td></tr>
                    <tr><th scope='row'>Jenis Kelamin</th>          <td><select class='form-control' name='af'> 
                                                                          <option value='0' selected>- Pilih Jenis Kelamin -</option>";
  $jk = mysqli_query($conn, "SELECT * FROM rb_jenis_kelamin");
  while ($a = mysqli_fetch_array($jk)) {
    echo "<option value='$a[id_jenis_kelamin]'>$a[jenis_kelamin]</option>";
  }
  echo "</select></td></tr>
                    <tr><th scope='row'>Agama</th>                  <td><select class='form-control' name='ag'> 
                                                                          <option value='0' selected>- Pilih Agama -</option>";
  $agama = mysqli_query($conn, "SELECT * FROM rb_agama");
  while ($a = mysqli_fetch_array($agama)) {
    echo "<option value='$a[id_agama]'>$a[nama_agama]</option>";
  }
  echo "</select></td></tr>
				
                    <tr><th scope='row'>No Hp</th>                  <td><input type='text' class='form-control' name='ah'></td></tr>
                    <tr><th scope='row'>No Telpon</th>              <td><input type='text' class='form-control' name='ai'></td></tr>
                    <tr><th scope='row'>Alamat Email</th>           <td><input type='text' class='form-control' name='aj'></td></tr>
                    <tr><th scope='row'>Alamat</th>                 <td><input type='text' class='form-control' name='ak'></td></tr>
                    <tr><th scope='row'>RT/RW</th>                  <td><input type='text' class='form-control' value='00/00' name='al'></td></tr>
                    <tr><th scope='row'>Dusun</th>                  <td><input type='text' class='form-control' name='am'></td></tr>
                    <tr><th scope='row'>Kelurahan</th>              <td><input type='text' class='form-control' name='an'></td></tr>
                    <tr><th scope='row'>Kecamatan</th>              <td><input type='text' class='form-control' name='ao'></td></tr>
                    <tr><th scope='row'>Kode Pos</th>               <td><input type='text' class='form-control' name='ap'></td></tr>
                    <tr><th scope='row'>NUPTK</th>                  <td><input type='text' class='form-control' name='aq'></td></tr>
                    <tr><th scope='row'>Bidang Studi</th>           <td><input type='text' class='form-control' name='ar'></td></tr>
                    <tr><th scope='row'>Jenis PTK</th>              <td><select class='form-control' name='as'> 
                                                                          <option value='0' selected>- Pilih Jenis PTK -</option>";
  $ptk = mysqli_query($conn, "SELECT * FROM rb_jenis_ptk order by id_jenis_ptk");
  while ($a = mysqli_fetch_array($ptk)) {
    echo "<option value='$a[id_jenis_ptk]'>$a[jenis_ptk]</option>";
  }
  echo "</select></td></tr>
  <tr><th scope='row'>Tugas Tambahan</th>              <td><select class='form-control' name='at'> 
  <option value='0' selected>- Pilih Tugas Tambahan -</option>";
  $ptk = mysqli_query($conn, "SELECT * FROM rb_tugas_tambahan order by id");
  while ($a = mysqli_fetch_array($ptk)) {
    echo "<option value='$a[id]'>$a[nmTugas]</option>";
  }
  echo "</select></td></tr>
  <tr><th scope='row'>Kelas </th>                  <td><select class='form-control' name='xx'> 
  <option value='0' selected>- Pilih Kelas -</option>";
  $agama = mysqli_query($conn, "SELECT * FROM kelas_siswa");
  while ($a = mysqli_fetch_array($agama)) {
    if ($a[idKelas] == $s[nmKelas]) {
      echo "<option value='$a[idKelas]' selected>$a[nmKelas]</option>";
    } else {
      echo "<option value='$a[idKelas]'>$a[nmKelas]</option>";
    }
  }
  echo "</select><b><p style='padding:2px; color:red'>*Isi Jika Wali Kelas</p></b></td></tr>
  
                    <tr><th scope='row'>Status Pegawai</th>         <td><select class='form-control' name='au'> 
                                                                          <option value='0' selected>- Pilih Status Kepegawaian -</option>";
  $status_kepegawaian = mysqli_query($conn, "SELECT * FROM rb_status_kepegawaian order by id_status_kepegawaian");
  while ($a = mysqli_fetch_array($status_kepegawaian)) {
    echo "<option value='$a[id_status_kepegawaian]'>$a[status_kepegawaian]</option>";
  }
  echo "</select></td></tr>
                    <tr><th scope='row'>Status Keaktifan</th>       <td><select class='form-control' name='av'> 
                                                                          <option value='0' selected>- Pilih Status Keaktifan -</option>";
  $status_keaktifan = mysqli_query($conn, "SELECT * FROM rb_status_keaktifan");
  while ($a = mysqli_fetch_array($status_keaktifan)) {
    echo "<option value='$a[id_status_keaktifan]'>$a[nama_status_keaktifan]</option>";
  }
  echo "</select></td></tr>
                    <tr><th scope='row'>Status Nikah</th>           <td><select class='form-control' name='aw'> 
                                                                          <option value='0' selected>- Pilih Status Pernikahan -</option>";
  $status_pernikahan = mysqli_query($conn, "SELECT * FROM rb_status_pernikahan");
  while ($a = mysqli_fetch_array($status_pernikahan)) {
    echo "<option value='$a[id_status_pernikahan]'>$a[status_pernikahan]</option>";
  }
  echo "</select></td></tr>
                     <tr><th scope='row'>Foto</th>             <td><div style='position:relative;''>
                                                                          <a class='btn btn-warning' href='javascript:;'>
                                                                            <span class='glyphicon glyphicon-search'></span> Browse..."; ?>
  <input type='file' class='files' name='ax' accept='.png, .jpg, .jpeg' onchange='$("#upload-file-info").html($(this).val());'>
  <?php echo "</a> <span style='width:155px' class='label label-info' id='upload-file-info'></span>
                                                                        </div>
                    </td></tr> 
                  </tbody>
                  </table>
                </div>

                <div class='col-md-6'>
                  <table class='table table-condensed table-bordered'>
                  <tbody>
                    <tr><th width='150px' scope='row'>NIK</th>      <td><input type='text' class='form-control' name='ba'></td></tr>
                    <tr><th scope='row'>SK CPNS</th>                <td><input type='text' class='form-control' name='bb'></td></tr>
                    <tr><th scope='row'>Tanggal CPNS</th>           <td><input type='text' class='form-control' name='bc'></td></tr>
                    <tr><th scope='row'>SK Pengangkat</th>          <td><input type='text' class='form-control' name='bd'></td></tr>
                    <tr><th scope='row'>TMT Pengangkat</th>         <td><input type='text' class='form-control' name='be'></td></tr>
                    <tr><th scope='row'>Lemb. Pengangkat</th>       <td><input type='text' class='form-control' name='bf'></td></tr>
                    <tr><th scope='row'>Golongan</th>               <td><select class='form-control' name='bg'> 
                                                                          <option value='0' selected>- Pilih Golongan -</option>";
  $golongan = mysqli_query($conn, "SELECT * FROM rb_golongan");
  while ($a = mysqli_fetch_array($golongan)) {
    echo "<option value='$a[id_golongan]'>$a[nama_golongan]</option>";
  }
  echo "</select></td></tr>
                    <tr><th scope='row'>Sumber Gaji</th>            <td><input type='text' class='form-control' value='$s[sumber_gaji]' name='bh'></td></tr>

                    <tr><th scope='row'>Ahli Laboratorium</th>      <td><input type='text' class='form-control' name='bi'></td></tr>
                    <tr><th scope='row'>Nama Ibu Kandung</th>       <td><input type='text' class='form-control' name='bj'></td></tr>
                    <tr><th scope='row'>Nama Suami/Istri</th>       <td><input type='text' class='form-control' name='bk'></td></tr>
                    <tr><th scope='row'>Nip Suami/Istri</th>        <td><input type='text' class='form-control' name='bl'></td></tr>
                    <tr><th scope='row'>Pekerjaan Suami/Istri</th>  <td><input type='text' class='form-control' name='bm'></td></tr>
                    <tr><th scope='row'>TMT PNS</th>                <td><input type='text' class='form-control' name='bn'></td></tr>
                    <tr><th scope='row'>Lisensi Kepsek</th>         <td><input type='text' class='form-control' name='bo'></td></tr>
                    <tr><th scope='row'>Jml Sekolah Binaan</th>     <td><input type='text' class='form-control' name='bp'></td></tr>
                    <tr><th scope='row'>Diklat Kepengawasan</th>    <td><input type='text' class='form-control' name='bq'></td></tr>
                    <tr><th scope='row'>Mampu Handle KK</th>        <td><input type='text' class='form-control' name='br'></td></tr>
                    <tr><th scope='row'>Keahlian Breile</th>        <td><input type='text' class='form-control' name='bs'></td></tr>
                    <tr><th scope='row'>Keahlian B.Isyarat</th>     <td><input type='text' class='form-control' name='bt'></td></tr>
                    <tr><th scope='row'>Kewarganegaraan</th>        <td><input type='text' class='form-control' name='bu'></td></tr>
                    <tr><th scope='row'>NIY NIGK</th>               <td><input type='text' class='form-control' name='bv'></td></tr>
                    <tr><th scope='row'>NPWP</th>                   <td><input type='text' class='form-control' name='bw'></td></tr>

                  </tbody>
                  </table>
                </div> 
                <div style='clear:both'></div>
                        <div class='box-footer'>
                          <button type='submit' name='tambah' class='btn btn-info'>Tambahkan</button>
                          <a href='index.php?view=guru'><button type='button' class='btn btn-default pull-right'>Cancel</button></a>
                        </div> 
              </div>
            </form>
            </div>";
} elseif ($_GET[act] == 'editguru') {
  if (isset($_POST[update1])) {
    $rtrw = explode('/', $_POST[al]);
    $rt = $rtrw[0];
    $rw = $rtrw[1];
    $dir_gambar = 'foto_pegawai/';
    $filename = basename($_FILES['ax']['name']);
    $filenamee = date("YmdHis") . '-' . basename($_FILES['ax']['name']);
    $uploadfile = $dir_gambar . $filenamee;
    if ($filename != '') {
      if (move_uploaded_file($_FILES['ax']['tmp_name'], $uploadfile)) {
        mysqli_query($conn, "UPDATE rb_guru SET 
                                   nip          = '$_POST[aa]',
                                   password     = '$_POST[ab]',
                                   nama_guru         = '$_POST[ac]',
                                   tempat_lahir       = '$_POST[ad]',
                                   tanggal_lahir = '$_POST[ae]',
                                   id_jenis_kelamin       = '$_POST[af]',
                                   id_agama           = '$_POST[ag]',
                                   hp         = '$_POST[ah]',
                                   telepon       = '$_POST[ai]',
                                   email        = '$_POST[aj]',
                                   alamat_jalan      = '$_POST[ak]',
                                   rt = '$rt',
                                   rw          = '$rw',
                                   nama_dusun = '$_POST[am]',
                                   desa_kelurahan = '$_POST[an]',
                                   kecamatan = '$_POST[ao]',
                                   kode_pos = '$_POST[ap]',
                                   nuptk = '$_POST[aq]',
                                   pengawas_bidang_studi = '$_POST[ar]', 
                                   id_jenis_ptk = '$_POST[as]',
                                   tugas_tambahan = '$_POST[at]', 
                                   id_status_kepegawaian = '$_POST[au]',
                                   id_status_keaktifan = '$_POST[av]',
                                   id_status_pernikahan = '$_POST[aw]', 
                                   foto = '$filenamee', 
                                  idKelas = '$_POST[xx]',
                                   nik = '$_POST[ba]', 
                                   sk_cpns = '$_POST[bb]', 
                                   tanggal_cpns = '$_POST[bc]', 
                                   sk_pengangkatan = '$_POST[bd]', 
                                   tmt_pengangkatan = '$_POST[be]', 
                                   lembaga_pengangkatan = '$_POST[bf]',
                                   id_golongan = '$_POST[bg]', 
                                   sumber_gaji = '$_POST[bh]',
                                   keahlian_laboratorium = '$_POST[bi]',
                                   nama_ibu_kandung = '$_POST[bj]',
                                   nama_suami_istri = '$_POST[bk]',
                                   nip_suami_istri = '$_POST[bl]',
                                   pekerjaan_suami_istri = '$_POST[bm]',
                                   tmt_pns = '$_POST[bn]',
                                   lisensi_kepsek = '$_POST[bo]',
                                   jumlah_sekolah_binaan = '$_POST[bp]',
                                   diklat_kepengawasan = '$_POST[bq]',
                                   mampu_handle_kk = '$_POST[br]',
                                   keahlian_breile = '$_POST[bs]',
                                   keahlian_bahasa_isyarat = '$_POST[bt]',
                                   kewarganegaraan = '$_POST[bu]',
                                   niy_nigk = '$_POST[bv]',
                                   npwp = '$_POST[bw]' where nip='$_POST[id]'");
      }
    } else {
      mysqli_query($conn, "UPDATE rb_guru SET 
                                   nip          = '$_POST[aa]',
                                   password     = '$_POST[ab]',
                                   nama_guru         = '$_POST[ac]',
                                   tempat_lahir       = '$_POST[ad]',
                                   tanggal_lahir = '$_POST[ae]',
                                   id_jenis_kelamin       = '$_POST[af]',
                                   id_agama           = '$_POST[ag]',
                                   hp         = '$_POST[ah]',
                                   telepon       = '$_POST[ai]',
                                   email        = '$_POST[aj]',
                                   alamat_jalan      = '$_POST[ak]',
                                   rt = '$rt',
                                   rw          = '$rw',
                                   nama_dusun = '$_POST[am]',
                                   desa_kelurahan = '$_POST[an]',
                                   kecamatan = '$_POST[ao]',
                                   kode_pos = '$_POST[ap]',
                                   nuptk = '$_POST[aq]',
                                   pengawas_bidang_studi = '$_POST[ar]', 
                                   id_jenis_ptk = '$_POST[as]',
                                   tugas_tambahan = '$_POST[at]', 
                                   id_status_kepegawaian = '$_POST[au]',
                                   id_status_keaktifan = '$_POST[av]',
                                   id_status_pernikahan = '$_POST[aw]',
                                    idKelas = '$_POST[xx]',
                                   nik = '$_POST[ba]', 
                                   sk_cpns = '$_POST[bb]', 
                                   tanggal_cpns = '$_POST[bc]', 
                                   sk_pengangkatan = '$_POST[bd]', 
                                   tmt_pengangkatan = '$_POST[be]', 
                                   lembaga_pengangkatan = '$_POST[bf]',
                                   id_golongan = '$_POST[bg]', 
                                   sumber_gaji = '$_POST[bh]',
                                   keahlian_laboratorium = '$_POST[bi]',
                                   nama_ibu_kandung = '$_POST[bj]',
                                   nama_suami_istri = '$_POST[bk]',
                                   nip_suami_istri = '$_POST[bl]',
                                   pekerjaan_suami_istri = '$_POST[bm]',
                                   tmt_pns = '$_POST[bn]',
                                   lisensi_kepsek = '$_POST[bo]',
                                   jumlah_sekolah_binaan = '$_POST[bp]',
                                   diklat_kepengawasan = '$_POST[bq]',
                                   mampu_handle_kk = '$_POST[br]',
                                   keahlian_breile = '$_POST[bs]',
                                   keahlian_bahasa_isyarat = '$_POST[bt]',
                                   kewarganegaraan = '$_POST[bu]',
                                   niy_nigk = '$_POST[bv]',
                                   npwp = '$_POST[bw]' where nip='$_POST[id]'");
    }
    echo "<script>document.location='index.php?view=guru&act=detailguru&id=" . $_POST[id] . "';</script>";
  }

  $detail = mysqli_query($conn, "SELECT * FROM rb_guru where nip='$_GET[id]'");
  $s = mysqli_fetch_array($detail);
  echo "<div class='col-md-12'>
                      <div class='box box-warning'>
                        <div class='box-header with-border'>
                          <h3 class='box-title'>Edit Data Guru</h3>
                        </div>
                      <div class='box-body'>
                      <form method='POST' class='form-horizontal' action='' enctype='multipart/form-data'>
                        <div class='col-md-7'>
                          <table class='table table-condensed table-bordered'>
                          <tbody>
                            <input type='hidden' name='id' value='$s[nip]'>
                            <tr><th style='background-color:#E7EAEC' width='160px' rowspan='25'>";
  if (trim($s[foto]) == '') {
    echo "<img class='img-thumbnail' style='width:155px' src='foto_siswa/no-image.jpg'>";
  } else {
    echo "<img class='img-thumbnail' style='width:155px' src='foto_pegawai/$s[foto]'>";
  }
  echo "</th>
                            </tr>
                            <input type='hidden' name='id' value='$s[nip]'>
                            <tr><th width='120px' scope='row'>Nip</th>      <td><input type='text' class='form-control' value='$s[nip]' name='aa'></td></tr>
                            <tr><th scope='row'>Password</th>               <td><input type='text' class='form-control' value='$s[password]' name='ab'></td></tr>
                            <tr><th scope='row'>Nama Lengkap</th>           <td><input type='text' class='form-control' value='$s[nama_guru]' name='ac'></td></tr>
                            <tr><th scope='row'>Tempat Lahir</th>           <td><input type='text' class='form-control' value='$s[tempat_lahir]' name='ad'></td></tr>
                            <tr><th scope='row'>Tanggal Lahir</th>          <td><input type='text' class='form-control' value='$s[tanggal_lahir]' name='ae'></td></tr>
                
                            <tr><th scope='row'>Jenis Kelamin</th>          <td><select class='form-control' name='af'> 
                                                                                  <option value='0' selected>- Pilih Jenis Kelamin -</option>";
  $jk = mysqli_query($conn, "SELECT * FROM rb_jenis_kelamin");
  while ($a = mysqli_fetch_array($jk)) {
    if ($a[id_jenis_kelamin] == $s[id_jenis_kelamin]) {
      echo "<option value='$a[id_jenis_kelamin]' selected>$a[jenis_kelamin]</option>";
    } else {
      echo "<option value='$a[id_jenis_kelamin]'>$a[jenis_kelamin]</option>";
    }
  }
  echo "</select></td></tr>
                            <tr><th scope='row'>Agama</th>                  <td><select class='form-control' name='ag'> 
                                                                                  <option value='0' selected>- Pilih Agama -</option>";
  $agama = mysqli_query($conn, "SELECT * FROM rb_agama");
  while ($a = mysqli_fetch_array($agama)) {
    if ($a[id_agama] == $s[id_agama]) {
      echo "<option value='$a[id_agama]' selected>$a[nama_agama]</option>";
    } else {
      echo "<option value='$a[id_agama]'>$a[nama_agama]</option>";
    }
  }
  echo "</select></td></tr>
                            <tr><th scope='row'>No Hp</th>                  <td><input type='text' class='form-control' value='$s[hp]' name='ah'></td></tr>
                            <tr><th scope='row'>No Telpon</th>              <td><input type='text' class='form-control' value='$s[telepon]' name='ai'></td></tr>
                            <tr><th scope='row'>Alamat Email</th>           <td><input type='text' class='form-control' value='$s[email]' name='aj'></td></tr>
                            <tr><th scope='row'>Alamat</th>                 <td><input type='text' class='form-control' value='$s[alamat_jalan]' name='ak'></td></tr>
                            <tr><th scope='row'>RT/RW</th>                  <td><input type='text' class='form-control' value='$s[rt]/$s[rw]' name='al'></td></tr>
                            <tr><th scope='row'>Dusun</th>                  <td><input type='text' class='form-control' value='$s[nama_dusun]' name='am'></td></tr>
                            <tr><th scope='row'>Kelurahan</th>              <td><input type='text' class='form-control' value='$s[desa_kelurahan]' name='an'></td></tr>
                            <tr><th scope='row'>Kecamatan</th>              <td><input type='text' class='form-control' value='$s[kecamatan]' name='ao'></td></tr>
                            <tr><th scope='row'>Kode Pos</th>               <td><input type='text' class='form-control' value='$s[kode_pos]' name='ap'></td></tr>
                            <tr><th scope='row'>NUPTK</th>                  <td><input type='text' class='form-control' value='$s[nuptk]' name='aq'></td></tr>
                            <tr><th scope='row'>Bidang Studi</th>           <td><input type='text' class='form-control' value='$s[pengawas_bidang_studi]' name='ar'></td></tr>
                            <tr><th scope='row'>Jenis PTK</th>              <td><select class='form-control' name='as'> 
                                                                                  <option value='0' selected>- Pilih Jenis PTK -</option>";
  $ptk = mysqli_query($conn, "SELECT * FROM rb_jenis_ptk order by id_jenis_ptk");
  while ($a = mysqli_fetch_array($ptk)) {
    if ($a[id_jenis_ptk] == $s[id_jenis_ptk]) {
      echo "<option value='$a[id_jenis_ptk]' selected>$a[jenis_ptk]</option>";
    } else {
      echo "<option value='$a[id_jenis_ptk]'>$a[jenis_ptk]</option>";
    }
  }
  echo "</select></td></tr>
          <tr><th scope='row'>Tugas Tambahan</th>              <td><select class='form-control' name='at'> 
          <option value='0' selected>- Pilih Tugas Tambahan -</option>";
  $ptk = mysqli_query($conn, "SELECT * FROM rb_tugas_tambahan order by id");
  while ($a = mysqli_fetch_array($ptk)) {
    if ($a[idate()] == $s[tugas_tambahan]) {
      echo "<option value='$a[id]' selected>$a[nmTugas]</option>";
    } else {
      echo "<option value='$a[id]'>$a[nmTugas]</option>";
    }
  }
  echo "</select></td></tr>
          <tr><th scope='row'>Kelas </th>                  <td><select class='form-control' name='xx'> 
          <option value='0' selected>- Pilih Kelas -</option>";
  $kelas = mysqli_query($conn, "SELECT * FROM kelas_siswa");
  while ($a = mysqli_fetch_array($kelas)) {
    if ($a[idKelas] == $s[idKelas]) {
      echo "<option value='$a[idKelas]' selected>$a[nmKelas]</option>";
    } else {
      echo "<option value='$a[idKelas]'>$a[nmKelas]</option>";
    }
  }
  echo "</select><b><p style='padding:2px; color:red'>*Isi Jika Wali Kelas</p></b></td></tr>
                            <tr><th scope='row'>Status Pegawai</th>         <td><select class='form-control' name='au'> 
                                                                                  <option value='0' selected>- Pilih Status Kepegawaian -</option>";
  $status_kepegawaian = mysqli_query($conn, "SELECT * FROM rb_status_kepegawaian order by id_status_kepegawaian");
  while ($a = mysqli_fetch_array($status_kepegawaian)) {
    if ($a[id_status_kepegawaian] == $s[id_status_kepegawaian]) {
      echo "<option value='$a[id_status_kepegawaian]' selected>$a[status_kepegawaian]</option>";
    } else {
      echo "<option value='$a[id_status_kepegawaian]'>$a[status_kepegawaian]</option>";
    }
  }
  echo "</select></td></tr>
                            <tr><th scope='row'>Status Keaktifan</th>       <td><select class='form-control' name='av'> 
                                                                                  <option value='0' selected>- Pilih Status Keaktifan -</option>";
  $status_keaktifan = mysqli_query($conn, "SELECT * FROM rb_status_keaktifan");
  while ($a = mysqli_fetch_array($status_keaktifan)) {
    if ($a[id_status_keaktifan] == $s[id_status_keaktifan]) {
      echo "<option value='$a[id_status_keaktifan]' selected>$a[nama_status_keaktifan]</option>";
    } else {
      echo "<option value='$a[id_status_keaktifan]'>$a[nama_status_keaktifan]</option>";
    }
  }
  echo "</select></td></tr>
                            <tr><th scope='row'>Status Nikah</th>           <td><select class='form-control' name='aw'> 
                                                                                  <option value='0' selected>- Pilih Status Pernikahan -</option>";
  $status_pernikahan = mysqli_query($conn, "SELECT * FROM rb_status_pernikahan");
  while ($a = mysqli_fetch_array($status_pernikahan)) {
    if ($a[id_status_pernikahan] == $s[id_status_pernikahan]) {
      echo "<option value='$a[id_status_pernikahan]' selected>$a[status_pernikahan]</option>";
    } else {
      echo "<option value='$a[id_status_pernikahan]'>$a[status_pernikahan]</option>";
    }
  }
  echo "</select></td></tr>
                            <tr><th scope='row'>Ganti Foto</th>             <td><div style='position:relative;''>
                                                                                  <a class='btn btn-warning' href='javascript:;'>
                                                                                    <span class='glyphicon glyphicon-search'></span> Browse..."; ?>
  <input type='file' class='files' name='ax' accept='.png, .jpg, .jpeg' onchange='$("#upload-file-info").html($(this).val());'>
<?php echo "</a> <span style='width:155px' class='label label-info' id='upload-file-info'></span>
                                                                                </div>
                            </td></tr> 
                          </tbody>
                          </table>
                        </div>
        
                        <div class='col-md-5'>
                          <table class='table table-condensed table-bordered'>
                          <tbody>
                            <tr><th width='150px' scope='row'>NIK</th>      <td><input type='text' class='form-control' value='$s[nik]' name='ba'></td></tr>
                            <tr><th scope='row'>SK CPNS</th>                <td><input type='text' class='form-control' value='$s[sk_cpns]' name='bb'></td></tr>
                            <tr><th scope='row'>Tanggal CPNS</th>           <td><input type='text' class='form-control' value='$s[tanggal_cpns]' name='bc'></td></tr>
                            <tr><th scope='row'>SK Pengangkat</th>          <td><input type='text' class='form-control' value='$s[sk_pengangkatan]' name='bd'></td></tr>
                            <tr><th scope='row'>TMT Pengangkat</th>         <td><input type='text' class='form-control' value='$s[tmt_pengangkatan]' name='be'></td></tr>
                            <tr><th scope='row'>Lemb. Pengangkat</th>       <td><input type='text' class='form-control' value='$s[lembaga_pengangkatan]' name='bf'></td></tr>
                            <tr><th scope='row'>Golongan</th>               <td><select class='form-control' name='bg'> 
                                                                                  <option value='0' selected>- Pilih Golongan -</option>";
  $golongan = mysqli_query($conn, "SELECT * FROM rb_golongan");
  while ($a = mysqli_fetch_array($golongan)) {
    if ($a[id_golongan] == $s[id_golongan]) {
      echo "<option value='$a[id_golongan]' selected>$a[nama_golongan]</option>";
    } else {
      echo "<option value='$a[id_golongan]'>$a[nama_golongan]</option>";
    }
  }
  echo "</select></td></tr>
                            <tr><th scope='row'>Sumber Gaji</th>            <td><input type='text' class='form-control' value='$s[sumber_gaji]' name='bh'></td></tr>
        
                            <tr><th scope='row'>Ahli Laboratorium</th>      <td><input type='text' class='form-control' value='$s[keahlian_laboratorium]' name='bi'></td></tr>
                            <tr><th scope='row'>Nama Ibu Kandung</th>       <td><input type='text' class='form-control' value='$s[nama_ibu_kandung]' name='bj'></td></tr>
                            <tr><th scope='row'>Nama Suami/Istri</th>       <td><input type='text' class='form-control' value='$s[nama_suami_istri]' name='bk'></td></tr>
                            <tr><th scope='row'>Nip Suami/Istri</th>        <td><input type='text' class='form-control' value='$s[nip_suami_istri]' name='bl'></td></tr>
                            <tr><th scope='row'>Pekerjaan Suami/Istri</th>  <td><input type='text' class='form-control' value='$s[pekerjaan_suami_istri]' name='bm'></td></tr>
                            <tr><th scope='row'>TMT PNS</th>                <td><input type='text' class='form-control' value='$s[tmt_pns]' name='bn'></td></tr>
                            <tr><th scope='row'>Lisensi Kepsek</th>         <td><input type='text' class='form-control' value='$s[lisensi_kepsek]' name='bo'></td></tr>
                            <tr><th scope='row'>Jml Sekolah Binaan</th>     <td><input type='text' class='form-control' value='$s[jumlah_sekolah_binaan]' name='bp'></td></tr>
                            <tr><th scope='row'>Diklat Kepengawasan</th>    <td><input type='text' class='form-control' value='$s[diklat_kepengawasan]' name='bq'></td></tr>
                            <tr><th scope='row'>Mampu Handle KK</th>        <td><input type='text' class='form-control' value='$s[mampu_handle_kk]' name='br'></td></tr>
                            <tr><th scope='row'>Keahlian Breile</th>        <td><input type='text' class='form-control' value='$s[keahlian_breile]' name='bs'></td></tr>
                            <tr><th scope='row'>Keahlian B.Isyarat</th>     <td><input type='text' class='form-control' value='$s[keahlian_bahasa_isyarat]' name='bt'></td></tr>
                            <tr><th scope='row'>Kewarganegaraan</th>        <td><input type='text' class='form-control' value='$s[kewarganegaraan]' name='bu'></td></tr>
                            <tr><th scope='row'>NIY NIGK</th>               <td><input type='text' class='form-control' value='$s[niy_nigk]' name='bv'></td></tr>
                            <tr><th scope='row'>NPWP</th>                   <td><input type='text' class='form-control' value='$s[npwp]' name='bw'></td></tr>
        
                          </tbody>
                          </table>
                        </div> 
                        <div style='clear:both'></div>
                                <div class='box-footer'>
                                  <button type='submit' name='update1' class='btn btn-info'>Update</button>
                                  <a href='index.php?view=siswa'><button type='button' class='btn btn-default pull-right'>Cancel</button></a>
                                </div> 
                      </div>
                    </form>
                    </div>";
} elseif ($_GET[act] == 'detailguru') {
  $detail = mysqli_query($conn, "SELECT a.*, b.jenis_kelamin, c.status_kepegawaian, d.jenis_ptk, e.nama_agama, f.nama_status_keaktifan, g.nama_golongan, h.status_pernikahan 
                                FROM rb_guru a LEFT JOIN rb_jenis_kelamin b ON a.id_jenis_kelamin=b.id_jenis_kelamin 
                                  LEFT JOIN rb_status_kepegawaian c ON a.id_status_kepegawaian=c.id_status_kepegawaian 
                                    LEFT JOIN rb_jenis_ptk d ON a.id_jenis_ptk=d.id_jenis_ptk 
                                      LEFT JOIN rb_agama e ON a.id_agama=e.id_agama 
                                        LEFT JOIN rb_status_keaktifan f ON a.id_status_keaktifan=f.id_status_keaktifan 
                                          LEFT JOIN rb_golongan g ON a.id_golongan=g.id_golongan
                                            LEFT JOIN rb_status_pernikahan h ON a.id_status_pernikahan=h.id_status_pernikahan
                                              where a.nip='$_GET[id]'");
  $s = mysqli_fetch_array($detail);
  echo "<div class='col-md-12'>
              <div class='box box-info'>
                <div class='box-header with-border'>
                  <h3 class='box-title'>Detail Data Guru</h3>
                </div>
              <div class='table-responsive'>
              <form method='POST' class='form-horizontal' action='' enctype='multipart/form-data'>
                <div class='col-md-7'>
                  <table class='table table-condensed table-bordered'>
                  <tbody>
                    <input type='hidden' name='id' value='$s[nip]'>
                    <tr><th style='background-color:#E7EAEC' width='160px' rowspan='25'>";
  if (trim($s[foto]) == '') {
    echo "<img class='img-thumbnail' style='width:155px' src='foto_siswa/no-image.jpg'>";
  } else {
    echo "<img class='img-thumbnail' style='width:155px' src='foto_pegawai/$s[foto]'>";
  }
  if ($_SESSION[level] != 'kepala') {
    echo "<a href='index.php?view=guru&act=editguru&id=$_GET[id]' class='btn btn-success btn-block'>Edit Profile</a>";
  }
  echo "</th>
                    </tr>
                    <tr><th width='120px' scope='row'>Nip</th>      <td>$s[nip]</td></tr>
                    <tr><th scope='row'>Password</th>               <td>$s[password]</td></tr>
                    <tr><th scope='row'>Nama Lengkap</th>           <td>$s[nama_guru]</td></tr>
                    <tr><th scope='row'>Tempat Lahir</th>           <td>$s[tempat_lahir]</td></tr>
                    <tr><th scope='row'>Tanggal Lahir</th>          <td>$s[tanggal_lahir]</td></tr>
					 <tr><th scope='row'>Id Kelas</th>          <td>$s[idKelas]</td></tr>
                    <tr><th scope='row'>Jenis Kelamin</th>          <td>$s[jenis_kelamin]</td></tr>
                    <tr><th scope='row'>Agama</th>                  <td>$s[nama_agama]</td></tr>
                    <tr><th scope='row'>No Hp</th>                  <td>$s[hp]</td></tr>
                    <tr><th scope='row'>No Telpon</th>              <td>$s[telepon]</td></tr>
                    <tr><th scope='row'>Alamat Email</th>           <td>$s[email]</td></tr>
                    <tr><th scope='row'>Alamat</th>                 <td>$s[alamat_jalan]</td></tr>
                    <tr><th scope='row'>RT/RW</th>                  <td>$s[rt]/$s[rw]</td></tr>
                    <tr><th scope='row'>Dusun</th>                  <td>$s[nama_dusun]</td></tr>
                    <tr><th scope='row'>Kelurahan</th>              <td>$s[desa_kelurahan]</td></tr>
                    <tr><th scope='row'>Kecamatan</th>              <td>$s[kecamatan]</td></tr>
                    <tr><th scope='row'>Kode Pos</th>               <td>$s[kode_pos]</td></tr>
                    <tr><th scope='row'>NUPTK</th>                  <td>$s[nuptk]</td></tr>
                    <tr><th scope='row'>Bidang Studi</th>           <td>$s[pengawas_bidang_studi]</td></tr>
                    <tr><th scope='row'>Jenis PTK</th>              <td>$s[jenis_ptk]</td></tr>
                    <tr><th scope='row'>Tugas Tambahan</th>         <td>$s[tugas_tambahan]</td></tr>
                    <tr><th scope='row'>Status Pegawai</th>         <td>$s[status_kepegawaian]</td></tr>
                    <tr><th scope='row'>Status Keaktifan</th>       <td>$s[nama_status_keaktifan]</td></tr>
                    <tr><th scope='row'>Status Nikah</th>           <td>$s[status_pernikahan]</td></tr>
                  </tbody>
                  </table>
                </div>

                <div class='col-md-5'>
                  <table class='table table-condensed table-bordered'>
                  <tbody>
                    <tr><th width='150px' scope='row'>NIK</th>      <td>$s[nik]</td></tr>
                    <tr><th scope='row'>SK CPNS</th>                <td>$s[sk_cpns]</td></tr>
                    <tr><th scope='row'>Tanggal CPNS</th>           <td>$s[tanggal_cpns]</td></tr>
                    <tr><th scope='row'>SK Pengangkat</th>          <td>$s[sk_pengangkatan]</td></tr>
                    <tr><th scope='row'>TMT Pengangkat</th>         <td>$s[tmt_pengangkatan]</td></tr>
                    <tr><th scope='row'>Lemb. Pengangkat</th>       <td>$s[lembaga_pengangkatan]</td></tr>
                    <tr><th scope='row'>Golongan</th>               <td>$s[nama_golongan]</td></tr>
                    <tr><th scope='row'>Sumber Gaji</th>            <td>$s[sumber_gaji]</td></tr>

                    <tr><th scope='row'>Ahli Laboratorium</th>  <td>$s[keahlian_laboratorium]</td></tr>
                    <tr><th scope='row'>Nama Ibu Kandung</th>            <td>$s[nama_ibu_kandung]</td></tr>
                    <tr><th scope='row'>Nama Suami/Istri</th>            <td>$s[nama_suami_istri]</td></tr>
                    <tr><th scope='row'>Nip Suami/Istri</th>            <td>$s[nip_suami_istri]</td></tr>
                    <tr><th scope='row'>Pekerjaan Suami/Istri</th>            <td>$s[pekerjaan_suami_istri]</td></tr>
                    <tr><th scope='row'>TMT PNS</th>            <td>$s[tmt_pns]</td></tr>
                    <tr><th scope='row'>Lisensi Kepsek</th>            <td>$s[lisensi_kepsek]</td></tr>
                    <tr><th scope='row'>Jml Sekolah Binaan</th>            <td>$s[jumlah_sekolah_binaan]</td></tr>
                    <tr><th scope='row'>Diklat Kepengawasan</th>            <td>$s[diklat_kepengawasan]</td></tr>
                    <tr><th scope='row'>Mampu Handle KK</th>            <td>$s[mampu_handle_kk]</td></tr>
                    <tr><th scope='row'>Keahlian Breile</th>            <td>$s[keahlian_breile]</td></tr>
                    <tr><th scope='row'>Keahlian B.Isyarat</th>            <td>$s[keahlian_bahasa_isyarat]</td></tr>
                    <tr><th scope='row'>Kewarganegaraan</th>            <td>$s[kewarganegaraan]</td></tr>
                    <tr><th scope='row'>NIY NIGK</th>            <td>$s[niy_nigk]</td></tr>
                    <tr><th scope='row'>NPWP</th>                   <td>$s[npwp]</td></tr>

                  </tbody>
                  </table>
                </div> 
              </div>
            </form>
            </div>";
}
?>