Add consultation module assets and libraries

This commit is contained in:
Power BI Dev
2026-05-02 10:11:07 +07:00
parent a52c2a8462
commit 5fb1151fea
1239 changed files with 392281 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
<?php
session_start();
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
$conn = new createCon();
$dbh = $conn->connect();
checkKey('POST', 'token');
checkKey('POST', 'id');
checkKey('POST', 'topik');
checkKey('POST', 'tanggal');
$token = trim($_POST['token']);
$id = trim($_POST['id']);
$topik = trim($_POST['topik']);
$tanggal = trim($_POST['tanggal']);
$authorized = false;
$sql = 'SELECT * FROM tugas_akhir LEFT JOIN mahasiswa ON tugas_akhir.nim = mahasiswa.nim WHERE token = :token AND idTugasAkhir = (SELECT idTugasAkhir FROM konsultasi WHERE idKonsul = :idKonsul)';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->bindParam(':idKonsul', $id);
$stmt->execute();
if ($stmt->rowCount() > 0) {
$authorized = true;
}
if (!$authorized) {
echo getUnauthorizedMessage();
exit();
}
if ($topik == '') {
echo getDataEmptyMessage();
exit();
}
$sql = 'SELECT * FROM konsultasi WHERE idKonsul = :idKonsul';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':idKonsul', $id);
$stmt->execute();
$timestamp1 = 0;
$timestamp2 = 0;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$timestamp1 = intval($row['timestampDosen1']);
$timestamp2 = intval($row['timestampDosen2']);
}
if ($timestamp1 > 0 || $timestamp2 > 0) {
echo json_encode(
array(
'status' => 0,
'msg' => 'Tidak dapat mengedit data konsultasi ini, data telah di verifikasi pembimbing!!!',
)
);
exit();
}
$sql = 'UPDATE konsultasi SET tanggal = :tanggal, topik = :topik WHERE idKonsul = :idKonsul';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':tanggal', $tanggal);
$stmt->bindParam(':topik', $topik);
$stmt->bindParam(':idKonsul', $id);
$stmt->execute();
$error = $stmt->errorInfo();
$isError = true;
if ($error[0] == '00000') {
$isError = false;
}
if ($isError) {
echo json_encode(
array(
'status' => 0,
'msg' => 'Terjadi kesalahan teknis!!!',
)
);
} else {
echo json_encode(
array(
'status' => 1,
'msg' => 'Berhasil mengedit data konsultasi!!!',
)
);
}

View File

@@ -0,0 +1,158 @@
<?php
session_start();
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
$conn = new createCon();
$dbh = $conn->connect();
checkKey('POST', 'token');
checkKey('POST', 'id');
checkKey('POST', 'tipe');
$token = trim($_POST['token']);
$tipe = strtolower(trim($_POST['tipe']));
$idTugasAkhir = intval($_POST['id']);
$mahasiswa = false;
$dosen = false;
switch ($tipe) {
case 'mahasiswa': $tabel = 'mahasiswa'; $mahasiswa = true; break;
case 'dosen': $tabel = 'dosen'; $dosen = true; break;
default: echo getUnknownTypeMessage(); exit();
}
$sql = "SELECT * FROM $tabel WHERE token = :token";
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->execute();
$nim = '';
$nip = '';
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
if ($mahasiswa) {
$nim = $row['nim'];
}
if ($dosen) {
$nip = $row['nip'];
}
}
$authorized = false;
$sql = 'SELECT * FROM tugas_akhir WHERE idTugasAkhir = :id';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':id', $idTugasAkhir);
$stmt->execute();
if ($stmt->rowCount() == 0) {
echo getKonsultasiNotFoundMessage();
exit();
}
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
if ($mahasiswa) {
$nimTA = $row['nim'];
if ($nim == $nimTA) {
$authorized = true;
}
}
if ($dosen) {
$pemb1 = $row['pemb1'];
$pemb2 = $row['pemb2'];
if (($pemb1 == $nip) || ($pemb2 == $nip)) {
$authorized = true;
}
}
$judul = $row['judul'];
$nimDb = $row['nim'];
$pemb1 = $row['pemb1'];
$pemb2 = $row['pemb2'];
$peng1 = $row['peng1'];
$peng2 = $row['peng2'];
$semester = $row['semester'];
$tahunAjaran = $row['tahunAjaran'];
$tanggalKeputusan = $row['tanggalKeputusan'];
$waktuKeputusan = $row['waktuKeputusan'];
$selesai = $row['selesai'];
}
if (!$authorized) {
echo getUnauthorizedMessage();
exit();
}
$sql = 'SELECT * FROM dosen WHERE nip IN (:pemb1, :pemb2, :peng1, :peng2)';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':pemb1', $pemb1);
$stmt->bindParam(':pemb2', $pemb2);
$stmt->bindParam(':peng1', $peng1);
$stmt->bindParam(':peng2', $peng2);
$stmt->execute();
$namaPemb1 = '-';
$namaPemb2 = '-';
$namaPeng1 = '-';
$namaPeng2 = '-';
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$nipDosenDb = $row['nip'];
$namaDosenDb = $row['namaDosen'];
if ($pemb1 == $nipDosenDb) {
$namaPemb1 = $namaDosenDb;
}
if ($pemb2 == $nipDosenDb) {
$namaPemb2 = $namaDosenDb;
}
if ($peng1 == $nipDosenDb) {
$namaPeng1 = $namaDosenDb;
}
if ($peng2 == $nipDosenDb) {
$namaPeng2 = $namaDosenDb;
}
}
$sql = 'SELECT * FROM mahasiswa WHERE nim = :nim';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':nim', $nimDb);
$stmt->execute();
$namaMahasiswaDb = '-';
$hp = '';
$email = '';
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$namaMahasiswaDb = $row['nama'];
$hp = $row['hp'];
$email = $row['email'];
}
$tanggalKeputusanText = convertToDmy($tanggalKeputusan);
echo json_encode(utf8ize(array(
'status' => 1,
'tugasAkhir' => array(
'judul' => $judul,
'mahasiswa' => $namaMahasiswaDb,
'nim' => $nimDb,
'hp' => $hp,
'email' => $email,
'pembimbing1' => $namaPemb1,
'pembimbing2' => $namaPemb2,
'penguji1' => $namaPeng1,
'penguji2' => $namaPeng2,
'semester' => $semester,
'tahun' => $tahunAjaran,
'tanggalKeputusan' => $tanggalKeputusanText,
),
)));

