<?php 
	include "php_class/class_mysql.php";
	include "php_class/class_dosen.php";
	$DataDosen = new dataDosen;
	include "php_class/class_jadwal.php";
	$DataJadwal = new dataJadwal;
	$DataJadwal2 = new dataJadwal;
	$DataJadwal3 = new dataJadwal;
?>

<link href="<?php echo $base?>plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $base?>plugins/iCheck/all.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $base?>plugins/timepicker/bootstrap-timepicker.min.css" rel="stylesheet"/>
<script src="<?php echo $base?>plugins/input-mask/jquery.inputmask.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/input-mask/jquery.inputmask.date.extensions.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/input-mask/jquery.inputmask.extensions.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/timepicker/bootstrap-timepicker.min.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/iCheck/icheck.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $base?>plugins/autocomplete/shieldui-all.css" />
<link href="<?php echo $base?>bootstrap/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="<?php echo $base?>bootstrap/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="<?php echo $base?>bootstrap/js/locales/bootstrap-datetimepicker.id.js" charset="UTF-8"></script>
<script type="text/javascript" src="<?php echo $base?>plugins/autocomplete/shieldui-all.min.js"></script>
<script>
	$(document).ready(function(){
	var base = <?php echo json_encode($base);?>;
		$("#cari").click(function(){
			$("#myModal1").modal('show');
		});
		$("#dosen").click(function(){
			$("#myModal2").modal('show');
		});
		$("#setting").click(function(){
			$("#myModal").modal('show');
		});
		$("#copy").click(function(){
			$("#myModal3").modal('show');
		});

	});
</script>
<script type="text/javascript">
 function hourChange(selectObj) {
   var selectIndex=selectObj.selectedIndex;
   var selectValue=selectObj.options[selectIndex].text;
   if (selectIndex == 0){
		$('#subunitkerja').show();
		$('#subunitkerja2').hide();
   } else {
		$('#subunitkerja').hide();
		$('#subunitkerja2').show();	   }
 }

</script>
<style>
	.checkbox2{	width:20px; height:20px; float:left; }
</style>
<section class="content-header">
  <h1>
   Data SAP
  </h1>
  <ol class="breadcrumb">
    <li><a href="<?php echo $base?>"><i class="fa fa-dashboard"></i> Home</a></li>
    <li><a href="<?php echo $base?>data-skripsi">Data SAP</a></li>
    <li class="active">Setting Tugas Mengajar</li>
  </ol>
