feat(dashboard): quitar botón atrás, agregar accesos rápidos a recepción y lugares
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
6e80ce8d1c
commit
5f0565eca2
@@ -115,13 +115,39 @@ Layout::open('Dashboard Turnero', 'fas fa-chart-bar');
|
||||
@media(max-width:600px) { #aiPanel { width:100%; right:0; border-radius:16px 16px 0 0; } }
|
||||
</style>
|
||||
|
||||
<?php
|
||||
// Cargar lugares activos para los botones de acceso rápido
|
||||
$_dbLugares = [];
|
||||
try {
|
||||
$_pdo = Database::getInstance()->getConnection();
|
||||
// Recepción: primer escritorio
|
||||
$_receps = $_pdo->query("SELECT id, nombre FROM turnero_lugares WHERE activo=1 AND tipo='recepcion' ORDER BY sort_order LIMIT 1")->fetchAll(PDO::FETCH_ASSOC);
|
||||
// Muestras agrupadas (grupo_id comparte pantalla) + lugares individuales sin grupo
|
||||
$_muestras = $_pdo->query(
|
||||
"SELECT MIN(id) AS id,
|
||||
CASE WHEN grupo_id IS NOT NULL THEN 'Toma de Muestras' ELSE nombre END AS nombre,
|
||||
tipo, grupo_id
|
||||
FROM turnero_lugares
|
||||
WHERE activo=1 AND tipo='muestras'
|
||||
GROUP BY COALESCE(grupo_id, id)
|
||||
ORDER BY MIN(sort_order)"
|
||||
)->fetchAll(PDO::FETCH_ASSOC);
|
||||
foreach ($_receps as $_l) $_dbLugares[] = ['icon'=>'fas fa-concierge-bell', 'label'=>$_l['nombre'], 'url'=>BASE_URL.'erp.php?m=turnero&v=recepcion&desk_id='.$_l['id']];
|
||||
foreach ($_muestras as $_l) $_dbLugares[] = ['icon'=>'fas fa-flask', 'label'=>$_l['nombre'], 'url'=>BASE_URL.'erp.php?m=turnero&v=lugar&lugar_id='.$_l['id']];
|
||||
} catch (\Throwable $_) {}
|
||||
?>
|
||||
<div class="page-header">
|
||||
<a href="<?= BASE_URL ?>erp.php?m=turnero&v=recepcion" class="back-btn">
|
||||
<i class="fas fa-arrow-left me-1"></i>Volver
|
||||
</a>
|
||||
<h1><i class="fas fa-chart-bar me-2 text-primary"></i>Dashboard Turnero</h1>
|
||||
|
||||
<!-- Accesos rápidos a lugares -->
|
||||
<?php foreach ($_dbLugares as $_btn): ?>
|
||||
<a href="<?= htmlspecialchars($_btn['url'], ENT_QUOTES) ?>" class="btn btn-sm btn-outline-primary">
|
||||
<i class="<?= $_btn['icon'] ?> me-1"></i><?= htmlspecialchars($_btn['label'], ENT_QUOTES) ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<!-- Selector de fecha -->
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<div class="d-flex align-items-center gap-2 ms-auto">
|
||||
<label class="small fw-semibold text-muted mb-0">Fecha:</label>
|
||||
<input type="date" id="fechaInput" class="form-control form-control-sm" style="width:150px"
|
||||
value="<?= date('Y-m-d') ?>" max="<?= date('Y-m-d') ?>">
|
||||
|
||||
Reference in New Issue
Block a user