Commit Bulk
This commit is contained in:
41
service/_4564_periodo/periodos.v2.php
Normal file
41
service/_4564_periodo/periodos.v2.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$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: 64293fb86c06e45331ab9963822762f77b9c403ca949adcc31286d550e902fff202e4c69d1574b2082ecf0b3a28b6cfd4d88b3a7d2c2ab7d329666b9a527fb1b",
|
||||
"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('clave_carrera', $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);
|
||||
Reference in New Issue
Block a user