View File

@@ -0,0 +1,183 @@
<?php
session_start();
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
$conn = new createCon();
$dbh = $conn->connect();
checkKey('POST', 'token');
checkKey('POST', 'id');
checkKey('POST', 'tipe');
$token = trim($_POST['token']);
$tipe = strtolower(trim($_POST['tipe']));
$idTugasAkhir = intval($_POST['id']);
$mahasiswa = false;
$dosen = false;
switch ($tipe) {
case 'mahasiswa': $tabel = 'mahasiswa'; $mahasiswa = true; break;
case 'dosen': $tabel = 'dosen'; $dosen = true; break;
default: echo getUnknownTypeMessage(); exit();
}
$sql = "SELECT * FROM $tabel WHERE token = :token";
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->execute();
$nim = '';
$nip = '';
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
if ($mahasiswa) {
$nim = $row['nim'];
}
if ($dosen) {
$nip = $row['nip'];
}
}
$authorized = false;
$sql = 'SELECT * FROM tugas_akhir WHERE idTugasAkhir = :id';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':id', $idTugasAkhir);
$stmt->execute();
if ($stmt->rowCount() == 0) {
echo getKonsultasiNotFoundMessage();
exit();
}
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$pemb1 = $row['pemb1'];
$pemb2 = $row['pemb2'];
if ($mahasiswa) {
$nimTA = $row['nim'];
if ($nim == $nimTA) {
$authorized = true;
}
}
if ($dosen) {
$isPemb1 = false;
$isPemb2 = false;
if (($pemb1 == $nip)) {
$isPemb1 = true;
$authorized = true;
}
if (($pemb2 == $nip)) {
$isPemb2 = true;
$authorized = true;
}
}
}
if (!$authorized) {
echo getUnauthorizedMessage();
exit();
}
$sql = "SELECT * FROM dosen WHERE nip IN('$pemb1','$pemb2')";
$stmt = $dbh->prepare($sql);
$stmt->execute();
$namaPemb1 = '-';
$namaPemb2 = '-';
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$nipDb = $row['nip'];
if ($nipDb == $pemb1) {
$namaPemb1 = $row['namaDosen'];
}
if ($nipDb == $pemb2) {
$namaPemb2 = $row['namaDosen'];
}
}
$sql = 'SELECT * FROM konsultasi WHERE idTugasAkhir = :id ORDER BY DATE(tanggal) DESC';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':id', $idTugasAkhir);
$stmt->execute();
$data = [];
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$timestamp = $row['timestamp'];
$waktuText = $row['tanggal'];
$topik = $row['topik'];
$timestampDosen1 = intval($row['timestampDosen1']);
$timestampDosen2 = intval($row['timestampDosen2']);
$catatanPemb1 = $row['catatanDosen1'];
$catatanPemb2 = $row['catatanDosen2'];
if ($catatanPemb1 == '') {
$catatanPemb1 = 'Tidak Ada Catatan';
}
if ($catatanPemb2 == '') {
$catatanPemb2 = 'Tidak Ada Catatan';
}
$editable = true;
if ($timestampDosen1 > 0 || $timestampDosen2 > 0) {
$editable = false;
}
$verifPemb1 = false;
if ($timestampDosen1 > 0) {
$verifPemb1 = true;
}
$verifPemb2 = false;
if ($timestampDosen2 > 0) {
$verifPemb2 = true;
}
if ($dosen) {
if ($isPemb1) {
if ($verifPemb1) {
$editable = false;
} else {
$editable = true;
}
}
if ($isPemb2) {
if ($verifPemb2) {
$editable = false;
} else {
$editable = true;
}
}
}
array_push($data, [
'id' => $row['idKonsul'],
'waktu' => $waktuText,
'editable' => $editable,
'isPemb1' => $isPemb1,
'isPemb2' => $isPemb2,
'topik' => $topik,
'pemb1' => $namaPemb1,
'verifPemb1' => $verifPemb1,
'waktuPemb1' => date('d-m-Y H:i:s', $timestampDosen1),
'catatanPemb1' => $catatanPemb1,
'pemb2' => $namaPemb2,
'verifPemb2' => $verifPemb2,
'waktuPemb2' => date('d-m-Y H:i:s', $timestampDosen2),
'catatanPemb2' => $catatanPemb2,
]);
}
echo json_encode(utf8ize([
'status' => 1,
'data' => $data,
]));

