Record Title: ${recordTitle}
Record Type: ${recordType}
Date Created: ${recordDate}
Created By: ${createdBy}
Description: ${description}

`; html += `
Category Score Status
Retention & Access Controls ${retention.count} / ${retention.total} ${retentionRating.text}
Compliance Checklist ${compliance.count} / ${compliance.total} ${complianceRating.text}
`; summaryOutput.innerHTML = html; } function generatePDF() { const recordTitle = document.getElementById("recordTitle").value.trim() || "N/A"; const recordType = document.getElementById("recordType").value || "N/A"; const recordDate = document.getElementById("recordDate").value || "N/A"; const createdBy = document.getElementById("createdBy").value.trim() || "N/A"; const description = document.getElementById("description").value.trim() || "N/A"; const retention = countChecked("controls"); const compliance = countChecked("compliance"); const dateNow = new Date().toLocaleDateString(); function loadJsPDF(callback) { if (window.jspdf) return callback(); const script = document.createElement("script"); script.src = "https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"; script.onload = callback; document.head.appendChild(script); } loadJsPDF(() => { const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFont("helvetica"); doc.setFontSize(18); doc.setTextColor("#003366"); doc.text("Legal Record Keeping System Report", 14, 20); doc.setFontSize(12); doc.setTextColor("#000"); doc.text(`Report Date: ${dateNow}`, 14, 30); doc.text(`Record Title: ${recordTitle}`, 14, 38); doc.text(`Record Type: ${recordType}`, 14, 46); doc.text(`Date Created: ${recordDate}`, 14, 54); doc.text(`Created By: ${createdBy}`, 14, 62); doc.setFontSize(14); doc.text("Description:", 14, 72); const descLines = doc.splitTextToSize(description, 180); doc.setFontSize(11); doc.text(descLines, 14, 80); let y = 80 + descLines.length * 7 + 10; doc.setFontSize(14); doc.text("Retention & Access Controls:", 14, y); y += 7; doc.setFontSize(11); doc.text(`Items Checked: ${retention.count} of ${retention.total}`, 14, y); y += 10; doc.setFontSize(14); doc.text("Compliance Checklist:", 14, y); y += 7; doc.setFontSize(11); doc.text(`Items Checked: ${compliance.count} of ${compliance.total}`, 14, y); doc.save("Legal_Record_Keeping_Report.pdf"); }); } nextBtn.addEventListener("click", () => { if (currentTab === tabs.length - 1) { currentTab = 0; } else if (currentTab === tabs.length - 2) { displaySummary(); currentTab++; } else { currentTab++; } showTab(currentTab); }); prevBtn.addEventListener("click", () => { if (currentTab > 0) { currentTab--; showTab(currentTab); } }); downloadPDFBtn.addEventListener("click", generatePDF); function showTab(index) { tabs.forEach((tab, i) => { tab.style.display = i === index ? "block" : "none"; }); prevBtn.style.display = index === 0 ? "none" : "inline-block"; if (index === tabs.length - 1) { nextBtn.textContent = "Restart"; downloadPDFBtn.style.display = "inline-block"; } else { nextBtn.textContent = "Next ⟶"; downloadPDFBtn.style.display = "none"; } } showTab(currentTab); });
Scroll to Top