'https://portal.ulsa.edu.mx/servicios/AuditoriaAsistencialRest/AuditoriaAsistencialService.svc/auditoriaAsistencial/inicioSesion/seleccionar', CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, //CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{"username":"SGU_APSA_AUD_ASIST","password":"B4qa594JFPr2ufHrZdHS8A=="}', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', //'Transfer-Encoding: chunked', 'Accept: application/json' ), )); $response = curl_exec($curl); if ($response === false) { echo 'Error cURL: ' . curl_error($curl) . '
'; echo 'Código de error: ' . curl_errno($curl) . '
'; curl_close($curl); exit; } 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); $id_SGU_periodos_en_Base_de_Datos = array_map(fn($item) => $item['id_periodo_sgu'], $db->get('periodo', columns:'id_periodo_sgu')); $periodos_en_SGU = json_decode($response); if( is_array($periodos_en_SGU) && count($periodos_en_SGU) > 0){ $periodos_html = implode("\n", array_map( fn($periodo) => <<
ID SGU:
{$periodo->IdPeriodo}
Clave
{$periodo->NombrePeriodo}
Nivel:
{$periodo->NombreNivel}
HTML, array_filter( $periodos_en_SGU, fn($periodo) => !in_array($periodo->IdPeriodo, $id_SGU_periodos_en_Base_de_Datos) ))); }else{ echo "Error al obtener periodos
"; } curl_close($curl); ?>
SGU Clave Nombre Nivel Fecha de inicio Fecha de fin Acciones
{{ periodo.id_periodo_sgu }} {{ periodo.periodo_clave }}