View File

@@ -0,0 +1,82 @@
<?php
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
$conn = new createCon();
$dbh = $conn->connect();
checkKey('POST', 'token');
$token = trim($_POST['token']);
$sql = 'SELECT * FROM dosen WHERE token = :token';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->execute();
$authorized = false;
if ($stmt->rowCount() > 0) {
$authorized = true;
}
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$nip = $row['nip'];
}
$sql = 'SELECT tugas_akhir.idTugasAkhir, judul, mahasiswa.nim, nama FROM tugas_akhir LEFT JOIN (SELECT * FROM konsultasi WHERE idKonsul IN (SELECT MAX(idKonsul) FROM konsultasi GROUP BY idTugasAkhir)) as t ON tugas_akhir.idTugasAkhir = t.idTugasAkhir LEFT JOIN mahasiswa ON tugas_akhir.nim = mahasiswa.nim WHERE pemb1 = :nip1 OR pemb2 = :nip2 AND selesai = 0';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':nip1', $nip);
$stmt->bindParam(':nip2', $nip);
$stmt->execute();
$data = array();
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$id = $row['idTugasAkhir'];
$judul = $row['judul'];
$nim = $row['nim'];
$nama = $row['nama'];
$lastKonsultasi = $row['timestamp'];
$diffDay = '-';
if ($lastKonsultasi == null) {
$untilNow = '-';
} else {
if ($lastKonsultasi == 0) {
$untilNow = '-';
} else {
$timeAwal = intval($lastKonsultasi);
$timeAkhir = time();
$datediff = $timeAkhir - $timeAwal;
$diffDay = round($datediff / (60 * 60 * 24));
if ($diffDay < 0) {
$diffDay = 0;
}
$untilNow = $diffDay;
}
}
$konsultasiTerakhir = 'BELUM PERNAH KONSULTASI';
if ($diffDay != '-') {
$konsultasiTerakhir = date('d-m-Y', $lastKonsultasi);
}
array_push($data, array(
'id' => $id,
'judul' => $judul,
'nim' => $nim,
'nama' => $nama,
'konsultasiTerakhir' => $konsultasiTerakhir,
'bedaHari' => $diffDay,
));
}
echo json_encode(utf8ize(array(
'status' => 1,
'data' => $data,
)));

View File

@@ -0,0 +1,39 @@
<?php
session_start();
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
$conn = new createCon();
$dbh = $conn->connect();
checkKey('POST', 'token');
$token = trim($_POST['token']);
$sql = 'SELECT * FROM mahasiswa WHERE token = :token';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->execute();
if ($stmt->rowCount() == 0) {
echo getUnauthorizedMessage();
exit();
}
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$nim = $row['nim'];
$nama = $row['nama'];
$email = $row['email'];
$hp = $row['hp'];
}
echo json_encode(utf8ize(array(
'status' => 1,
'nim' => $nim,
'nama' => $nama,
'email' => $email,
'hp' => $hp,
)));

View File

@@ -0,0 +1,68 @@
<?php
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
$conn = new createCon();
$dbh = $conn->connect();
checkKey('POST', 'token');
checkKey('POST', 'tipe');
$token = trim($_POST['token']);
$tipe = trim($_POST['tipe']);
$mahasiswa = false;
$dosen = false;
switch ($tipe) {
case 'mahasiswa': $tabel = 'mahasiswa'; $mahasiswa = true; break;
case 'dosen': $tabel = 'dosen'; $dosen = true; break;
default: echo getUnknownTypeMessage(); exit();
}
$sql = "SELECT * FROM $tabel WHERE token = :token";
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->execute();
$authorized = false;
if ($stmt->rowCount() > 0) {
$authorized = true;
}
if ($mahasiswa) {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$nim = $row['nim'];
}
}
if ($dosen) {
checkKey('POST', 'nim');
$nim = $_POST['nim'];
}
$sql = 'SELECT * FROM tugas_akhir WHERE nim = :nim ORDER BY idTugasAkhir DESC';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':nim', $nim);
$stmt->execute();
$data = array();
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$id = $row['idTugasAkhir'];
$judul = $row['judul'];
$semester = $row['semester'];
array_push($data, array(
'id' => $id,
'judul' => $judul,
'semester' => $semester,
));
}
echo json_encode(utf8ize(array(
'status' => 1,
'tugasAkhir' => $data,
)));

View File

@@ -0,0 +1,85 @@
<?php
session_start();
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
$conn = new createCon();
$dbh = $conn->connect();
checkKey('POST', 'token');
checkKey('POST', 'id');
$token = trim($_POST['token']);
$id = trim($_POST['id']);
$authorized = false;
$sql = 'SELECT * FROM tugas_akhir LEFT JOIN mahasiswa ON tugas_akhir.nim = mahasiswa.nim WHERE token = :token AND idTugasAkhir = (SELECT idTugasAkhir FROM konsultasi WHERE idKonsul = :idKonsul)';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->bindParam(':idKonsul', $id);
$stmt->execute();
if ($stmt->rowCount() > 0) {
$authorized = true;
}
if (!$authorized) {
echo getUnauthorizedMessage();
exit();
}
$sql = 'SELECT * FROM konsultasi WHERE idKonsul = :idKonsul';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':idKonsul', $id);
$stmt->execute();
$timestamp1 = 0;
$timestamp2 = 0;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$timestamp1 = intval($row['timestampDosen1']);
$timestamp2 = intval($row['timestampDosen2']);
}
if ($timestamp1 > 0 || $timestamp2 > 0) {
echo json_encode(
array(
'status' => 0,
'msg' => 'Tidak dapat menghapus data konsultasi ini, data telah di verifikasi pembimbing!!!',
)
);
exit();
}
$sql = 'DELETE FROM konsultasi WHERE idKonsul = :idKonsul';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':idKonsul', $id);
$stmt->execute();
$error = $stmt->errorInfo();
$isError = true;
if ($error[0] == '00000') {
$isError = false;
}
if ($isError) {
echo json_encode(
array(
'status' => 0,
'msg' => 'Terjadi kesalahan teknis!!!',
)
);
} else {
echo json_encode(
array(
'status' => 1,
'msg' => 'Berhasil menghapus data konsultasi!!!',
)
);
}

