<?php 
			include "php_class/class_mysql.php";
            include "php_class/class_proposal.php";	
			include "php_class/class_skk.php";
			include "php_class/class_mahasiswa.php";
			$DataMahasiswa = new DataMahasiswa;
			$dataskk = new DataSKK;	
			$DataProposal = new DataProposal;
            $id = $xcode;
			
			
			$Nama = $dataskk->get_skk_single_by_id('Nama',$id);			
			$NPM = $dataskk->get_skk_single_by_id('NPM',$id);			
			$SMT = $dataskk->get_skk_single_by_id('SMT',$id);			
			$Latdis = $dataskk->get_skk_single_by_id('Latdis',$id);			
			$Ospek = $dataskk->get_skk_single_by_id('Ospek',$id);			
			$Kerbaksos = $dataskk->get_skk_single_by_id('Kerbaksos',$id);			
			$StadiumGeneral = $dataskk->get_skk_single_by_id('StadiumGeneral',$id);			
			$BSM = $dataskk->get_skk_single_by_id('BSM',$id);			
			$PdJur = $dataskk->get_skk_single_by_id('PdJur',$id);			
			$PdRegional = $dataskk->get_skk_single_by_id('PdRegional',$id);			
			$PdNasional = $dataskk->get_skk_single_by_id('PdNasional',$id);			
			$PdInternasional = $dataskk->get_skk_single_by_id('PdInternasional',$id);			
			$MnJur = $dataskk->get_skk_single_by_id('MnJur',$id);			
			$MnRegional = $dataskk->get_skk_single_by_id('MnRegional',$id);	
			$MnNasional = $dataskk->get_skk_single_by_id('MnNasional',$id);			
			$MnInternasional = $dataskk->get_skk_single_by_id('MnInternasional',$id);			
			$PmJur = $dataskk->get_skk_single_by_id('PmJur',$id);			
			$PmRegional = $dataskk->get_skk_single_by_id('PmRegional',$id);			
			$PmNasional = $dataskk->get_skk_single_by_id('PmNasional',$id);			
			$PmInternational = $dataskk->get_skk_single_by_id('PmInternational',$id);			
			$JurKetua = $dataskk->get_skk_single_by_id('JurKetua',$id);			
			$JurWakil = $dataskk->get_skk_single_by_id('JurWakil',$id);	
			$JurSek = $dataskk->get_skk_single_by_id('JurSek',$id);			
			$JurBen = $dataskk->get_skk_single_by_id('JurBen',$id);			
			$JurAng = $dataskk->get_skk_single_by_id('JurAng',$id);			
			$RegKetua = $dataskk->get_skk_single_by_id('RegKetua',$id);			
			$RegWakil = $dataskk->get_skk_single_by_id('RegWakil',$id);			
			$RegSek = $dataskk->get_skk_single_by_id('RegSek',$id);			
			$RegBen = $dataskk->get_skk_single_by_id('RegBen',$id);			
			$RegAng = $dataskk->get_skk_single_by_id('RegAng',$id);			

			$NasKetua = $dataskk->get_skk_single_by_id('NasKetua',$id);			
			$NasWakil = $dataskk->get_skk_single_by_id('NasWakil',$id);			
			$NasSek = $dataskk->get_skk_single_by_id('NasSek',$id);			
			$NasBen = $dataskk->get_skk_single_by_id('NasBen',$id);			
			$NasAng = $dataskk->get_skk_single_by_id('NasAng',$id);			

			$IntKetua = $dataskk->get_skk_single_by_id('IntKetua',$id);			
			$IntWakil = $dataskk->get_skk_single_by_id('IntWakil',$id);			
			$IntSek = $dataskk->get_skk_single_by_id('IntSek',$id);			
			$IntBen = $dataskk->get_skk_single_by_id('IntBen',$id);			
			$IntAng = $dataskk->get_skk_single_by_id('IntAng',$id);	
			
			$Wajib = $dataskk->get_skk_single_by_id('Wajib',$id);			
			$LainJur = $dataskk->get_skk_single_by_id('LainJur',$id);			
			$LainReg = $dataskk->get_skk_single_by_id('LainReg',$id);			
			$LainNas = $dataskk->get_skk_single_by_id('LainNas',$id);			
			$LainInt = $dataskk->get_skk_single_by_id('LainInt',$id);	
			
			$semester = $dataskk->get_skk_single_by_id('semester', $id);
			$tahunAkademik = $dataskk->get_skk_single_by_id('tahunAkademik', $id);
					

        ?>

