Fix JavaScript function call and update onclick handler

This commit is contained in:
Naiel
2026-02-14 15:08:04 +01:00
committed by GitHub
parent 618fc6679b
commit 5e3bbe45ba

View File

@@ -177,7 +177,7 @@ switch ($_GET["action"]) {
function seleccionarAlumno(element, nombre) {
element.style.backgroundColor = "#9cff9f"; // Verde
announceAndMaybeRedirect(
"¡Hola " + nombre['n'] + "!",
"¡Hola " + nombre + "!",
"/entreaulas/paneldiario.php?aulario=<?php echo urlencode($_GET['aulario'] ?? ''); ?>",
true
);
@@ -204,7 +204,7 @@ switch ($_GET["action"]) {
$photo_path = $alumno_path . "/photo.jpg";
$photo_exists = file_exists($photo_path);
?>
<a href="#" class="card grid-item" style="color: black;" onclick="seleccionarAlumno(this, '<?php echo htmlspecialchars($alumno_name, ENT_QUOTES); ?>');" aria-label="Seleccionar alumno <?php echo htmlspecialchars($alumno_name); ?>">
<a href="#" class="card grid-item" style="color: black;" onclick='seleccionarAlumno(this, "<?php echo htmlspecialchars($alumno_name, ENT_QUOTES); ?>");' aria-label="Seleccionar alumno <?php echo htmlspecialchars($alumno_name); ?>">
<?php if ($photo_exists): ?>
<img src="_filefetch.php?type=alumno_photo&alumno=<?php echo urlencode($alumno_name); ?>&centro=<?php echo urlencode($centro_id); ?>&aulario=<?php echo urlencode($aulario_id); ?>" height="150" class="bg-white" alt="Foto de <?php echo htmlspecialchars($alumno_name); ?>">
<?php else: ?>