View File

View File

@@ -0,0 +1,211 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
session_start();
include '../../conf/function.php';
include '../../conf/class.server.php';
include '../../conf/koneksiPDO.php';
header('Content-Type: application/json');
$server = new Server();
$urlServiceSpota = $server->getSpotaServiceURL();
$urlLoginSpota = $urlServiceSpota.'/login.php';
$conn = new createCon();
$dbh = $conn->connect();
$dbhSpota = $conn->connectSpota();
checkKey('POST', 'username');
checkKey('POST', 'password');
$username = trim(strtoupper($_POST['username']));
$password = md5($_POST['password']);
$loginSuccess = false;
$pesanError = 'Username dan password tidak cocok!!!';
$redir = '';
$sql = 'SELECT * FROM tbmhs WHERE nim = :nim AND password = :password';
$stmt = $dbhSpota->prepare($sql);
$stmt->bindParam(':nim', $username);
$stmt->bindParam(':password', $password);
$stmt->execute();
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$loginSuccess = true;
$level = 'mahasiswa';
$idMhs = $row['idmhs'];
$nim = $row['nim'];
$namaMhs = $row['nmLengkap'];
$email = $row['email'];
$foto = $row['foto'];
$urlFoto = "http://spota.untan.ac.id/img/$foto";
$data = [
'id' => $idMhs,
'nim' => $nim,
'nama' => $namaMhs,
'email' => $email,
'foto' => $foto,
];
}
if (!$loginSuccess) {
$sql = 'SELECT * FROM tbdosen WHERE nip = :nip AND password = :password';
$stmt = $dbhSpota->prepare($sql);
$stmt->bindParam(':nip', $username);
$stmt->bindParam(':password', $password);
$stmt->execute();
// if($username == "123456"){
// $x = '198908192019032012';
// $sql = 'SELECT * FROM tbdosen WHERE nip = :nip';
// $stmt = $dbh->prepare($sql);
// $stmt->bindParam(':nip', $x);
// $stmt->execute();
// }
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$loginSuccess = true;
$level = 'dosen';
$idDosen = $row['iddosen'];
$nip = $row['nip'];
$nama = $row['nmLengkap'];
$email = $row['email'];
$hp = $row['nohp'];
$foto = $row['foto'];
$jenisDosen = $row['jenis'];
$kajur = false;
if ($jenisDosen == 'K') {
$kajur = true;
}
$urlFoto = "http://spota.untan.ac.id/img/$foto";
$data = [
'id' => $idDosen,
'nip' => $nip,
'nama' => $nama,
'email' => $email,
'hp' => $hp,
'foto' => $foto,
'kajur' => $kajur,
];
}
}
if($loginSuccess){
$token = $token = createToken($username);
if ($level == 'mahasiswa') {
$loginSuccess = true;
$sql = 'SELECT * FROM mahasiswa WHERE nim = :nim';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':nim', $username);
$stmt->execute();
if ($stmt->rowCount() == 0) {
$sql = 'INSERT INTO mahasiswa(idMahasiswa, nim, nama, email, token) VALUES(:idMhs, :nim, :nama, :email, :token)';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':idMhs', $data['id']);
$stmt->bindParam(':nim', $username);
$stmt->bindParam(':nama', $data['nama']);
$stmt->bindParam(':email', $data['email']);
$stmt->bindParam(':token', $token);
$stmt->execute();
} else {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$tokenDb = $row['token'];
$updateToken = false;
if ($tokenDb == null) {
$updateToken = true;
} else {
if ($tokenDb == '') {
$updateToken = true;
} else {
$token = $tokenDb;
}
}
if ($updateToken) {
$sql = 'UPDATE mahasiswa SET token = :token WHERE idMahasiswa = :id';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':id', $data['id']);
$stmt->bindParam(':token', $token);
$stmt->execute();
}
}
}
$data['token'] = $token;
$_SESSION['konsulMahasiswa'] = $data;
$redir = 'mahasiswa/';
} elseif ($level == 'dosen') {
$loginSuccess = true;
if($username === "123456"){
$username = "198908192019032012";
}
$sql = 'SELECT * FROM dosen WHERE nip = :nip';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':nip', $username);
$stmt->execute();
if ($stmt->rowCount() == 0) {
$sql = 'INSERT INTO dosen(idDosen, nip, namaDosen, email, hp, token) VALUES(:idDosen, :nip, :nama, :email, :hp, :token)';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':idDosen', $data['id']);
$stmt->bindParam(':nip', $username);
$stmt->bindParam(':nama', $data['nama']);
$stmt->bindParam(':email', $data['email']);
$stmt->bindParam(':hp', $data['hp']);
$stmt->bindParam(':token', $token);
$stmt->execute();
} else {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$tokenDb = $row['token'];
$updateToken = false;
if ($tokenDb == null) {
$updateToken = true;
} else {
if ($tokenDb == '') {
$updateToken = true;
} else {
$token = $tokenDb;
}
}
if ($updateToken) {
$sql = 'UPDATE dosen SET token = :token WHERE idDosen = :id';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':id', $data['id']);
$stmt->bindParam(':token', $token);
$stmt->execute();
}
}
}
$data['token'] = $token;
$_SESSION['konsulDosen'] = $data;
$redir = 'dosen/';
} else {
echo json_encode(array('status' => 0, 'msg' => 'Tipe login user tidak diketahui.'));
}
}
if ($loginSuccess) {
echo json_encode(array('status' => 1, 'msg' => 'Login sukses!!!', 'data' => $data, 'redir' => $redir));
} else {
echo json_encode(array('status' => 0, 'msg' => $pesanError));
}

