<?php
header("Access-Control-Allow-Origin: *");
include "../../inc/config.php";

$url = get_service_url();
$token = get_token();

$json_response = [];
$periode = "";
$jenis_kelamin = "";
$jurusan = "";
$id_agama = "";
$jumlah = 0;

if ($_POST["jurusan"] != "all") {
    $jurusan = "and id_prodi='".$_POST['jurusan']."'";
}



$filter_dosen = "id_substansi is not null $jurusan";
$filter_dosen = trim($filter_dosen);

$temp_count_mk = [
    "act" => "GetCountSubstansiKuliah",
    "token" => $token,
    "filter" => $filter_dosen,
];
$temp_count = json_decode($db->run($temp_count_mk, $url));
if (!empty($temp_count->data)) {
    $jumlah = $temp_count->data;
}

if ($jumlah > 0) {
    $json_response["jumlah"] = $jumlah;
} else {
    $json_response["jumlah"] = 0;
}

echo json_encode($json_response);
?>
