This commit is contained in:
@@ -1,19 +1,30 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
|
||||||
if (!isset($_SESSION['user']))
|
if (!isset($_SESSION['user']))
|
||||||
die(json_encode(['error' => 'No se ha iniciado sesión']));
|
die(json_encode(['error' => 'No se ha iniciado sesión']));
|
||||||
|
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
$ruta = "../";
|
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
$sql = "SELECT fi_carrera(:nombre, :idfacultad, :idnivel, true, :estado)";
|
|
||||||
$params = [':nombre' => mb_strtoupper($_POST['nombre']), ':idfacultad' => $_POST['facultad'], ':idnivel' => $_POST['nivel'], ':estado' => $_POST['estado']];
|
|
||||||
|
|
||||||
print_r($_POST);
|
$nombre_carrera = mb_strtoupper($_POST['carreraCrear']);
|
||||||
echo json_encode(query($sql, $params, true));
|
$facultad_id = $_POST['facultadCrear'];
|
||||||
$user->print_to_log("Crea carrera", new: $params);
|
$nivel_id = $_POST['nivelCrear'];
|
||||||
|
$clave_carrera = $_POST['nombreCarreraCrear'];
|
||||||
|
|
||||||
|
|
||||||
|
$sql = "INSERT INTO public.carrera(carrera_nombre, facultad_id, nivel_id, clave_carrera, carrera_activa, carrera_comun)
|
||||||
|
VALUES (:nombre_carrera, :facultad_id, :nivel_id, :clave_carrera, true, false)";
|
||||||
|
|
||||||
|
$params = [
|
||||||
|
':nombre_carrera' => $nombre_carrera,
|
||||||
|
':facultad_id' => $facultad_id,
|
||||||
|
':nivel_id' => $nivel_id,
|
||||||
|
':clave_carrera' => $clave_carrera
|
||||||
|
];
|
||||||
|
|
||||||
|
$resultado = query($sql, $params, true);
|
||||||
header("Location: ../carreras.php?facultad=" . $_POST['facultad']);
|
header("Location: ../carreras.php?facultad=" . $_POST['facultad']);
|
||||||
exit();
|
exit();
|
||||||
|
|||||||
@@ -2,15 +2,22 @@
|
|||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
|
||||||
if (!isset($_SESSION['user']))
|
if (!isset($_SESSION['user']))
|
||||||
die(json_encode(['error' => 'No se ha iniciado sesión']));
|
die(json_encode(['error' => 'No se ha iniciado sesión']));
|
||||||
|
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
$ruta = "../";
|
$ruta = "../include/bd_pdo.php";
|
||||||
require_once "../include/bd_pdo.php";
|
|
||||||
global $pdo;
|
global $pdo;
|
||||||
$sql = "SELECT * FROM fs_carreras(:idfacultad, :idcarrera, null)";
|
|
||||||
$params = [':idfacultad' => $_POST['idfacultad'], ':idcarrera' => $_POST['idcarrera']];
|
|
||||||
$user->print_to_log("Crea carrera", old: $params);
|
$idmateria = $_POST['idmateria'];
|
||||||
echo json_encode(query($sql, $params, true));
|
|
||||||
|
$sql = "SELECT ca.clave_carrera,ca.carrera_id, ca.carrera_nombre, f.facultad_id, n.nivel_id, n.nivel_nombre
|
||||||
|
FROM carrera ca
|
||||||
|
JOIN facultad f ON f.facultad_id = ca.facultad_id
|
||||||
|
JOIN nivel n ON n.nivel_id = ca.nivel_id
|
||||||
|
WHERE ca.carrera_id = :idmateria";
|
||||||
|
|
||||||
|
$params = [':idmateria' => $idmateria];
|
||||||
|
$result = query($sql, $params, true);
|
||||||
|
echo json_encode($result);
|
||||||
|
|||||||
@@ -1,19 +1,31 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
|
||||||
if (!isset($_SESSION['user']))
|
if (!isset($_SESSION['user']))
|
||||||
die(json_encode(['error' => 'No se ha iniciado sesión']));
|
die(json_encode(['error' => 'No se ha iniciado sesión']));
|
||||||
|
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
$ruta = "../";
|
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
$old = query("SELECT * FROM FS_CARRERA WHERE ID = :id", [':id' => $_POST['id']]);
|
|
||||||
$sql = "SELECT fu_updatecarrera(:idcarrera, :nombre, :activa, :idnivel)";
|
$nombre_carrera = mb_strtoupper($_POST['carreraEditar']);
|
||||||
print_r($_POST);
|
$facultad_id = $_POST['facultadEditar'];
|
||||||
$params = [':idcarrera' => $_POST['id'], ':nombre' => mb_strtoupper($_POST['nombre']), ':activa' => $_POST['estado'], ':idnivel' => $_POST['nivel']];
|
$nivel_id = $_POST['nivelEditar'];
|
||||||
|
$clave_carrera = $_POST['nombreCarreraEditar'];
|
||||||
|
$carrera_id = $_POST['id'];
|
||||||
|
|
||||||
|
|
||||||
|
$sql = "UPDATE public.carrera SET carrera_nombre=:nombre_carrera, facultad_id = :facultad_id, nivel_id = :nivel_id, clave_carrera = :clave_carrera WHERE carrera_id = :id";
|
||||||
|
|
||||||
|
$params = [
|
||||||
|
':nombre_carrera' => $nombre_carrera,
|
||||||
|
':facultad_id' => $facultad_id,
|
||||||
|
':nivel_id' => $nivel_id,
|
||||||
|
':clave_carrera' => $clave_carrera,
|
||||||
|
':id' => $carrera_id
|
||||||
|
];
|
||||||
|
|
||||||
query($sql, $params, true);
|
query($sql, $params, true);
|
||||||
$user->print_to_log("Actualiza carrera.", old: $old, new: $params);
|
|
||||||
header("Location: ../carreras.php?facultad=" . $_POST['facultad']);
|
header("Location: ../carreras.php?facultad=" . $_POST['facultad']);
|
||||||
exit();
|
exit();
|
||||||
@@ -17,7 +17,7 @@ SELECT json_agg(json_build_object(
|
|||||||
'id', id,
|
'id', id,
|
||||||
'hora_inicio', hora_inicio,
|
'hora_inicio', hora_inicio,
|
||||||
'hora_fin', hora_fin,
|
'hora_fin', hora_fin,
|
||||||
'selected', current_time between hora_inicio and hora_fin
|
'selected', false --current_time between hora_inicio and hora_fin
|
||||||
)) AS bloque_horario
|
)) AS bloque_horario
|
||||||
FROM bloques
|
FROM bloques
|
||||||
",
|
",
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ if (is_array($user)) {
|
|||||||
} else {
|
} else {
|
||||||
$_SESSION['user'] = serialize($user);
|
$_SESSION['user'] = serialize($user);
|
||||||
|
|
||||||
header("Location: " . ($_SESSION['ruta'] ?? "../main.php"));
|
header("Location: " . (isset($_SESSION['ruta']) ? $_SESSION['ruta'] : "../main.php"));
|
||||||
}
|
}
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
88
action/reposicion_select_old.php
Normal file
88
action/reposicion_select_old.php
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Obtiene datos de reposición
|
||||||
|
*/
|
||||||
|
$ruta = "../";
|
||||||
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
|
// check if the session is started
|
||||||
|
if (!isset($_SESSION['user']))
|
||||||
|
die('No se ha iniciado sesión');
|
||||||
|
|
||||||
|
$user = unserialize($_SESSION['user']);
|
||||||
|
|
||||||
|
|
||||||
|
//--- Objeto para validar usuario. El id de usuario lo lee desde sesión
|
||||||
|
/*if(!$objSesion->tieneAcceso()){
|
||||||
|
$return["error"] = "Error! No tienes permisos para realizar esta acción.";
|
||||||
|
}else*/ if(!isset($_POST["id"])){
|
||||||
|
$return["error"] = "Error! No se recibió la información de la reposición.";
|
||||||
|
}else{
|
||||||
|
$id = filter_input(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
||||||
|
|
||||||
|
|
||||||
|
try{
|
||||||
|
if($user->rol["rol_id"] == 7){//es supervisor
|
||||||
|
$rs = $db->querySingle('SELECT * from fs_reposicion_solicitud(:id, NULL, NULL, NULL, NULL, NULL, NULL, NULL, :sup)',
|
||||||
|
[':id' => $id, ':sup'=>$user->user["id"]]
|
||||||
|
);
|
||||||
|
}else{//coordinador
|
||||||
|
$rs = $db->querySingle('SELECT * from fs_reposicion_solicitud(:id, :fac, NULL, NULL, NULL, NULL, NULL, NULL, null)',
|
||||||
|
[':id' => $id, ":fac"=>$user->facultad["facultad_id"] ]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch(Exception $e){
|
||||||
|
$return["error"] = "Ocurrió un error al leer los datos de la reposición.";
|
||||||
|
echo json_encode($return);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$return["fecha_clase"] = date('d/m/Y', strtotime($rs["fecha_clase"]));
|
||||||
|
$return["fecha_nueva"] = date('d/m/Y', strtotime($rs["fecha_nueva"]));
|
||||||
|
$hora_nueva = explode(":",$rs["hora_nueva"]);
|
||||||
|
$return["hora_ini"] = $hora_nueva[0];
|
||||||
|
$return["min_ini"] = $hora_nueva[1];
|
||||||
|
$hora_nueva_fin = explode(":",$rs["hora_nueva_fin"]);
|
||||||
|
$return["hora_fin"] = $hora_nueva_fin[0];
|
||||||
|
$return["min_fin"] = $hora_nueva_fin[1];
|
||||||
|
$return["duracion"] = $rs["duracion_interval"];
|
||||||
|
|
||||||
|
// $return["carrera"] = $rs["PlanEstudio_desc"];
|
||||||
|
$return["horario"] = $rs["horario_id"];
|
||||||
|
$return["materia"] = $rs["materia_id"];
|
||||||
|
$return["materia_desc"] = $rs["materia_nombre"];
|
||||||
|
$return["salon"] = $rs["salon_id"];
|
||||||
|
if($rs["salon_id"]==""){
|
||||||
|
$return["salon_desc"] = "Pendiente";
|
||||||
|
}else{
|
||||||
|
$salon_json = json_decode($rs["salon_array"], true);
|
||||||
|
if($salon_json[0]== "UNIVERSIDAD LA SALLE"){
|
||||||
|
unset($salon_json[0]);
|
||||||
|
}
|
||||||
|
$return["salon_desc"] = join(" / ",$salon_json);
|
||||||
|
}
|
||||||
|
|
||||||
|
//$return["salon_desc"] = $rs["salon"]=="" ? "-Pendiente-": $rs["salon"];
|
||||||
|
$return["ciclo"] = $rs["ciclo"];
|
||||||
|
$return["bloque"] = $rs["bloque"];
|
||||||
|
$return["profesor"] = $rs["profesor_id"];
|
||||||
|
$return["profesor_nombre"] = $rs["profesor_nombre"];
|
||||||
|
$return["comentario"] = $rs["descripcion"];
|
||||||
|
$return["alumnos"] = $rs["alumnos"];
|
||||||
|
$return["tipo"] = $rs["es_reposicion"];
|
||||||
|
$return["aula"] = $rs["tipoaula_id"];
|
||||||
|
$return["aula_desc"] = $rs["tipoaula_nombre"];
|
||||||
|
$return["aula_supervisor"] = $rs["tipoaula_supervisor"];
|
||||||
|
$return["dia"] = date('w', strtotime($rs["fecha_clase"]));
|
||||||
|
$return["motivo_cancelacion"] = $rs["motivo_cancelacion"];
|
||||||
|
$return["estado"] = $rs["estado_reposicion_id"];
|
||||||
|
$return["facultad"] = $rs["facultad_nombre"];
|
||||||
|
$return["carrera"] = $rs["carrera_nombre"];
|
||||||
|
$return["grupo"] = $rs["horario_grupo"];
|
||||||
|
$return["supervisor_nombre"] = $rs["supervisor_nombre"];
|
||||||
|
}
|
||||||
|
echo json_encode($return);
|
||||||
|
?>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actualizar reposiciones
|
* Actualiza reposición
|
||||||
*/
|
*/
|
||||||
$pag = "../reposiciones_crear.php";
|
$pag = "../reposiciones_crear.php";
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
|
|||||||
490
carreras.php
490
carreras.php
@@ -1,124 +1,414 @@
|
|||||||
|
<?php
|
||||||
|
require_once 'class/c_login.php';
|
||||||
|
require_once 'include/bd_pdo.php';
|
||||||
|
|
||||||
|
$user = Login::get_user();
|
||||||
|
|
||||||
|
$user->access();
|
||||||
|
if ($user->acceso == null) {
|
||||||
|
// die($access);
|
||||||
|
header('Location: main.php?error=1');
|
||||||
|
} else {
|
||||||
|
$user->print_to_log('Carreras');
|
||||||
|
}
|
||||||
|
$facultad = $user->facultad['facultad_id'] ?? -1;
|
||||||
|
if ($user->admin) {
|
||||||
|
$facultad = null;
|
||||||
|
}
|
||||||
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Auditoría asistencial</title>
|
<title>Carreras</title>
|
||||||
<?php
|
<?php
|
||||||
include 'import/html_css_files.php';
|
include 'import/html_css_files.php';
|
||||||
?>
|
?>
|
||||||
<link rel="stylesheet" type="text/css" href="https://unpkg.com/trix@2.0.0/dist/trix.css">
|
|
||||||
<style>
|
|
||||||
[v-cloak] {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script src="js/jquery.min.js"></script>
|
|
||||||
<script src="js/jquery-ui.js"></script>
|
|
||||||
<script src="js/bootstrap/bootstrap.min.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?
|
<?php
|
||||||
$redirect = $_SERVER['PHP_SELF'];
|
|
||||||
include "import/html_header.php";
|
include "import/html_header.php";
|
||||||
global $user;
|
|
||||||
|
|
||||||
html_header(
|
html_header(
|
||||||
"Carreras",
|
"CARRERAS",
|
||||||
"Sistema de gestión de checador",
|
"Gestión de Checador "
|
||||||
);
|
);
|
||||||
?>
|
$user->access();
|
||||||
<main class="container-fluid px-4 my-4" id="app" v-cloak @vue:mounted="mounted" style="min-height: 70vh;">
|
$max_count = 30;
|
||||||
<section class="row mt-4">
|
|
||||||
<div class="col-12 position-relative">
|
|
||||||
<!-- Loop for messages -->
|
|
||||||
<div class="toast show shadow-sm mb-3 bg-white"
|
|
||||||
style="position: fixed; top: 15%; right: 1%; max-width: 300px;" role="alert" aria-live="assertive"
|
|
||||||
aria-atomic="true"
|
|
||||||
@vue:mounted="$('.toast').toast({delay: 5000}).toast('show').on('hidden.bs.toast', () => { message.text = '' })"
|
|
||||||
v-if="message.text">
|
|
||||||
<div class="toast-header">
|
|
||||||
<strong class="mr-auto text-primary text-uppercase text-center w-100 px-4">
|
|
||||||
{{ message.title }}
|
|
||||||
</strong>
|
|
||||||
<small class="text-muted">{{ message.timestamp }}</small>
|
|
||||||
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close"
|
|
||||||
@click="message.text = ''">
|
|
||||||
<span aria-hidden="true">
|
|
||||||
<i class="fas fa-times"></i>
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="toast-body">
|
|
||||||
<div :class="message.type == 'success' ? 'text-success' : 'text-danger'"><i
|
|
||||||
:class="message.type == 'success' ? 'fas fa-check-circle' : 'fas fa-times-circle'"></i>
|
|
||||||
{{ message.text }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<div class="container">
|
|
||||||
<div class="row" v-for="facultad in carreras">
|
|
||||||
<!-- Facultad Card -->
|
|
||||||
<div class="card col-12 mb-4 shadow-lg">
|
|
||||||
<div class="card-header bg-primary text-white">
|
|
||||||
<h3 class="mb-1">{{ facultad.facultad_nombre }}</h3>
|
|
||||||
</div>
|
|
||||||
<div class="card-body bg-white">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<!-- Loop for Carreras -->
|
|
||||||
<div class="col-md-6 mb-3" v-for="carrera in facultad.carreras">
|
|
||||||
<div class="card border-secondary mb-3 shadow-sm">
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title text-primary text-uppercase text-center w-100 px-4 mb-3 text-truncate text-break border-bottom border-secondary pb-2"
|
|
||||||
:title="carrera.carrera_nombre">
|
|
||||||
{{ carrera.carrera_nombre }}
|
|
||||||
</h5>
|
|
||||||
|
|
||||||
<!-- Dropdown for Niveles -->
|
/*$sql = "SELECT * FROM (:nombre, :carrera, :facultad)";
|
||||||
<div class="dropdown">
|
if (isset($_POST["desc"])) {
|
||||||
<button class="btn btn-outline-secondary dropdown-toggle" type="button"
|
$desc = $_POST["desc"];
|
||||||
data-toggle="dropdown" aria-expanded="false"
|
$filter_desc = htmlspecialchars($desc, ENT_QUOTES, 'UTF-8');
|
||||||
@vue:mounted="$('.dropdown-toggle').dropdown()">
|
} else {
|
||||||
{{ carrera.nivel_nombre }}
|
$desc = null;
|
||||||
</button>
|
}
|
||||||
<div class="dropdown-menu shadow">
|
|
||||||
<a class="dropdown-item" v-for="nivel in niveles" key="nivel.nivel_id"
|
if (isset($_POST["carrera"])) {
|
||||||
style="cursor: pointer; user-select: none;"
|
$pcarrera = $_POST["carrera"];
|
||||||
@click="setNivel(carrera, nivel)"
|
$filter_carrera = htmlspecialchars($pcarrera, ENT_QUOTES, 'UTF-8');
|
||||||
:class="nivel.nivel_id == carrera.nivel_id ? 'active' : ''"
|
} else {
|
||||||
:disabled="nivel.nivel_id == carrera.nivel_id">
|
$pcarrera = null;
|
||||||
{{ nivel.nivel_nombre }}
|
}
|
||||||
</a>
|
|
||||||
</div>
|
if ($pcarrera == "") {
|
||||||
</div>
|
$sql .= "LIMIT 30";
|
||||||
</div>
|
}
|
||||||
</div>
|
$fs_materias = query(
|
||||||
</div> <!-- End of Carreras loop -->
|
$sql,
|
||||||
</div>
|
array(":nombre" => $desc, ":carrera" => $pcarrera, ":facultad" => $facultad),
|
||||||
</div>
|
single: false
|
||||||
|
);
|
||||||
|
$fs_carreras = query(
|
||||||
|
"SELECT * FROM fs_carreras(:facultad, null, null) ORDER BY unaccent(carrera_nombre)",
|
||||||
|
array(":facultad" => $facultad),
|
||||||
|
single: false
|
||||||
|
);*/
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare('SELECT ca.carrera_id, ca.clave_carrera, ca.carrera_nombre, f.facultad_nombre
|
||||||
|
FROM carrera ca
|
||||||
|
JOIN facultad f ON f.facultad_id = ca.facultad_id
|
||||||
|
WHERE ca.carrera_id != 0
|
||||||
|
ORDER BY f.facultad_nombre, ca.carrera_nombre');
|
||||||
|
$stmt->execute();
|
||||||
|
$carr = $stmt->fetchAll();
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare('SELECT * FROM nivel');
|
||||||
|
$stmt->execute();
|
||||||
|
$nivel = $stmt->fetchAll();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare('SELECT * FROM facultad');
|
||||||
|
$stmt->execute();
|
||||||
|
$facultad = $stmt->fetchAll();
|
||||||
|
|
||||||
|
|
||||||
|
//print_r($fs_materias);
|
||||||
|
|
||||||
|
?>
|
||||||
|
<main class="content marco">
|
||||||
|
<!-- Filtro -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Tabla -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 table-responsive">
|
||||||
|
<!--
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-outline-primary" data-toggle="modal"
|
||||||
|
data-target="#modal">
|
||||||
|
<span class="ing-editar ing-fw"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
-->
|
||||||
|
<div class="col-12 text-end pb-3">
|
||||||
|
<button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#modalCrear">
|
||||||
|
<span class="ing-mas ing-fw"></span>
|
||||||
|
Crear
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<!-- End of Facultad Card -->
|
|
||||||
|
<table class="table table-sm table-striped table-white">
|
||||||
|
<thead class="thead-dark">
|
||||||
|
<tr>
|
||||||
|
<th>Clave Carrera</th>
|
||||||
|
<th>Nombre Facultad</th>
|
||||||
|
<th>Nombre Carrera</th>
|
||||||
|
<th>Editar</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
if ($carr) {
|
||||||
|
foreach ($carr as $materia) {
|
||||||
|
|
||||||
|
?>
|
||||||
|
<tr data-id="<?= $materia["carrera_id"]; ?>" id="<?= $materia["carrera_id"]; ?>">
|
||||||
|
<td class="text-primary">
|
||||||
|
<?= $materia["clave_carrera"]; ?>
|
||||||
|
</td>
|
||||||
|
<td class="text-primary">
|
||||||
|
<?= $materia["facultad_nombre"]; ?>
|
||||||
|
</td>
|
||||||
|
<td class="text-primary">
|
||||||
|
<!-- <small>(<?= $materia["clave_materia"]; ?>)</small> -->
|
||||||
|
<?= $materia["carrera_nombre"]; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<button type="button" class="btn btn-outline-primary" data-toggle="modal"
|
||||||
|
data-target="#modal">
|
||||||
|
<span class="ing-editar ing-fw"></span>
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div id="message"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<?
|
<!-- Footer -->
|
||||||
include "import/html_footer.php"; ?>
|
<?php
|
||||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"
|
include "import/html_footer.php";
|
||||||
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
|
?>
|
||||||
crossorigin="anonymous"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"
|
<!-- Modal Crear-->
|
||||||
integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
|
<div class="modal fade" id="modalCrear" tabindex="-1" role="dialog" aria-labelledby="modalCrear" aria-hidden="true">
|
||||||
crossorigin="anonymous"></script>
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js"
|
<div class="modal-content">
|
||||||
integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+"
|
<div class="modal-header">
|
||||||
crossorigin="anonymous"></script>
|
<h4 class="col-12 modal-title text-center">
|
||||||
|
<span id="modalLable">
|
||||||
|
Crear Carrera
|
||||||
|
</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form action="action\action_carreras_insert.php" method="post" id="formaModal"
|
||||||
|
onsubmit="return valida_campos_crear()">
|
||||||
|
<div class="form-box">
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="carreraCrear" class="col-4 col-form-label">Nombre Carrera*</label>
|
||||||
|
<div class="col-8">
|
||||||
|
<input id="carreraCrear" name="carreraCrear" type="text" class="form-control" maxlength="100">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="facultadCrear" class="col-4 col-form-label">Nombre Facultad*</label>
|
||||||
|
<div class="col-8">
|
||||||
|
<?php
|
||||||
|
echo '<select class="form-control area" id="facultadCrear" name="facultadCrear" required style="color: black;">';
|
||||||
|
foreach ($facultad as $op) {
|
||||||
|
echo '<option value="' . $op['facultad_id'] . '">' . $op['facultad_nombre'] . '</option>';
|
||||||
|
}
|
||||||
|
echo '</select>';
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="nivelCrear" class="col-4 col-form-label">Nivel*</label>
|
||||||
|
<div class="col-8">
|
||||||
|
<?php
|
||||||
|
echo '<select class="form-control area" id="nivelCrear" name="nivelCrear" required style="color: black;">';
|
||||||
|
foreach ($nivel as $op) {
|
||||||
|
echo '<option value="' . $op['nivel_id'] . '">' . $op['nivel_nombre'] . '</option>';
|
||||||
|
}
|
||||||
|
echo '</select>';
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="nombreCarreraCrear" class="col-4 col-form-label">Clave de la Carrera*</label>
|
||||||
|
<div class="col-8">
|
||||||
|
<input id="nombreCarreraCrear" name="nombreCarreraCrear" type="text" class="form-control"
|
||||||
|
maxlength="100">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<div class="offset-4 col-8">
|
||||||
|
<button type="submit" class="btn btn-outline-primary" id="submitBtn" data-tipo="1">
|
||||||
|
<span class="ing-aceptar ing-fw"></span> Guardar
|
||||||
|
</button>
|
||||||
|
<button type="reset" class="btn btn-outline-danger" data-dismiss="modal">
|
||||||
|
<span class="ing-cancelar ing-fw"></span> Cancelar
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- End Modal Crear-->
|
||||||
|
|
||||||
|
<!-- Modal -->
|
||||||
|
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="col-12 modal-title text-center">
|
||||||
|
<span id="modalLable">
|
||||||
|
Editar Carrera
|
||||||
|
</span>
|
||||||
|
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form action="./action/action_carreras_update.php" method="post" id="formaModal"
|
||||||
|
onsubmit="return valida_campos_editar()">
|
||||||
|
<input type="hidden" name="id" id="carrera_id">
|
||||||
|
<div class="form-box">
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="carreraEditar" class="col-4 col-form-label">Nombre Carrera*</label>
|
||||||
|
<div class="col-8">
|
||||||
|
<input id="carreraEditar" name="carreraEditar" type="text" class="form-control" maxlength="100">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="facultad" class="col-4 col-form-label">Nombre Facultad*</label>
|
||||||
|
<div class="col-8">
|
||||||
|
<?php
|
||||||
|
echo '<select class="form-control area" id="facultadEditar" name="facultadEditar" required style="color: black;">';
|
||||||
|
foreach ($facultad as $op) {
|
||||||
|
echo '<option value="' . $op['facultad_id'] . '">' . $op['facultad_nombre'] . '</option>';
|
||||||
|
}
|
||||||
|
echo '</select>';
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="nivel" class="col-4 col-form-label">Nivel*</label>
|
||||||
|
<div class="col-8">
|
||||||
|
<?php
|
||||||
|
echo '<select class="form-control area" id="nivelEditar" name="nivelEditar" required style="color: black;">';
|
||||||
|
foreach ($nivel as $op) {
|
||||||
|
echo '<option value="' . $op['nivel_id'] . '">' . $op['nivel_nombre'] . '</option>';
|
||||||
|
}
|
||||||
|
echo '</select>';
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="nombreCarreraEditar" class="col-4 col-form-label">Clave de la Carrera*</label>
|
||||||
|
<div class="col-8">
|
||||||
|
<input id="nombreCarreraEditar" name="nombreCarreraEditar" type="text" class="form-control"
|
||||||
|
maxlength="100">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<div class="offset-4 col-8">
|
||||||
|
<button type="submit" class="btn btn-outline-primary" id="submitBtn" data-tipo="1">
|
||||||
|
<span class="ing-aceptar ing-fw"></span> Guardar
|
||||||
|
</button>
|
||||||
|
<button type="reset" class="btn btn-outline-danger" data-dismiss="modal">
|
||||||
|
<span class="ing-cancelar ing-fw"></span> Cancelar
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- End Modal -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="js/jquery.min.js"></script>
|
||||||
|
<script src="js/bootstrap/bootstrap.min.js"></script>
|
||||||
<script src="js/datalist.js"></script>
|
<script src="js/datalist.js"></script>
|
||||||
<script src="js/carreras.js?<?= rand(0, 2) ?>" type="module"></script>
|
<?php
|
||||||
<script src="js/scrollables.js"></script>
|
require_once 'js/messages.php';
|
||||||
|
?>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function valida_campos_editar() {
|
||||||
|
$('.is-invalid').removeClass('is-invalid');
|
||||||
|
var ok = true;
|
||||||
|
|
||||||
|
if ($("#carreraEditar").val().trim() === "") {
|
||||||
|
$("#carreraEditar").addClass("is-invalid");
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($("#nombreCarreraEditar").val().trim() === "") {
|
||||||
|
$("#nombreCarreraEditar").addClass("is-invalid");
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function valida_campos_crear() {
|
||||||
|
$('.is-invalid').removeClass('is-invalid');
|
||||||
|
var ok = true;
|
||||||
|
|
||||||
|
if ($("#carreraCrear").val().trim() === "") {
|
||||||
|
$("#carreraCrear").addClass("is-invalid");
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($("#nombreCarreraCrear").val().trim() === "") {
|
||||||
|
$("#nombreCarreraCrear").addClass("is-invalid");
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on("click", ".btn-reset", function (event) {
|
||||||
|
var forma = $(this).parents("form");
|
||||||
|
forma.find("input[type=text]").val("");
|
||||||
|
setDatalistFirst("#filter_carrera");
|
||||||
|
forma.submit();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#modal').on('show.bs.modal', function (event) {
|
||||||
|
var button = $(event.relatedTarget);
|
||||||
|
var id = button.closest("tr").data("id");
|
||||||
|
|
||||||
|
//var id = $(event.relatedTarget).parents("tr").data("id");
|
||||||
|
$.ajax({
|
||||||
|
url: "action/action_carreras_select.php",
|
||||||
|
type: "post",
|
||||||
|
dataType: "json",
|
||||||
|
data: {
|
||||||
|
idmateria: id
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
$("#carreraEditar").val(result["carrera_nombre"]);
|
||||||
|
$("#facultadEditar").val(result["facultad_id"]);
|
||||||
|
$("#nivelEditar").val(result["nivel_id"]);
|
||||||
|
$("#nombreCarreraEditar").val(result["clave_carrera"]);
|
||||||
|
$("#carrera_id").val(result["carrera_id"]);
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
console.log("Error")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
49
periodos_sgu.php
Normal file
49
periodos_sgu.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?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_CUSTOMREQUEST => 'POST',
|
||||||
|
CURLOPT_POSTFIELDS =>'{"username":"SGU_APSA_AUD_ASIST","password":"B4qa594JFPr2ufHrZdHS8A=="}',
|
||||||
|
CURLOPT_HTTPHEADER => array(
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'Transfer-Encoding: chunked'
|
||||||
|
),
|
||||||
|
));
|
||||||
|
|
||||||
|
$response = curl_exec($curl);
|
||||||
|
|
||||||
|
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);
|
||||||
|
$periodos = implode("\n", array_map(
|
||||||
|
fn($periodo) => <<<HTML
|
||||||
|
<li class="list-group item" value="{$periodo->IdPeriodo}" data-clave="{$periodo->NombrePeriodo}">
|
||||||
|
{$periodo->NombrePeriodo} - {$periodo->NombreNivel}
|
||||||
|
</li>
|
||||||
|
HTML, array_filter(
|
||||||
|
json_decode($response),
|
||||||
|
fn($periodo) => in_array($periodo->IdPeriodo, [])
|
||||||
|
)));
|
||||||
|
|
||||||
|
curl_close($curl);
|
||||||
|
echo <<<HTML
|
||||||
|
<ul class="list-group" id="alumnos">
|
||||||
|
{$periodos}
|
||||||
|
</ul>
|
||||||
|
HTML;
|
||||||
Reference in New Issue
Block a user