View File

@@ -0,0 +1,185 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
session_start();
include '../../conf/function.php';
include '../../conf/class.server.php';
include '../../conf/koneksiPDO.php';
header('Content-Type: application/json');
$server = new Server();
$urlServiceSpota = $server->getSpotaServiceURL();
$urlLoginSpota = $urlServiceSpota.'/login.php';
echo $urlLoginSpota;
$conn = new createCon();
$dbh = $conn->connect();
checkKey('POST', 'username');
checkKey('POST', 'password');
$username = trim(strtoupper($_POST['username']));
$password = $_POST['password'];
$loginSuccess = false;
$pesanError = 'Username dan password tidak cocok!!!';
$postData = array(
'username' => $username,
'password' => $password,
);
$postData = http_build_query($postData);
/**
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_URL, $urlLoginSpota);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$resultJSON = curl_exec($ch);
*/
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded',
'content' => $postData
)
);
$context = stream_context_create($opts);
$resultJSON = file_get_contents($urlLoginSpota, false, $context);
$result = json_decode($resultJSON, 1);
/**
if (curl_errno($ch)) {
$error_msg = curl_error($ch);
print_r($error_msg);
}
*/
$redir = '';
if (isset($result['status'])) {
$status = $result['status'];
if ($status === 1) {
$token = $token = createToken($username);
$level = $result['level'];
$data = $result['data'];
if ($level == 'mahasiswa') {
$loginSuccess = true;
$sql = 'SELECT * FROM mahasiswa WHERE nim = :nim';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':nim', $username);
$stmt->execute();
if ($stmt->rowCount() == 0) {
$sql = 'INSERT INTO mahasiswa(idMahasiswa, nim, nama, email, token) VALUES(:idMhs, :nim, :nama, :email, :token)';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':idMhs', $data['id']);
$stmt->bindParam(':nim', $username);
$stmt->bindParam(':nama', $data['nama']);
$stmt->bindParam(':email', $data['email']);
$stmt->bindParam(':token', $token);
$stmt->execute();
} else {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$tokenDb = $row['token'];
$updateToken = false;
if ($tokenDb == null) {
$updateToken = true;
} else {
if ($tokenDb == '') {
$updateToken = true;
} else {
$token = $tokenDb;
}
}
if ($updateToken) {
$sql = 'UPDATE mahasiswa SET token = :token WHERE idMahasiswa = :id';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':id', $data['id']);
$stmt->bindParam(':token', $token);
$stmt->execute();
}
}
}
$data['token'] = $token;
$_SESSION['konsulMahasiswa'] = $data;
$redir = 'mahasiswa/';
} elseif ($level == 'dosen') {
$loginSuccess = true;
if($username === "123456"){
$username = "198908192019032012";
}
$sql = 'SELECT * FROM dosen WHERE nip = :nip';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':nip', $username);
$stmt->execute();
if ($stmt->rowCount() == 0) {
$sql = 'INSERT INTO dosen(idDosen, nip, namaDosen, email, hp, token) VALUES(:idDosen, :nip, :nama, :email, :hp, :token)';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':idDosen', $data['id']);
$stmt->bindParam(':nip', $username);
$stmt->bindParam(':nama', $data['nama']);
$stmt->bindParam(':email', $data['email']);
$stmt->bindParam(':hp', $data['hp']);
$stmt->bindParam(':token', $token);
$stmt->execute();
} else {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$tokenDb = $row['token'];
$updateToken = false;
if ($tokenDb == null) {
$updateToken = true;
} else {
if ($tokenDb == '') {
$updateToken = true;
} else {
$token = $tokenDb;
}
}
if ($updateToken) {
$sql = 'UPDATE dosen SET token = :token WHERE idDosen = :id';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':id', $data['id']);
$stmt->bindParam(':token', $token);
$stmt->execute();
}
}
}
$data['token'] = $token;
$_SESSION['konsulDosen'] = $data;
$redir = 'dosen/';
} else {
echo json_encode(array('status' => 0, 'msg' => 'Tipe login user tidak diketahui.'));
}
}
} else {
$pesanError = 'Tidak dapat terhubung ke server SPOTA.';
//spota down here
}
if ($loginSuccess) {
echo json_encode(array('status' => 1, 'msg' => 'Login sukses!!!', 'data' => $data, 'redir' => $redir));
} else {
echo json_encode(array('status' => 0, 'msg' => $pesanError));
}

