Download | Attendance Management System
table width: 100%; border-collapse: collapse; font-size: 0.85rem;
// simple escape for XSS safety function escapeHtml(str) if (!str) return ''; return str.replace(/[&<>]/g, function(m) if (m === '&') return '&'; if (m === '<') return '<'; if (m === '>') return '>'; return m; ).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, function(c) return c; ); download attendance management system
.status-absent background: #ffe6e5; color: #b91c1c; table width: 100%; border-collapse: collapse; font-size: 0
.status-present background: #dff9e6; color: #11734c; table width: 100%
// Download buttons document.getElementById('downloadCsvBtn').addEventListener('click', downloadCSV); document.getElementById('downloadJsonBtn').addEventListener('click', downloadJSON); document.getElementById('resetDemoBtn').addEventListener('click', () => if (confirm("Reset all data to demo employees & today's sample attendance? Current records will be lost.")) resetToDemo(); ); ); </script> </body> </html>
// ---------- EXPORT FUNCTIONS: CSV / JSON (full attendance + employees) ---------- function generateFullReportData() const data = loadData(); const employees, attendanceRecords = data; // enrich each attendance record with employee name const enriched = attendanceRecords.map(rec => const emp = employees.find(e => e.id === rec.employeeId); return employeeId: rec.employeeId, employeeName: emp ? emp.name : 'Unknown', date: rec.date, status: rec.status, timestamp: rec.timestamp ; ); return employees, attendanceDetails: enriched ;
button background: #1f5e7e; border: none; padding: 10px 20px; border-radius: 40px; font-weight: 600; color: white; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: 0.2s; font-size: 0.85rem; box-shadow: 0 2px 5px rgba(0,0,0,0.1);