lab_formularios

This commit is contained in:
Lizandro Guarnizo
2026-04-07 15:12:22 -05:00
parent 58f420e7ce
commit ded060e161
3 changed files with 147 additions and 184 deletions
+5 -1
View File
@@ -17,11 +17,15 @@ try {
if (!empty($_GET['paciente_id'])) $filtros['paciente_id'] = (int)$_GET['paciente_id'];
if (!empty($_GET['estado'])) $filtros['estado'] = $_GET['estado'];
if (!empty($_GET['fecha_desde'])) $filtros['fecha_desde'] = $_GET['fecha_desde'];
if (!empty($_GET['fecha_hasta'])) $filtros['fecha_hasta'] = $_GET['fecha_hasta'];
if (!empty($_GET['paciente'])) $filtros['paciente'] = trim($_GET['paciente']);
// Enfermero solo ve los suyos
if (userRole() === 'enfermero') {
$filtros['enviado_por'] = adminId();
}
jsonOk(['data' => $form->listarEnvios($filtros)]);
$pagina = max(1, (int)($_GET['page'] ?? 1));
$porPagina = !empty($_GET['export']) ? 9999 : max(1, min(100, (int)($_GET['limit'] ?? 20)));
jsonOk($form->listarEnvios($filtros, $pagina, $porPagina));
}
// Plantilla específica