INNER CODE UNIT · Python
_generate_html_report
infobyte/emploleaks · emploleaks.py:690
def _generate_html_report(self, filename, use_ai=False):
"""Generate a modular dashboard HTML report with tabs for each data category."""
cur = self.local_conn.cursor()
esc = self._html_escape
cur.execute("""
SELECT e.employee_id, e.name, e.title, e.profile_photo_url, e.department
FROM employees e WHERE e.company_id = ? ORDER BY e.name
""", (self.company_id,))
employees = cur.fetchall()
if not employees:
log.info("No employees found for this company.")
cur.close()
return
has_departments = any(emp['department'] for emp in employees)