up
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* GET /modules/turnero/api/get_lugar_formularios.php
|
||||
* Retorna los formularios de consentimiento configurados para un lugar.
|
||||
* Sin autenticación (acceso interno).
|
||||
*
|
||||
* Query params:
|
||||
* lugar_id int requerido
|
||||
*/
|
||||
require_once __DIR__ . '/_helpers.php';
|
||||
requireMethod('GET');
|
||||
|
||||
$lugarId = isset($_GET['lugar_id']) ? (int) $_GET['lugar_id'] : 0;
|
||||
if (!$lugarId) jsonError('lugar_id requerido.');
|
||||
|
||||
$stmt = db()->prepare(
|
||||
"SELECT f.id, f.nombre
|
||||
FROM turnero_lugar_consentimientos tlc
|
||||
JOIN lab_formularios f ON f.id = tlc.formulario_id
|
||||
WHERE tlc.lugar_id = ?
|
||||
AND f.is_active = 1
|
||||
ORDER BY f.nombre ASC"
|
||||
);
|
||||
$stmt->execute([$lugarId]);
|
||||
$formularios = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
jsonOk(['formularios' => $formularios]);
|
||||
Reference in New Issue
Block a user