                <!-- Content Header (Page header) -->
                <section class="content-header">
                    <h1>
                     Kelas Kuliah
                    </h1>
                           <ol class="breadcrumb">
                        <li><a href="<?=base_index();?>"><i class="fa fa-dashboard"></i> Home</a></li>
                        <li><a href="<?=base_index();?>kelas-kuliah">Kelas Kuliah</a></li>
                        <li class="active">Tambah Kelas Kuliah</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">Tambah Kelas Kuliah</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="input" method="post" class="form-horizontal foto_banyak" action="<?=base_admin();?>modul/kelas_kuliah/kelas_kuliah_action.php?act=in">
                      <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" placeholder="20151" class="form-control" required> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Kode Matakuliah" class="control-label col-lg-2">Kelas Kampus Merdeka</label>
                        <div class="col-lg-10">
                          <label class="radio-inline"><input type="radio" name="kampus_merdeka" value="1"> Ya</label>
                          <label class="radio-inline"><input type="radio" name="kampus_merdeka" value="0" checked=""> Tidak</label>
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Kode Matakuliah" class="control-label col-lg-2">Kode Matakuliah</label>
                        <div class="col-lg-10">
                          <input type="text" name="kode_mk" placeholder="Kode Matakuliah" class="form-control" required> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Nama Matakuliah" class="control-label col-lg-2">Nama Matakuliah</label>
                        <div class="col-lg-10">
                          <input type="text" name="nama_mk" placeholder="Nama Matakuliah" class="form-control"> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Nama Kelas" class="control-label col-lg-2">Nama Kelas</label>
                        <div class="col-lg-10">
                          <input type="text" name="nama_kelas" placeholder="01" class="form-control" required> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Nama Kelas" class="control-label col-lg-2">Bahasan</label>
                        <div class="col-lg-10">
                          <input type="text" name="bahasan_case"  class="form-control"> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="lingkup" class="control-label col-lg-2">Lingkup</label>
                        <div class="col-lg-2">
                          <select name="lingkup" data-placeholder="Pilih lingkup..." class="form-control chzn-select" tabindex="2" required>

               <?php 
               $data_lingkup = array(
                '1' => 'Internal',
                '2' => 'External',
                '3' => 'Campuran'
              );
              foreach ($data_lingkup as $key => $val) {
                  echo "<option value='$key'>$val</option>";
              } 
              ?>
              </select>
                        </div>
                      </div><!-- /.form-group -->

<div class="form-group">
                        <label for="lingkup" class="control-label col-lg-2">Mode Kuliah</label>
                        <div class="col-lg-2">
                          <select name="mode_kuliah" data-placeholder="Pilih mode_kuliah..." class="form-control chzn-select" tabindex="2" required>

               <?php 
               $data_mode_kuliah = array(
                'O' => 'Online',
                'F' => 'Offline',
                'M' => 'Campuran'
              );
              foreach ($data_mode_kuliah as $key => $val) {
                echo "<option value='$key'>$val</option>";
              } ?>
              </select>
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group show-tgl-tutup" style="display: none">
                        <label for="Nama Kelas" class="control-label col-lg-2">Tanggal Tutup Pendaftaran</label>
                        <div class="col-lg-10">
                          <input type="text" id="tgl3" name="tgl_tutup" class="form-control tgl-tutup"> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group show-kapasitas" style="display: none">
                        <label for="Nama Kelas" class="control-label col-lg-2">Kapasitas</label>
                        <div class="col-lg-2">
                          <input type="number" id="kapasitas" name="kapasitas" class="form-control"> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Nama Kelas" class="control-label col-lg-2">Tanggal Mulai Efektif</label>
                        <div class="col-lg-10">
                          <input type="text" id="tgl1" name="tgl_mulai_koas" class="form-control"> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Nama Kelas" class="control-label col-lg-2">Tangal Akhir Efektif</label>
                        <div class="col-lg-10">
                          <input type="text" id="tgl2" name="tgl_selesai_koas" class="form-control"> 
                        </div>
                      </div><!-- /.form-group -->
<div class="form-group">
                        <label for="Jurusan" class="control-label col-lg-2">Jurusan</label>
                        <div class="col-lg-10">
                          <select name="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) {
                  echo "<option value='$isi->kode_jurusan'>$isi->jenjang $isi->nama_jurusan</option>";
                  
               } ?>
              </select>
                        </div>
                      </div><!-- /.form-group -->
                      <div class="form-group">
                        <label for="tags" class="control-label col-lg-2">&nbsp;</label>
                        <div class="col-lg-10">
                         <a onclick="window.history.back(-1)" 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">
  
  $("input[type=radio][name=kampus_merdeka]").change(function(){
    if(parseInt($(this).val())){
      $('.show-tgl-tutup').show();
      $('.show-kapasitas').show();
      $('#tgl1').prop('required',true);
      $('#tgl2').prop('required',true);
      $('#kapasitas').prop('required',true);
      $('#tgl3').prop('required',true);
    } else{
      $('.show-tgl-tutup').hide();
      $('.show-kapasitas').hide();
      $('#tgl1').prop('required',false);
      $('#tgl2').prop('required',false);
      $('#kapasitas').prop('required',false);
      $('#tgl3').prop('required',false);
    }
  });
</script>