The admin dashboard, located atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JAQA20/LaComanda/llms.txt
Use this file to discover all available pages before exploring further.
views/admin/admin.php, is the central control panel for restaurant managers. It requires rol_id=1 and provides a unified view of live order activity, currently connected staff, and quick navigation to product, category, and user management. Every section of the dashboard is designed to give administrators immediate situational awareness without leaving a single screen.
Dashboard Sections
Order History
A real-time order table displaying order number, table, total, date, and the computed
estado_general for every order. Summary statistics at the top of the card show total orders, total revenue, delivered count, and pending count. Data is fetched via:Connected Users
A live table of every staff member currently logged in, showing their role, IP address, current page, last activity timestamp, and device/browser. Powered by:Sessions with no activity in the last 30 minutes are automatically removed.
Products & Categories
Browse and manage the full product catalog and the category structure that drives kitchen and barista routing. Product and category management views are located at:
views/admin/productos.php
User Management
Create, edit, and delete staff accounts for waiters, kitchen staff, and baristas. All user operations are performed from:
views/admin/usuarios.php
Order Estado Calculation
Theestado_general field displayed in the order history table is not stored directly — it is computed dynamically from the individual detalle_orden items belonging to each order. The logic follows this priority chain:
| Condition | Resulting estado_general |
|---|---|
All items have status entregado | entregada |
All items are listo or entregado | lista |
Any item is en_preparacion | en_preparacion |
| None of the above apply | pendiente |
Admin Override
Administrators can forcibly set any order to any valid state using the override endpoint:| Parameter | Description |
|---|---|
numero | The order number to update |
estado | The target state to apply |
area | The area context for the update |
pendiente, en_proceso, lista, entregada
This bypasses the normal item-level workflow and is particularly useful for fixing stuck orders — for example, an order where a preparation item was never marked ready but the food has already been served. Use this override sparingly; it does not update individual detalle_orden item statuses, only the order-level record.
Connected Users Details
TheGET /public/api/usuariosConectados.php endpoint returns a JSON array of session objects. Each object contains the following fields:
| Field | Description |
|---|---|
usuario_id | Unique ID of the logged-in user |
nombre | Display name of the user |
email | User’s email address |
rol | Role label (e.g. Admin, Mesero, Cocina, Barista) |
login_at | Timestamp of when the session was created |
ultima_actividad | Timestamp of the most recent activity ping |
dispositivo | Detected device type — Desktop, Móvil, or Tablet — plus the browser name |
pagina_actual | The last URL or view the user was active on |
ip | Client IP address at login |
logout_at | Timestamp of explicit logout, or null if still active |
estado_label | Human-readable status: Activo ahora, Inactivo reciente, or Inactivo |
estado_class | CSS class corresponding to the estado label, used for badge styling |
Session data is stored in
controller/sesiones_activas.json, not in MySQL. Sessions inactive for more than 30 minutes are automatically removed.