diff --git a/modules/turnero/api/configurar_tomas.php b/modules/turnero/api/configurar_tomas.php index dc098b7..14e9da1 100644 --- a/modules/turnero/api/configurar_tomas.php +++ b/modules/turnero/api/configurar_tomas.php @@ -44,7 +44,13 @@ if ($tc['datos_respuestas']) { // Merge: preserve config from other exams already saved if (!isset($dr['_tomas_config']) || !is_array($dr['_tomas_config'])) $dr['_tomas_config'] = []; foreach ($cfg as $k => $v) $dr['_tomas_config'][$k] = $v; -if ($examType !== '') $dr['_c8j2g16'] = $examType; +// Guardar selección completa de exámenes (array) para que el reload restaure todos +$examTypes = isset($body['exam_types']) && is_array($body['exam_types']) ? array_values(array_filter($body['exam_types'])) : []; +if ($examTypes) { + $dr['_c8j2g16'] = count($examTypes) === 1 ? $examTypes[0] : $examTypes; +} elseif ($examType !== '' && !array_key_exists('_c8j2g16', $dr)) { + $dr['_c8j2g16'] = $examType; +} if ($otroHora !== '') $dr['_otro_hora'] = $otroHora; $pdo->prepare("UPDATE turnero_consentimientos SET datos_respuestas = ? WHERE id = ?") diff --git a/ver_formulario_enviado.php b/ver_formulario_enviado.php index b60fe6a..7e6bc5b 100644 --- a/ver_formulario_enviado.php +++ b/ver_formulario_enviado.php @@ -1392,14 +1392,15 @@ var _mpOtroHora =