Stable 2-ago-2023

This commit is contained in:
2023-08-02 09:12:46 -06:00
parent 6a7c6b7ed9
commit f0cc3c585d
60 changed files with 6497 additions and 908 deletions

37
service/periodos.v2.php Normal file
View File

@@ -0,0 +1,37 @@
<?
$ruta = "../";
require_once '../include/bd_pdo.php';
global $db;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://portal.ulsa.edu.mx/servicios/AuditoriaAsistencialRest/AuditoriaAsistencialService.svc/auditoriaAsistencial/catalogos/periodos/v2/seleccionar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"token: f65f921264e4ab135472adb5a946212dd4b995d929294afec31eef192b8de8d6a076648906f70012c9803e5918d0fc99499d7d1fb7c998cc06c7a10eef61f66a",
"username: SGU_APSA_AUD_ASIST"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err)
die("cURL Error #:$err");
$json = json_decode($response, true);
$selectedData = array_map(function ($item) use ($db) {
$item['in_db'] = $db->where('carrera_nombre', $item['NombreCarrera'], 'ILIKE')->has('carrera');
$item['linked'] = $db->where('id_referencia', $item['ClaveCarrera'], 'ILIKE')->has('carrera');
return $item;
}, $json);
// Output the selected data directly
header('Content-Type: application/json');
echo json_encode($selectedData, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);