<?php
include "../../inc/config.php";
$token = get_token();
$url = $db->get_service_url('rest');

$id_jur = $_POST['jurusan'];
$semester = $_POST['semester'];

    $filter_kelas = "id_prodi='".$id_jur."' and id_semester='".$semester."'";
                $temp_data_kelas = [
      'act' => 'GetDetailKelasKuliah',
        'token' => $token,
        'filter' => $filter_kelas,
        'order' => "id_semester DESC",
        'limit' => "",
        'offset' => ""

    ];


    $kelas = json_decode($db->run($temp_data_kelas,$url));



foreach ($kelas->data as $data_kelas) {
    $array_kode_mk[$data_kelas->id_matkul] = array('id_mk' => $data_kelas->id_matkul,'kode_mk' => $data_kelas->kode_mata_kuliah,'nama_mk' => $data_kelas->nama_mata_kuliah);
}
//$kode_mk_group = array_unique($array_kode_mk);
//dump($array_kode_mk);
echo '<option value="all">Semua</option>';
foreach ($array_kode_mk as $isi => $data) {
echo "<option value='".$data['id_mk']."'>".$data['kode_mk']." - ". $data['nama_mk']."</option>";
}