Del servidor bueno
Some checks are pending
Deploy Pruebas / deploy (push) Waiting to run

This commit is contained in:
Your Name
2024-10-11 16:44:27 -06:00
parent 32cbebfca8
commit 960592e68b
33 changed files with 2993 additions and 2536 deletions

49
periodos_sgu.php Normal file
View File

@@ -0,0 +1,49 @@
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://portal.ulsa.edu.mx/servicios/AuditoriaAsistencialRest/AuditoriaAsistencialService.svc/auditoriaAsistencial/inicioSesion/seleccionar',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{"username":"SGU_APSA_AUD_ASIST","password":"B4qa594JFPr2ufHrZdHS8A=="}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Transfer-Encoding: chunked'
),
));
$response = curl_exec($curl);
curl_close($curl);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://portal.ulsa.edu.mx/servicios/AuditoriaAsistencialRest/AuditoriaAsistencialService.svc/auditoriaAsistencial/catalogos/periodos/v1/seleccionar',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS =>'[]',
CURLOPT_HTTPHEADER => array(
"token:".json_decode($response, true),
'username: SGU_APSA_AUD_ASIST',
'Transfer-Encoding: chunked'
),
));
$response = curl_exec($curl);
$periodos = implode("\n", array_map(
fn($periodo) => <<<HTML
<li class="list-group item" value="{$periodo->IdPeriodo}" data-clave="{$periodo->NombrePeriodo}">
{$periodo->NombrePeriodo} - {$periodo->NombreNivel}
</li>
HTML, array_filter(
json_decode($response),
fn($periodo) => in_array($periodo->IdPeriodo, [])
)));
curl_close($curl);
echo <<<HTML
<ul class="list-group" id="alumnos">
{$periodos}
</ul>
HTML;