<?php
include("../library/inc.connection.php");
include_once "library/inc.library.php";
include_once "library/inc.sesadmin.php";
include_once "library/inc.dataadmin.php";
$semester_id = $_SESSION['SES_SEMESTER'];

?>
<div class="col-xs-12">
<!-- Standar Tabel awal -->
		<div class="box table-responsive">
            <div class="box-header bg-green-gradient">
              <h3 class="box-title"><li class='glyphicon glyphicon-tasks'></li> &nbsp;&nbsp; Tambah Data Pembelajaran Suplemen Erapor</h3>
			  <div class="box-tools pull-right">
			  <a href='?page=Data-Pembelajaran-Suplemen' target='_self' alt='Tambah KKM' class="btn btn-warning btn-sm"><li class="glyphicon glyphicon-eject"></li> Batal Tambah</a>   
            </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
<form method='post' action='?page=Pembelajaran-Suplemen-Simpan'>  
<table class="table">
  <tr> 
    <td width="20%"><b>Semester</b></td>
    <td width="2%" align="center"><b>:</b></td>
	 <td><input class="form-control" type='text' name ='txtsemester' value='<?php echo $semester_id;?>' readonly /></td>
    </td>
  </tr>
  
	<tr>
    <td width="15%"><b>Mata Pelajaran</td>
    <td width="2%"><b>:</td>
    <td width="83%"><select class="form-control" name="txtMapel">    
<option value ="">Pilih Mata Pelajaran :</option>
<?php   
    $qmapel = pg_query("SELECT * FROM tabel_mapel WHERE kelompok='S'
        ORDER BY nm_mapel ASC");
    while ($mapel = pg_fetch_array($qmapel)){
?>
    <option value ="<?php echo"$mapel[mata_pelajaran_id]";?>"><?php echo"$mapel[nm_mapel]";?></option>
<?php } ?>
</select>
    </td>
  </tr>
 
    <tr> 
    <td width="20%"><b>Kelas</b></td>
    <td width="2%" align="center"><b>:</b></td>
	        <td><select class="form-control" name="txtKelas">
			<option value="">Pilih Kelas :</option>
            <?php   
    $qkelas = pg_query("SELECT DISTINCT rombongan_belajar_id, nm_kelas FROM tabel_kelas
      WHERE semester_id = '$semester_id' AND jenis_rombel IN ('1','8','9')
      ORDER BY nm_kelas ASC");
    while ($kelas = pg_fetch_array($qkelas)){
    ?>
    <option value ="<?php echo"$kelas[rombongan_belajar_id]";?>">
      <?php echo"$kelas[nm_kelas]";?>
    </option>
    <?php } ?>

	</select></td>
	</td>
   </tr>
 
 <tr> 
    <td width="20%"><b>Guru Mata Pelajaran</b></td>
    <td width="2%" align="center"><b>:</b></td>
	 <td>
	 <select class="form-control" name="txtptkterdaftar">    
<option value ="">Pilih Guru Mata Pelajaran :</option>
<?php   
    $qmapelptk = pg_query("SELECT
*
FROM v_ptk_aktif WHERE semester_id = '$semester_id' ORDER BY nama ASC");
    while ($mapelptk = pg_fetch_array($qmapelptk)){
?>
    <option value ="<?php echo"$mapelptk[ptk_terdaftar_id]";?>"><?php echo"$mapelptk[nama]";?></option>
<?php } ?>
</select>
	 
	 </td>
    </td>
  </tr>
  <tr class="bg-info">
 <td colspan="3">
  <div class="box-tools pull-right">  
            <input class="btn btn-success" type='submit' name="btnSave" value='SIMPAN'  onclick="jalankanload()">
			</div>
  
  </td>
</tr> 
</table>
</form>
</div><div id="loading" align="center"></div>
          </div>
<!-- Standar Tabel akhir -->
</div>

