<div class="content-wrapper">
  <h4>
  EXAM <small class="text-muted">/ ADD</small>
  </h4>
  <hr>
  <div class="row">

    <!-- <?php echo $_GET['TYPE']; ?> -->

    <div class="col-md-5 col-xs-12 d-flex align-items-stretch grid-margin">
      <div class="row flex-grow">
        <div class="col-12 col-xs-12">
          <div class="card">
            <div class="card-body">
              <h4 class="card-title">SETTING OF EXAM</h4>
              <p class="card-description">
                <!-- Basic form layout -->
              </p>
               <form class="forms-sample" action="?page=proses" method="post" enctype="multipart/form-data">
                <input type="hidden" name="id_guru" value="<?=$sesi; ?>">

                <div class="form-group">
                  <label for="jenis">Type of Exam *</label>
                  <select class="form-control" id="jenis" name="id_jenis" style="font-weight: bold;background-color: #212121;color: #fff;" required>
                  <option value=''>-- Choose --</option>
                  <?php
                  $sqlJenis=mysqli_query($con, "SELECT * FROM tb_jenisujian ORDER BY id_jenis DESC");
                  while($jenis=mysqli_fetch_array($sqlJenis)){
                  echo "<option value='$jenis[id_jenis]'>$jenis[jenis_ujian]</option>";
                  }
                  ?>
                  </select>
                </div>

                <div class="form-group">
                  <label for="mapel">Training Name *</label>
                  <select class="form-control" name="id_roleguru" onchange="cek_database()" id="id_roleguru" style="font-weight: bold;background-color: #212121;color: #fff;" required>
                  <option value=''>-- Choose --</option>
                  <?php
                  $sqlMapel=mysqli_query($con, "SELECT * FROM tb_roleguru
                          INNER JOIN tb_master_kelas ON tb_roleguru.id_kelas=tb_master_kelas.id_kelas
                          INNER JOIN tb_master_mapel ON tb_roleguru.id_mapel=tb_master_mapel.id_mapel
                          INNER JOIN tb_master_semester ON tb_roleguru.id_semester=tb_master_semester.id_semester
                          INNER JOIN tb_master_jurusan ON tb_roleguru.id_jurusan=tb_master_jurusan.id_jurusan
                          WHERE tb_roleguru.id_guru='$sesi'");
                  while($mapel=mysqli_fetch_array($sqlMapel)){
                  echo "<option value='$mapel[id_roleguru]'>$mapel[mapel]- $mapel[kelas] - Jurusan $mapel[jurusan] $mapel[semester]</option>";
                  }
                  ?>
                  </select>
                
                 
                  <input type="hidden" name="id_kelas" id="id_kelas">
                   <input type="hidden" name="id_mapel" id="id_mapel">
                  <input type="hidden" name="id_semester" id="id_semester">
                   <input type="hidden" name="id_jurusan" id="id_jurusan">
                </div>
                  <div class="form-group">
                  <label>Name of Exam *</label>
                  <input type="text" name="judul" class="form-control" placeholder="Judul Perangkat ..">
                </div>
                <div class="form-group">
                  <label>Exam Start Date *</label>
                  <input type="date" name="tgl_awal" class="form-control" value="<?php echo date('Y-m-d') ?>">
                </div>

                <div class="form-group">
                  <label>Exam End Date *</label>
                  <input type="date" name="tgl_akhir" class="form-control" value="<?php echo date('Y-m-d') ?>">
                </div>


                 <div class="form-group">
                  <label>Time of Exam *</label>
                  <input type="text" name="jam" class="form-control"placeholder='Exam Duration Hours are filled with 2 digits (01)'maxlength="2" required>
                  <input type="text" name="menit" class="form-control" placeholder='Exam Duration Minutes filled with 2 digits (00)' maxlength='2' maxlength="2" required>
                </div>
                 <div class="form-group">
                  <label>Number of Questions*</label>
                  <input type="number" name="jumlah" class="form-control" placeholder="Number of Question ..">
                </div>

                 <div class="form-group">
                  <!-- <label for="mapel">Mata Pelajaran *</label> -->
                  <select class="form-control" name="acak" style="font-weight: bold;background-color: #212121;color: #fff;" required>
                  <option value="acak">Random Questions</option>
                  <option value="tidak">Not Random Questions</option>
                  </select>
              </div>
              <div class="form-group">
                <label>Exam Status *</label>
                <div class="form-radio form-radio-flat">
                <label class="form-check-label" for="Y">
                <input type="radio" class="form-check-input" name="aktif" id="Y" value="Y">
                Active
                </label>
                </div>
              </div>
              <div class="form-group">
                <div class="form-radio form-radio-flat">
                <label class="form-check-label" for="N">
                <input type="radio" class="form-check-input" name="aktif" id="N" value="N">
                Not Active
                </label>
                </div>
              </div>

                <hr>
   

                <button type="submit" name="ujianSave" class="btn btn-info mr-2">Save</button>
                <a href="javascript:history.back()" class="btn btn-danger">Cancel</a>
              </form>

         
                
				</div>
				</div>
				</div>
				</div>
				</div>
				</div>
				</div>
