From 76fe06b0dfbc71b97051b3b978e51435c8eff4f5 Mon Sep 17 00:00:00 2001 From: Alejandro Rosales Date: Mon, 18 Sep 2023 19:08:35 +0000 Subject: [PATCH] All --- action/action_auditoria.php | 1 + action/reposicion_insert.php | 48 +- action/reposicion_profesor_materias.php | 3 +- action/rutas_salón_horario.php | 47 +- api/horario_profesor_log.php | 34 + auditoria.php | 9 +- class/c_abstract_data.php | 147 +++++ class/database.php | 119 ++++ class/schema/periodo_v1.json | 38 ++ composer.lock | 308 ++++----- import/html_css_files.php | 10 +- import/html_header.php | 15 +- import/html_header_index.php | 15 +- logs.php | 188 ++++++ logs/postgres.php | 72 +++ pgsql-log/get-logs.sh | 23 + pgsql-log/postgresql-Fri.log | 0 pgsql-log/postgresql-Mon.log | 0 pgsql-log/postgresql-Sat.log | 0 pgsql-log/postgresql-Sun.log | 0 pgsql-log/postgresql-Thu.log | 5 + pgsql-log/postgresql-Tue.log | 159 +++++ pgsql-log/postgresql-Wed.log | 187 ++++++ pgsql-log/tail | 0 reposiciones_crear.php | 69 +- sample/rutas.json | 803 ------------------------ supervisor.php | 9 +- test.php | 14 +- 28 files changed, 1259 insertions(+), 1064 deletions(-) create mode 100644 api/horario_profesor_log.php create mode 100644 class/c_abstract_data.php create mode 100644 class/database.php create mode 100644 class/schema/periodo_v1.json create mode 100644 logs.php create mode 100644 logs/postgres.php create mode 100644 pgsql-log/get-logs.sh create mode 100644 pgsql-log/postgresql-Fri.log create mode 100644 pgsql-log/postgresql-Mon.log create mode 100644 pgsql-log/postgresql-Sat.log create mode 100644 pgsql-log/postgresql-Sun.log create mode 100644 pgsql-log/postgresql-Thu.log create mode 100644 pgsql-log/postgresql-Tue.log create mode 100644 pgsql-log/postgresql-Wed.log create mode 100644 pgsql-log/tail delete mode 100644 sample/rutas.json diff --git a/action/action_auditoria.php b/action/action_auditoria.php index 0fc07c0..1fab385 100644 --- a/action/action_auditoria.php +++ b/action/action_auditoria.php @@ -68,6 +68,7 @@ try { comentario, registro_fecha_justificacion, profesor.profesor_id, profesor_nombre, profesor_clave, profesor_correo, + horario_id, materia, carrera, horarios.facultad_id, facultad, nivel, horario_hora, horario_fin, horario_grupo, horarios.salon, fechas.registro_fecha_ideal, estado_supervisor.estado_supervisor_id as estado_supervisor_id, diff --git a/action/reposicion_insert.php b/action/reposicion_insert.php index 851abfe..a63d543 100644 --- a/action/reposicion_insert.php +++ b/action/reposicion_insert.php @@ -7,7 +7,16 @@ $ruta = "../"; require_once "../class/c_login.php"; // check if the session is started -$user = Login::get_user(); +if (!isset($_SESSION['user'])) + die('No se ha iniciado sesión'); + +$user = unserialize($_SESSION['user']); +//$user->access(); + +$duracion_id = filter_input(INPUT_POST, "duracion", FILTER_SANITIZE_NUMBER_INT);//1 Repo , 0 Cambio +$bloque = filter_input(INPUT_POST, "bloque", FILTER_SANITIZE_NUMBER_INT);//1 Repo , 0 Cambio +$ciclo = filter_input(INPUT_POST, "ciclo", FILTER_SANITIZE_NUMBER_INT);//1 Repo , 0 Cambio +$fecha_falta = trim(htmlspecialchars($_POST["fecha_falta"], ENT_QUOTES, "UTF-8"));//limpia texto $fecha_falta = trim(htmlspecialchars($_POST["fecha_falta"], ENT_QUOTES, "UTF-8"));//limpia texto $fecha = trim(htmlspecialchars($_POST["fecha_inicial"], ENT_QUOTES, "UTF-8"));//limpia texto $fecha_cambio = trim(htmlspecialchars($_POST["fecha_cambio"], ENT_QUOTES, "UTF-8"));//limpia texto @@ -26,19 +35,21 @@ else //$salon = trim(filter_input(INPUT_POST, "salon", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto $comentario = trim(htmlspecialchars($_POST["comentario"], ENT_QUOTES, "UTF-8"));//limpia texto + +$duracion_rs = $db->querySingle("select * from duracion where duracion_id = :id", [":id"=>$duracion_id]); +$duracion_tiempo = $duracion_rs["duracion_interval"]; + //-- Obtiene datos de horario regular de clase -$horario_rs = $db->querySingle('SELECT * from fs_horario_basic where id = :hor', +$horario_rs = $db->querySingle('SELECT * from horario_view where horario_id = :hor', [':hor' => $hor] ); $materia = $horario_rs["materia_id"]; -$gpo = $horario_rs["grupo"]; -$duracion = $horario_rs["duracion_total"]; -$dia = $horario_rs["dia"]; +$dia = $horario_rs["horario_dia"]; $hora = $hora_ini.":".$min_ini.":00"; $fecha_new = DateTime::createFromFormat('d/m/Y', $fecha)->format('Y-m-d')." ".$hora; -$fecha_fin_new = date("Y-m-d H:i:00", strtotime($fecha_new.' + '.$duracion.' minute')); +$fecha_fin_new = date("Y-m-d", strtotime($fecha_new))." ".$duracion_tiempo; $dia_new = date('w', strtotime($fecha_new)); if($tipo == 1){//Reposición @@ -52,8 +63,10 @@ if($tipo == 1){//Reposición //Valida que tenga clase en la fecha de falta if(intval($dia) != intval($dia_falta)){ - //header("Location:".$pag."?error=11"); - echo intval($dia)." != ".intval($dia_falta); + header("Location:".$pag."?error=11"); + /*print_r($_POST); + echo 'SELECT * from horario_view where horario_id = '.$hor; + echo intval($dia)." != ".intval($dia_falta);*/ exit(); } @@ -66,24 +79,28 @@ if($tipo == 1){//Reposición exit(); } */ - //Valida que profesor no este en 2 reposiciones al mismo tiempo + //Valida que profesor no este en 2 reposiciones al mismo tiempo en la fecha nueva $traslape = $db->querySingle('SELECT * from traslape_profesor_reposicion(:prof, :fecha, :hora, :dur)', - [':prof' => $prof, ':fecha'=>$fecha_falta, ':hora'=>$hora, ':dur'=>$duracion] + [':prof' => $prof, ':fecha'=>DateTime::createFromFormat('d/m/Y', $fecha)->format('Y-m-d'), ':hora'=>$hora, ':dur'=>$duracion_tiempo] )["traslape_profesor_reposicion"]; if($traslape){ + //print_r($_POST); + //echo "SELECT * from traslape_profesor_reposicion($prof,'".DateTime::createFromFormat('d/m/Y', $fecha)->format('Y-m-d')."' , '$hora', $duracion)"; header("Location:".$pag."?error=9"); exit(); } try{ - $db->query('SELECT * from fi_reposicion(:f_falta, :f_nueva, :hora_nueva, :hor, :prof, 1, :desc, :alumnos, true, :aula, :duracion)', + $db->query('SELECT * from fi_reposicion_solicitud(:f_falta, :f_nueva, :hora_nueva, :hor, :prof, 1, :desc, :alumnos, true, :aula, :duracion, :usr, :bloque, :ciclo)', [':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora, ':hor' => $hor, - ':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion + ':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_id, ':usr'=>$user->user["id"], + ':bloque' => $bloque, ':ciclo' => $ciclo ] ); }catch(Exception $e){ - header("Location: ".$pag."?error=1"); + echo $e->getMessage(); + //header("Location: ".$pag."?error=1"); exit(); } @@ -96,9 +113,10 @@ if($tipo == 1){//Reposición }else{//Cambio salón / hora try{ - $db->query('SELECT * from fi_reposicion(:f_falta, :f_nueva, :hora_nueva, :hor, :prof, 1, :desc, :alumnos, true, :aula, :duracion)', + $db->query('SELECT * from fi_reposicion_solicitud(:f_falta, :f_nueva, :hora_nueva, :hor, :prof, 1, :desc, :alumnos, true, :aula, :duracion, :usr, :bloque, :ciclo)', [':f_falta' => $fecha_falta, ':f_nueva' => $fecha_cambio, ':hora_nueva' => $hora, ':hor' => $hor, - ':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion + ':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_id, ':usr'=>$user->user["id"], + ':bloque' => $bloque, ':ciclo' => $ciclo ] ); }catch(Exception $e){ diff --git a/action/reposicion_profesor_materias.php b/action/reposicion_profesor_materias.php index 84aae32..4a61663 100644 --- a/action/reposicion_profesor_materias.php +++ b/action/reposicion_profesor_materias.php @@ -33,7 +33,8 @@ $user = unserialize($_SESSION['user']); foreach($rs as $m){ $mat_arr[] = array("horario_id"=>$m["horario_id"], "horario_dia"=>$m["horario_dia"], "horario_hora"=>substr($m["horario_hora"], 0, 2), "horario_min"=>substr($m["horario_hora"], 3, 2), - "materia_nombre"=>$m["materia_nombre"].' - '.$m["horario_dia_nombre"]." ".substr($m["horario_hora"], 0, -3) + "materia_nombre"=>$m["materia_nombre"].' - '.$m["horario_dia_nombre"]." ".substr($m["horario_hora"], 0, -3), + "grupo"=>$m["horario_grupo"], "duracion" => $m["duracion"] ); } diff --git a/action/rutas_salón_horario.php b/action/rutas_salón_horario.php index b19f230..db99750 100644 --- a/action/rutas_salón_horario.php +++ b/action/rutas_salón_horario.php @@ -81,29 +81,42 @@ try { 'horario_view', columns: $columns ), - 'query' => $db->getLastQuery(), - 'reposiciones' => $db - ->join('periodo', 'periodo.periodo_id = horario_view.periodo_id') - ->join('registro', 'registro.horario_id = horario_view.horario_id') - ->join('reposicion', 'registro.reposicion_id = reposicion.reposicion_id') - ->join('bloque_horario', '(bloque_horario.hora_inicio, bloque_horario.hora_fin) OVERLAPS (reposicion_hora, reposicion_hora + horario_view.duracion)') - ->join('profesor', 'profesor.profesor_id = registro.profesor_id') - ->join('salon_view', 'salon_view.salon_id = reposicion.salon_id', 'LEFT') - ->join('salon as salon_reposicion', 'salon_reposicion.salon_id = horario_view.salon_id', 'LEFT') - ->where("CURRENT_DATE BETWEEN periodo.periodo_fecha_inicio AND periodo.periodo_fecha_fin") - ->where("reposicion_fecha = CURRENT_DATE") - ->where('bloque_horario.id', $_GET['bloque_horario_id']) - ->where('salon_view.id_espacio_padre', $ruta['id_espacio_sgu']) - ->get( - 'horario_view', - columns: $columns + // 'query' => $db->getLastQuery(), + 'reposiciones' => $db->query( + 'SELECT ' . implode(', ', $columns) . << $_GET['bloque_horario_id'], + 'id_espacio_sgu' => $ruta['id_espacio_sgu'], + ] ), ], $ruta, ), $data ); - echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); + + $data = array_filter( + $data, + fn($ruta) => count($ruta['horarios']) > 0 || count($ruta['reposiciones']) > 0 + ); + + echo json_encode(array_values($data), JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); } else { http_response_code(405); echo json_encode(['error' => 'method not allowed']); diff --git a/api/horario_profesor_log.php b/api/horario_profesor_log.php new file mode 100644 index 0000000..7edfd90 --- /dev/null +++ b/api/horario_profesor_log.php @@ -0,0 +1,34 @@ + 'Request error.']); + die(); +} + + +$periodos = array_map(fn($array) => $array['id_periodo_sgu'], $db + ->join('periodo', 'periodo.periodo_id = horario_view.periodo_id') + ->join('horario_profesor', 'horario_profesor.horario_id = horario_view.horario_id') + ->where('profesor_id', $input['profesor_id']) + ->groupBy('id_periodo_sgu') + ->orderBy('id_periodo_sgu', 'DESC') + ->get('horario_view', 5, 'id_periodo_sgu')); + +$clave_profesor = $db->where('profesor_id', $input['profesor_id'])->getOne('profesor', 'profesor_clave')['profesor_clave']; + +$horarios = []; +$rest = new Horarios(); + +foreach ($periodos as $periodo) { + $horarios = array_merge($horarios, $rest->get(data: ['idPeriodo' => $periodo, 'claveProfesor' => $clave_profesor, 'fecha' => date('Y-m-d')])); +} + +$db + ->where('log_id', $input['log_id']) + ->update("log_registro", ['horario_web' => json_encode($horarios)]); \ No newline at end of file diff --git a/auditoria.php b/auditoria.php index 30ca405..fa630b2 100644 --- a/auditoria.php +++ b/auditoria.php @@ -282,8 +282,7 @@ @@ -606,7 +605,7 @@
-
+
-
-
+
+
Observaciones
diff --git a/class/c_abstract_data.php b/class/c_abstract_data.php new file mode 100644 index 0000000..fa235c6 --- /dev/null +++ b/class/c_abstract_data.php @@ -0,0 +1,147 @@ + $value) { + $conditions[] = "$key = :$key"; + } + + $sql = "SELECT $what FROM $this->tableName"; + if ($conditions) { + $sql .= " WHERE " . implode(" AND ", $conditions); + } + + $result = $db->query($sql, $params); + return $result; + } + + protected function insert__(array $params = [], ?string $where = null) + { + global $db; + + if ($where === null) { + $where = $this->tableName; + } + + $columns = []; + foreach ($params as $key => $value) { + $columns[] = "$key = :$key"; + } + + $sql = "INSERT INTO $where SET " . implode(", ", $columns); + $result = $db->query($sql, $params); + return $result; + + } +} + +abstract class WebServiceSGU +{ + const BASE_URL = "https://portal.ulsa.edu.mx/servicios/AuditoriaAsistencialRest/AuditoriaAsistencialService.svc/auditoriaAsistencial"; + + private static array $keys = [ + 'username' => 'SGU_APSA_AUD_ASIST', + 'password' => 'B4qa594JFPr2ufHrZdHS8A==', + ]; + + private static ?JsonSchema\Validator $validator = null; + private string $baseUrl; + + public function __construct(protected string $endpoint, protected ?string $schema = null) + { + $this->baseUrl = self::BASE_URL . $endpoint; + } + + private static function initCurl(array $options = []) + { + $ch = curl_init(); + curl_setopt_array($ch, $options); + return $ch; + } + + private static function get_token(): string + { + $curl = self::initCurl([ + CURLOPT_URL => self::BASE_URL . "/inicioSesion/seleccionar", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_CUSTOMREQUEST => "POST", + CURLOPT_HTTPHEADER => ["Content-Type: application/json"], + CURLOPT_POSTFIELDS => json_encode(self::$keys), + ]); + + $response = curl_exec($curl); + $err = curl_error($curl); + curl_close($curl); + + if ($err) + throw new Exception("cURL Error: $err"); + + return trim($response, '"'); // remove quotes + } + + protected function validate_schema($data): bool + { + if ($this->schema === null) + return true; + + self::getValidator()->validate($data, (object) json_decode($this->schema)); + return self::getValidator()->isValid(); + } + + public static function getValidator(): JsonSchema\Validator + { + return self::$validator ??= new JsonSchema\Validator(); + } + + public function get_errors(): array + { + return self::getValidator()->getErrors(); + } + + public function get(array $data = []): array + { + if (!$this->validate_schema($data)) { + throw new Exception('Invalid schema'); + } + + $ch = self::initCurl([ + CURLOPT_POST => 1, + CURLOPT_POSTFIELDS => json_encode($data), + CURLOPT_URL => $this->baseUrl, + CURLOPT_HTTPHEADER => [ + 'Content-Type: application/json', + 'Accept: application/json', + 'username: ' . self::$keys['username'], + 'token: ' . self::get_token(), + ], + CURLOPT_RETURNTRANSFER => 1, + ]); + + $response = curl_exec($ch); + if (curl_errno($ch)) { + throw new Exception('cURL Error: ' . curl_error($ch)); + } + + curl_close($ch); + + $response = json_decode($response, true); + + if ($response === null) { + throw new Exception('Invalid response'); + } + + return $response; + } +} \ No newline at end of file diff --git a/class/database.php b/class/database.php new file mode 100644 index 0000000..0902d46 --- /dev/null +++ b/class/database.php @@ -0,0 +1,119 @@ +periodo_v1 = new Periodo_v1(); + $this->periodo_v2 = new Periodo_v2(); + } + + public function get_v1(): array + { + return $this->periodo_v1->get(); + } + + public function get_v2(): array + { + return $this->periodo_v2->get(); + } + + public function get_merged(): array + { + $v2Data = $this->get_v2(); + + // Create an associative array with IdPeriodo as the key for faster lookup + $v2Lookup = array_column($v2Data, null, 'IdPeriodo'); + + return array_map(function ($itemV1) use ($v2Lookup) { + if (isset($v2Lookup[$itemV1['IdPeriodo']])) { + $itemV2 = $v2Lookup[$itemV1['IdPeriodo']]; + $mergedItem = array_merge($itemV1, $itemV2); + unset($mergedItem['NombreCarrera']); // Remove NombreCarrera as specified + return $mergedItem; + } + return $itemV1; // If no matching IdPeriodo found in v2, return the original v1 item + }, $this->get_v1()); + } +} + +final class Espacios extends WebServiceSGU +{ + public function __construct() + { + parent::__construct("/catalogos/espacios/seleccionar"); + } +} + +final class Carreras extends WebServiceSGU +{ + public function __construct() + { + parent::__construct("/catalogos/carreras/seleccionar"); + } +} + +final class Horarios extends WebServiceSGU +{ + public function __construct() + { + parent::__construct( + "/seleccionar", + <<=7.0.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -779,7 +723,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for PSR-7 HTTP message factories", @@ -794,31 +738,31 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" }, - "time": "2019-04-30T12:38:16+00:00" + "time": "2023-04-10T20:10:41+00:00" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -833,7 +777,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -847,9 +791,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { "name": "psr/simple-cache", @@ -951,16 +895,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -975,7 +919,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1013,7 +957,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -1029,20 +973,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -1057,7 +1001,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1096,7 +1040,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -1112,20 +1056,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -1134,7 +1078,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1179,7 +1123,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -1195,7 +1139,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "vlucas/phpdotenv", @@ -1290,5 +1234,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/import/html_css_files.php b/import/html_css_files.php index 8eb65e2..f79241f 100644 --- a/import/html_css_files.php +++ b/import/html_css_files.php @@ -1,6 +1,6 @@ - - - - - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/import/html_header.php b/import/html_header.php index 22fda38..d49b4f7 100644 --- a/import/html_header.php +++ b/import/html_header.php @@ -1,16 +1,15 @@ - + access(); $pagina = substr(basename($_SERVER['PHP_SELF']), 0, -4); -if ($pagina != "main" && !$user->acceso) { +if (!in_array($pagina, ["main", "test"]) && !$user->acceso) { header('Location: main.php?error=1'); exit; } @@ -19,11 +18,11 @@ $grupos = $user->admin ? queryAll("SELECT * FROM GRUPO ORDER BY grupo_nombre") : function html_header($title, $header = null) { - global $grupos, $user, $db; + global $grupos, $user, $db, $ruta; ?>