date("Y-m-d H:i:s"), "alumno" => $alumno, "panels" => [ "quien_soy" => null, "calendar" => null, "calendario_diasemana" => null, "calendario_mes" => null, "actividades" => null, "menu" => null ] ]; file_put_contents($panel_file, json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)); } } } function guardarPanelDiario($panel_name, $data, $alumno, $centro_id, $aulario_id) { $diario_path = getDiarioPath($alumno, $centro_id, $aulario_id); if ($diario_path) { $panel_file = $diario_path . "/Panel.json"; if (file_exists($panel_file)) { $existing = json_decode(file_get_contents($panel_file), true); if (is_array($existing)) { $existing["panels"][$panel_name] = [ "completed" => true, "timestamp" => date("Y-m-d H:i:s"), "data" => $data ]; file_put_contents($panel_file, json_encode($existing, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)); } } } } // Manejo de AJAX para guardar paneles if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_GET['api'])) { header('Content-Type: application/json'); $api_action = $_GET['api']; $alumno = $_SESSION["entreaulas_selected_alumno"] ?? ''; $centro_id = $_SESSION["auth_data"]["entreaulas"]["centro"] ?? ''; if ($api_action === 'guardar_panel' && $alumno && $centro_id) { $input = json_decode(file_get_contents('php://input'), true); $panel_name = $input['panel'] ?? ''; $panel_data = $input['data'] ?? []; $aulario_id = $_SESSION["entreaulas_selected_aulario"] ?? ''; guardarPanelDiario($panel_name, $panel_data, $alumno, $centro_id, $aulario_id); echo json_encode(['success' => true]); die(); } } switch ($_GET["form"]) { case "alumno_selected": $alumno = $_GET["alumno"] ?? ""; $centro_id = $_SESSION["auth_data"]["entreaulas"]["centro"] ?? ""; $aulario_id = $_GET["aulario"] ?? ''; $photo_url = $_GET["photo"] ?? ''; if ($alumno !== "" && $centro_id !== "" && $aulario_id !== "") { $_SESSION["entreaulas_selected_alumno"] = $alumno; $_SESSION["entreaulas_selected_aulario"] = $aulario_id; initDiario($alumno, $centro_id, $aulario_id); // Guardar el panel "quien_soy" como completado con foto URL si existe $who_am_i_data = ["alumno" => $alumno]; if ($photo_url !== '') { $who_am_i_data["photoUrl"] = $photo_url; } guardarPanelDiario("quien_soy", $who_am_i_data, $alumno, $centro_id, $aulario_id); header("Location: paneldiario.php?aulario=" . urlencode($_GET["aulario"] ?? '')); die(); } break; } require_once "_incl/pre-body.php"; ini_set("display_errors", "0"); ?> $panel_value) { $progress[$panel_name] = !is_null($panel_value) && isset($panel_value['completed']); } } } } } // Contar paneles completados $paneles_totales = 6; // quien_soy, calendar, calendario_diasemana, calendario_mes, actividades, menu $paneles_completados = count(array_filter($progress)); $porcentaje = ($paneles_completados / $paneles_totales) * 100; $todos_completados = ($paneles_completados === $paneles_totales); switch ($_GET["action"]) { default: case "index": if ($alumno_actual): ?>

Panel de Diario -

de paneles completados


¿Quién soy?

¿Que dia es?

¿Que vamos a hacer?

¿Que vamos a comer?
📋 Ver Resumen Imprimible

Resumen del Diario

Alumno:
Fecha:
Hora de registro:

Paneles Completados

'¿Quién soy?', 'calendar' => '¿Qué día es?', 'calendario_diasemana' => 'Día de la semana', 'calendario_mes' => 'Mes', 'actividades' => '¿Qué vamos a hacer?', 'menu' => '¿Qué vamos a comer?' ]; foreach ($diario_data['panels'] as $panel_name => $panel_info): $label = $panel_labels[$panel_name] ?? $panel_name; $completed = !is_null($panel_info) && isset($panel_info['completed']); $timestamp = $completed ? $panel_info['timestamp'] : 'No completado'; $panel_data = $completed && isset($panel_info['data']) ? $panel_info['data'] : []; ?>

Alumno seleccionado:

Foto del alumno

Día seleccionado:

Día de la semana:

<?php echo htmlspecialchars($panel_data['nombre']); ?>

Mes seleccionado:

<?php echo htmlspecialchars($panel_data['nombre']); ?>

Actividad:

<?php echo htmlspecialchars($panel_data['actividad']); ?>

Tipo de menú:

Error: No hay datos de diario disponibles.

