periodos con catálogo
Deploy Pruebas / deploy (push) Failing after 1m42s

This commit is contained in:
AlexLara
2026-07-30 11:05:09 -06:00
parent 39198a0fd1
commit 29d34bd5e4
+94 -2
View File
@@ -25,6 +25,68 @@
?>
<main class="container-fluid px-4 my-4" id="app" v-cloak @vue:mounted="mounted" style="min-height: 70vh;"
v-scope="">
<?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_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) . '<br>';
echo 'Código de error: ' . curl_errno($curl) . '<br>';
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) => <<<HTML
<li class="list-group-item" value="{$periodo->IdPeriodo}" data-clave="{$periodo->NombrePeriodo}">
<dl class="row">
<dt class="col-sm-3">ID SGU:</dt> <dd class="col-sm-9">{$periodo->IdPeriodo}</dd>
<dt class="col-sm-3">Clave</dt> <dd class="col-sm-9">{$periodo->NombrePeriodo}</dd>
<dt class="col-sm-3">Nivel:</dt> <dd class="col-sm-9">{$periodo->NombreNivel}</dd>
</dl>
</li>
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<br>";
}
curl_close($curl);
?>
<div aria-live="polite" aria-atomic="true" style="position: relative">
<div style="position: fixed; bottom: 2%; right: 2%; z-index: 9999; min-width: 300px;">
@@ -32,7 +94,7 @@
<div class="toast show shadow-sm mb-3 bg-white shadow-sm" role="alert" aria-live="assertive"
aria-atomic="true" v-for="(message, index) in messages"
@vue:mounted="$(`#toast-${message.timestamp.getTime()}`).toast({delay: 5000}).toast('show').on('hidden.bs.toast', () => messages.splice(index, 1))" " :key="
message.timestamp.getTime()" :id="`toast-${message.timestamp.getTime()}`">
message.timestamp.getTime()" :id="`toast-${message.timestamp.getTime()}`"">
<div class="toast-header" :class="`bg-primary text-white`">
<strong class="mr-auto text-uppercase text-center w-100 px-4">
<i
@@ -54,7 +116,37 @@
</div>
</div>
<div class="container">
<div class="d-flex flex-wrap flex-row-reverse align-items-center mb-3">
<div class="d-flex flex-wrap justify-content-between align-items-center mb-3" style="gap: 1rem">
<aside id="lista-periodos col-3">
<a class="btn btn-primary text-white">
<div class="ing-listado-menus"></div>
Lista de Periodos
</a>
<ul class="list-group col-3 ml-auto h-50 overflow-auto position-absolute shadow-lg" id="periodos-list-group">
<?= $periodos_html ?>
</ul>
</aside>
<style>
#periodos-list-group {
display: none;
transition: opacity 1s ease;
z-index:10;
}
aside:focus-within, aside:hover {
#periodos-list-group {
display: flex;
transition: opacity 1s ease;
}
}
</style>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#createPeriodoModal">
<div class="ing-mas"></div>
Crear periodo