</section>
<section class="content">
 	<div class="row">
    	<div class="col-md-12">
        	 <div class="box box-info">
                <div class="box-body">
                    <div class="col-sm-7" >
                        <?php 
                        $tahun = $_POST['tahun'];
                        $semester = $_POST['semester'];
                        
                            if ($tahun == '' ){
                                $tahun = '2016/2017';
                            }
                            if ($semester == '' ){
                                $semester = 'GENAP';
                            }					
                            if ($program == '') {
                                $program = 'Reguler';	
                            }	
                                        
                                echo "<H5 style='margin-bottom:15px;'>Tahun Akademik : ".$tahun."</h5>";
                                echo "<H5 style='margin-bottom:15px;'>Semester Akademik : ".$semester."</h5>";
                                
                        ?>
                    </div>
                    <div class="col-sm-5">
            <button type="submit" class="btn btn-primary" id="setting" style="margin-top:20px; float:right"> <i class="glyphicon glyphicon glyphicon glyphicon-edit" style="padding-right:4px;"></i>Setting</button>
                    </div>
             	</div>
                <div class="box-body">
                        <div class="peringatan">
                        </div>
                	<form method="post" action="<?php echo $base?>query-add-beban-tugas">
                    	<input type="hidden" name="semester" value="<?php echo $semester?>">
                        <input type="hidden" name="tahun" value="<?php echo $tahun?>">
                    	<div class="form-group">
                            <label for="Operator" class="control-label">Nama Dosen</label>
                            <div class="input-group">
                                <input type="text" name="nama"  class="form-control"  placeholder="nama dosen" id="dosen">
                                <span class="input-group-addon" id="copy">
                                    <i class="glyphicon glyphicon-copy" ></i>
                                </span>
							</div>
                        </div>
                     	<div class="form-group">
                            <label for="Operator" class="control-label">NIP/NIDN</label>
                            <div class="input-group">
                                <input type="text" name="nip"  class="form-control"  placeholder="NIP/NIDN" id="nip">
                                <span class="input-group-addon" id="cari">
                                    <i class="glyphicon glyphicon-search" ></i>
                                </span>
							</div>
                         </div>
                    	<div class="form-group">
                            <label for="Operator" class="control-label">Nama Dosen (dicetak)</label>
                            <input type="text" name="namas"  class="form-control"  placeholder="nama dosen yang dicetak" id="namas">
                        </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Gol/Ruang</label>
                            <input type="text" name="gol"  class="form-control"  placeholder="golongan" id="gol">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Pangkat</label>
                            <input type="text" name="pangkat"  class="form-control"  placeholder="pangkat" id="pangkat">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Jabatan Akademik</label>
                            <input type="text" name="jabatan"  class="form-control"  placeholder="jabatan" id="jabatan">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Jabatan Struktural</label>
                            <input type="text" name="struktural"  class="form-control"  placeholder="jabatan struktural" id="struktural">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Status Kepegawaian</label>
                            <select name="statuspegawai"  class="form-control" id="statuspegawai">
                            	<option value="Dosen Tetap">Dosen Tetap</option>
                                <option value="Dosen Tidak Tetap">Dosen Tidak Tetap</option>
                                <option value="Dosen Dpk">Dosen Dpk</option>
                                <option value="Kontrak">Kontrak</option>
                                <option value="Pasca Sarjana">Pasca Sarjana</option>
                            </select>
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Unit Kerja</label>
                            <select name="unitkerja"  class="form-control" id="unitkerja" onchange="hourChange(this);">
                            	<option value="Universitas Warmadewa">Universitas Warmadewa</option>
                                <option value="Lainnya">Lainnya</option>
                            </select>
						</div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Sub Unit Kerja</label>
                            <select name="subunitkerja"  class="form-control" id="subunitkerja">
                            	<option value="Fakultas Ekonomi">Fakultas Ekonomi</option>
                                <option value="Pasca Sarjana">Pasca Sarjana</option>
                                <option value="Rektorat">Rektorat</option>
                            </select>
                            <input type="text" name="subunitkerja2" class="form-control" style="display:none" id="subunitkerja2">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Pendidikan Dosen S3</label>
                            <select name="s3"  class="form-control" id="s3">
                                <option value="Tidak">Tidak</option>
                            	<option value="Ya">Ya</option>
                            </select>
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Asisten Kuliah Praktikum</label>
                            <input type="number" name="satub"  class="form-control"  placeholder="asisten kuliah praktikum" value="0" id="satub">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Bimbingan Kuliah Kerja/Kerja Praktek</label>
                            <input type="number" name="satuc"  class="form-control"  placeholder="Bimbingan Kuliah Kerja/Kerja Praktek" value="0" id="satuc">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Bimbingan Skripsi</label>
                            <input type="number" name="satud"  class="form-control"  placeholder="Bimbingan Skripsi" value="0">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Penelitian Kelompok / Antar Bidang</label>
                            <input type="number" name="duaa"  class="form-control"  placeholder="Penelitian Kelompok / Antar Bidang" value="0" id="duaa">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Penelitian Individu</label>
                            <input type="number" name="duab"  class="form-control"  placeholder="Penelitian Individu" value="0" id="duab">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Menulis naskah buku/ Menterjemahkan naskah buku/ Menyunting naskah buku Menulis Diklat</label>
                            <input type="number" name="duac"  class="form-control"  placeholder="Menulis naskah buku/ Menterjemahkan naskah buku/ Menyunting naskah buku Menulis Diklat" value="0" id="duac">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Pengabdian Masyarakat</label>
                            <input type="number" name="tiga"  class="form-control"  placeholder="Pengabdian Masyarakat" value="0" id="tiga">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Pembimbing Akademika</label>
                            <input type="number" name="empata"  class="form-control"  placeholder="Pembimbing Akademika" value="0" id="empata">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Pembinaan Kegiatan Kemahasiswaan</label>
                            <input type="number" name="empatb"  class="form-control"  placeholder="Pembinaan Kegiatan Kemahasiswaan" value="0" id="empatb">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Pimpinan Organisasi Inter</label>
                            <input type="number" name="empatc"  class="form-control"  placeholder="Pimpinan Organisasi Inter" value="0" id="empatc">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Jabatan Struktural</label>
                            <input type="number" name="limaa"  class="form-control"  placeholder="Jabatan Struktural" value="0" id="limaa">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Jabatan Non Struktural</label>
                            <input type="number" name="limab"  class="form-control"  placeholder="Jabatan Non Struktural" value="0" id="limab">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Tanggal Surat</label>
                            <input type="text" name="tgl"  class="form-control"  placeholder="tanggal surat" id="tgl">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">No Rekening</label>
                            <input type="text" name="norek"  class="form-control"  placeholder="no rekening" id="norek">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Tugas Minimal Wajib Mengajar</label>
                            <input type="number" name="minimalmengajar"  class="form-control"  value="0" id="minimalmengajar">
                         </div>
                         <div class="form-group">
                            <label for="Operator" class="control-label">Status Kepegawaian (Form B)</label>
                            <select name="formb"  class="form-control" id="formb">
                                <option value="Dosen Dalam">Dosen Dalam</option>
                            	<option value="Dosen Luar">Dosen Luar</option>
                                <option value="Dosen Luar Dalam">Dosen Luar Dalam</option>
                            </select>
                         </div>
                         <div class="form-group">
                            <button type="submit" class="btn btn-default"><i class='glyphicon glyphicon-ok'></i> Simpan</button>
                         </div>
                    </form>
                </div>
               </div>
         </div>
    </div>
