menambah field anggota pada tb_penelitian dan tb_laporan, memperbaiki tampilan untuk melihat penelitian, menambah tampilan mahasiswa, memperbaiki proses menampilkan gambar profil

This commit is contained in:
cowrie committed 2026-11-18 04:57:55 +08:00
1 parent 400e05adec
commit 4b7b08400a
19 files changed
+2332 -232

No files matched your search

+29 -13
View File
@@ -7,6 +7,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>Aplikasi Penelitian Dosen - Halaman Utama Dosen</title>
<link rel="icon" href="assets/images/icon.png" type="image/x-icon">
<script>
(async function checkAuth() {
const dosenId = localStorage.getItem('dosen_id');
@@ -312,20 +314,34 @@
}
$(document).ready(function () {
const dosenName = localStorage.getItem('dosen_name');
const dosenId = localStorage.getItem('dosen_id');
const dosenName = localStorage.getItem('dosen_name');
if (dosenName) document.getElementById('dosenName').textContent = dosenName;
// Fetch current profile image
$.get(`/api/dosen`, function (data) {
const dosen = data.find(d => d.dosen_id === dosenId);
if (dosen && dosen.dosen_image) {
const imgUrl = `/api/images/dosen/${dosen.dosen_image}`;
$('#profileImagePreview').attr('src', imgUrl);
$('#foto_dosen').attr('src', imgUrl);
}
});
console.log("Dosen ID:", dosenId, "Dosen Name:", dosenName);
// Fetch current profile image using the FAST single-record API
if (dosenId) {
$.get(`/api/dosen/cek/${dosenId}`, function (dosen) {
console.log("Fetched dosen data:", dosen);
console.log("Dosen Image:", dosen.dosen_image);
if (dosen && dosen.dosen_image) {
const imgUrl = `/api/images/dosen/${dosen.dosen_image}?t=${new Date().getTime()}`;
$('#profileImagePreview').attr('src', imgUrl);
$('#foto_dosen').attr('src', imgUrl);
}
}).fail(function (xhr) {
console.error("Gagal memuat data dosen:", xhr.responseJSON?.error);
// If the ID is invalid, log them out
if (xhr.status === 404) {
swal("Sesi Berakhir", "Data dosen tidak ditemukan. Silakan login kembali.", "warning");
setTimeout(() => {
localStorage.clear();
window.location.href = 'index.html';
}, 2000);
}
});
}
// Fetch Data for Stats and Last Update
$.ajax({
@@ -374,8 +390,8 @@
container.append(`
<div style="margin-bottom: 15px;">
<h5 style="margin-top: 0; font-weight: bold; color: #333; line-height: 1.4;">${latestUpdateItem.judul_penelitian}</h5>
<p style="font-size: 13px; color: #555; text-align: justify; margin-bottom: 10px;">
<i class="fa fa-users"></i> ${latestUpdateItem.anggota ? JSON.parse(latestUpdateItem.anggota).join(', ') : '-'} <br>
<p style="font-size: 13px; color: #555; text-align: justify; margin-bottom: 10px; margin-top: 5px;">
${keteranganText}
</p>