'; endif; break; case "quien_soy": // ¿Quién soy? - Identificación del alumno $aulario_id = basename($_GET["aulario"] ?? ''); $centro_id = basename($_SESSION["auth_data"]["entreaulas"]["centro"] ?? ''); // Validate parameters if (empty($aulario_id) || empty($centro_id)) { echo '

Error: Parámetros inválidos.

'; break; } $base_path = "/DATA/entreaulas/Centros"; $alumnos_path = "$base_path/$centro_id/Aularios/$aulario_id/Alumnos"; // Validate the path is within the expected directory $real_path = realpath($alumnos_path); $real_base = realpath($base_path); $alumnos = []; if ($real_path !== false && $real_base !== false && strpos($real_path, $real_base) === 0 && is_dir($real_path)) { $alumnos = glob($real_path . "/*", GLOB_ONLYDIR); } ?>

¿Quién soy?

No hay alumnos registrados en este aulario.

Para añadir alumnos, accede al inicio del aulario.

, "", "");' aria-label="Seleccionar alumno "> Foto de <?php echo htmlspecialchars($alumno_name); ?>
?

¿Que vamos a hacer?

format("Y-m-d"); $menuTypesPath = "/DATA/entreaulas/Centros/$centro_id/Aularios/$source_aulario_id/Comedor-MenuTypes.json"; $defaultMenuTypes = [ ["id" => "basal", "label" => "Menú basal", "color" => "#0d6efd"], ["id" => "vegetariano", "label" => "Menú vegetariano", "color" => "#198754"], ["id" => "alergias", "label" => "Menú alergias", "color" => "#dc3545"], ]; $menuTypes = json_decode(@file_get_contents($menuTypesPath), true); if (!is_array($menuTypes) || count($menuTypes) === 0) { $menuTypes = $defaultMenuTypes; } $menuTypeIds = []; foreach ($menuTypes as $t) { if (!empty($t["id"])) { $menuTypeIds[] = $t["id"]; } } $menuTypeId = $_GET["menu"] ?? ($menuTypeIds[0] ?? "basal"); if (!in_array($menuTypeId, $menuTypeIds, true)) { $menuTypeId = $menuTypeIds[0] ?? "basal"; } $ym = $dateObj->format("Y-m"); $day = $dateObj->format("d"); $dataPath = "/DATA/entreaulas/Centros/$centro_id/Aularios/$source_aulario_id/Comedor/$ym/$day/_datos.json"; $menuData = [ "date" => $date, "menus" => [] ]; if (file_exists($dataPath)) { $existing = json_decode(file_get_contents($dataPath), true); if (is_array($existing)) { $menuData = array_merge($menuData, $existing); } } $menuForType = $menuData["menus"][$menuTypeId] ?? null; function image_src_simple($value, $centro_id, $aulario_id, $date) { if (!$value) { return ""; } return "/entreaulas/_filefetch.php?type=comedor_image¢ro=" . urlencode($centro_id) . "&aulario=" . urlencode($aulario_id) . "&date=" . urlencode($date) . "&file=" . urlencode($value); } ?>

¿Qué vamos a comer?

¿Que dia es?

'; } foreach (range(1, $days_in_month) as $dia) { $ds = date('N', strtotime(date('Y-m-') . sprintf("%02d", $dia))); if ($ds > 5) { ?>
'; } ?>

¿Que día de la semana es?

"Lunes", 2 => "Martes", 3 => "Miércoles", 4 => "Jueves", 5 => "Viernes" ]; $dow_euskara = [ 1 => "Astelehena", 2 => "Asteartea", 3 => "Asteazkena", 4 => "Osteguna", 5 => "Ostirala" ]; foreach ($days_of_week as $ds => $day_name) { $pictogram_url = '/static/arasaac/diadelasemana/' . strtolower($day_name) . '.png'; ?>
"Enero", 2 => "Febrero", 3 => "Marzo", 4 => "Abril", 5 => "Mayo", 6 => "Junio", 7 => "Julio", 8 => "Agosto", 9 => "Septiembre", 10 => "Octubre", 11 => "Noviembre", 12 => "Diciembre" ]; $meses_eus = [ 1 => "Urtarrila", 2 => "Otsaila", 3 => "Martxoa", 4 => "Apirila", 5 => "Maiatza", 6 => "Ekaina", 7 => "Uztaila", 8 => "Abuztua", 9 => "Iraila", 10 => "Urria", 11 => "Azaroa", 12 => "Abendua" ]; ?>

¿Que mes es?

$mes_name) { $pictogram_url = '/static/arasaac/mesesdelano/' . strtolower($mes_name) . '.png'; ?>