<?php
require("../../../config/koneksi.php");
require("../../../config/function.php");
require("../../../config/crud.php");
$kelas = $_POST['kelas'];
$guru = $_SESSION['id_pengawas'];
$sql = mysqli_query($koneksi, "SELECT * FROM jadwal_mapel JOIN mata_pelajaran ON mata_pelajaran.kode_mapel=jadwal_mapel.kode WHERE kelas='".$kelas."' AND guru='".$guru."' ");
$html = "<option value=''>Pilih</option>";
while($data = mysqli_fetch_array($sql)){ 
	$html .= "<option value='".$data['kode']."'>".$data['nama_mapel']."</option>"; 
}
$callback = array('mapel'=>$html); 
echo json_encode($callback); 
?>