</section>

<link href="<?php echo $base?>plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<script src="<?php echo $base?>plugins/datatables/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/datatables/dataTables.bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript">
  $(document).ready(function(){
	$("#example1").dataTable();
	
  });
</script>

<div id="myModal1" class="modal fade" role="dialog">
  <div class="modal-dialog modal-lg">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Daftar Dosen</h4>
      </div>
      <div class="modal-body">
      	<div class="table-responsive">
          <table id="example1" class="table table-bordered table-striped table-hover">
             <thead>
                <tr>
                    <th>No</th>
                    <th>Nama Dosen</th>
                    <th>NIK / NIP</th>
                    <th>Jabatan</th>
                    <th>Golongan</th>
                </tr>
            </thead>
            <tbody>
            <?php
            	$JumlahData = $DataDosen->get_data_dosen('',$a,'jumlah');
				if ($JumlahData<=0){
					echo "<tr class='odd gradeX'>";
					echo "<td>No Data</td>";
					echo "<td></td>";
					echo "<td></td>";
					echo "<td></td>";
					echo "</tr>";	
				}else{
					for ($a=1;$a<=$JumlahData;$a++){
						$id = $DataDosen->get_data_dosen('Id',$a,'');
						$NIDN = $DataDosen->get_data_dosen('NIDN', $a, '');
						$Nama = $DataDosen->get_data_dosen('Nama',$a,'');
						$NIK = $DataDosen->get_data_dosen('NIP',$a,'');
						$JABATAN = $DataDosen->get_data_dosen('JABATAN',$a,'');
						$GOL = $DataDosen->get_data_dosen('GOL',$a,'');
						$PANGKAT = $DataDosen->get_data_dosen('PANGKAT',$a,'');
						
						echo "<tr ids='".$id."-".$Nama."-".$NIK."/ ".$NIDN."-".$JABATAN."-".$GOL."-".$PANGKAT."' class='odd gradeX context pilih1'>";
						echo "<td>".$id."</td>";
						echo "<td>".$Nama."</td>";
						echo "<td>".$NIK."</td>";
						echo "<td>".$JABATAN."</td>";
						echo "<td>".$GOL."</td>";
						echo "</tr>";
					}
				}
			?>
        	</tbody>
          </table>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" id="closemodal" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>
