up
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user