Add the main admin, dosen, mahasiswa, API, and service code needed to run the core legacy application with configurable upload storage.
42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
session_start();
|
|
|
|
include '../../steven/conf/koneksiPDO.php';
|
|
include '../../steven/conf/function.php';
|
|
|
|
$conn = new createCon();
|
|
$dbh = $conn->connect();
|
|
|
|
header('Content-Type: application/json');
|
|
|
|
if (!isset($_SESSION['login-dosen'])) {
|
|
echo json_encode(['status' => 403, 'msg' => 'Forbidden']);
|
|
exit;
|
|
}
|
|
|
|
$nim = $_GET['nim'];
|
|
|
|
$url = "https://informatika.untan.ac.id/API/public/get_detail_mahasiswa.php?key=MfQE6ej2ffxEKgVx7YXVA3HbHg3d4hRhXyBnRnYgkjwuSaLNW2V5PxeVSKWySUsbbhVyEWVSs&nim=$nim";
|
|
$getDetailMahasiswa = file_get_contents($url);
|
|
$decodedDetailMahasiswa = json_decode($getDetailMahasiswa, true);
|
|
|
|
if(!isset($decodedDetailMahasiswa['status'])){
|
|
echo json_encode([
|
|
'status' => 0,
|
|
'msg' => 'Tidak dapat mengakses API biodata informatika',
|
|
]);
|
|
exit;
|
|
}
|
|
|
|
if($decodedDetailMahasiswa['status'] == "0"){
|
|
echo json_encode([
|
|
'status' => 0,
|
|
'msg' => $decodedDetailMahasiswa['msg'],
|
|
]);
|
|
exit;
|
|
}
|
|
|
|
$data = $decodedDetailMahasiswa['data'];
|
|
|
|
echo json_encode(utf8ize(['status' => 1, 'data' => $data]));
|
|
?>
|