async function loadInquiries() { initStickyHeader(); const pmType = document.getElementById('filterPmType').value; const category = document.getElementById('filterCategory').value; const status = document.getElementById('filterStatus').value; const keyword = document.getElementById('searchKeyword').value; const params = new URLSearchParams({ pm_type: pmType, category: category, keyword: keyword }); try { const response = await fetch(`/api/inquiries?${params}`); const data = await response.json(); updateStats(data); const filteredData = status ? data.filter(item => item.status === status) : data; renderInquiryList(filteredData); } catch (e) { console.error("데이터 로딩 중 오류 발생:", e); } } function initStickyHeader() { const header = document.getElementById('stickyHeader'); const thead = document.querySelector('.inquiry-table thead'); if (header && thead) { const headerHeight = header.offsetHeight; const totalOffset = 36 + headerHeight; document.querySelectorAll('.inquiry-table thead th').forEach(th => { th.style.top = totalOffset + 'px'; }); } } function renderInquiryList(data) { const tbody = document.getElementById('inquiryList'); tbody.innerHTML = data.map(item => `