diff --git a/app.py b/app.py index a43d409..01f48ee 100644 --- a/app.py +++ b/app.py @@ -10948,13 +10948,32 @@ def time_attendance_records(): unique_employees = TimeAttendance.get_unique_employees() unique_locations = TimeAttendance.get_unique_locations() projects = Project.query.filter_by(active_status=True).order_by(Project.name).all() - + + # Resolve display name for the employee filter input + employee_display_name = '' + if employee_filter: + try: + import re as _re + numeric_only = _re.search(r'\d+', str(employee_filter)) + if numeric_only: + emp = Employee.query.filter_by(id=int(numeric_only.group(0))).first() + if emp: + employee_display_name = f"{emp.lastName}, {emp.firstName}" + else: + employee_display_name = f"ID: {employee_filter}" + else: + employee_display_name = f"ID: {employee_filter}" + except (ValueError, TypeError): + employee_display_name = employee_filter + return render_template( 'time_attendance_records.html', records=records, unique_employees=unique_employees, unique_locations=unique_locations, - projects=projects + projects=projects, + employee_display_name=employee_display_name, + employee_filter=employee_filter or '' ) except Exception as e: diff --git a/templates/time_attendance_records.html b/templates/time_attendance_records.html index 2b49093..72b6a34 100644 --- a/templates/time_attendance_records.html +++ b/templates/time_attendance_records.html @@ -3,6 +3,53 @@ {% block extra_head %} + {% endblock %} {% block content %} @@ -55,15 +102,28 @@