PACKAGE LOG1 - PHONE OR EMAIL LOGIN

Purpose
- Staff can log in using phone number or email.
- Phone number is preferred.
- Existing app.js remains compatible because it still posts the field named "email".
- Backend now treats that field as a generic login identity.

Files
- /api/login.php
- /attendance/log1-apply-login-label.php
- /sql/verify-log1-phone-login-readiness.sql
- /README-LOG1.txt

Extract inside
- /home/uent/public_html

What changes
1) /api/login.php
   - Accepts identity from:
     identity
     email
     phone
   - Tries phone number first when input looks like a phone.
   - Falls back to email.
   - Normalises South African phone numbers:
     0821234567 -> 27821234567
     +27821234567 -> 27821234567
     27821234567 -> 27821234567
     082 123 4567 -> 27821234567
   - Blocks login if one phone number matches more than one active user.

2) Optional login screen label patch
   Open once:
   https://uent.co.za/attendance/log1-apply-login-label.php?secret=westcoast-log1-2026

   This changes attendance/index.html:
   Email -> Phone number or email
   input type email -> text
   placeholder -> Phone number or email

   It creates a backup:
   index.html.log1-backup-YYYYMMDDHHMMSS

   After using it, delete:
   /attendance/log1-apply-login-label.php

Testing
- Login with phone:
  082xxxxxxx
  +2782xxxxxxx
  2782xxxxxxx

- Login with email:
  staff@email.com

Important
- You already checked duplicate phone numbers in uent_Attendance and it returned zero rows.
- If new staff are added later, keep phone numbers unique for active users.