View File

@@ -0,0 +1,48 @@
<?php
session_start();
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
$conn = new createCon();
$dbh = $conn->connect();
checkKey('POST', 'token');
checkKey('POST', 'email');
checkKey('POST', 'hp');
$token = trim($_POST['token']);
$email = trim($_POST['email']);
$hp = trim($_POST['hp']);
$sql = 'UPDATE mahasiswa SET email = :email, hp = :hp WHERE token = :token';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->bindParam(':email', $email);
$stmt->bindParam(':hp', $hp);
$stmt->execute();
$error = $stmt->errorInfo();
$isError = true;
if ($error[0] == '00000') {
$isError = false;
}
if ($isError) {
echo json_encode(
array(
'status' => 0,
'msg' => 'Terjadi kesalahan teknis!!!',
)
);
} else {
echo json_encode(
array(
'status' => 1,
'msg' => 'Berhasil mengubah data pribadi!!!',
)
);
}

View File

@@ -0,0 +1,77 @@
<?php
session_start();
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
$conn = new createCon();
$dbh = $conn->connect();
checkKey('POST', 'token');
checkKey('POST', 'id');
checkKey('POST', 'topik');
checkKey('POST', 'tanggal');
$token = trim($_POST['token']);
$id = trim($_POST['id']);
$topik = trim($_POST['topik']);
$tanggal = trim($_POST['tanggal']);
$authorized = false;
$sql = 'SELECT * FROM tugas_akhir LEFT JOIN mahasiswa ON tugas_akhir.nim = mahasiswa.nim WHERE token = :token AND idTugasAkhir = :idTugasAkhir';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->bindParam(':idTugasAkhir', $id);
$stmt->execute();
if ($stmt->rowCount() > 0) {
$authorized = true;
}
if (!$authorized) {
echo getUnauthorizedMessage();
exit();
}
if ($topik == '') {
echo getDataEmptyMessage();
exit();
}
$now = time();
$dateNow = date('d-m-Y', $now);
$sql = 'INSERT INTO konsultasi(tanggal, timestamp, idTugasAkhir, topik) VALUES (:tanggal, :timestamp, :idTA, :topik)';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':tanggal', $tanggal);
$stmt->bindParam(':timestamp', $now);
$stmt->bindParam(':idTA', $id);
$stmt->bindParam(':topik', $topik);
$stmt->execute();
$error = $stmt->errorInfo();
$isError = true;
if ($error[0] == '00000') {
$isError = false;
}
if ($isError) {
echo json_encode(
array(
'status' => 0,
'msg' => 'Terjadi kesalahan teknis!!!',
'error' => $error,
)
);
} else {
echo json_encode(
array(
'status' => 1,
'msg' => 'Berhasil menambah data konsultasi!!!',
)
);
}

View File

@@ -0,0 +1,143 @@
<?php
session_start();
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
checkKey('POST', 'token');
checkKey('POST', 'id');
checkKey('POST', 'verif');
checkKey('POST', 'catatan');
$token = $_POST['token'];
$id = $_POST['id'];
$verif = $_POST['verif'];
$catatan = $_POST['catatan'];
$conn = new createCon();
$dbh = $conn->connect();
$connBio = new createCon();
$dbhBio = $connBio->connectDbBio();
$connDosen = new createCon();
$dbhDosen = $connDosen->connectDbDosen();
$sql = 'SELECT * FROM dosen WHERE token = :token';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->execute();
if ($stmt->rowCount() === 0) {
echo getUnauthorizedMessage();
exit();
}
$sql = 'SELECT * FROM kerja_praktek WHERE idKerjaPraktek = :idKP';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':idKP', $id);
$stmt->execute();
$lanjutan = false;
while($row = $stmt->fetch(PDO::FETCH_ASSOC)){
$lanjutanDari = intval($row['lanjutanDari']);
if($lanjutanDari > 0){
$lanjutan = true;
}
}
if($lanjutan){
$sql = 'SELECT * FROM kerja_praktek WHERE idKerjaPraktek = :idKP';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':idKP', $lanjutanDari);
$stmt->execute();
while($row = $stmt->fetch(PDO::FETCH_ASSOC)){
$sql = 'UPDATE kerja_praktek SET setujuAdmin = :setuju, timestampSetujuAdmin = :timestamp, catatanKajur = :catatan WHERE idKerjaPraktek = :id';
$stmt1 = $dbhBio->prepare($sql);
$stmt1->bindParam(':setuju', $row['setujuAdmin']);
$stmt1->bindParam(':timestamp', $row['timestampSetujuAdmin']);
$stmt1->bindParam(':catatan', row['catatanKajur']);
$stmt1->bindParam(':id', $id);
$stmt1->execute();
}
}
$time = time();
$sql = 'UPDATE kerja_praktek SET setuju = :setuju, timestampSetuju = :timestamp, catatanPA = :catatan WHERE idKerjaPraktek = :id';
$stmt = $dbhBio->prepare($sql);
$stmt->bindParam(':setuju', $verif);
$stmt->bindParam(':timestamp', $time);
$stmt->bindParam(':catatan', $catatan);
$stmt->bindParam(':id', $id);
$stmt->execute();
$error = $stmt->errorInfo();
$isError = true;
if ($error[0] == '00000') {
$isError = false;
}
if ($isError) {
echo json_encode(
[
'status' => 0,
'msg' => 'Terjadi kesalahan teknis!!!',
]
);
} else {
if(!$lanjutan){
$sql = 'SELECT kerja_praktek.nim, nama_lengkap, topik, instansi FROM kerja_praktek LEFT JOIN bio_mahasiswa ON kerja_praktek.nim = bio_mahasiswa.nim WHERE idKerjaPraktek = :id';
$stmt = $dbhBio->prepare($sql);
$stmt->bindParam(':id', $id);
$stmt->execute();
if ($stmt->rowCount() > 0) {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$nimMahasiswa = $row['nim'];
$namaMahasiswa = $row['nama_lengkap'];
$topik = $row['topik'];
$namaInstansi = $row['instansi'];
}
$emailTo = [];
array_push($emailTo, 'tu@informatika.untan.ac.id');
//array_push($emailTo, 'apriefekon92@gmail.com');
array_push($emailTo, 'sholvariza@untan.ac.id');
$judulEmail = 'Data Kerja Praktek Baru';
$isiEmail = "Data kerja praktek mahasiswa $namaMahasiswa / $nimMahasiswa mengajukan kerja praktek dengan topik '$topik' di instansi $namaInstansi dan telah di verifikasi oleh dosen PA masing-masing.";
$ch = curl_init();
$emailParams = [];
$emailParams['to'] = json_encode($emailTo);
$emailParams['judul'] = $judulEmail;
$emailParams['content'] = $isiEmail;
$emailParams['from'] = 'system@informatika.untan.ac.id';
$postdata = $emailParams;
curl_setopt($ch, CURLOPT_URL, 'https://informatika.untan.ac.id/API/sendMail.php');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
}
}
echo json_encode(
[
'status' => 1,
'msg' => 'Berhasil melakukan verifikasi kerja praktek ini!!!',
]
);
}

