From 29d34bd5e4c59fe6443bfd88235c0aab2da51d2b Mon Sep 17 00:00:00 2001 From: AlexLara Date: Thu, 30 Jul 2026 11:05:09 -0600 Subject: [PATCH] =?UTF-8?q?periodos=20con=20cat=C3=A1logo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- periodos.php | 514 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 303 insertions(+), 211 deletions(-) diff --git a/periodos.php b/periodos.php index 4169ca4..44e546f 100644 --- a/periodos.php +++ b/periodos.php @@ -1,211 +1,303 @@ - - - - - - - Auditoría asistencial - - - - - - -
-
-
- - - -
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - -
SGUClaveNombreNivelFecha de inicioFecha de finAcciones
- {{ periodo.id_periodo_sgu }} - - {{ periodo.periodo_clave }} - - - - - - - - - - - -
-
- - -
- - - -
- - - - - - - - - - \ No newline at end of file + + + + + + + Auditoría asistencial + + + + + + +
+ '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); + ?> + +
+
+ + + +
+
+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
SGUClaveNombreNivelFecha de inicioFecha de finAcciones
+ {{ periodo.id_periodo_sgu }} + + {{ periodo.periodo_clave }} + + + + + + + + + + + +
+
+ + +
+ + + +
+ + + + + + + + + +