<script>
	$(document).ready(function(){
		$('.pilih1').click(function(){
			var kode = $(this).attr('ids');
			var pecah = kode.split("-");	
				kodeDosen = pecah[0];
				nama = pecah[1];
				nip = pecah[2];
				jabatan = pecah[3];
				gol = pecah[4];
				pangkat = pecah[5];
				
			$('#nip').val(nip);
			$('#namas').val(nama);
			$('#jabatan').val(jabatan);
			$('#gol').val(gol);
			$('#pangkat').val(pangkat);
			$('#myModal1').modal('hide')
		});
	});
</script>
   
<link href="<?php echo $base?>plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<script src="<?php echo $base?>plugins/datatables/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/datatables/dataTables.bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript">
  $(document).ready(function(){
	$("#example2").dataTable();
	
  });
</script>

<div id="myModal2" class="modal fade" role="dialog">
  <div class="modal-dialog modal-lg">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Data Dosen dari Jadwal</h4>
      </div>
      <div class="modal-body">
      	<div class="table-responsive">
          <table id="example2" class="table table-bordered table-striped table-hover">
             <thead>
                <tr>
                    <th>No</th>
                    <th>Nama Dosen</th>
                    <th>Semester Akademik</th>
                    <th>Hari</th>
                    <th>Tahun</th>
                </tr>
            </thead>
            <tbody>
            <?php
            	$JumlahData = $DataJadwal->get_data_sk_bt('',$a,'jumlah', $tahun, $semester, $program);
				if ($JumlahData<=0){
					echo "<tr class='odd gradeX'>";
					echo "<td>No Data</td>";
					echo "<td></td>";
					echo "<td></td>";
					echo "<td></td>";
					echo "</tr>";	
				}else{
					for ($a=1;$a<=$JumlahData;$a++){
						$id1 = $DataJadwal->get_data_sk_bt('id',$a,'', $tahun, $semester, $program);
						$dosen1 = $DataJadwal->get_data_sk_bt('dosen', $a, '', $tahun, $semester, $program);
						$semester1 = $DataJadwal->get_data_sk_bt('sm', $a, '', $tahun, $semester, $program);
						$hari1 = $DataJadwal->get_data_sk_bt('hari', $a, '', $tahun, $semester, $program);
						$tahun1 = $DataJadwal->get_data_sk_bt('tahun', $a, '', $tahun, $semester, $program);
						
						echo "<tr ids='".$id1."-".$dosen1."' class='odd gradeX context pilih2'>";
						echo "<td>".$id1."</td>";
						echo "<td>".$dosen1."</td>";
						echo "<td>".$semester1."</td>";
						echo "<td>".$hari1."</td>";
						echo "<td>".$tahun1."</td>";
						echo "</tr>";
					}
				}
			?>
        	</tbody>
          </table>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" id="closemodal" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>
<script>
	$(document).ready(function(){
		$('.pilih2').click(function(){
			var kode = $(this).attr('ids');
			var pecah = kode.split("-");	
				iddosenjd = pecah[0];
				dosen = pecah[1];
				
			$('#dosen').val(dosen);
			$('#myModal2').modal('hide')
		});
	});
</script>