View File

@@ -0,0 +1,125 @@
<?php
session_start();
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
$conn = new createCon();
$dbh = $conn->connect();
checkKey('POST', 'token');
checkKey('POST', 'id');
checkKey('POST', 'catatan');
checkKey('POST', 'tanggal');
$token = trim($_POST['token']);
$id = trim($_POST['id']);
$catatan = trim($_POST['catatan']);
$tanggal = trim($_POST['tanggal']);
$authorized = false;
$sql = 'SELECT * FROM dosen WHERE token = :token';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->execute();
if ($stmt->rowCount() > 0) {
$authorized = true;
}
if (!$authorized) {
echo getUnauthorizedMessage();
exit();
}
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$nipDosen = $row['nip'];
}
$sql = 'SELECT * FROM konsultasi LEFT JOIN tugas_akhir on konsultasi.idTugasAkhir = tugas_akhir.idTugasAkhir WHERE (pemb1 = :pemb1 OR pemb2 = :pemb2) AND idKonsul = :idKonsul';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':pemb1', $nipDosen);
$stmt->bindParam(':pemb2', $nipDosen);
$stmt->bindParam(':idKonsul', $id);
$stmt->execute();
if ($stmt->rowCount() == 0) {
echo getUnauthorizedMessage();
exit();
}
$pemb1 = false;
$pemb2 = false;
$timestampDosen = 0;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$pemb1Db = $row['pemb1'];
$pemb2Db = $row['pemb2'];
if ($pemb1Db == $nipDosen) {
$pemb1 = true;
$timestampDosen = $row['timestampDosen1'];
}
if ($pemb2Db == $nipDosen) {
$pemb2 = true;
$timestampDosen = $row['timestampDosen2'];
}
}
/**
if ($timestampDosen > 0) {
echo json_encode(
array(
'status' => 1,
'msg' => 'Berhasil melakukan verifikasi konsultasi ini!!!',
)
);
exit();
}
*/
$now = time();
if ($pemb1) {
$sql = 'UPDATE konsultasi SET tanggal = :tanggal, timestampDosen1 = :timestamp, catatanDosen1 = :catatan WHERE idKonsul = :idKonsul';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':tanggal', $tanggal);
$stmt->bindParam(':timestamp', $now);
$stmt->bindParam(':catatan', $catatan);
$stmt->bindParam(':idKonsul', $id);
$stmt->execute();
}
if ($pemb2) {
$sql = 'UPDATE konsultasi SET tanggal = :tanggal, timestampDosen2 = :timestamp, catatanDosen2 = :catatan WHERE idKonsul = :idKonsul';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':tanggal', $tanggal);
$stmt->bindParam(':timestamp', $now);
$stmt->bindParam(':catatan', $catatan);
$stmt->bindParam(':idKonsul', $id);
$stmt->execute();
}
$error = $stmt->errorInfo();
$isError = true;
if ($error[0] == '00000') {
$isError = false;
}
if ($isError) {
echo json_encode(
array(
'status' => 0,
'msg' => 'Terjadi kesalahan teknis!!!',
)
);
} else {
echo json_encode(
array(
'status' => 1,
'msg' => 'Berhasil melakukan verifikasi konsultasi ini!!!',
)
);
}

View File

