From c32cb403330f50ca20406c54d1c787ce079afcfd Mon Sep 17 00:00:00 2001 From: Nguyen Ngo Date: Sat, 27 Dec 2025 10:43:18 -0500 Subject: [PATCH] Update verification review detail with correct info --- app.py | 26 +- templates/verification_review_detail.html | 524 +++++++++++----------- 2 files changed, 288 insertions(+), 262 deletions(-) diff --git a/app.py b/app.py index 5ea097b..c4a69b5 100644 --- a/app.py +++ b/app.py @@ -5552,6 +5552,22 @@ def verification_review_detail(record_id): # Get the QR code information for additional context qr_code = QRCode.query.get(record.qr_code_id) if record.qr_code_id else None + # Get employee name from Employee table + employee_name = None + try: + if record.employee_id: + employee = Employee.query.filter_by(id=int(record.employee_id)).first() + if employee: + employee_name = f"{employee.lastName}, {employee.firstName}" + else: + employee_name = f"Unknown (ID: {record.employee_id})" + except (ValueError, TypeError) as e: + logger_handler.logger.warning(f"Could not lookup employee name for ID {record.employee_id}: {e}") + employee_name = f"Unknown (ID: {record.employee_id})" + + # Get event type from QR code (Check In/Check Out) + location_event = qr_code.location_event if qr_code and qr_code.location_event else 'N/A' + # Log the access for audit trail logger_handler.logger.info( f"User {session.get('username')} ({session.get('role')}) " @@ -5570,10 +5586,12 @@ def verification_review_detail(record_id): check_in_time = str(record.check_in_time) if record.check_in_time else 'N/A' return render_template('verification_review_detail.html', - record=record, - qr_code=qr_code, - check_in_date=check_in_date, - check_in_time=check_in_time) + record=record, + qr_code=qr_code, + check_in_date=check_in_date, + check_in_time=check_in_time, + employee_name=employee_name, + location_event=location_event) except Exception as e: logger_handler.logger.error(f"Error loading verification review detail: {e}") diff --git a/templates/verification_review_detail.html b/templates/verification_review_detail.html index b8b3ebe..dc0b61b 100644 --- a/templates/verification_review_detail.html +++ b/templates/verification_review_detail.html @@ -1,53 +1,50 @@ -{% extends "base_authenticated.html" %} - -{% block title %}Verification Review - QR Code Management{% endblock %} - -{% block extra_head %} +{% extends "base_authenticated.html" %} {% block title %}Verification Review - +QR Code Management{% endblock %} {% block extra_head %} -{% endblock %} - -{% block content %} +{% endblock %} {% block content %}
- -
-

- - Verification Photo Review -

-

Review and approve/reject employee verification photo for off-site check-in

+ +
+

+ + Verification Photo Review +

+

+ Review and approve/reject employee verification photo for off-site + check-in +

+
+ + + {% if record.verification_status != 'pending' %} +
+ + This verification has already been {{ record.verification_status + }}. +
+ {% endif %} + + +
+ +
+

+ + Employee Information +

+
+ Employee ID + {{ record.employee_id }} +
+
+ Employee Name + {{ employee_name or 'Unknown' }} +
+
+ Check-in Date + {{ check_in_date }} +
+
+ Check-in Time + {{ check_in_time }} +
+
+ Status + + + {{ record.verification_status.upper() }} + + +
- - {% if record.verification_status != 'pending' %} -
- - This verification has already been {{ record.verification_status }}. -
- {% endif %} - - -
- -
-

- - Employee Information -

-
- Employee ID - {{ record.employee_id }} -
-
- Employee Name - {{ record.employee_name or 'Unknown' }} -
-
- Check-in Date - {{ check_in_date }} -
-
- Check-in Time - {{ check_in_time }} -
-
- Status - - - {{ record.verification_status.upper() }} - - -
-
- - -
-

- - Location Information -

-
- Location Name - {{ record.location_name or 'Unknown' }} -
-
- Event - {{ record.location_event or 'N/A' }} -
-
- Distance from QR - - {% if record.location_accuracy %} - {% if record.location_accuracy > 0.5 %} - {{ "%.3f"|format(record.location_accuracy) }} miles - {% elif record.location_accuracy > 0.2 %} - {{ "%.3f"|format(record.location_accuracy) }} miles - {% else %} - {{ "%.3f"|format(record.location_accuracy) }} miles - {% endif %} - {% else %} - N/A - {% endif %} - -
-
- QR Address - {{ qr_code.address if qr_code else 'N/A' }} -
-
- Check-in Address - {{ record.address or 'N/A' }} -
-
- Device - {{ record.device_info or 'Unknown' }} -
-
- - -
-

- - Verification Photo -

- {% if record.verification_photo %} - Verification Photo for {{ record.employee_id }} - {% else %} -
- -

No Photo Available

-

This record does not have a verification photo.

-
- {% endif %} -
+ +
+

+ + Location Information +

+
+ Location Name + {{ record.location_name or 'Unknown' }} +
+
+ Event + {{ location_event or 'N/A' }} +
+
+ Distance from QR + + {% if record.location_accuracy %} {% if record.location_accuracy > 0.5 + %} + {{ "%.3f"|format(record.location_accuracy) }} miles + {% elif record.location_accuracy > 0.2 %} + {{ "%.3f"|format(record.location_accuracy) }} miles + {% else %} + {{ "%.3f"|format(record.location_accuracy) }} miles + {% endif %} {% else %} N/A {% endif %} + +
+
+ QR Address + {{ qr_code.address if qr_code else 'N/A' }} +
+
+ Check-in Address + {{ record.address or 'N/A' }} +
+
+ Device + {{ record.device_info or 'Unknown' }} +
- - {% if record.verification_status == 'pending' %} -
- - - - - Back to Attendance - + +
+

+ + Verification Photo +

+ {% if record.verification_photo %} + Verification Photo for {{ record.employee_id }} + {% else %} +
+ +

No Photo Available

+

This record does not have a verification photo.

+
+ {% endif %}
- {% else %} - - {% endif %} +
+ + + {% if record.verification_status == 'pending' %} +
+ + + + + Back to Attendance + +
+ {% else %} + + {% endif %}
-{% endblock %} \ No newline at end of file +{% endblock %}