<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog modal-lg">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Setting</h4>
      </div>
      <div class="modal-body">
          <form action="<?php echo $base?>add-beban-tugas" method="post" name="cmb" style="margin-bottom:35px;" id="cmb">
            <div class="form-group">
                <label class="control-label">Tahun Akademik</label>
                <select class="form-control" name="tahun">
                <?php 
                    if ($tahun != "") {
                        echo "<option value='".$tahun."'>".$tahun."</option>";
                    }
					    $JumlahData = $DataJadwal2->get_all_tahun('',$a,'jumlah');	
                            for ($a=1;$a<=$JumlahData;$a++){
                            $tahun = $DataJadwal2->get_all_tahun('tahun',$a,'');
                       		echo "<option value=".$tahun.">".$tahun."</option>";
                        }
                ?>
                </select>
			</div>
            <div class="form-group">
                <label class="control-label">Semester</label>
                <select class="form-control" name="semester">
                <?php 
                    if ($semester != "") {
                        echo "<option value='".$semester."'>".$semester."</option>";
                    }
                ?>
                	<option value="GENAP">GENAP</option>
                    <option value="GANJIL">GANJIL</option>
                </select>
			</div>

                <button type="submit" class="btn btn-primary" id="OK" style="margin-top:20px;"> <i class="glyphicon glyphicon glyphicon-ok-circle"></i> OK</button>
         </form>   
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" id="closemodal" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>


<link href="<?php echo $base?>plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<script src="<?php echo $base?>plugins/datatables/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/datatables/dataTables.bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript">
  $(document).ready(function(){
	$("#example3").dataTable();
	
  });
</script>

<div id="myModal3" class="modal fade" role="dialog">
  <div class="modal-dialog modal-lg">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Data Dosen dari Data Sebelumnya</h4>
      </div>
      <div class="modal-body">
      	<div class="table-responsive">
          <table id="example3" class="table table-bordered table-striped table-hover">
             <thead>
                <tr>
                    <th>No</th>
                    <th>Nama Dosen</th>
                    <th>Semester Akademik</th>
                    <th>Tahun</th>
                </tr>
            </thead>
            <tbody>
            <?php
				$DataJadwal4 = new dataJadwal;
            	$JumlahData = $DataJadwal4->get_data_beban('',$a,'jumlah');
				if ($JumlahData<=0){
					echo "<tr class='odd gradeX'>";
					echo "<td>No Data</td>";
					echo "<td></td>";
					echo "<td></td>";
					echo "<td></td>";
					echo "</tr>";	
				}else{
					for ($a=1;$a<=$JumlahData;$a++){
						$id = $DataJadwal4->get_data_beban('id',$a,'');
						$nama = $DataJadwal4->get_data_beban('nama',$a,'');
						$nip = $DataJadwal4->get_data_beban('nip',$a,'');
						$gol = $DataJadwal4->get_data_beban('gol',$a,'');
						$pangkat = $DataJadwal4->get_data_beban('pangkat',$a,'');
						$jabatan = $DataJadwal4->get_data_beban('jabatan',$a,'');
						$statuspegawai = $DataJadwal4->get_data_beban('statuspegawai',$a,'');
						$unitkerja = $DataJadwal4->get_data_beban('unitkerja',$a,'');
						$subunitkerja = $DataJadwal4->get_data_beban('subunitkerja',$a,'');
						$s3 = $DataJadwal4->get_data_beban('s3',$a,'');
						$satub = $DataJadwal4->get_data_beban('satub',$a,'');
						$satuc = $DataJadwal4->get_data_beban('satuc',$a,'');
						$satud = $DataJadwal4->get_data_beban('satud',$a,'');
						$duaa = $DataJadwal4->get_data_beban('duaa',$a,'');
						$duab = $DataJadwal4->get_data_beban('duab',$a,'');
						$duac = $DataJadwal4->get_data_beban('duac',$a,'');
						$tiga = $DataJadwal4->get_data_beban('tiga',$a,'');
						$empata = $DataJadwal4->get_data_beban('empata',$a,'');
						$empatb = $DataJadwal4->get_data_beban('empatb',$a,'');
						$empatc = $DataJadwal4->get_data_beban('empatc',$a,'');
						$limaa = $DataJadwal4->get_data_beban('limaa',$a,'');
						$limab = $DataJadwal4->get_data_beban('limab',$a,'');
						$semester = $DataJadwal4->get_data_beban('semester',$a,'');
						$tahun = $DataJadwal4->get_data_beban('tahun',$a,'');
						$tgl = $DataJadwal4->get_data_beban('tgl',$a,'');
						$norek = $DataJadwal4->get_data_beban('norek',$a,'');
						$minimalmengajar = $DataJadwal4->get_data_beban('minimalmengajar',$a,'');
						$namas = $DataJadwal4->get_data_beban('namas',$a,'');
						$struktural = $DataJadwal4->get_data_beban('struktural',$a,'');
						$formb = $DataJadwal4->get_data_beban('formb',$a,'');
												
						echo "<tr ids='".$nama."+".$nip."+".$gol."+".$pangkat."+".$jabatan."+".$statuspegawai."+".$unitkerja."+".$subunitkerja."+".$s3."+".$satub."+".$satuc."+".$satud."+".$duaa."+".$duab."+".$duac."+".$tiga."+".$empata."+".$empatb."+".$empatc."+".$limaa."+".$limab."+".$semester."+".$tahun."+".$tgl."+".$norek."+".$minimalmengajar."+".$namas."+".$struktural."+".$formb."' class='odd gradeX context pilih4'>";
						echo "<td>".$a."</td>";
						echo "<td>".$nama."</td>";
						echo "<td>".$semester."</td>";
						echo "<td>".$tahun."</td>";
						echo "</tr>";
					}
				}
			?>
        	</tbody>
          </table>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" id="closemodal" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>
