50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
<?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;
|