Government Regulatory Law Compliance Audit System

Government Regulatory Law Compliance Audit System

A guided self-audit tool for key U.S. regulatory frameworks.

Configure Your Audit

Compliance Checklist

0%

Audit Report

Disclaimer: This tool is for informational and self-assessment purposes only. It is not a substitute for professional legal or compliance advice. Consult with a qualified expert for guidance on your specific situation.

${index + 1}. ${item.q}

`).join(''); container.querySelectorAll('input[type="radio"]').forEach(radio => { radio.addEventListener('change', updateProgress); }); updateProgress(); } function updateProgress() { const regulation = document.getElementById('regulation-select').value; const totalQuestions = auditData[regulation].questions.length; const answeredQuestions = document.querySelectorAll('#checklist-container input[type="radio"]:checked').length; const percentage = totalQuestions > 0 ? Math.round((answeredQuestions / totalQuestions) * 100) : 0; document.getElementById('progress-bar').style.width = `${percentage}%`; document.getElementById('progress-text').textContent = `${percentage}%`; } // --- Report Generation --- function generateReport() { const regulation = document.getElementById('regulation-select').value; const data = auditData[regulation]; const subject = document.getElementById('audit-subject').value; const results = []; data.questions.forEach((item, index) => { const checked = document.querySelector(`input[name="q${index}"]:checked`); results.push({ question: item.q, answer: checked ? checked.value : 'unanswered', recommendation: item.r }); }); const yesCount = results.filter(r => r.answer === 'yes').length; const applicableCount = results.filter(r => r.answer === 'yes' || r.answer === 'no').length; const score = applicableCount > 0 ? Math.round((yesCount / applicableCount) * 100) : 100; let riskLevel, riskColor; if (score >= 90) { riskLevel = "Low"; riskColor = "text-green-600"; } else if (score >= 60) { riskLevel = "Medium"; riskColor = "text-yellow-600"; } else { riskLevel = "High"; riskColor = "text-red-600"; } const nonCompliantItems = results.filter(r => r.answer === 'no').map(item => `
  • ${item.question}

    Recommendation: ${item.recommendation}

  • ` ).join(''); const reportHTML = `
    Compliance Score
    ${score}%
    Risk Level
    ${riskLevel}

    Audit Subject: ${subject}

    Framework: ${data.name}

    Date: ${new Date().toLocaleDateString('en-US')}

    Areas for Review

      ${nonCompliantItems || "
    • No immediate areas for review identified based on responses.
    • "}
    `; document.getElementById('report-output').innerHTML = reportHTML; } // --- PDF Download --- const downloadPdfBtn = document.getElementById('download-pdf-btn'); async function downloadPDF() { const { jsPDF } = window.jspdf; const pdfPreview = document.getElementById('pdf-preview'); const container = document.getElementById('pdf-container'); const reportContent = document.getElementById('report-output').innerHTML; pdfPreview.innerHTML = `

    Compliance Audit Report

    ${reportContent} `; downloadPdfBtn.textContent = 'Generating...'; downloadPdfBtn.disabled = true; container.classList.remove('hidden'); container.style.position = 'absolute'; container.style.left = '-9999px'; container.style.top = '0'; try { const canvas = await html2canvas(pdfPreview, { scale: 2 }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const margin = 40; const usableWidth = pdfWidth - margin * 2; const imgScaledHeight = (canvas.height * usableWidth) / canvas.width; pdf.addImage(imgData, 'PNG', margin, margin, usableWidth, imgScaledHeight); pdf.save('Compliance-Audit-Report.pdf'); } catch (error) { console.error("Error generating PDF:", error); } finally { container.classList.add('hidden'); container.style.position = ''; container.style.left = ''; container.style.top = ''; downloadPdfBtn.textContent = 'Download PDF Report'; downloadPdfBtn.disabled = false; pdfPreview.innerHTML = ''; } } downloadPdfBtn.addEventListener('click', downloadPDF); // --- Initial Load --- updateDisplay(); });
    Scroll to Top