@@ -0,0 +1,96 @@
<?php
session_start();
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
$conn = new createCon();
$dbh = $conn->connect();
$connBio = new createCon();
$dbhBio = $connBio->connectDbBio();
checkKey('POST', 'token');
checkKey('POST', 'id');
checkKey('POST', 'catatan');
checkKey('POST', 'tanggal');
$token = trim($_POST['token']);
$id = trim($_POST['id']);
$catatan = trim($_POST['catatan']);
$tanggal = trim($_POST['tanggal']);
$authorized = false;
$sql = 'SELECT * FROM dosen WHERE token = :token';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->execute();
if ($stmt->rowCount() > 0) {
$authorized = true;
}
if (!$authorized) {
echo getUnauthorizedMessage();
exit();
}
$sql = 'SELECT * FROM konsultasi_kp WHERE idKonsul = :idKonsul';
$stmt = $dbhBio->prepare($sql);
$stmt->bindParam(':idKonsul', $id);
$stmt->execute();
if ($stmt->rowCount() == 0) {
echo getUnauthorizedMessage();
exit();
}
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$timestampDosen = $row['timestampVerif'];
}
if ($timestampDosen > 0) {
echo json_encode(
array(
'status' => 1,
'msg' => 'Berhasil melakukan verifikasi konsultasi ini!!!',
)
);
exit();
}
$now = time();
$sql = 'UPDATE konsultasi_kp SET tanggal = :tanggal, timestampVerif = :timestamp, catatanDosen = :catatan WHERE idKonsul = :idKonsul';
$stmt = $dbhBio->prepare($sql);
$stmt->bindParam(':tanggal', $tanggal);
$stmt->bindParam(':timestamp', $now);
$stmt->bindParam(':catatan', $catatan);
$stmt->bindParam(':idKonsul', $id);
$stmt->execute();
$error = $stmt->errorInfo();
$isError = true;
if ($error[0] == '00000') {
$isError = false;
}
if ($isError) {
echo json_encode(
array(
'status' => 0,
'msg' => 'Terjadi kesalahan teknis!!!',
)
);
} else {
echo json_encode(
array(
'status' => 1,
'msg' => 'Berhasil melakukan verifikasi konsultasi ini!!!',
)
);
}

View File

@@ -0,0 +1,110 @@
<?php
session_start();
include '../../conf/koneksiPDO.php';
include '../../conf/function.php';
header('Content-Type: application/json');
checkKey('POST', 'token');
checkKey('POST', 'id');
checkKey('POST', 'verif');
checkKey('POST', 'catatan');
$token = $_POST['token'];
$id = $_POST['id'];
$verif = $_POST['verif'];
$catatan = $_POST['catatan'];
$conn = new createCon();
$dbh = $conn->connect();
$connBio = new createCon();
$dbhBio = $connBio->connectDbBio();
$connDosen = new createCon();
$dbhDosen = $connDosen->connectDbDosen();
$sql = 'SELECT * FROM dosen WHERE token = :token';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':token', $token);
$stmt->execute();
if ($stmt->rowCount() === 0) {
echo getUnauthorizedMessage();
exit();
}
$time = time();
$sql = 'UPDATE kerja_praktek SET proposalApproved = :setuju, timestampApproved = :timestamp, catatanRevisiProposal = :catatan WHERE idKerjaPraktek = :id';
$stmt = $dbhBio->prepare($sql);
$stmt->bindParam(':setuju', $verif);
$stmt->bindParam(':timestamp', $time);
$stmt->bindParam(':catatan', $catatan);
$stmt->bindParam(':id', $id);
$stmt->execute();
$error = $stmt->errorInfo();
$isError = true;
if ($error[0] == '00000') {
$isError = false;
}
if ($isError) {
echo json_encode(
[
'status' => 0,
'msg' => 'Terjadi kesalahan teknis!!!',
]
);
} else {
$sql = 'SELECT kerja_praktek.nim, nama_lengkap, topik, instansi FROM kerja_praktek LEFT JOIN bio_mahasiswa ON kerja_praktek.nim = bio_mahasiswa.nim WHERE idKerjaPraktek = :id';
$stmt = $dbhBio->prepare($sql);
$stmt->bindParam(':id', $id);
$stmt->execute();
if ($stmt->rowCount() > 0) {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$nimMahasiswa = $row['nim'];
$namaMahasiswa = $row['nama_lengkap'];
$topik = $row['topik'];
$namaInstansi = $row['instansi'];
}
$emailTo = [];
array_push($emailTo, 'tu@informatika.untan.ac.id');
//array_push($emailTo, 'apriefekon92@gmail.com');
array_push($emailTo, 'sholvariza@untan.ac.id');
$judulEmail = 'Verifikasi Proposal oleh dosen pembimbing KP';
$isiEmail = "Proposal kerja praktek mahasiswa $namaMahasiswa / $nimMahasiswa telah di verifikasi oleh dosen KP masing-masing.";
$ch = curl_init();
$emailParams = [];
$emailParams['to'] = json_encode($emailTo);
$emailParams['judul'] = $judulEmail;
$emailParams['content'] = $isiEmail;
$emailParams['from'] = 'system@informatika.untan.ac.id';
$postdata = $emailParams;
curl_setopt($ch, CURLOPT_URL, 'https://informatika.untan.ac.id/API/sendMail.php');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
}
echo json_encode(
[
'status' => 1,
'msg' => 'Berhasil melakukan verifikasi kerja praktek ini!!!',
]
);
}

View File

@@ -0,0 +1,11 @@
<?php
session_start();
if (isset($_SESSION['konsulDosen'])) {
$_SESSION['konsulDosen'] = $_SESSION['konsulDosen'];
}
if (isset($_SESSION['konsulMahasiswa'])) {
$_SESSION['konsulMahasiswa'] = $_SESSION['konsulMahasiswa'];
}