<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>
<script>
	$(document).ready(function(){
	var base = <?php echo json_encode($base);?>;
		$('#NPM').keyup(function(e){
	  		if(e.keyCode == 13){
				var npm = $('#NPM').val();
				var action = '3';
				var program = $('#program').val();
				var tahun = $('#tahun').val();
				var semester = $('#semester').val();
				var idgrup = $('#idgrup').val();
				if (npm==''){
					$('.peringatan').html('<div id="warning"><div class="alert alert-warning" role="alert">NPM Masih Kosong!</div></div>')			
				}else{
					$('.peringatan').html('<div id="warning"><img src="img/ld.gif"></div>')			
					$.ajax({
						type:"POST",
						data: "index=" + npm + "&program=" + program + "&tahun=" + tahun + "&semester=" + semester + "&grup=" + idgrup ,
						url:"<?php echo $base?>cek-npm-proposal.php",     
						success: function(data){
							var tampung = data;
							if(tampung!=404){
								$('#form1').show();
								var pecah=tampung.split(":");
								$('#nama').val(pecah[0]);
								$('#idMhs').val(pecah[3]);
								$('#bungkus').show();
								$('.peringatan').html('<div id="warning"><div role="alert"></div></div>')
							}else{
								$('.peringatan').html('<div id="warning"><div class="alert alert-warning" role="alert">Mahasiswa dengan NPM ini tidak ditemukan!</div></div>')
								$('#NPM').focus();	
								$('#simpan').hide();
								}
						}
					});
				}
			} 
		});

	});
</script>

<style>
	.checkbox2{	width:20px; height:20px; float:left; }
</style>
<section class="content-header">
  <h1>
   Data SKK
  </h1>
  <ol class="breadcrumb">
    <li><a href="<?php echo $base?>"><i class="fa fa-dashboard"></i> Home</a></li>
    <li class="active">Edit Data SKK</li>
  </ol>
