Documentation Index
Fetch the complete documentation index at: https://mintlify.com/emmanueljarquin-sys/GrupoMecsaCMS/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Employee Management module allows you to maintain a comprehensive directory of all employees in your organization. Each employee profile includes personal information, professional details, contact data, and a photo.Employee photos are stored in Supabase Storage and must be in image format (JPG, PNG, etc.).
Key Features
Employee Directory
View and search all employees with their photos, names, positions, and departments.
Contact Information
Store phone numbers and email addresses for easy communication.
Department Assignment
Link employees to specific departments for organizational structure.
Photo Management
Upload and display employee photos in the directory.
CRUD Operations
Create New Employee
Open the New Employee Modal
Click the “Añadir nuevo” button in the top-right corner of the employee directory.
Fill in Employee Details
Complete the following required and optional fields:Required Fields:
- Nombre completo - Full name of the employee
- Fotografía - Employee photo (image file)
- Departamento - Select from existing departments
- Puesto / Descripción - Job title or role description
- Celular - Mobile phone number
- Correo electrónico - Email address
The system automatically generates a unique ID for each new employee and stores the creation timestamp.
Read/View Employees
The employee directory displays:- ID - Unique employee identifier
- Foto - Employee photo thumbnail (120px)
- Nombre - Full name
- Descripción - Job title or position
- Departamento - Department badge
- Acciones - Edit and delete buttons
Pagination
Pagination
The employee list supports pagination with configurable rows per page (default: 10 employees per page). Use the pagination controls at the bottom of the table to navigate through pages.
Update Employee Information
Click the Edit Button
In the employee table, click the edit icon (pen) in the Actions column for the employee you want to modify.
Modify the Information
Update any of the following fields:
- Full name
- Photo (optional - only if you want to change the current photo)
- Job description
- Department assignment
- Mobile phone number
- Email address
When editing, the current photo is displayed as a preview. You only need to upload a new file if you want to replace it.
Delete Employee
Click the delete icon (trash) in the Actions column for any employee. A confirmation prompt will appear before permanently removing the employee from the system.Form Fields and Validation
| Field Name | Type | Required | Validation | Storage |
|---|---|---|---|---|
nombre | Text | Yes | Non-empty string | Database |
foto | File | Yes (create) | Image format | Supabase Storage (empleados bucket) |
descripcion | Textarea | No | None | Database |
departamento | Select | Yes | Must match existing department | Database |
celular | Text | No | None | Database |
correo | No | Valid email format | Database |
Data Structure
Database Table: empleados
Photo Storage
Employee photos are stored in the Supabase Storage bucketempleados with the path pattern:
Role-Based Access
Access to the Employee Management module requires an active session with a valid authentication token. Users without a valid
$_SESSION['token'] will be redirected to the login page.Required Permissions
- View Employees - Authenticated users with valid session
- Create Employee - Users with write permissions
- Edit Employee - Users with write permissions
- Delete Employee - Users with delete permissions
Integration with Other Modules
The Employee Management module integrates with:Departments
Employee records pull department names from the
departamento table for the dropdown selector.Supabase Storage
Photos are stored and retrieved from the Supabase Storage
empleados bucket.Technical Details
API Endpoints
- GET
/empleados?select=*&order=id.desc&limit={perPage}&offset={offset}- Fetch paginated employees - GET
/empleados?select=id- Get total count for pagination - POST
/empleados- Create new employee - POST
/functions/editarEmpleado.php- Update employee - Storage PUT
/storage/v1/object/empleados/{path}- Upload photo
JavaScript Files
main.js- Core CMS functionalitymainempleados.js- Employee-specific interactions (edit modal population, delete confirmation)
User Workflows
Adding a New Team Member
Ensure Department Exists
Before adding an employee, make sure their department is already created in the Departments module.
Create Employee Record
Click “Añadir nuevo” and fill in all relevant information including name, photo, department, description, phone, and email.
Updating Contact Information
Locate the Employee
Use pagination or scroll through the employee directory to find the person whose information needs updating.