This commit is contained in:
Lizandro Guarnizo
2026-06-16 08:02:30 -05:00
parent 35b13468b6
commit 42ccb1d436
2 changed files with 18 additions and 9 deletions
+16 -7
View File
@@ -13,9 +13,13 @@ if (!isUserLoggedIn()) {
try {
$pdo = Database::getInstance()->getConnection();
$lugares = $pdo->query(
"SELECT id, nombre FROM turnero_lugares WHERE activo = 1 ORDER BY sort_order ASC"
)->fetchAll(PDO::FETCH_ASSOC);
// Para destino solo nos interesa recepción y toma de muestras
$lugarRecepcion = $pdo->query(
"SELECT id, nombre FROM turnero_lugares WHERE tipo='recepcion' AND activo=1 ORDER BY sort_order LIMIT 1"
)->fetch(PDO::FETCH_ASSOC);
$lugarMuestras = $pdo->query(
"SELECT id, nombre FROM turnero_lugares WHERE tipo='muestras' AND activo=1 ORDER BY sort_order LIMIT 1"
)->fetch(PDO::FETCH_ASSOC);
$examenes = $pdo->query(
"SELECT id, codigo, nombre, categoria FROM exam_tipos WHERE activo = 1 ORDER BY categoria, nombre"
@@ -44,6 +48,8 @@ try {
$examenesAgrupados = [];
$deskId = 0;
$desk = null;
$lugarRecepcion = null;
$lugarMuestras = null;
}
$deskNombre = $desk['nombre'] ?? null; // null = vista genérica
@@ -341,10 +347,13 @@ require_once __DIR__ . '/../../../shared/components/sidebar.php';
<div class="ficha-section">
<h6><i class="fas fa-map-marker-alt me-1"></i>Lugar destino</h6>
<select id="sel-lugar" class="form-select form-select-sm">
<option value="">— Seleccione lugar —</option>
<?php foreach ($lugares as $l): ?>
<option value="<?= (int)$l['id'] ?>"><?= htmlspecialchars($l['nombre']) ?></option>
<?php endforeach; ?>
<option value="">— Seleccione destino —</option>
<?php if ($lugarRecepcion): ?>
<option value="<?= (int)$lugarRecepcion['id'] ?>">Recepción</option>
<?php endif; ?>
<?php if ($lugarMuestras): ?>
<option value="<?= (int)$lugarMuestras['id'] ?>">Toma de muestras</option>
<?php endif; ?>
</select>
</div>