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