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

$status_data = "";
$jurusan = "";
$json_response = array();


if ($_POST['jurusan']=='all') {
  if ($_SESSION['level']!=1) {
    $jurusan = "and jurusan.kode_jurusan='".$_SESSION['jurusan']."'";
  }
} else {
	$jurusan = "and jurusan.kode_jurusan='".$_POST['jurusan']."'";
}



$data = $db->fetch_custom("select *,update_nik.id as id_krs from update_nik inner join jurusan on update_nik.kode_jurusan=jurusan.kode_jurusan where status_error!='1' $jurusan");

if ($data->rowCount()>0) {
   $json_response['jumlah'] = $data->rowCount();
} else {
  $json_response['jumlah'] = 0;
}

echo json_encode($json_response);

?>
