How claire-mata/control_asistencia works
1. What this system is
- Control_Asistencia is a monolithic PHP + MySQL web application for employee attendance control.
- The app is organized around server-rendered pages, form submissions, and a shared database schema (empleados.sql), rather than a separate API/backend frontend split.
2. Main runtime and storage
- PHP handles authentication, CRUD, attendance marking, and report generation.
- MySQL is the persistent store, with the schema defined in empleados.sql.
- The app likely runs in a classic LAMP-style deployment, with no evidence of a framework.
3. Core architectural boundary: login/session control
- login.php is the entry entry point for authentication.
- salir.php handles session termination.
- index.php and admin_ventana.php appear to be post-login landing pages for different roles.
- The README explicitly indicates an administrator account (ADMIN / admin), so role-based access is part of the design.
4. Administrative subsystem: employee management
- CRUD for employees/users is split into page + action pairs:
- form_agregar.php → agregar.php
- form_modificar.php → modificar.php
- form_eliminar.php → eliminar.php
- This suggests a form-driven flow where the UI page gathers data and a separate PHP handler performs the DB mutation.
- admin_ventana.php is likely the admin dashboard that links these actions together.
5. Attendance capture subsystem
- The employee attendance flow is centered on:
- asistencia.php
- ins_marca_dia.php
- verAsistencia.php
- ver_llegadas.php
- mostrar_llegadas.php
- This likely supports marking entry/exit and viewing recent clock-ins.
- The presence of js/clock.js and js/marcar.js indicates time-based UI behavior and attendance marking interactions are partially handled client-side.
6. Schedule/configuration subsystem
- config_horario.php and js/config_horario.js implement schedule setup.
- This is an important business-rule boundary: attendance evaluation depends on configured work hours, so schedule configuration affects how arrivals and lateness are interpreted.
7. Reporting subsystem
- Reports are separated by time scope and employee scope:
- reporteDiario.php
- reporteAnual.php
- reporteEmp.php
- js/reporteRango.js
- mostrar_llegadas.php and ver_llegadas.php appear to support report-like views of arrival data.
- The architecture suggests report pages query the same attendance tables with different filters rather than using a reporting service layer.
8. Shared application structure
- conexion.php is the shared DB connection layer used across most PHP pages.
- funciones.php likely contains reusable business logic and helper functions, reducing duplication in attendance, user, and report pages.
- head.php, foot.php, and leftmenu.php are shared UI fragments, which means the page layout is assembled from common includes.
9. Client-side assets
- The js/ folder contains small feature-specific scripts:
- clock.js for live time display or timestamp behavior
- marcar.js for attendance marking UI
- config_horario.js for schedule form behavior
- reporteRango.js for date-range report selection
- ver_llegadas.js for arrival listing interactions
- These scripts support the server-rendered pages but do not form a separate frontend application.
10. Data flow through the system
- User starts at login.php.
- On success, session state routes them to either admin or employee-facing views.
- Admin actions submit forms to PHP handlers that write to MySQL.
- Attendance actions capture current date/time and persist attendance records.
- Reports and history screens read from the same attendance and employee tables, filtered by date, employee, or period.
11. Likely domain entities
- Based on the file names and project scope, the key entities are:
- employee/user records
- attendance marks by day and time
- schedules/hours configuration
- report views over attendance history
- empleados.sql is the authoritative source for the table structure behind these entities.
12. Project organization style
- The repository follows a page-per-action architecture common in small PHP systems:
- UI page
- form page
- processing page
- This keeps implementation simple, but also means there is no strong separation into controllers/services/models; business logic is distributed across PHP files and shared includes.
13. Documentation and deliverables
- The PDF files (AgendaSprint1.pdf, AgendaEntregable1.pdf, IEEE.pdf, ManualProgramador.pdf) indicate this is a coursework-style or structured team project with formal documentation.
- The README also reflects sprint planning and backlog tracking, which helps explain why the codebase is organized around complete vertical features rather than layered architecture.
14. What an architecture diagram should show
- A browser client interacting with a PHP web app.
- A shared MySQL database at the center.
- Four major functional blocks around it:
- authentication/session management
- employee administration
- attendance capture/consultation
- reporting and schedule configuration
- Shared include files and JavaScript assets as supporting components across those blocks.
Main entry points: empleados.sql Schema · admin_ventana.php Admin desk · asistencia.php Attendance · conexion.php DB connect
Components 31
Client
Browser-side entry point
- Browser · User-facing web client
Auth
Login and session control
Admin
Employee management
- Admin desk · Administrator dashboard
admin_ventana.php - Add form · Employee creation form
form_agregar.php - Add employee · Persists new employee data
agregar.php - Edit form · Employee edit form
form_modificar.php - Update employee · Updates employee records
modificar.php - Delete form · Employee delete confirmation form
form_eliminar.php - Delete employee · Removes employee records
eliminar.php
Attendance
Clock-in and history
- Attendance · Attendance capture and consultation page
asistencia.php - Mark day · Stores daily attendance mark
ins_marca_dia.php - View attendance · Attendance history view
verAsistencia.php - Arrivals · Lists recent arrivals
ver_llegadas.php - Show arrivals · Filtered arrival display
mostrar_llegadas.php
Reports
Reporting and schedule views
- Schedule · Work-hours configuration
config_horario.php - Daily report · Day-based attendance report
reporteDiario.php - Annual report · Year-based attendance report
reporteAnual.php - Employee report · Employee-specific attendance report
reporteEmp.php
Shared
Common includes and DB access
- DB connect · Shared MySQL connection layer
conexion.php - Helpers · Reusable business logic and helpers
funciones.php - Header · Common page header fragment
head.php - Footer · Common page footer fragment
foot.php - Menu · Shared navigation menu
leftmenu.php
Assets
Small feature scripts
- Clock · Live time display behavior
js/clock.js - Mark UI · Attendance marking interaction
js/marcar.js - Sched UI · Schedule form behavior
js/config_horario.js - Range UI · Date-range report controls
js/reporteRango.js - Arrivals UI · Arrival listing interaction
js/ver_llegadas.js
Connections 42
- Browser → Login: start · User begins at the login page
- Login → Home: success · Successful login routes into the app
- Login → Admin desk: admin · Administrator landing path
- Home → Logout: logout · Session termination path
- Admin desk → Add form: add · Opens employee creation form
- Admin desk → Edit form: edit · Opens employee edit form
- Admin desk → Delete form: delete · Opens employee delete form
- Add form → Add employee: submit · Form posts to creation handler
- Edit form → Update employee: submit · Form posts to update handler
- Delete form → Delete employee: submit · Form posts to delete handler
- Home → Attendance: attendance · Employee-facing attendance access
- Attendance → Mark day: mark · Saves the day's attendance mark
- Attendance → View attendance: history · Shows attendance history
- View attendance → Arrivals: arrivals · Moves into arrival-focused views
- Arrivals → Show arrivals: filter · Displays filtered arrival lists
- Schedule → Daily report: basis · Schedule settings feed report interpretation
- Schedule → Annual report: basis · Schedule settings affect annual views
- Schedule → Employee report: basis · Schedule settings affect employee views
- Login → DB connect: db · Authentication uses the shared connection
- Admin desk → DB connect: db · Admin pages use the shared connection
- Attendance → DB connect: db · Attendance pages query the database
- Daily report → DB connect: db · Report pages query the database
- Annual report → DB connect: db · Report pages query the database
- Employee report → DB connect: db · Report pages query the database
- Add employee → Schema: write · Creates employee rows
- Update employee → Schema: write · Updates employee rows
- Delete employee → Schema: write · Deletes employee rows
- Mark day → Schema: write · Stores attendance records
- View attendance → Schema: read · Reads attendance history
- Daily report → Schema: read · Reads attendance data for daily reports
- Annual report → Schema: read · Reads attendance data for annual reports
- Employee report → Schema: read · Reads attendance data for employee reports
- Header → Home: layout · Shared header assembled into pages
- Footer → Home: layout · Shared footer assembled into pages
- Menu → Admin desk: layout · Shared menu assembled into admin pages
- Helpers → Add employee: helpers · Reusable logic supports CRUD actions
- Helpers → Mark day: helpers · Reusable logic supports attendance capture
- Clock → Attendance: ui · Live clock supports attendance marking
- Mark UI → Attendance: ui · Attendance UI behavior
- Sched UI → Schedule: ui · Schedule form behavior
- Range UI → Daily report: ui · Date-range controls for reports
- Arrivals UI → Arrivals: ui · Arrival list interactions