Smart Attendance is an integrated web platform for employee check-in and check-out, built with PHP and MySQL. It runs in the browser as a PWA and exposes a mobile API. Platform: smart.aismisr.net — Arabic RTL interface, Africa/Cairo timezone.
Overview
The core idea is to tie attendance to:
- GPS coordinates and location accuracy
- A defined geofence around the branch or worksite
- Selfie capture on check-in/out (configurable)
- Live location tracking during open sessions
- Management dashboards and reports
Ideal for organizations with multiple branches, field staff (hotline, drug screening, awareness teams...), and a need to prove where employees were — not just when.
Problems It Solves
Traditional Attendance
- Paper or fingerprint without location proof → GPS + geofence binding
- Attendance fraud from another location → geofence + selfie + event log
- No real-time visibility → monitoring dashboard + live map + today's attendance
- Hard monthly aggregation → printable PDF reports
Field & Multi-Site Staff
- Multiple worksites → multi-branch support and place_note
- Multiple daily sessions → configurable limits per department/branch
- Different work radius → per-department geofence settings
Leaving the Work Zone
- Unauthorized departure → out-of-geofence detection + alerts + unauthorized_exits log
- Auto checkout after staying outside → outside_auto_checkout_minutes
- Auto checkout on GPS silence → gps_silence_auto_checkout_minutes
Admin Dashboard
The main dashboard shows KPIs: attendance rate, today's check-ins, monthly progress, and weekly attendance charts — with LIVE updates and tabs for overview cards, map, and analytics.
Live Monitoring & Map
The Employee Monitoring screen shows status cards (present, checked out, out of range, exit permit, online now) with an interactive Leaflet/OpenStreetMap — color-coded markers for each status.
The Live Map displays all branches and check-in points across Egypt — with auto location refresh, branch counters, and real-time attendance status. Employee route tracking (polyline from location_pings) with live polling and WhatsApp contact button.
The Employee Track screen shows an open session (LIVE) with check-in location on the map, geocoded address, check-in time, session status, and a direct WhatsApp button — with GPS route tracking (location_pings) throughout the day.
For Employees (PWA / Web)
- Check-in with GPS + accuracy + selfie + place note
- Check-out from anywhere with coordinates logged
- Periodic ping during open session (inside/outside_geofence)
- Short permits and exit permits (configurable)
- Employee dashboard + internal chat + profile
For Management
- Today's attendance — instant view with branch/department/employee filters
- Reports: employee summary, session detail, daily summary, locations — PDF with logo
- Branch/user management and department settings (geofence, session limits, auto checkout)
- Exit permit review and unauthorized exit handling
- System log (system_logs) + permissions guide + impersonation for support
Mobile API
REST-like endpoints: api_login, api_me, api_checkin, api_checkout, api_ping, api_permission, api_exit_permit_return, api_session — with expiring api_tokens.
User Roles
- super_admin — full access
- technician — monitoring, reports, support
- branch_admin — branch-level management
- employee — attendance, ping, chat
Technology Stack
- Backend: PHP 8+, PDO/MySQL
- Frontend: HTML/CSS/JS, Cairo font, RTL
- Maps: Leaflet.js + OpenStreetMap
- Geocoding: Nominatim + Photon
- Web sessions + API tokens for mobile
Supported Departments
hotline, drug_screening, awareness, other — each with independent settings: max_sessions_per_day, geofence_radius_meters, outside_auto_checkout_minutes.
Business Benefits
- ✓ GPS-proven check-in/out location
- ✓ Real-time field staff monitoring on a map
- ✓ Live movement route tracking during the day
- ✓ Monthly reports: sessions and work days per employee
- ✓ Unauthorized exit detection and auto checkout
- ✓ Multi-branch + permissions + audit trail
Important Considerations
- Depends on device GPS — accuracy varies by environment
- Geocoding via OpenStreetMap may be approximate
- Requires internet for attendance and monitoring
- Photos and pings increase storage over time