Skip to main content
Skip to footer
Home Publikasi Direktori Skripsi (Cek judul) Direktori Skripsi (Cek judul)
document.addEventListener('DOMContentLoaded', function() {
const csvUrl = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQRsMMfualScVhiKw8xylAAwvXNqxH9_v8qYDGjeJ2CxrZ3NpqJGoh2JmeRwJMP1bISovXGeHX_NOHm/pub?gid=2054449473&single=true&output=csv';
const searchInput = document.getElementById('searchInput');
const csvTable = document.getElementById('csvTable').getElementsByTagName('tbody')[0];
fetch(csvUrl)
.then(response => response.text())
.then(data => {
const rows = data.split('n').slice(1); // Menghapus header
rows.forEach(row => {
const cells = row.split(',');
const tr = document.createElement('tr');
cells.forEach(cell => {
const td = document.createElement('td');
td.innerText = cell;
tr.appendChild(td);
});
csvTable.appendChild(tr);
});
});
searchInput.addEventListener('keyup', function() {
const filter = searchInput.value.toLowerCase();
const rows = csvTable.getElementsByTagName('tr');
for (let i = 0; i < rows.length; i++) {
let cells = rows[i].getElementsByTagName('td');
let showRow = false;
for (let j = 0; j < cells.length; j++) {
if (cells[j].innerText.toLowerCase().indexOf(filter) > -1) {
showRow = true;
break;
}
}
rows[i].style.display = showRow ? '' : 'none';
}
});
});