feat(turnero): dispositivos por IP, firmas, formularios y muestras prolongadas
- login.php: detectar dispositivo por IP al autenticar y redirigir al lugar asignado - dashboard.php / lugar.php / recepcion.php: bloquear acceso por dispositivo (IP→lugar) - lugar.php: modal firma profesional pre-guardada; compact 2-col en iframe; botón WA solo cuando el formulario requiere firma del paciente - ver_formulario_enviado.php: modo compact tablet, auto-save borrador (merge), firma profesional en 1 clic, Muestras Prolongadas (countdown + Finalizar), auto_profesional pre-fill desde sesión, fecha→fecha_hoy en campos de toma/recepción - get_consentimientos.php: añadir requiere_firma_paciente para controlar botón WA - save_firma_profesional.php: API para guardar firma pre-configurada del profesional - migrations: turnero_dispositivos, admin_users.firma_svg, clon VIH F-LAB-05 para turnero Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
4de9c2f9b4
commit
8760b685ad
@@ -41,6 +41,25 @@ if ($_POST && !$loginBlocked) {
|
||||
$_SESSION['login_ip'] = $clientIp;
|
||||
$_SESSION['login_time'] = time();
|
||||
|
||||
// Tablet fija: redirigir al lugar asignado por IP y bloquear el resto
|
||||
try {
|
||||
$_dispStmt = Database::getInstance()->getConnection()->prepare(
|
||||
"SELECT td.lugar_id, td.nombre, tl.tipo
|
||||
FROM turnero_dispositivos td
|
||||
JOIN turnero_lugares tl ON tl.id = td.lugar_id
|
||||
WHERE td.ip = ? AND td.activo = 1 LIMIT 1"
|
||||
);
|
||||
$_dispStmt->execute([$clientIp]);
|
||||
$_disp = $_dispStmt->fetch(PDO::FETCH_ASSOC);
|
||||
if ($_disp) {
|
||||
$_SESSION['turnero_dispositivo'] = $_disp;
|
||||
$url = $_disp['tipo'] === 'recepcion'
|
||||
? BASE_URL . 'erp.php?m=turnero&v=recepcion&desk_id=' . $_disp['lugar_id']
|
||||
: BASE_URL . 'erp.php?m=turnero&v=lugar&lugar_id=' . $_disp['lugar_id'];
|
||||
header('Location: ' . $url); exit;
|
||||
}
|
||||
} catch (\Throwable $_) {}
|
||||
|
||||
$roleSlug = $adminUser['role'] ?? 'admin';
|
||||
$modules = $adminUser['modules'] ?? [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user