</section>
<section class="content">
 	<div class="row">
    	<div class="col-md-12">
        	 <div class="box box-info">
                <div class="box-header">
                  <h3 class="box-title">Tambah Data SKK</h3>
                </div>
                <div class="box-body">
                        <div class="peringatan">
                        </div>
                	<form method="post" action="<?php echo $base?>query-edit-skk">
                    	<input type="hidden" name="idMhs" id="idMhs" value="<?php echo $id?>">
                        <div class="form-group">
                            <label class="control-label">NPM</label>
                            <input type="text" name="npm"  class="form-control"  id="NPM" value="<?php echo $NPM?>" disabled>
                        </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">Nama Mahasiswa</label>
                            <input type="text" name="nama" required="required" class="form-control"  id="nama" value="<?php echo $Nama?>" disabled>
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">Semester (angka romawi)</label>
                            <select class="form-control" name="semester" >
							<?php echo "<option value='".$SMT."'>".$SMT."</option>"; ?>
                                    <option value="Ganjil">Ganjil</option>
                                    <option value="Genap">Genap</option>
                            </select>
                         </div>
                        <div class="form-group" style="margin-bottom:25px; border-bottom:#999 solid thin">
                            <label for="Operator" class="control-label">Tahun Akademik</label>
                            <select class="form-control" name="tahunAkademik" >
                                    <?php echo "<option value='".$tahunAkademik."'>".$tahunAkademik."</option>"; ?>
									<?php 
                                        $JumlahData = $DataMahasiswa->get_all_angkatan_2('',$a,'jumlah');	
                                            for ($a=1;$a<=$JumlahData;$a++){
                                            $angkatan = $DataMahasiswa->get_all_angkatan_2('angkatan',$a,'');
                                            if ($angkatan == '08'){
                                                $upAngkatan = '09';
                                            }else{
                                                $upAngkatan = $angkatan + 1;
                                            }
                                            
                
                                            $tahun = $angkatan.$upAngkatan;
                                            $tahun1 = "20".$angkatan."/20".$upAngkatan;
                                            echo "<option value=".$tahun1.">".$tahun1."</option>";
                
                                        }
                                    ?>
                            </select>
                         </div>

                            <label for="Operator" class="control-label" >WAJIB</label>
                        <div class="form-group">
                            <label for="Operator" class="control-label">1. Latdis</label>
                            <input type="text" name="latdis" required="required" class="form-control"  value="<?php echo $Latdis?>">
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">2. Ospek/Ceraf</label>
                            <input type="text" name="ospek" required="required" class="form-control"  value="<?php echo $Ospek?>"  >
                         </div>
                        <div class="form-group" style="margin-bottom:25px; border-bottom:#999 solid thin">
                            <label for="Operator" class="control-label">3. Kerbaksos</label>
                            <input type="text" name="kerbaksos" required="required" class="form-control"  value="<?php echo $Kerbaksos?>"  >
                         </div>
                         
                            <label for="Operator" class="control-label" >WAJIB UTAMA JURUSAN</label>
                        <div class="form-group">
                            <label for="Operator" class="control-label">1. Stadium General</label>
                            <input type="text" name="stadiumgeneral" required="required" class="form-control"  value="<?php echo $StadiumGeneral?>"  >
                         </div>
                        <div class="form-group" style="margin-bottom:25px; border-bottom:#999 solid thin">
                            <label for="Operator" class="control-label">2. BSM</label>
                            <input type="text" name="bsm" required="required" class="form-control"  value="<?php echo $BSM?>"  >
                         </div>
                         
                            <label for="Operator" class="control-label" >PENDIDIKAN/PENALARAN</label>
                        <div class="form-group">
                            <label for="Operator" class="control-label">1. Jur./Fak./Universitas</label>
                            <input type="text" name="pdjur" required="required" class="form-control"  value="<?php echo $PdJur?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">2. Regional</label>
                            <input type="text" name="pdregional" required="required" class="form-control"  value="<?php echo $PdRegional?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">3. Nasional</label>
                            <input type="text" name="pdnasional" required="required" class="form-control"  value="<?php echo $PdNasional?>"  >
                         </div>
                        <div class="form-group" style="margin-bottom:25px; border-bottom:#999 solid thin">
                            <label for="Operator" class="control-label">4. Internasional</label>
                            <input type="text" name="pdinternasional" required="required" class="form-control"  value="<?php echo $PdNasional?>"  >
                         </div>
                         
                            <label for="Operator" class="control-label" >MINAT DAN BAKAT</label>
                        <div class="form-group">
                            <label for="Operator" class="control-label">1. Jur./Fak./Universitas</label>
                            <input type="text" name="mnjur" required="required" class="form-control"  value="<?php echo $MnJur?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">2. Regional</label>
                            <input type="text" name="mnregional" required="required" class="form-control"  value="<?php echo $MnRegional?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">3. Nasional</label>
                            <input type="text" name="mnnasional" required="required" class="form-control"  value="<?php echo $MnNasional?>"  >
                         </div>
                        <div class="form-group" style="margin-bottom:25px; border-bottom:#999 solid thin">
                            <label for="Operator" class="control-label">4. Internasional</label>
                            <input type="text" name="mninternasional" required="required" class="form-control"  value="<?php echo $MnInternasional?>"  >
                         </div>
                         
                            <label for="Operator" class="control-label" >PENGABDIAN MASYARAKAT</label>
                        <div class="form-group">
                            <label for="Operator" class="control-label">1. Jur./Fak./Universitas</label>
                            <input type="text" name="pmjur" required="required" class="form-control"  value="<?php echo $PmJur?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">2. Regional</label>
                            <input type="text" name="pmregional" required="required" class="form-control"  value="<?php echo $PmRegional?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">3. Nasional</label>
                            <input type="text" name="pmnasional" required="required" class="form-control"  value="<?php echo $PmNasional?>"  >
                         </div>
                        <div class="form-group" style="margin-bottom:25px; border-bottom:#999 solid thin">
                            <label for="Operator" class="control-label">4. Internasional</label>
                            <input type="text" name="pminternasional" required="required" class="form-control"  value="<?php echo $PmInternational?>"  >
                         </div>
                         
                            <label for="Operator" class="control-label" >KEPENGURUSAN DAN KEPEMIMPINAN</label>
                        <div class="form-group">
                            <label for="Operator" class="control-label">1. Ketua (Jur./Fak./Universitas) </label>
                            <input type="text" name="jurKetua" required="required" class="form-control"  value="<?php echo $JurKetua?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">2. Wakil (Jur./Fak./Universitas)</label>
                            <input type="text" name="jurWakil" required="required" class="form-control"  value="<?php echo $JurWakil?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">3. Sekretaris (Jur./Fak./Universitas)</label>
                            <input type="text" name="jurSek" required="required" class="form-control"  value="<?php echo $JurSek?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">4. Bendahara (Jur./Fak./Universitas)</label>
                            <input type="text" name="jurBen" required="required" class="form-control"  value="<?php echo $JurBen?>"  >
                         </div>
                        <div class="form-group" style="margin-bottom:25px; border-bottom:#999 solid thin">
                            <label for="Operator" class="control-label">5. Anggota (Jur./Fak./Universitas)</label>
                            <input type="text" name="jurAng" required="required" class="form-control"  value="<?php echo $JurAng?>"  >
                         </div>

                        <div class="form-group">
                            <label for="Operator" class="control-label">1. Ketua (Regional) </label>
                            <input type="text" name="regKetua" required="required" class="form-control"  value="<?php echo $RegKetua?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">2. Wakil (Regional)</label>
                            <input type="text" name="regWakil" required="required" class="form-control"  value="<?php echo $RegWakil?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">3. Sekretaris (Regional)</label>
                            <input type="text" name="regSek" required="required" class="form-control"  value="<?php echo $RegSek?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">4. Bendahara (Regional)</label>
                            <input type="text" name="regBen" required="required" class="form-control"  value="<?php echo $RegBen?>"  >
                         </div>
                        <div class="form-group" style="margin-bottom:25px; border-bottom:#999 solid thin">
                            <label for="Operator" class="control-label">5. Anggota (Regional)</label>
                            <input type="text" name="regAng" required="required" class="form-control"  value="<?php echo $RegAng?>"  >
                         </div>

                        <div class="form-group">
                            <label for="Operator" class="control-label">1. Ketua (Nasional) </label>
                            <input type="text" name="nasKetua" required="required" class="form-control"  value="<?php echo $NasKetua?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">2. Wakil (Nasional)</label>
                            <input type="text" name="nasWakil" required="required" class="form-control"  value="<?php echo $NasWakil?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">3. Sekretaris (Nasional)</label>
                            <input type="text" name="nasSek" required="required" class="form-control"  value="<?php echo $NasSek?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">4. Bendahara (Nasional)</label>
                            <input type="text" name="nasBen" required="required" class="form-control"  value="<?php echo $NasBen?>"  >
                         </div>
                        <div class="form-group" style="margin-bottom:25px; border-bottom:#999 solid thin">
                            <label for="Operator" class="control-label">5. Anggota (Nasional)</label>
                            <input type="text" name="nasAng" required="required" class="form-control"  value="<?php echo $NasAng?>"  >
                         </div>

                        <div class="form-group">
                            <label for="Operator" class="control-label">1. Ketua (Internasional) </label>
                            <input type="text" name="intKetua" required="required" class="form-control"  value="<?php echo $IntKetua?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">2. Wakil (Internasional)</label>
                            <input type="text" name="intWakil" required="required" class="form-control"  value="<?php echo $IntWakil?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">3. Sekretaris (Internasional)</label>
                            <input type="text" name="intSek" required="required" class="form-control"  value="<?php echo $IntSek?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">4. Bendahara (Internasional)</label>
                            <input type="text" name="intBen" required="required" class="form-control"  value="<?php echo $IntBen?>"  >
                         </div>
                        <div class="form-group" style="margin-bottom:25px; border-bottom:#999 solid thin">
                            <label for="Operator" class="control-label">5. Anggota (Internasional)</label>
                            <input type="text" name="intAng" required="required" class="form-control"  value="<?php echo $IntAng?>"  >
                         </div>
                        
                        <div class="form-group" style="margin-bottom:25px; border-bottom:#999 solid thin">
                            <label for="Operator" class="control-label">WAJIB PKL DAN STUDI BANDING</label>
                            <input type="text" name="wajib" required="required" class="form-control"  value="<?php echo $Wajib?>"  >
                         </div>

                            <label for="Operator" class="control-label" >LAIN-LAIN</label>
                        <div class="form-group">
                            <label for="Operator" class="control-label">1. Jur./Fak./Universitas</label>
                            <input type="text" name="lainjur" required="required" class="form-control"  value="<?php echo $LainJur?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">2. Regional</label>
                            <input type="text" name="lainregional" required="required" class="form-control"  value="<?php echo $LainReg?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">3. Nasional</label>
                            <input type="text" name="lainnasional" required="required" class="form-control"  value="<?php echo $LainNas?>"  >
                         </div>
                        <div class="form-group">
                            <label for="Operator" class="control-label">4. Internasional</label>
                            <input type="text" name="laininternasional" required="required" class="form-control"  value="<?php echo $LainInt?>"  >
                         </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>

    	
    	
   