Initial Commit

This commit is contained in:
Cloud User
2024-03-06 17:45:49 -06:00
commit 8986493161
250 changed files with 43078 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
header('Content-Type: application/json');
$ruta = "../";
require_once("../include/bd_pdo.php");
$grupo = isset($_GET['grupo']) ? $_GET['grupo'] : 1;
$grupo_horarios = $db->querySingle(
"WITH bloques AS (
SELECT id, hora_inicio, hora_fin
FROM public.bloque_horario
WHERE grupo = ?
ORDER BY hora_inicio ASC
)
SELECT json_agg(json_build_object(
'id', id,
'hora_inicio', hora_inicio,
'hora_fin', hora_fin,
'selected', current_time between hora_inicio and hora_fin
)) AS bloque_horario
FROM bloques
",
[$grupo]
)['bloque_horario'];
echo $grupo_horarios;