<script>
	$(document).ready(function(){
		$('.pilih4').click(function(){
			var kode = $(this).attr('ids');
			var pecah = kode.split("+");	
				a = pecah[0];
				b = pecah[1];
				c = pecah[2];
				d = pecah[3];
				e = pecah[4];
				f = pecah[5];
				g = pecah[6];
				h = pecah[7];
				i = pecah[8];
				j = pecah[9];
				k = pecah[10];
				l = pecah[11];
				m = pecah[12];
				n = pecah[13];
				o = pecah[14];
				p = pecah[15];
				q = pecah[16];
				r = pecah[17];
				s = pecah[18];
				t = pecah[19];
				u = pecah[20];
				v = pecah[21];
				w = pecah[22];
				x = pecah[23];
				y = pecah[24];
				z = pecah[25];
				aa = pecah[26];
				bb = pecah[27];
				cc = pecah[28];

				
			$('#dosen').val(a);
			$('#nip').val(b);
			$('#gol').val(c);
			$('#pangkat').val(d);
			$('#jabatan').val(e);
			$('#statuspegawai').val(f);
			$('#unitkerja').val(g);
			$('#subunitkerja').val(h);
			$('#s3').val(i);
			$('#satub').val(j);
			$('#satuc').val(k);
			$('#satud').val(l);
			$('#duaa').val(m);
			$('#duab').val(n);
			$('#duac').val(o);
			$('#tiga').val(p);
			$('#empata').val(q);
			$('#empatb').val(r);
			$('#empatc').val(s);
			$('#limaa').val(t);
			$('#limab').val(u);
			$('#semester').val(v);
			$('#tahun').val(w);
			$('#tgl').val(x);
			$('#norek').val(y);
			$('#minimalmengajar').val(z);
			$('#namas').val(aa);
			$('#struktural').val(bb);
			$('#formb').val(cc);
			
			$('#myModal3').modal('hide')
		});
	});
</script>

