                <!-- Content Header (Page header) -->
                <section class="content-header">
                    <h1>
                      Nilai Transfer
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="<?=base_index();?>"><i class="fa fa-dashboard"></i> Home</a></li>
                        <li><a href="<?=base_index();?>nilai-transfer">Nilai Transfer</a></li>
                        <li class="active">Edit Nilai Transfer</li>
                    </ol>
                </section>

                <!-- Main content -->
                <section class="content">
<div class="row">
    <div class="col-lg-12">
        <div class="box box-solid box-primary">
                                   <div class="box-header">
                                    <h3 class="box-title">Edit Nilai Transfer</h3>
                                    <div class="box-tools pull-right">
                                        <button class="btn btn-info btn-sm" data-widget="collapse"><i class="fa fa-minus"></i></button>
                                        <button class="btn btn-info btn-sm" data-widget="remove"><i class="fa fa-times"></i></button>
                                    </div>
                                </div>

                  <div class="box-body">
                     <form id="update" method="post" class="form-horizontal" action="<?=base_admin();?>modul/nilai_transfer/nilai_transfer_action.php?act=up">
                      <div class="form-group">
                        <label for="NIM" class="control-label col-lg-2">NIM</label>
                        <div class="col-lg-10">
                          <input type="text" name="nim" value="<?=$data_edit->nim;?>" class="form-control" required> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Kode MK Asal" class="control-label col-lg-2">Kode MK Asal</label>
                        <div class="col-lg-10">
                          <input type="text" name="kode_mk_asal" value="<?=$data_edit->kode_mk_asal;?>" class="form-control" required> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Nama Mata Kuliah Asal" class="control-label col-lg-2">Nama Mata Kuliah Asal</label>
                        <div class="col-lg-10">
                          <input type="text" name="nm_mk_asal" value="<?=$data_edit->nm_mk_asal;?>" class="form-control" required> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="SKS Asal" class="control-label col-lg-2">SKS Asal</label>
                        <div class="col-lg-10">
                          <input type="text" data-rule-number="true" name="sks_asal" value="<?=$data_edit->sks_asal;?>" class="form-control" required> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Nilai Huruf Asal" class="control-label col-lg-2">Nilai Huruf Asal</label>
                        <div class="col-lg-10">
                          <input type="text" name="nilai_huruf_asal" value="<?=$data_edit->nilai_huruf_asal;?>" class="form-control" required> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Kode Matakuliah Diakui" class="control-label col-lg-2">Kode Matakuliah Diakui</label>
                        <div class="col-lg-10">
                          <input type="text" name="kode_mk" value="<?=$data_edit->kode_mk;?>" class="form-control" > 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Kode Matakuliah Diakui" class="control-label col-lg-2">Nama Matakuliah Diakui</label>
                        <div class="col-lg-10">
                          <input type="text" name="nama_mk" value="<?=$data_edit->nama_mk;?>" class="form-control" > 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Nilai Huruf Diakui" class="control-label col-lg-2">Nilai Huruf Diakui</label>
                        <div class="col-lg-10">
                          <input type="text" name="nilai_huruf_diakui" value="<?=$data_edit->nilai_huruf_diakui;?>" class="form-control" > 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Nilai Angka Diakui" class="control-label col-lg-2">Nilai Indeks Diakui</label>
                        <div class="col-lg-10">
                          <input type="text" name="nilai_angka_diakui" value="<?=$data_edit->nilai_angka_diakui;?>" class="form-control" > 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Jurusan" class="control-label col-lg-2">Prodi</label>
                        <div class="col-lg-10">
                          <select name="kode_jurusan" data-placeholder="Pilih Jurusan..." class="form-control chzn-select" tabindex="2" required>

               <?php 
if ($_SESSION['level']==1) {
  $jur = $db->fetch_custom("select * from jurusan");
} else {
  $jur = $db->fetch_custom("select * from jurusan where kode_jurusan='".$_SESSION['jurusan']."'");
}
foreach ($jur as $isi) {

                  if ($data_edit->kode_jurusan==$isi->kode_jurusan) {
                    echo "<option value='$isi->kode_jurusan' selected>$isi->jenjang $isi->nama_jurusan</option>";
                  } else {
                    echo "<option value='$isi->kode_jurusan'>$isi->jenjang $isi->nama_jurusan</option>";
                  }
               } ?>
              </select>
                        </div>
                      </div><!-- /.form-group -->
                      <div class="form-group">
                        <label for="Semester" class="control-label col-lg-2">Semester</label>
                        <div class="col-lg-10">
                          <input type="text" name="semester" data-rule-number="true" value="<?=$data_edit->semester;?>" class="form-control" required>
                        </div>
                      </div><!-- /.form-group -->

<div class="form-group">
                        <label for="Jenis Pendaftaran" class="control-label col-lg-2">Asal Perguruan Tinggi</label>
                        <div class="col-lg-10">
                          <select name="kode_pt" id="kode_pt" data-placeholder="Pilih Asal Perguruan Tinggi ..." class="form-control kampus" tabindex="2" >
                          <?php
                            $kampuss = $db->fetch_custom("select * from satuan_pendidikan where npsn='$data_edit->kode_pt'");
                            foreach ($kampuss as $kampus) {
                              if ($data_edit->kode_pt==$kampus->npsn) {
                                echo "<option value='$kampus->npsn' selected>$kampus->nm_lemb</option>";
                              }
                            }
                             
                          ?>

              </select>
                        </div>
                      </div><!-- /.form-group -->
                      <div class="form-group">
                        <label for="Semester" class="control-label col-lg-2">ID Aktivitas</label>
                        <div class="col-lg-10">
                          <input type="text" name="id_aktivitas" value="<?=$data_edit->id_aktivitas;?>" class="form-control">
                        </div>
                      </div><!-- /.form-group -->
                      <input type="hidden" name="id" value="<?=$data_edit->id;?>">
                      <div class="form-group">
                        <label for="tags" class="control-label col-lg-2">&nbsp;</label>
                        <div class="col-lg-10">
                         <a href="<?=base_index();?>nilai-transfer" class="btn btn-success btn-flat"><i class="fa fa-step-backward"></i> Kembali</a>
                          <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> Simpan</button>
                        </div>
                      </div><!-- /.form-group -->
                    </form>
                   
          
                  </div>
                  </div>
              </div>
</div>
                  
                </section><!-- /.content -->
        
 <script type="text/javascript">
  $(document).ready(function() {
       $( ".kampus" ).select2({
    allowClear: true,
  width: "100%",
  ajax: {
    url: '<?=base_admin();?>modul/nilai_transfer/get_pt.php',
    dataType: 'json'
    // Additional AJAX parameters go here; see the end of this chapter for the full code of this example
  },
  formatInputTooShort: "Cari & Pilih Asal Kampus"
});
     });
 </script>