Perpus SMK2 Balige
Dashboard Data Kelas Data Buku Data Anggota Riwayat Peminjaman Laporan
Dashboard Data Kelas Data Buku Data Anggota Riwayat Peminjaman Laporan
© 2024 SMK Negeri 2 Balige - Perpustakaan Digital. All rights reserved.

Data Anggota

Laporan ${type.charAt(0).toUpperCase() + type.slice(1)}

${Object.keys(data[0]).map(col => ``).join('')} ${data.map(row => ` ${Object.values(row).map(cell => ``).join('')} `).join('')}
${col}
${cell}
`); printWindow.document.close(); } } // ---------------------------------------------- // ROUTING MANAGEMENT // ---------------------------------------------- // Map routes to render functions const routes = { '/login': renderLogin, '/dashboard': renderDashboard, '/kelas': renderPageDataKelas, '/buku': renderPageDataBuku, '/anggota': renderPageDataAnggota, '/riwayat': renderPageRiwayatPeminjaman, '/laporan': renderPageLaporan, }; function router() { let path = window.location.hash.replace('#', '') || '/login'; // Initial setup dummy data if user logged in initializeDummyData(); if(!authGuard(path)) return; if(routes[path]) { routes[path](); } else { // 404 fallback - redirect to dashboard or login if(isLoggedIn()){ window.location.hash = '#/dashboard'; } else { window.location.hash = '#/login'; } } } // Run router on load and hash changes window.addEventListener('hashchange', () => { router(); // After render, focus main content for accessibility setTimeout(() => { const main = document.getElementById('main-content'); if(main) main.focus(); }, 100); }); window.addEventListener('load', () => { router(); });