Full contact/user management with role-based access, photo uploads, and multi-entity linking.
contact_roles. You only see contacts assigned to your active entity.
The Contact Manager manages contacts, customers, and team members across business entities. It provides:
contact_roles pivot table (user_id, entity_id, role).After login, the system uses your active business_entities selection. Every contact shown belongs to that entity.
The table shows photo, name, email, phone, role and status. Filter by name/email/phone, status, gender, or role.
Fill in name, surname, email (required), optionally a photo and a role. New contacts get linked to your entity via contact_roles.
Deleting only removes the contact from your entity β the contact itself is only fully deleted if it has no other entity associations left.
Adding a contact whose email/RFC/CURP already exists doesn't create a duplicate β it links the existing contact to your entity instead.
| Feature | Description |
|---|---|
| π€ Photo/Avatar upload | PNG/JPG, stored under /media/platform/img/users/ with username-based filenames. |
| πͺͺ RFC/CURP validation | Uniqueness enforced at the application level β prevents duplicate official IDs across entities. |
| π’ Multi-entity architecture | A contact can belong to multiple entities, with a different role in each, via contact_roles. |
| π Password hashing | New contacts get a hashed password (password_hash()). Editing never shows or resets it accidentally. |
| π Live statistics | Aggregated counts (active/verified/primary) scoped to the active entity. |
| π Dynamic filtering | Combined search across name/email/phone/nick plus status/gender/role. |
All actions require an authenticated session and an active entity.
?action=getPaginated contacts with filters, scoped to the active entity via contact_roles.
?action=get&id=123Single contact's details (only if it belongs to your active entity).
?action=statsEntity-scoped statistics: total, active, verified, primary.
Validates name/email, checks for an existing contact first, then links the role.
Updates fields, handles a new photo upload, updates the entity's role.
Removes the contact_roles link; only deletes the contact itself if no other entity association remains.
contacts (personal data, photo, is_active), contact_roles (user_id, entity_id, role), business_entities (entity context).
contact_roles scoped to the active entity_id β you can't see or edit another entity's contacts.password_hash() β never plaintext.contact_roles has a row linking your user to that entity.business_entities record. This is normally created automatically at signup β if it's missing, contact an administrator.contact_roles entry for your entity.