Stable
This commit is contained in:
@@ -1,43 +1,43 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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']);
|
||||||
|
|
||||||
extract($_POST);
|
extract($_POST);
|
||||||
|
|
||||||
$initial_date = DateTime::createFromFormat('d/m/Y', $fecha_inicial);
|
$initial_date = DateTime::createFromFormat('d/m/Y', $fecha_inicial);
|
||||||
$final_date = DateTime::createFromFormat('d/m/Y', $fecha_final);
|
$final_date = DateTime::createFromFormat('d/m/Y', $fecha_final);
|
||||||
|
|
||||||
if ($initial_date > $final_date) {
|
if ($initial_date > $final_date) {
|
||||||
echo json_encode(['error' => 'La fecha inicial no puede ser mayor a la fecha final']);
|
echo json_encode(['error' => 'La fecha inicial no puede ser mayor a la fecha final']);
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
// Nombre del profesor es opcional
|
// Nombre del profesor es opcional
|
||||||
$params = [
|
$params = [
|
||||||
':carrera' => empty($carrera) ? null : $carrera,
|
':carrera' => empty($carrera) ? null : $carrera,
|
||||||
':periodo' => $periodo,
|
':periodo' => $periodo,
|
||||||
':nombre' => empty($nombre) ? null : $nombre,
|
':nombre' => empty($nombre) ? null : $nombre,
|
||||||
':clave' => empty($clave) ? null : $clave,
|
':clave' => empty($clave) ? null : $clave,
|
||||||
':initial_date' => $initial_date->format('Y-m-d'),
|
':initial_date' => $initial_date->format('Y-m-d'),
|
||||||
':final_date' => $final_date->format('Y-m-d'),
|
':final_date' => $final_date->format('Y-m-d'),
|
||||||
':facultad' => $facultad,
|
':facultad' => $facultad,
|
||||||
];
|
];
|
||||||
|
|
||||||
$response = json_encode(
|
$response = json_encode(
|
||||||
[
|
[
|
||||||
"retardo" => query("SELECT FS_HAS_RETARDO(:facultad) retardo", [
|
"retardo" => query("SELECT FS_HAS_RETARDO(:facultad) retardo", [
|
||||||
'facultad' => $facultad
|
'facultad' => $facultad
|
||||||
]),
|
]),
|
||||||
"reporte" => queryAll(
|
"reporte" => queryAll(
|
||||||
"SELECT * FROM fs_asistencia_reporte(:carrera, :periodo, :clave, :nombre, :facultad, :initial_date, :final_date) where total > 0",
|
"SELECT * FROM fs_asistencia_reporte(:carrera, :periodo, :clave, :nombre, :facultad, :initial_date, :final_date) where total > 0",
|
||||||
$params
|
$params
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$user->print_to_log("Genera reporte de asistencias", old: $params);
|
$user->print_to_log("Genera reporte de asistencias", old: $params);
|
||||||
echo $response;
|
echo $response;
|
||||||
|
|||||||
@@ -1,100 +1,100 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../vendor/autoload.php";
|
require_once "../vendor/autoload.php";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
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']);
|
||||||
$user->print_to_log('Genera excel de asistencias');
|
$user->print_to_log('Genera excel de asistencias');
|
||||||
|
|
||||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||||
|
|
||||||
$spreadsheet = new Spreadsheet();
|
$spreadsheet = new Spreadsheet();
|
||||||
$sheet = $spreadsheet->getActiveSheet();
|
$sheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
//crea imagen
|
//crea imagen
|
||||||
$drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing();
|
$drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing();
|
||||||
$drawing->setName('La Salle');
|
$drawing->setName('La Salle');
|
||||||
$drawing->setDescription('La Salle');
|
$drawing->setDescription('La Salle');
|
||||||
$drawing->setPath('../imagenes/logo.png'); // put your path and image here
|
$drawing->setPath('../imagenes/logo.png'); // put your path and image here
|
||||||
$drawing->setCoordinates('A1');
|
$drawing->setCoordinates('A1');
|
||||||
$drawing->setHeight(100);
|
$drawing->setHeight(100);
|
||||||
$drawing->setOffsetX(10);
|
$drawing->setOffsetX(10);
|
||||||
//agrega imagen
|
//agrega imagen
|
||||||
$drawing->setWorksheet($spreadsheet->getActiveSheet());
|
$drawing->setWorksheet($spreadsheet->getActiveSheet());
|
||||||
|
|
||||||
|
|
||||||
// In POST
|
// In POST
|
||||||
/** Array
|
/** Array
|
||||||
* * nombre
|
* * nombre
|
||||||
* * clave
|
* * clave
|
||||||
* * id
|
* * id
|
||||||
* * total
|
* * total
|
||||||
* * asistencias
|
* * asistencias
|
||||||
* * faltas
|
* * faltas
|
||||||
* * justificaciones
|
* * justificaciones
|
||||||
* * retardos
|
* * retardos
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$retardo = query("SELECT COALESCE(FS_HAS_RETARDO(:facultad), FALSE) AS retardo", [':facultad' => $user->facultad['facultad_id']])['retardo'];
|
$retardo = query("SELECT COALESCE(FS_HAS_RETARDO(:facultad), FALSE) AS retardo", [':facultad' => $user->facultad['facultad_id']])['retardo'];
|
||||||
extract($_POST);
|
extract($_POST);
|
||||||
|
|
||||||
$row = 6;
|
$row = 6;
|
||||||
|
|
||||||
$sheet->setCellValue("A$row", 'Clave');
|
$sheet->setCellValue("A$row", 'Clave');
|
||||||
$sheet->setCellValue("B$row", 'Profesor');
|
$sheet->setCellValue("B$row", 'Profesor');
|
||||||
$sheet->setCellValue("C$row", 'Asistencias');
|
$sheet->setCellValue("C$row", 'Asistencias');
|
||||||
$sheet->setCellValue("D$row", 'Faltas');
|
$sheet->setCellValue("D$row", 'Faltas');
|
||||||
$sheet->setCellValue("E$row", 'Justificaciones');
|
$sheet->setCellValue("E$row", 'Justificaciones');
|
||||||
$sheet->setCellValue("F$row", 'Retardos');
|
$sheet->setCellValue("F$row", 'Retardos');
|
||||||
$sheet->setCellValue("G$row", 'Total');
|
$sheet->setCellValue("G$row", 'Total');
|
||||||
|
|
||||||
// $row++;
|
// $row++;
|
||||||
$col = 0;
|
$col = 0;
|
||||||
# die(print_r($asistencias, true));
|
# die(print_r($asistencias, true));
|
||||||
foreach (json_decode($asistencias, true) as $profesor) {
|
foreach (json_decode($asistencias, true) as $profesor) {
|
||||||
$row++;
|
$row++;
|
||||||
$sheet->setCellValue("A$row", $profesor['profesor_clave']);
|
$sheet->setCellValue("A$row", $profesor['profesor_clave']);
|
||||||
$sheet->setCellValue("B$row", $profesor['profesor_nombre']);
|
$sheet->setCellValue("B$row", $profesor['profesor_nombre']);
|
||||||
$sheet->setCellValue("C$row", $profesor['asistencias']);
|
$sheet->setCellValue("C$row", $profesor['asistencias']);
|
||||||
$sheet->setCellValue("D$row", $profesor['faltas']);
|
$sheet->setCellValue("D$row", $profesor['faltas']);
|
||||||
$sheet->setCellValue("E$row", $profesor['justificaciones']);
|
$sheet->setCellValue("E$row", $profesor['justificaciones']);
|
||||||
$sheet->setCellValue("F$row", $profesor['retardos']);
|
$sheet->setCellValue("F$row", $profesor['retardos']);
|
||||||
$sheet->setCellValue("G$row", $profesor['total']);
|
$sheet->setCellValue("G$row", $profesor['total']);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Style
|
# Style
|
||||||
$sheet->getStyle("A6:G$row")->getBorders()->getAllBorders()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN);
|
$sheet->getStyle("A6:G$row")->getBorders()->getAllBorders()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN);
|
||||||
$sheet->getStyle("A6:G$row")->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
|
$sheet->getStyle("A6:G$row")->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
|
||||||
$sheet->getStyle("A6:G$row")->getAlignment()->setVertical(\PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER);
|
$sheet->getStyle("A6:G$row")->getAlignment()->setVertical(\PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER);
|
||||||
$sheet->getStyle("A6:G$row")->getAlignment()->setWrapText(true);
|
$sheet->getStyle("A6:G$row")->getAlignment()->setWrapText(true);
|
||||||
$sheet->getStyle("A6:G$row")->getFont()->setSize(12);
|
$sheet->getStyle("A6:G$row")->getFont()->setSize(12);
|
||||||
$sheet->getStyle("A6:G$row")->getFont()->setName('Indivisa Sans');
|
$sheet->getStyle("A6:G$row")->getFont()->setName('Indivisa Sans');
|
||||||
# Autosize columns
|
# Autosize columns
|
||||||
foreach (range('A', 'G') as $column) {
|
foreach (range('A', 'G') as $column) {
|
||||||
$sheet->getColumnDimension($column)->setAutoSize(true);
|
$sheet->getColumnDimension($column)->setAutoSize(true);
|
||||||
}
|
}
|
||||||
# filters in the column
|
# filters in the column
|
||||||
$sheet->setAutoFilter("A6:G6");
|
$sheet->setAutoFilter("A6:G6");
|
||||||
|
|
||||||
if (!$retardo) # hide column
|
if (!$retardo) # hide column
|
||||||
$sheet->getColumnDimension('F')->setVisible(false);
|
$sheet->getColumnDimension('F')->setVisible(false);
|
||||||
|
|
||||||
#$writer = new Xlsx($spreadsheet);
|
#$writer = new Xlsx($spreadsheet);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
# $writer->save('asistencias.xlsx');
|
# $writer->save('asistencias.xlsx');
|
||||||
|
|
||||||
// download
|
// download
|
||||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||||
header('Content-Disposition: attachment;filename="asistencias.xlsx"');
|
header('Content-Disposition: attachment;filename="asistencias.xlsx"');
|
||||||
header('Cache-Control: max-age=0');
|
header('Cache-Control: max-age=0');
|
||||||
|
|
||||||
// cache expires in 60 seconds (1 minute)
|
// cache expires in 60 seconds (1 minute)
|
||||||
header('Expires: mon 26 jul 1997 05:00:00 gmt');
|
header('Expires: mon 26 jul 1997 05:00:00 gmt');
|
||||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||||
header('Cache-Control: cache, must-revalidate');
|
header('Cache-Control: cache, must-revalidate');
|
||||||
header('Pragma: public');
|
header('Pragma: public');
|
||||||
|
|
||||||
$writer->save('php://output');
|
$writer->save('php://output');
|
||||||
|
|||||||
@@ -1,57 +1,57 @@
|
|||||||
<?
|
<?
|
||||||
#input $_GET['id_espacio_sgu']
|
#input $_GET['id_espacio_sgu']
|
||||||
#output rutas: [ ...ruta, salones: [{...salon}] ]
|
#output rutas: [ ...ruta, salones: [{...salon}] ]
|
||||||
header('Content-Type: application/json charset=utf-8');
|
header('Content-Type: application/json charset=utf-8');
|
||||||
$information = [
|
$information = [
|
||||||
'GET' => [
|
'GET' => [
|
||||||
#'periodo_id',
|
#'periodo_id',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
// check method
|
// check method
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||||
array_walk($information['GET'], function ($value) {
|
array_walk($information['GET'], function ($value) {
|
||||||
if (!array_key_exists($value, $_GET)) {
|
if (!array_key_exists($value, $_GET)) {
|
||||||
http_response_code(400);
|
http_response_code(400);
|
||||||
echo json_encode(['error' => "$value is required"]);
|
echo json_encode(['error' => "$value is required"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$data = $db->query("SELECT *, horario_view.facultad_id FROM registro
|
$data = $db->query("SELECT *, horario_view.facultad_id, horario_view.periodo_id FROM registro
|
||||||
JOIN horario_view USING (horario_id)
|
JOIN horario_view USING (horario_id)
|
||||||
LEFT JOIN estado_supervisor USING (estado_supervisor_id)
|
LEFT JOIN estado_supervisor USING (estado_supervisor_id)
|
||||||
LEFT JOIN profesor USING (profesor_id)
|
LEFT JOIN profesor USING (profesor_id)
|
||||||
LEFT JOIN usuario ON usuario.usuario_id = registro.supervisor_id
|
LEFT JOIN usuario ON usuario.usuario_id = registro.supervisor_id
|
||||||
ORDER BY registro_fecha_ideal DESC, horario_hora ASC, registro_fecha_supervisor ASC");
|
ORDER BY registro_fecha_ideal DESC, horario_hora ASC, registro_fecha_supervisor ASC");
|
||||||
|
|
||||||
$last_query = [
|
$last_query = [
|
||||||
'query' => $db->getLastQuery(),
|
'query' => $db->getLastQuery(),
|
||||||
];
|
];
|
||||||
|
|
||||||
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
} else {
|
} else {
|
||||||
http_response_code(405);
|
http_response_code(405);
|
||||||
echo json_encode(['error' => 'method not allowed']);
|
echo json_encode(['error' => 'method not allowed']);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (PDOException $th) {
|
} catch (PDOException $th) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => $th->getMessage(),
|
'error' => $th->getMessage(),
|
||||||
'query' => $db->getLastQuery(),
|
'query' => $db->getLastQuery(),
|
||||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
exit;
|
exit;
|
||||||
} catch (Exception $th) {
|
} catch (Exception $th) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => $th->getMessage(),
|
'error' => $th->getMessage(),
|
||||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = '../';
|
$ruta = '../';
|
||||||
require_once '../include/bd_pdo.php';
|
require_once '../include/bd_pdo.php';
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
$sql = "SELECT fu_update_estado_aviso(false, :id)";
|
$sql = "SELECT fu_update_estado_aviso(false, :id)";
|
||||||
$params = [':id' => $_POST['id']];
|
$params = [':id' => $_POST['id']];
|
||||||
echo json_encode(query($sql, $params, false));
|
echo json_encode(query($sql, $params, false));
|
||||||
?>
|
?>
|
||||||
@@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = '../';
|
$ruta = '../';
|
||||||
require_once '../include/bd_pdo.php';
|
require_once '../include/bd_pdo.php';
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
$profesores = [];
|
$profesores = [];
|
||||||
|
|
||||||
if(isset($_POST['tipo'])){
|
if(isset($_POST['tipo'])){
|
||||||
foreach($_POST['tipo'] as $tipo){
|
foreach($_POST['tipo'] as $tipo){
|
||||||
$profesores_carrera = query("SELECT profesor_id FROM fs_profesor_carrera(:carrera_id)", [':carrera_id' => $tipo], false);
|
$profesores_carrera = query("SELECT profesor_id FROM fs_profesor_carrera(:carrera_id)", [':carrera_id' => $tipo], false);
|
||||||
foreach($profesores_carrera as $profesor){
|
foreach($profesores_carrera as $profesor){
|
||||||
array_push($profesores, $profesor['profesor_id']);
|
array_push($profesores, $profesor['profesor_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql = "SELECT fi_aviso(:fecha_inicial, :fecha_final, :texto, :facultad)";
|
$sql = "SELECT fi_aviso(:fecha_inicial, :fecha_final, :texto, :facultad)";
|
||||||
$params = [':fecha_inicial' => $_POST['fecha_inicial'], ':fecha_final' => $_POST['fecha_final'], ':texto' => $_POST['texto'], ':facultad' => $_POST['facultad']];
|
$params = [':fecha_inicial' => $_POST['fecha_inicial'], ':fecha_final' => $_POST['fecha_final'], ':texto' => $_POST['texto'], ':facultad' => $_POST['facultad']];
|
||||||
$aviso_id = query($sql, $params, true);
|
$aviso_id = query($sql, $params, true);
|
||||||
|
|
||||||
$sql = "SELECT fi_aviso_profesor(:aviso_id, :profesor_id)";
|
$sql = "SELECT fi_aviso_profesor(:aviso_id, :profesor_id)";
|
||||||
foreach($profesores as $profesor_id){
|
foreach($profesores as $profesor_id){
|
||||||
$params = [':aviso_id' => $aviso_id['fi_aviso'], ':profesor_id' => $profesor_id];
|
$params = [':aviso_id' => $aviso_id['fi_aviso'], ':profesor_id' => $profesor_id];
|
||||||
query($sql, $params, false);
|
query($sql, $params, false);
|
||||||
}
|
}
|
||||||
header("Location: ../avisos.php");
|
header("Location: ../avisos.php");
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
||||||
@@ -1,52 +1,52 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = '../';
|
$ruta = '../';
|
||||||
require_once '../include/bd_pdo.php';
|
require_once '../include/bd_pdo.php';
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
$aviso = query("SELECT * FROM fs_aviso(:id, null, null, null, 0, null)", [':id' => $_POST['aviso_id']], true);
|
$aviso = query("SELECT * FROM fs_aviso(:id, null, null, null, 0, null)", [':id' => $_POST['aviso_id']], true);
|
||||||
if(isset($_POST['fecha_final'])){
|
if(isset($_POST['fecha_final'])){
|
||||||
$fecha_fin = $_POST['fecha_final'];
|
$fecha_fin = $_POST['fecha_final'];
|
||||||
}else{
|
}else{
|
||||||
$fecha_fin = $aviso['aviso_fecha_final'];
|
$fecha_fin = $aviso['aviso_fecha_final'];
|
||||||
}
|
}
|
||||||
if(isset($_POST['texto'])){
|
if(isset($_POST['texto'])){
|
||||||
$texto = $_POST['texto'];
|
$texto = $_POST['texto'];
|
||||||
}else{
|
}else{
|
||||||
$texto = $aviso['aviso_texto'];
|
$texto = $aviso['aviso_texto'];
|
||||||
}
|
}
|
||||||
if(isset($_POST['fecha_inicial'])){
|
if(isset($_POST['fecha_inicial'])){
|
||||||
$fecha_inicio = $_POST['fecha_inicial'];
|
$fecha_inicio = $_POST['fecha_inicial'];
|
||||||
}else{
|
}else{
|
||||||
$fecha_inicio = $aviso['aviso_fecha_inicial'];
|
$fecha_inicio = $aviso['aviso_fecha_inicial'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT fu_update_aviso(:id, :fecha_fin, :texto, :fecha_inicio)";
|
$sql = "SELECT fu_update_aviso(:id, :fecha_fin, :texto, :fecha_inicio)";
|
||||||
$params = [':id' => $_POST['aviso_id'], ':fecha_fin' => $fecha_fin, ':texto' => $texto, ':fecha_inicio' => $fecha_inicio];
|
$params = [':id' => $_POST['aviso_id'], ':fecha_fin' => $fecha_fin, ':texto' => $texto, ':fecha_inicio' => $fecha_inicio];
|
||||||
query($sql, $params, true);
|
query($sql, $params, true);
|
||||||
|
|
||||||
query("SELECT fd_aviso_profesor(:aviso_id)", [':aviso_id' => $_POST['aviso_id']], false);
|
query("SELECT fd_aviso_profesor(:aviso_id)", [':aviso_id' => $_POST['aviso_id']], false);
|
||||||
|
|
||||||
$profesores = [];
|
$profesores = [];
|
||||||
if(isset($_POST['tipo'])){
|
if(isset($_POST['tipo'])){
|
||||||
foreach($_POST['tipo'] as $tipo){
|
foreach($_POST['tipo'] as $tipo){
|
||||||
$profesores_carrera = query("SELECT profesor_id FROM fs_profesor_carrera(:carrera_id)", [':carrera_id' => $tipo], false);
|
$profesores_carrera = query("SELECT profesor_id FROM fs_profesor_carrera(:carrera_id)", [':carrera_id' => $tipo], false);
|
||||||
foreach($profesores_carrera as $profesor){
|
foreach($profesores_carrera as $profesor){
|
||||||
array_push($profesores, $profesor['profesor_id']);
|
array_push($profesores, $profesor['profesor_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach($_POST['usuario'] as $profesor){
|
foreach($_POST['usuario'] as $profesor){
|
||||||
array_push($profesores, $profesor);
|
array_push($profesores, $profesor);
|
||||||
}
|
}
|
||||||
$sql = "SELECT fi_aviso_profesor(:aviso_id, :profesor_id)";
|
$sql = "SELECT fi_aviso_profesor(:aviso_id, :profesor_id)";
|
||||||
foreach($profesores as $profesor_id){
|
foreach($profesores as $profesor_id){
|
||||||
$params = [':aviso_id' => $_POST['aviso_id'], ':profesor_id' => $profesor_id];
|
$params = [':aviso_id' => $_POST['aviso_id'], ':profesor_id' => $profesor_id];
|
||||||
query($sql, $params, false);
|
query($sql, $params, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
header("Location: ../avisos.php");
|
header("Location: ../avisos.php");
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
||||||
@@ -1,24 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
|
|
||||||
$nivel = $db->where("id", $_POST['periodo'])->getOne("fs_periodo", "nivel_id");
|
$nivel = $db->where("id", $_POST['periodo'])->getOne("fs_periodo", "nivel_id");
|
||||||
$carreras = $db
|
$carreras = $db
|
||||||
->where("nivel", $nivel)
|
->where("nivel", $nivel)
|
||||||
->where("facultad", $_POST['facultad'])
|
->where("facultad", $_POST['facultad'])
|
||||||
->get("fs_carrera", null, "id, carrera");
|
->get("fs_carrera", null, "id, carrera");
|
||||||
|
|
||||||
$user->print_to_log("Crea carrera", old: $_POST);
|
$user->print_to_log("Crea carrera", old: $_POST);
|
||||||
|
|
||||||
die(json_encode($carreras));
|
die(json_encode($carreras));
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
$sql = "SELECT fi_carrera(:nombre, :idfacultad, :idnivel, true, :estado)";
|
$sql = "SELECT fi_carrera(:nombre, :idfacultad, :idnivel, true, :estado)";
|
||||||
$params = [':nombre' => mb_strtoupper($_POST['nombre']), ':idfacultad' => $_POST['facultad'], ':idnivel' => $_POST['nivel'], ':estado' => $_POST['estado']];
|
$params = [':nombre' => mb_strtoupper($_POST['nombre']), ':idfacultad' => $_POST['facultad'], ':idnivel' => $_POST['nivel'], ':estado' => $_POST['estado']];
|
||||||
|
|
||||||
print_r($_POST);
|
print_r($_POST);
|
||||||
echo json_encode(query($sql, $params, true));
|
echo json_encode(query($sql, $params, true));
|
||||||
$user->print_to_log("Crea carrera", new: $params);
|
$user->print_to_log("Crea carrera", new: $params);
|
||||||
header("Location: ../carreras.php?facultad=" . $_POST['facultad']);
|
header("Location: ../carreras.php?facultad=" . $_POST['facultad']);
|
||||||
exit();
|
exit();
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
$sql = "SELECT * FROM fs_carreras(:idfacultad, :idcarrera, null)";
|
$sql = "SELECT * FROM fs_carreras(:idfacultad, :idcarrera, null)";
|
||||||
$params = [':idfacultad' => $_POST['idfacultad'], ':idcarrera' => $_POST['idcarrera']];
|
$params = [':idfacultad' => $_POST['idfacultad'], ':idcarrera' => $_POST['idcarrera']];
|
||||||
$user->print_to_log("Crea carrera", old: $params);
|
$user->print_to_log("Crea carrera", old: $params);
|
||||||
echo json_encode(query($sql, $params, true));
|
echo json_encode(query($sql, $params, true));
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
$old = query("SELECT * FROM FS_CARRERA WHERE ID = :id", [':id' => $_POST['id']]);
|
$old = query("SELECT * FROM FS_CARRERA WHERE ID = :id", [':id' => $_POST['id']]);
|
||||||
$sql = "SELECT fu_updatecarrera(:idcarrera, :nombre, :activa, :idnivel)";
|
$sql = "SELECT fu_updatecarrera(:idcarrera, :nombre, :activa, :idnivel)";
|
||||||
print_r($_POST);
|
print_r($_POST);
|
||||||
$params = [':idcarrera' => $_POST['id'], ':nombre' => mb_strtoupper($_POST['nombre']), ':activa' => $_POST['estado'], ':idnivel' => $_POST['nivel']];
|
$params = [':idcarrera' => $_POST['id'], ':nombre' => mb_strtoupper($_POST['nombre']), ':activa' => $_POST['estado'], ':idnivel' => $_POST['nivel']];
|
||||||
query($sql, $params, true);
|
query($sql, $params, true);
|
||||||
$user->print_to_log("Actualiza carrera.", old: $old, new: $params);
|
$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();
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
#$sql = "SELECT * FROM diasfestivos WHERE diasfestivos_id = :id";
|
#$sql = "SELECT * FROM diasfestivos WHERE diasfestivos_id = :id";
|
||||||
$sql = "DELETE FROM diasfestivos WHERE diasfestivos_id = :id";
|
$sql = "DELETE FROM diasfestivos WHERE diasfestivos_id = :id";
|
||||||
$params = [':id' => $_POST['id']];
|
$params = [':id' => $_POST['id']];
|
||||||
echo json_encode(query($sql, $params, false));
|
echo json_encode(query($sql, $params, false));
|
||||||
|
|||||||
@@ -1,48 +1,48 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
print_r($_POST);
|
print_r($_POST);
|
||||||
if ($_POST['periodo'] == 0) {
|
if ($_POST['periodo'] == 0) {
|
||||||
$periodo = null;
|
$periodo = null;
|
||||||
} else {
|
} else {
|
||||||
$periodo = $_POST['periodo'];
|
$periodo = $_POST['periodo'];
|
||||||
}
|
}
|
||||||
if (isset($_POST['rango'])) {
|
if (isset($_POST['rango'])) {
|
||||||
$diaInicio = new DateTime(date("Y-m-d", strtotime(str_replace("/", "-", $_POST['diaFestivo']))));
|
$diaInicio = new DateTime(date("Y-m-d", strtotime(str_replace("/", "-", $_POST['diaFestivo']))));
|
||||||
$diaFin = new DateTime(date("Y-m-d", strtotime(str_replace("/", "-", $_POST['diaFestivoFin']))));
|
$diaFin = new DateTime(date("Y-m-d", strtotime(str_replace("/", "-", $_POST['diaFestivoFin']))));
|
||||||
$cantidad = $diaFin->diff($diaInicio);
|
$cantidad = $diaFin->diff($diaInicio);
|
||||||
$date = date("Y-m-d", strtotime(str_replace("/", "-", $_POST['diaFestivo'])));
|
$date = date("Y-m-d", strtotime(str_replace("/", "-", $_POST['diaFestivo'])));
|
||||||
for ($dias = 0; $dias <= $cantidad->days; $dias++) {
|
for ($dias = 0; $dias <= $cantidad->days; $dias++) {
|
||||||
$sql = "SELECT fi_diasfestivos(:periodo, :dia)";
|
$sql = "SELECT fi_diasfestivos(:periodo, :dia)";
|
||||||
$params = [':periodo' => $periodo, ':dia' => $date];
|
$params = [':periodo' => $periodo, ':dia' => $date];
|
||||||
query($sql, $params, false);
|
query($sql, $params, false);
|
||||||
$date = date("Y-m-d", strtotime($date . "+ 1 days"));
|
$date = date("Y-m-d", strtotime($date . "+ 1 days"));
|
||||||
}
|
}
|
||||||
header("Location: ../días_festivos.php");
|
header("Location: ../días_festivos.php");
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
$sql = "SELECT * FROM fs_diasfestivos(null, :dia)";
|
$sql = "SELECT * FROM fs_diasfestivos(null, :dia)";
|
||||||
$params = [':dia' => $_POST['diaFestivo']];
|
$params = [':dia' => $_POST['diaFestivo']];
|
||||||
$dia_general = query($sql, $params, false);
|
$dia_general = query($sql, $params, false);
|
||||||
$sql = "SELECT * FROM fs_diasfestivos(null, null, :periodo, :dia)";
|
$sql = "SELECT * FROM fs_diasfestivos(null, null, :periodo, :dia)";
|
||||||
$params = [':periodo' => $periodo, ":dia" => $_POST['diaFestivo']];
|
$params = [':periodo' => $periodo, ":dia" => $_POST['diaFestivo']];
|
||||||
$dia = query($sql, $params, false);
|
$dia = query($sql, $params, false);
|
||||||
if (!$dia && !$dia_general) { //no hay repetidos
|
if (!$dia && !$dia_general) { //no hay repetidos
|
||||||
$sql = "SELECT fi_diasfestivos(:periodo, :dia)";
|
$sql = "SELECT fi_diasfestivos(:periodo, :dia)";
|
||||||
$id = query($sql, $params, false);
|
$id = query($sql, $params, false);
|
||||||
header("Location: ../días_festivos.php");
|
header("Location: ../días_festivos.php");
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
header("Location: ../días_festivos.php?error=1");
|
header("Location: ../días_festivos.php?error=1");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
$params = [':id' => $_POST['id']];
|
$params = [':id' => $_POST['id']];
|
||||||
if ($_POST['periodo'] == 0) {
|
if ($_POST['periodo'] == 0) {
|
||||||
$sql = "SELECT * FROM fs_diasfestivos(:id, null)";
|
$sql = "SELECT * FROM fs_diasfestivos(:id, null)";
|
||||||
} else {
|
} else {
|
||||||
$sql = "SELECT * FROM fs_diasfestivos(null, :id, null, null)";
|
$sql = "SELECT * FROM fs_diasfestivos(null, :id, null, null)";
|
||||||
}
|
}
|
||||||
echo json_encode(query($sql, $params, true));
|
echo json_encode(query($sql, $params, true));
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
if ($_POST['periodo'] == 0) {
|
if ($_POST['periodo'] == 0) {
|
||||||
$periodo = null;
|
$periodo = null;
|
||||||
} else
|
} else
|
||||||
$periodo = $_POST['periodo'];
|
$periodo = $_POST['periodo'];
|
||||||
$sql = "SELECT * FROM fs_diasfestivos(null, :dia) WHERE diasfestivos_id != :id";
|
$sql = "SELECT * FROM fs_diasfestivos(null, :dia) WHERE diasfestivos_id != :id";
|
||||||
$params = [':dia' => $_POST['diaFestivo'], ':id' => $_POST['id']];
|
$params = [':dia' => $_POST['diaFestivo'], ':id' => $_POST['id']];
|
||||||
$dia_general = query($sql, $params, false);
|
$dia_general = query($sql, $params, false);
|
||||||
$sql = "SELECT * FROM fs_diasfestivos(null, null, :periodo, :dia) WHERE diasfestivos_id != :id";
|
$sql = "SELECT * FROM fs_diasfestivos(null, null, :periodo, :dia) WHERE diasfestivos_id != :id";
|
||||||
$params = [':periodo' => $periodo, ':dia' => $_POST['diaFestivo'], ':id' => $_POST['id']];
|
$params = [':periodo' => $periodo, ':dia' => $_POST['diaFestivo'], ':id' => $_POST['id']];
|
||||||
$dia = query($sql, $params, false);
|
$dia = query($sql, $params, false);
|
||||||
if (!$dia && !$dia_general) { //no hay repetidos
|
if (!$dia && !$dia_general) { //no hay repetidos
|
||||||
$sql = "SELECT fu_update_diasfestivos(:id, :dia, :periodo)";
|
$sql = "SELECT fu_update_diasfestivos(:id, :dia, :periodo)";
|
||||||
query($sql, $params, false);
|
query($sql, $params, false);
|
||||||
header("Location: ../días_festivos.php");
|
header("Location: ../días_festivos.php");
|
||||||
exit();
|
exit();
|
||||||
} else { //es repetido
|
} else { //es repetido
|
||||||
header("Location: ../días_festivos.php?error=1");
|
header("Location: ../días_festivos.php?error=1");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,42 @@
|
|||||||
<?
|
<?
|
||||||
#input $_GET['id_espacio_sgu']
|
#input $_GET['id_espacio_sgu']
|
||||||
define("INFORMATION", [
|
define("INFORMATION", [
|
||||||
'GET' => [
|
'GET' => [
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
#output rutas: [ ...ruta, salones: [{...salon}] ]
|
#output rutas: [ ...ruta, salones: [{...salon}] ]
|
||||||
header('Content-Type: application/json charset=utf-8');
|
header('Content-Type: application/json charset=utf-8');
|
||||||
#return html
|
#return html
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
// check method
|
// check method
|
||||||
try {
|
try {
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||||
// check parameters
|
// check parameters
|
||||||
$raw = file_get_contents('php://input');
|
$raw = file_get_contents('php://input');
|
||||||
$post_get = json_decode($raw, true);
|
$post_get = json_decode($raw, true);
|
||||||
|
|
||||||
$data = $db->get('estado_supervisor');
|
$data = $db->get('estado_supervisor');
|
||||||
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
} else {
|
} else {
|
||||||
http_response_code(405);
|
http_response_code(405);
|
||||||
echo json_encode(['error' => 'method not allowed']);
|
echo json_encode(['error' => 'method not allowed']);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (PDOException $th) {
|
} catch (PDOException $th) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => $th->getMessage(),
|
'error' => $th->getMessage(),
|
||||||
'query' => $db->getLastQuery(),
|
'query' => $db->getLastQuery(),
|
||||||
'post_data' => $post_get,
|
'post_data' => $post_get,
|
||||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
exit;
|
exit;
|
||||||
} catch (Exception $th) {
|
} catch (Exception $th) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => $th->getMessage(),
|
'error' => $th->getMessage(),
|
||||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@@ -1,51 +1,51 @@
|
|||||||
<?
|
<?
|
||||||
$information = [
|
$information = [
|
||||||
'GET' => [],
|
'GET' => [],
|
||||||
];
|
];
|
||||||
header('Content-Type: application/json charset=utf-8');
|
header('Content-Type: application/json charset=utf-8');
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// check if the session is started
|
||||||
if (!isset($_SESSION['user'])) {
|
if (!isset($_SESSION['user'])) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => 'No se ha iniciado sesión'
|
'error' => 'No se ha iniciado sesión'
|
||||||
]);
|
]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
try {
|
try {
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||||
// check parameters
|
// check parameters
|
||||||
array_walk($information['GET'], function ($value) {
|
array_walk($information['GET'], function ($value) {
|
||||||
if (!array_key_exists($value, $_GET)) {
|
if (!array_key_exists($value, $_GET)) {
|
||||||
http_response_code(400);
|
http_response_code(400);
|
||||||
echo json_encode(['error' => "$value is required"]);
|
echo json_encode(['error' => "$value is required"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// step 1: get subrutas
|
// step 1: get subrutas
|
||||||
$data = $db->get('facultad');
|
$data = $db->get('facultad');
|
||||||
|
|
||||||
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
} else {
|
} else {
|
||||||
http_response_code(405);
|
http_response_code(405);
|
||||||
echo json_encode(['error' => 'method not allowed']);
|
echo json_encode(['error' => 'method not allowed']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} catch (PDOException $th) {
|
} catch (PDOException $th) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => $th->getMessage(),
|
'error' => $th->getMessage(),
|
||||||
'query' => $db->getLastQuery(),
|
'query' => $db->getLastQuery(),
|
||||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
exit;
|
exit;
|
||||||
} catch (Exception $th) {
|
} catch (Exception $th) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => $th->getMessage(),
|
'error' => $th->getMessage(),
|
||||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
$sql = "SELECT fi_facultad(:nombre, :activa)";
|
$sql = "SELECT fi_facultad(:nombre, :activa)";
|
||||||
$params = [':nombre' => mb_strtoupper($_POST['nombre']), ':activa' => $_POST['estado']];
|
$params = [':nombre' => mb_strtoupper($_POST['nombre']), ':activa' => $_POST['estado']];
|
||||||
$fac_id = query($sql, $params, true);
|
$fac_id = query($sql, $params, true);
|
||||||
$sql = "SELECT fi_tiempo_checado(:idfacultad, :idnivel, :antes, :despues, :retardo)";
|
$sql = "SELECT fi_tiempo_checado(:idfacultad, :idnivel, :antes, :despues, :retardo)";
|
||||||
$params = [':idfacultad' => $fac_id['fi_facultad'], ':idnivel' => 1, ':antes' => -15, ':despues' => 16, ':retardo' => 31];
|
$params = [':idfacultad' => $fac_id['fi_facultad'], ':idnivel' => 1, ':antes' => -15, ':despues' => 16, ':retardo' => 31];
|
||||||
query($sql, $params, false);
|
query($sql, $params, false);
|
||||||
$params = [':idfacultad' => $fac_id['fi_facultad'], ':idnivel' => 2, ':antes' => -15, ':despues' => 16, ':retardo' => 31];
|
$params = [':idfacultad' => $fac_id['fi_facultad'], ':idnivel' => 2, ':antes' => -15, ':despues' => 16, ':retardo' => 31];
|
||||||
query($sql, $params, false);
|
query($sql, $params, false);
|
||||||
print_r($fac_id);
|
print_r($fac_id);
|
||||||
header("Location: ../carreras.php?facultad=" . $fac_id['fi_facultad']);
|
header("Location: ../carreras.php?facultad=" . $fac_id['fi_facultad']);
|
||||||
exit();
|
exit();
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
$sql = "SELECT * FROM facultad WHERE facultad_id = :idFacultad";
|
$sql = "SELECT * FROM facultad WHERE facultad_id = :idFacultad";
|
||||||
$params = [':idFacultad' => $_POST['id_facultad']];
|
$params = [':idFacultad' => $_POST['id_facultad']];
|
||||||
echo json_encode(query($sql, $params, false));
|
echo json_encode(query($sql, $params, false));
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
$sql = "SELECT fu_updatefacultad(:nombre, :activa, :id)";
|
$sql = "SELECT fu_updatefacultad(:nombre, :activa, :id)";
|
||||||
$params = [':nombre' => mb_strtoupper($_POST['nombre']), ':activa' => $_POST['estado'], ':id' => $_POST['id']];
|
$params = [':nombre' => mb_strtoupper($_POST['nombre']), ':activa' => $_POST['estado'], ':id' => $_POST['id']];
|
||||||
query($sql, $params, false);
|
query($sql, $params, false);
|
||||||
header("Location: ../facultades.php");
|
header("Location: ../facultades.php");
|
||||||
exit();
|
exit();
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
|
|
||||||
// if method is get
|
// if method is get
|
||||||
header("Content-Type: application/json");
|
header("Content-Type: application/json");
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||||
$user->print_to_log("Acceso a reposiciones");
|
$user->print_to_log("Acceso a reposiciones");
|
||||||
if (empty($_GET['horario_id']))
|
if (empty($_GET['horario_id']))
|
||||||
die(json_encode(['error' => 'No se ha enviado el id del horario']));
|
die(json_encode(['error' => 'No se ha enviado el id del horario']));
|
||||||
// fecha greater than today
|
// fecha greater than today
|
||||||
$reposiciones = $db->query("SELECT fecha, EXTRACT(DOW FROM fecha) as day, EXTRACT(MONTH FROM fecha) as month, EXTRACT(YEAR FROM fecha) as year, EXTRACT(DAY FROM fecha) as dia_mes FROM fechas_clase(:horario_id) WHERE fecha > CURRENT_DATE", [
|
$reposiciones = $db->query("SELECT fecha, EXTRACT(DOW FROM fecha) as day, EXTRACT(MONTH FROM fecha) as month, EXTRACT(YEAR FROM fecha) as year, EXTRACT(DAY FROM fecha) as dia_mes FROM fechas_clase(:horario_id) WHERE fecha > CURRENT_DATE", [
|
||||||
'horario_id' => $_GET['horario_id']
|
'horario_id' => $_GET['horario_id']
|
||||||
]);
|
]);
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'status' => 'success',
|
'status' => 'success',
|
||||||
'data' => $reposiciones
|
'data' => $reposiciones
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once("../include/bd_pdo.php");
|
require_once("../include/bd_pdo.php");
|
||||||
extract($_POST);
|
extract($_POST);
|
||||||
$params = ['per' => $_POST['periodo'], 'fac' => $_POST['facultad'], 'car' => $_POST['carrera']];
|
$params = ['per' => $_POST['periodo'], 'fac' => $_POST['facultad'], 'car' => $_POST['carrera']];
|
||||||
|
|
||||||
$user->print_to_log("Acceso a grupos", old: $params);
|
$user->print_to_log("Acceso a grupos", old: $params);
|
||||||
$grupos = queryAll("SELECT DISTINCT LENGTH(GRUPO), GRUPO FROM fs_horario_basic WHERE PERIODO_ID = COALESCE(:per, PERIODO_ID) AND FACULTAD_ID = COALESCE(:fac, FACULTAD_ID) AND CARRERA_ID = COALESCE(:car, CARRERA_ID) ORDER BY LENGTH(GRUPO), GRUPO", $params);
|
$grupos = queryAll("SELECT DISTINCT LENGTH(GRUPO), GRUPO FROM fs_horario_basic WHERE PERIODO_ID = COALESCE(:per, PERIODO_ID) AND FACULTAD_ID = COALESCE(:fac, FACULTAD_ID) AND CARRERA_ID = COALESCE(:car, CARRERA_ID) ORDER BY LENGTH(GRUPO), GRUPO", $params);
|
||||||
|
|
||||||
$grupos = array_map(fn ($grupo) => $grupo['grupo'], $grupos);
|
$grupos = array_map(fn ($grupo) => $grupo['grupo'], $grupos);
|
||||||
|
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'status' => 'success',
|
'status' => 'success',
|
||||||
'grupos' => $grupos
|
'grupos' => $grupos
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once("../include/bd_pdo.php");
|
require_once("../include/bd_pdo.php");
|
||||||
|
|
||||||
$grupo = isset($_GET['grupo']) ? $_GET['grupo'] : 1;
|
$grupo = isset($_GET['grupo']) ? $_GET['grupo'] : 1;
|
||||||
$grupo_horarios = $db->querySingle(
|
$grupo_horarios = $db->querySingle(
|
||||||
"WITH bloques AS (
|
"WITH bloques AS (
|
||||||
SELECT id, hora_inicio, hora_fin
|
SELECT id, hora_inicio, hora_fin
|
||||||
FROM public.bloque_horario
|
FROM public.bloque_horario
|
||||||
WHERE grupo = ?
|
WHERE grupo = ?
|
||||||
ORDER BY hora_inicio ASC
|
ORDER BY hora_inicio ASC
|
||||||
)
|
)
|
||||||
|
|
||||||
SELECT json_agg(json_build_object(
|
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', current_time between hora_inicio and hora_fin
|
||||||
)) AS bloque_horario
|
)) AS bloque_horario
|
||||||
FROM bloques
|
FROM bloques
|
||||||
",
|
",
|
||||||
[$grupo]
|
[$grupo]
|
||||||
)['bloque_horario'];
|
)['bloque_horario'];
|
||||||
|
|
||||||
|
|
||||||
echo $grupo_horarios;
|
echo $grupo_horarios;
|
||||||
|
|||||||
@@ -1,35 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once("../include/bd_pdo.php");
|
require_once("../include/bd_pdo.php");
|
||||||
|
|
||||||
extract($_POST);
|
extract($_POST);
|
||||||
|
|
||||||
$dias = array("domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado");
|
$dias = array("domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado");
|
||||||
$horarios = $db
|
$horarios = $db
|
||||||
->get("fs_horario($periodo, $carrera, '$grupo', true)");
|
->get("fs_horario($periodo, $carrera, '$grupo', true)");
|
||||||
|
|
||||||
// get each id from $horarios (might be duplicate)
|
// get each id from $horarios (might be duplicate)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$horarios = array_map(function ($horario) use ($dias, $db) {
|
$horarios = array_map(function ($horario) use ($dias, $db) {
|
||||||
$horario['profesores'] = array_map(
|
$horario['profesores'] = array_map(
|
||||||
fn ($profesor) =>
|
fn ($profesor) =>
|
||||||
$db->where("id", $profesor)->getOne("fs_profesor"),
|
$db->where("id", $profesor)->getOne("fs_profesor"),
|
||||||
explode(",", substr($horario['profesores'], 1, -1))
|
explode(",", substr($horario['profesores'], 1, -1))
|
||||||
);
|
);
|
||||||
$horario['dia'] = $dias[$horario['dia']];
|
$horario['dia'] = $dias[$horario['dia']];
|
||||||
return $horario;
|
return $horario;
|
||||||
}, $horarios);
|
}, $horarios);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
"status" => "error",
|
"status" => "error",
|
||||||
"message" => $e->getMessage(),
|
"message" => $e->getMessage(),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?= json_encode([
|
<?= json_encode([
|
||||||
"status" => "success",
|
"status" => "success",
|
||||||
"horario" => $horarios,
|
"horario" => $horarios,
|
||||||
]) ?>
|
]) ?>
|
||||||
@@ -1,41 +1,41 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
|
|
||||||
extract($_POST);
|
extract($_POST);
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
"hora" => $hora,
|
"hora" => $hora,
|
||||||
"salon" => $salón,
|
"salon" => $salón,
|
||||||
"facultad_id" => $facultad,
|
"facultad_id" => $facultad,
|
||||||
"periodo" => $periodo,
|
"periodo" => $periodo,
|
||||||
"grupo" => $grupo,
|
"grupo" => $grupo,
|
||||||
"materia_id" => $materia,
|
"materia_id" => $materia,
|
||||||
"dia" => $día,
|
"dia" => $día,
|
||||||
"duracion" => $duración,
|
"duracion" => $duración,
|
||||||
"profesores" => "{{$profesores}}",
|
"profesores" => "{{$profesores}}",
|
||||||
];
|
];
|
||||||
|
|
||||||
header("Content-Type: application/json");
|
header("Content-Type: application/json");
|
||||||
$user->print_to_log("Creación de horario", new: $params);
|
$user->print_to_log("Creación de horario", new: $params);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$db->insert("fs_horario", $params);
|
$db->insert("fs_horario", $params);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
"status" => "error",
|
"status" => "error",
|
||||||
"message" => "No se pudo crear el horario",
|
"message" => "No se pudo crear el horario",
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
"status" => "success",
|
"status" => "success",
|
||||||
"message" => "Horario creado correctamente",
|
"message" => "Horario creado correctamente",
|
||||||
]));
|
]));
|
||||||
|
|||||||
@@ -1,38 +1,38 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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']);
|
||||||
|
|
||||||
extract($_POST);
|
extract($_POST);
|
||||||
try {
|
try {
|
||||||
$old = $db
|
$old = $db
|
||||||
->where('horario_id', $id)
|
->where('horario_id', $id)
|
||||||
->getOne('horario');
|
->getOne('horario');
|
||||||
|
|
||||||
$user->print_to_log("Eliminación de horario", old: $old);
|
$user->print_to_log("Eliminación de horario", old: $old);
|
||||||
|
|
||||||
$horario = $db
|
$horario = $db
|
||||||
->where('id', $id)
|
->where('id', $id)
|
||||||
->delete('fs_horario');
|
->delete('fs_horario');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
// if message contains "Integrity constraint violation"
|
// if message contains "Integrity constraint violation"
|
||||||
$message = (strpos($e->getMessage(), 'Foreign') !== false)
|
$message = (strpos($e->getMessage(), 'Foreign') !== false)
|
||||||
? "No se puede eliminar el registro, tiene datos asociados"
|
? "No se puede eliminar el registro, tiene datos asociados"
|
||||||
: "Error al eliminar el registro";
|
: "Error al eliminar el registro";
|
||||||
|
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
"status" => "error",
|
"status" => "error",
|
||||||
"message" => $message,
|
"message" => $message,
|
||||||
"response" => $e->getMessage(),
|
"response" => $e->getMessage(),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
"status" => "success",
|
"status" => "success",
|
||||||
"message" => "Horario eliminado correctamente",
|
"message" => "Horario eliminado correctamente",
|
||||||
]));
|
]));
|
||||||
@@ -1,51 +1,51 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
require_once "../include/func_excel.php";
|
require_once "../include/func_excel.php";
|
||||||
|
|
||||||
extract($_POST);
|
extract($_POST);
|
||||||
|
|
||||||
# $carrera;
|
# $carrera;
|
||||||
# $facultad;
|
# $facultad;
|
||||||
|
|
||||||
$horarios = json_decode($data, true);
|
$horarios = json_decode($data, true);
|
||||||
|
|
||||||
// make sure profesores are in the database
|
// make sure profesores are in the database
|
||||||
foreach ($horarios as $horario) {
|
foreach ($horarios as $horario) {
|
||||||
$params = [
|
$params = [
|
||||||
'materia' => $horario['materia'],
|
'materia' => $horario['materia'],
|
||||||
'carrera' => $carrera,
|
'carrera' => $carrera,
|
||||||
];
|
];
|
||||||
$horario['materia'] = query("SELECT FI_MATERIA(:materia, :carrera) id", $params)['id'];
|
$horario['materia'] = query("SELECT FI_MATERIA(:materia, :carrera) id", $params)['id'];
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
'clave' => $horario['clave'],
|
'clave' => $horario['clave'],
|
||||||
'nombre' => $horario['nombre'],
|
'nombre' => $horario['nombre'],
|
||||||
'correo' => $horario['correo'],
|
'correo' => $horario['correo'],
|
||||||
'grado' => $horario['grado'],
|
'grado' => $horario['grado'],
|
||||||
'facultad' => $facultad,
|
'facultad' => $facultad,
|
||||||
];
|
];
|
||||||
|
|
||||||
$horario['profesor'] = query("SELECT FI_PROFESOR(:nombre, :clave, :facultad, :correo, :grado) id", $params)['id'];
|
$horario['profesor'] = query("SELECT FI_PROFESOR(:nombre, :clave, :facultad, :correo, :grado) id", $params)['id'];
|
||||||
$horario = array_diff_key($horario, array_flip(['clave', 'nombre', 'correo', 'grado', '']));
|
$horario = array_diff_key($horario, array_flip(['clave', 'nombre', 'correo', 'grado', '']));
|
||||||
$horario['periodo'] = $periodo;
|
$horario['periodo'] = $periodo;
|
||||||
$horario['facultad'] = $facultad;
|
$horario['facultad'] = $facultad;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
query(
|
query(
|
||||||
"SELECT FI_HORARIO(:horario::VARCHAR, :profesor::INT, :materia::INT, :facultad::INT, :periodo::INT, :grupo::VARCHAR, :salon::VARCHAR)",
|
"SELECT FI_HORARIO(:horario::VARCHAR, :profesor::INT, :materia::INT, :facultad::INT, :periodo::INT, :grupo::VARCHAR, :salon::VARCHAR)",
|
||||||
$horario
|
$horario
|
||||||
);
|
);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
"status" => "error",
|
"status" => "error",
|
||||||
"sql" => $e->getMessage(),
|
"sql" => $e->getMessage(),
|
||||||
"message" => "Error al cargar el archivo",
|
"message" => "Error al cargar el archivo",
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?= json_encode([
|
<?= json_encode([
|
||||||
"status" => "success",
|
"status" => "success",
|
||||||
"message" => "Horarios guardado con éxito",
|
"message" => "Horarios guardado con éxito",
|
||||||
]) ?>
|
]) ?>
|
||||||
|
|||||||
@@ -1,38 +1,38 @@
|
|||||||
<?php
|
<?php
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once("../include/bd_pdo.php");
|
require_once("../include/bd_pdo.php");
|
||||||
|
|
||||||
$dias = array("domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado");
|
$dias = array("domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(empty($_POST['profesor_id']))
|
if(empty($_POST['profesor_id']))
|
||||||
throw new Exception("No se ha especificado un profesor");
|
throw new Exception("No se ha especificado un profesor");
|
||||||
|
|
||||||
// RECORD LAST QUERY
|
// RECORD LAST QUERY
|
||||||
$horarios = $db->query("SELECT * FROM fs_horario(_periodo_id => ?, _last => true, _profesor_id => ?) ORDER BY MATERIA", [
|
$horarios = $db->query("SELECT * FROM fs_horario(_periodo_id => ?, _last => true, _profesor_id => ?) ORDER BY MATERIA", [
|
||||||
$_POST['periodo_id'],
|
$_POST['periodo_id'],
|
||||||
$_POST['profesor_id'],
|
$_POST['profesor_id'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$horarios = array_map(function ($horario) use ($dias, $db) {
|
$horarios = array_map(function ($horario) use ($dias, $db) {
|
||||||
$horario['profesores'] = array_map(
|
$horario['profesores'] = array_map(
|
||||||
fn ($profesor) =>
|
fn ($profesor) =>
|
||||||
$db->where("id", $profesor)->getOne("fs_profesor"),
|
$db->where("id", $profesor)->getOne("fs_profesor"),
|
||||||
explode(",", substr($horario['profesores'], 1, -1))
|
explode(",", substr($horario['profesores'], 1, -1))
|
||||||
);
|
);
|
||||||
$horario['dia'] = $dias[$horario['dia']];
|
$horario['dia'] = $dias[$horario['dia']];
|
||||||
return $horario;
|
return $horario;
|
||||||
}, $horarios);
|
}, $horarios);
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
"status" => "success",
|
"status" => "success",
|
||||||
"data" => $horarios,
|
"data" => $horarios,
|
||||||
// "data" => [],
|
// "data" => [],
|
||||||
]));
|
]));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
"status" => "error",
|
"status" => "error",
|
||||||
"message" => $e->getMessage(),
|
"message" => $e->getMessage(),
|
||||||
"query" => $db->getLastQuery(),
|
"query" => $db->getLastQuery(),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +1,48 @@
|
|||||||
<?php
|
<?php
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
// check if the session is started
|
// 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']);
|
||||||
|
|
||||||
$horario = array_map(fn ($value) => $_POST[$value], array_filter([
|
$horario = array_map(fn ($value) => $_POST[$value], array_filter([
|
||||||
"hora" => "hora",
|
"hora" => "hora",
|
||||||
"dia" => "día",
|
"dia" => "día",
|
||||||
"salon" => "salón",
|
"salon" => "salón",
|
||||||
"duracion" => "duración",
|
"duracion" => "duración",
|
||||||
], fn ($value) => !empty($_POST[$value])));
|
], fn ($value) => !empty($_POST[$value])));
|
||||||
|
|
||||||
if (!empty($_POST['profesores']))
|
if (!empty($_POST['profesores']))
|
||||||
$horario["profesores"] = "{ {$_POST['profesores']} }";
|
$horario["profesores"] = "{ {$_POST['profesores']} }";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$id = $_POST['id'] ?? 0;
|
$id = $_POST['id'] ?? 0;
|
||||||
|
|
||||||
$old = $db
|
$old = $db
|
||||||
->where("horario_id", $id)
|
->where("horario_id", $id)
|
||||||
->getOne("horario");
|
->getOne("horario");
|
||||||
|
|
||||||
$horario = $db
|
$horario = $db
|
||||||
->where("id", $id)
|
->where("id", $id)
|
||||||
->update("fs_horario", $horario);
|
->update("fs_horario", $horario);
|
||||||
|
|
||||||
$new = $db
|
$new = $db
|
||||||
->orderBy("horario_id", "DESC")
|
->orderBy("horario_id", "DESC")
|
||||||
->getOne("horario");
|
->getOne("horario");
|
||||||
|
|
||||||
$user->print_to_log("Actualización de horario", old: $old, new: $new);
|
$user->print_to_log("Actualización de horario", old: $old, new: $new);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
"status" => "error",
|
"status" => "error",
|
||||||
"message" => $e->getMessage(),
|
"message" => $e->getMessage(),
|
||||||
'POST' => $_POST,
|
'POST' => $_POST,
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
"status" => "success",
|
"status" => "success",
|
||||||
]));
|
]));
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
extract($_POST);
|
extract($_POST);
|
||||||
|
|
||||||
/* print_r($claves);
|
/* print_r($claves);
|
||||||
exit; */
|
exit; */
|
||||||
|
|
||||||
$fecha = DateTime::createFromFormat('d/m/Y', $fecha);
|
$fecha = DateTime::createFromFormat('d/m/Y', $fecha);
|
||||||
|
|
||||||
if (isset($hora)) {
|
if (isset($hora)) {
|
||||||
$claves = [[
|
$claves = [[
|
||||||
'clave' => $clave,
|
'clave' => $clave,
|
||||||
'hora' => $hora,
|
'hora' => $hora,
|
||||||
'id' => $id
|
'id' => $id
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
foreach ($claves as $horario)
|
foreach ($claves as $horario)
|
||||||
try {
|
try {
|
||||||
$profesor_id = $horario["clave"];
|
$profesor_id = $horario["clave"];
|
||||||
query("SELECT fi_registrar_asistencia(:id::INT, FALSE, ARRAY[ NOW(), :fecha::DATE + :hora::TIME ]::TIMESTAMP[], :profesor_id::INT, TRUE)", [
|
query("SELECT fi_registrar_asistencia(:id::INT, FALSE, ARRAY[ NOW(), :fecha::DATE + :hora::TIME ]::TIMESTAMP[], :profesor_id::INT, TRUE)", [
|
||||||
":fecha" => $fecha->format('Y-m-d'),
|
":fecha" => $fecha->format('Y-m-d'),
|
||||||
":hora" => $horario["hora"],
|
":hora" => $horario["hora"],
|
||||||
":id" => $horario["id"],
|
":id" => $horario["id"],
|
||||||
":profesor_id" => $profesor_id
|
":profesor_id" => $profesor_id
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
die( json_encode(["error" => $e->getMessage()]) );
|
die( json_encode(["error" => $e->getMessage()]) );
|
||||||
}
|
}
|
||||||
|
|
||||||
die(json_encode(["success" => true]));
|
die(json_encode(["success" => true]));
|
||||||
|
|||||||
@@ -1,43 +1,42 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Valida usuario con la BD y devuelve contraseña para validar con PHP
|
* Valida usuario con la BD y devuelve contraseña para validar con PHP
|
||||||
*
|
*
|
||||||
* Recibe:
|
* Recibe:
|
||||||
* POST: usuario, password
|
* POST: usuario, password
|
||||||
*
|
*
|
||||||
* Error:
|
* Error:
|
||||||
* 0 - No se recibieron datos
|
* 0 - No se recibieron datos
|
||||||
* 1 - Usuario/Contraseña incorrectos
|
* 1 - Usuario/Contraseña incorrectos
|
||||||
* 2 - Usuario no esta en BD
|
* 2 - Usuario no esta en BD
|
||||||
* 3 - No existe usuario
|
* 3 - No existe usuario
|
||||||
*
|
*
|
||||||
* Success:
|
* Success:
|
||||||
* Redirecciona a inicio.php
|
* Redirecciona a inicio.php
|
||||||
*/
|
*/
|
||||||
include_once("../include/nocache.php"); //continue on error
|
include_once "../include/nocache.php"; //continue on error
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once("../include/bd_pdo.php"); //die on error
|
require_once "../include/bd_pdo.php"; //die on error
|
||||||
require_once("../class/c_login.php");
|
require_once "../class/c_login.php";
|
||||||
require_once("../include/util.php");
|
require_once "../include/util.php";
|
||||||
require_once("../include/nusoap/nusoap.php");
|
|
||||||
|
if (!isset($_POST["username"]) || !isset($_POST["passwd"]))
|
||||||
if (!isset($_POST["username"]) || !isset($_POST["passwd"]))
|
die(header("Location: ../index.php?error=0"));
|
||||||
die(header("Location: ../index.php?error=0"));
|
|
||||||
|
$usr = trim(filter_input(INPUT_POST, "username")); //limpia texto
|
||||||
$usr = trim(filter_input(INPUT_POST, "username")); //limpia texto
|
$pass = $_POST["passwd"];
|
||||||
$pass = $_POST["passwd"];
|
|
||||||
|
$user = Login::validUser($usr, $pass);
|
||||||
$user = Login::validUser($usr, $pass);
|
|
||||||
|
if (is_array($user)) {
|
||||||
if (is_array($user)) {
|
$_SESSION['error'] = true;
|
||||||
$_SESSION['error'] = true;
|
// build query params
|
||||||
// build query params
|
$params = http_build_query($user);
|
||||||
$params = http_build_query($user);
|
header("Location: ../index.php?$params");
|
||||||
header("Location: ../index.php?$params");
|
} else {
|
||||||
} else {
|
$_SESSION['user'] = serialize($user);
|
||||||
$_SESSION['user'] = serialize($user);
|
|
||||||
|
header("Location: " . (isset($_SESSION['ruta']) ? $_SESSION['ruta'] : "../main.php"));
|
||||||
header("Location: " . (isset($_SESSION['ruta']) ? $_SESSION['ruta'] : "../main.php"));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
@@ -1,26 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
extract($_POST);
|
extract($_POST);
|
||||||
# print_r($_POST); exit;
|
# print_r($_POST); exit;
|
||||||
|
|
||||||
if (!isset($_SESSION['user']))
|
if (!isset($_SESSION['user']))
|
||||||
die(header('Location: index.php'));
|
die(header('Location: index.php'));
|
||||||
|
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
|
|
||||||
if (!$user->admin && ($access = $user->access('asistencia')) == 'n')
|
if (!$user->admin && ($access = $user->access('asistencia')) == 'n')
|
||||||
die(json_encode(['error' => true]));
|
die(json_encode(['error' => true]));
|
||||||
|
|
||||||
$user->print_to_log('Consultar materias');
|
$user->print_to_log('Consultar materias');
|
||||||
$materias = queryAll(
|
$materias = queryAll(
|
||||||
"SELECT id, nombre FROM FS_MATERIA WHERE carrera = COALESCE(:carrera, carrera) ORDER BY nombre",
|
"SELECT id, nombre FROM FS_MATERIA WHERE carrera = COALESCE(:carrera, carrera) ORDER BY nombre",
|
||||||
[':carrera' => empty($carrera) ? null : $carrera]
|
[':carrera' => empty($carrera) ? null : $carrera]
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?= json_encode([
|
<?= json_encode([
|
||||||
'status' => 'success',
|
'status' => 'success',
|
||||||
'materias' => $materias,
|
'materias' => $materias,
|
||||||
]); ?>
|
]); ?>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
$sql="SELECT * FROM materia WHERE materia_id = :idMateria";
|
$sql="SELECT * FROM materia WHERE materia_id = :idMateria";
|
||||||
$params = ['idMateria' => $_POST['idmateria']];
|
$params = ['idMateria' => $_POST['idmateria']];
|
||||||
echo json_encode(query($sql, $params, false));
|
echo json_encode(query($sql, $params, false));
|
||||||
?>
|
?>
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
$sql = "UPDATE materia SET materia_nombre = :nombre WHERE materia_id = :id";
|
$sql = "UPDATE materia SET materia_nombre = :nombre WHERE materia_id = :id";
|
||||||
$params = array(':nombre' => mb_strtoupper($_POST["nombre"]), ':id' => $_POST["id"]);
|
$params = array(':nombre' => mb_strtoupper($_POST["nombre"]), ':id' => $_POST["id"]);
|
||||||
$hecho = query($sql, $params, false);
|
$hecho = query($sql, $params, false);
|
||||||
header("Location: ../materias.php");
|
header("Location: ../materias.php");
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
<!-- fi_horario(
|
<!-- fi_horario(
|
||||||
p_hora character varying,
|
p_hora character varying,
|
||||||
p_materia character varying,
|
p_materia character varying,
|
||||||
p_clave character varying,
|
p_clave character varying,
|
||||||
p_nombre character varying,
|
p_nombre character varying,
|
||||||
p_grado character varying,
|
p_grado character varying,
|
||||||
p_correo character varying,
|
p_correo character varying,
|
||||||
p_facultad integer,
|
p_facultad integer,
|
||||||
p_carrera integer,
|
p_carrera integer,
|
||||||
p_grupo character varying DEFAULT NULL::character varying,
|
p_grupo character varying DEFAULT NULL::character varying,
|
||||||
p_salon character varying DEFAULT NULL::character varying) -->
|
p_salon character varying DEFAULT NULL::character varying) -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
|
|
||||||
$sql = "SELECT fi_horario(:hora, :materia, :clave, :nombre, :grado, :correo, :facultad, :carrera, :grupo, :salon)";
|
$sql = "SELECT fi_horario(:hora, :materia, :clave, :nombre, :grado, :correo, :facultad, :carrera, :grupo, :salon)";
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
$sql = "SELECT fi_periodo(:fecha_inicio, :fecha_fin, :estado, :nombre, :nivel, :facultad)";
|
$sql = "SELECT fi_periodo(:fecha_inicio, :fecha_fin, :estado, :nombre, :nivel, :facultad)";
|
||||||
$params = [
|
$params = [
|
||||||
':fecha_inicio' => $_POST['fecha_inicial'],
|
':fecha_inicio' => $_POST['fecha_inicial'],
|
||||||
':fecha_fin' => $_POST['fecha_final'],
|
':fecha_fin' => $_POST['fecha_final'],
|
||||||
':estado' => $_POST['estadoP'],
|
':estado' => $_POST['estadoP'],
|
||||||
':nombre' => mb_strtoupper($_POST['nombreP']),
|
':nombre' => mb_strtoupper($_POST['nombreP']),
|
||||||
':nivel' => $_POST['nivelP'],
|
':nivel' => $_POST['nivelP'],
|
||||||
':facultad' => $_POST['facultadP']
|
':facultad' => $_POST['facultadP']
|
||||||
];
|
];
|
||||||
echo json_encode(query($sql, $params, true));
|
echo json_encode(query($sql, $params, true));
|
||||||
header("Location: ../carreras.php?facultad=".$_POST['facultadP']);
|
header("Location: ../carreras.php?facultad=".$_POST['facultadP']);
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
$sql = "SELECT * FROM fs_periodo WHERE facultad_id = :idfacultad AND id = :idperiodo";
|
$sql = "SELECT * FROM fs_periodo WHERE facultad_id = :idfacultad AND id = :idperiodo";
|
||||||
$params = [':idfacultad' => $_POST['idfacultad'], ':idperiodo' => $_POST['idperiodo']];
|
$params = [':idfacultad' => $_POST['idfacultad'], ':idperiodo' => $_POST['idperiodo']];
|
||||||
echo json_encode(query($sql, $params, true));
|
echo json_encode(query($sql, $params, true));
|
||||||
?>
|
?>
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
print_r($_POST);
|
print_r($_POST);
|
||||||
$sql = "SELECT fu_update_periodo(:periodo_id, :fecha_inicio, :fecha_final, :estado, :nombre, :nivel)";
|
$sql = "SELECT fu_update_periodo(:periodo_id, :fecha_inicio, :fecha_final, :estado, :nombre, :nivel)";
|
||||||
$params = [
|
$params = [
|
||||||
':periodo_id' => $_POST['idP'],
|
':periodo_id' => $_POST['idP'],
|
||||||
':fecha_inicio' => $_POST['fecha_inicial'],
|
':fecha_inicio' => $_POST['fecha_inicial'],
|
||||||
':fecha_final' => $_POST['fecha_final'],
|
':fecha_final' => $_POST['fecha_final'],
|
||||||
':estado' => $_POST['estadoP'],
|
':estado' => $_POST['estadoP'],
|
||||||
':nombre' => mb_strtoupper($_POST['nombreP']),
|
':nombre' => mb_strtoupper($_POST['nombreP']),
|
||||||
':nivel' => $_POST['nivelP']
|
':nivel' => $_POST['nivelP']
|
||||||
];
|
];
|
||||||
echo json_encode(query($sql, $params, true));
|
echo json_encode(query($sql, $params, true));
|
||||||
header("Location: ../carreras.php?facultad=".$_POST['facultadP']);
|
header("Location: ../carreras.php?facultad=".$_POST['facultadP']);
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
||||||
@@ -1,27 +1,27 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
if (!isset($_SESSION['user'])) {
|
if (!isset($_SESSION['user'])) {
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
exit;
|
exit;
|
||||||
} else
|
} else
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
|
|
||||||
$params = array(':id' => $user->user['id'], ':per' => $_POST['id']);
|
$params = array(':id' => $user->user['id'], ':per' => $_POST['id']);
|
||||||
$user->print_to_log('Actualizando periodo from ' . $user->periodo . ' to ' . $_POST['id']);
|
$user->print_to_log('Actualizando periodo from ' . $user->periodo . ' to ' . $_POST['id']);
|
||||||
|
|
||||||
query("SELECT FU_UPDATEPERIODO(:id, :per)", $params);
|
query("SELECT FU_UPDATEPERIODO(:id, :per)", $params);
|
||||||
$user->periodo = $params[':per'];
|
$user->periodo = $params[':per'];
|
||||||
|
|
||||||
# if the user is admin, also update the facultad in user object
|
# if the user is admin, also update the facultad in user object
|
||||||
if ($user->admin) {
|
if ($user->admin) {
|
||||||
$facultad = query("SELECT FACULTAD_ID id, FACULTAD f FROM FS_PERIODO WHERE ID = :id", [':id' => $user->periodo]);
|
$facultad = query("SELECT FACULTAD_ID id, FACULTAD f FROM FS_PERIODO WHERE ID = :id", [':id' => $user->periodo]);
|
||||||
$user->facultad = array(
|
$user->facultad = array(
|
||||||
'facultad_id' => $facultad["id"],
|
'facultad_id' => $facultad["id"],
|
||||||
'facultad' => $facultad["f"],
|
'facultad' => $facultad["f"],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$_SESSION['user'] = serialize($user);
|
$_SESSION['user'] = serialize($user);
|
||||||
header("Location: {$_POST["target"]}");
|
header("Location: {$_POST["target"]}");
|
||||||
|
|||||||
@@ -1,40 +1,40 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
if(isset($_POST['lectura']))
|
if(isset($_POST['lectura']))
|
||||||
$ver = $_POST['lectura'];
|
$ver = $_POST['lectura'];
|
||||||
if(isset($_POST['editar']))
|
if(isset($_POST['editar']))
|
||||||
$editar = $_POST['editar'];
|
$editar = $_POST['editar'];
|
||||||
foreach($editar as $edit){
|
foreach($editar as $edit){
|
||||||
$edit_separado = explode("_", $edit);
|
$edit_separado = explode("_", $edit);
|
||||||
$completo[]=$edit_separado;
|
$completo[]=$edit_separado;
|
||||||
}
|
}
|
||||||
#echo "<br><br><br><br>";
|
#echo "<br><br><br><br>";
|
||||||
#print_r($ver);
|
#print_r($ver);
|
||||||
#print_r($editar);
|
#print_r($editar);
|
||||||
query("SELECT fd_permiso()", null, false);
|
query("SELECT fd_permiso()", null, false);
|
||||||
foreach($ver as $lectura){
|
foreach($ver as $lectura){
|
||||||
$igual=false;
|
$igual=false;
|
||||||
$ver_separado = explode("_", $lectura);
|
$ver_separado = explode("_", $lectura);
|
||||||
#print_r($ver_separado);
|
#print_r($ver_separado);
|
||||||
foreach($completo as $comp){
|
foreach($completo as $comp){
|
||||||
if($ver_separado[0] == $comp[0] && $ver_separado[1] == $comp[1]){
|
if($ver_separado[0] == $comp[0] && $ver_separado[1] == $comp[1]){
|
||||||
#echo " igual";
|
#echo " igual";
|
||||||
$igual=true;
|
$igual=true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#echo "<br>";
|
#echo "<br>";
|
||||||
if(!$igual)
|
if(!$igual)
|
||||||
$completo[]=$ver_separado;
|
$completo[]=$ver_separado;
|
||||||
}
|
}
|
||||||
#print_r($completo);
|
#print_r($completo);
|
||||||
foreach($completo as $actual){
|
foreach($completo as $actual){
|
||||||
$sql = "SELECT fi_permiso(:pagina, :rol, :tipo)";
|
$sql = "SELECT fi_permiso(:pagina, :rol, :tipo)";
|
||||||
$params = [':pagina' => $actual['0'], ':rol' => $actual['1'], ':tipo' => $actual['2']];
|
$params = [':pagina' => $actual['0'], ':rol' => $actual['1'], ':tipo' => $actual['2']];
|
||||||
query($sql, $params, false);
|
query($sql, $params, false);
|
||||||
}
|
}
|
||||||
header("Location: ../permisos.php");
|
header("Location: ../permisos.php");
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once("../include/bd_pdo.php");
|
require_once("../include/bd_pdo.php");
|
||||||
|
|
||||||
extract($_GET);
|
extract($_GET);
|
||||||
|
|
||||||
$profesores = $db
|
$profesores = $db
|
||||||
->where("facultad_id", $facultad ?? 0)
|
->where("facultad_id", $facultad ?? 0)
|
||||||
->get("fs_profesor");
|
->get("fs_profesor");
|
||||||
|
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
"status" => "success",
|
"status" => "success",
|
||||||
"profesores" => $profesores
|
"profesores" => $profesores
|
||||||
]);
|
]);
|
||||||
@@ -1,40 +1,40 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
|
|
||||||
// die(print_r($_POST, true));
|
// die(print_r($_POST, true));
|
||||||
|
|
||||||
extract($_POST);
|
extract($_POST);
|
||||||
// if hora fin is null, then subtract half an hour from hora inicio and set hora fin to hora inicio + half an hour
|
// if hora fin is null, then subtract half an hour from hora inicio and set hora fin to hora inicio + half an hour
|
||||||
$hora_fin = empty($hora_fin) ? $hora_inicio : $hora_fin;
|
$hora_fin = empty($hora_fin) ? $hora_inicio : $hora_fin;
|
||||||
|
|
||||||
$hora_inicio = date('H:i:s', strtotime($hora_inicio < '07:00' ? '07:00' : $hora_inicio) - 1800);
|
$hora_inicio = date('H:i:s', strtotime($hora_inicio < '07:00' ? '07:00' : $hora_inicio) - 1800);
|
||||||
$hora_fin = date('H:i:s', strtotime($hora_fin > '22:00' ? '22:00' : $hora_fin) + 1800);
|
$hora_fin = date('H:i:s', strtotime($hora_fin > '22:00' ? '22:00' : $hora_fin) + 1800);
|
||||||
|
|
||||||
die(json_encode(
|
die(json_encode(
|
||||||
array_map(fn ($row) => array_merge(
|
array_map(fn ($row) => array_merge(
|
||||||
$db->where('id', $row['profesor_id'])->getOne('fs_profesor'),
|
$db->where('id', $row['profesor_id'])->getOne('fs_profesor'),
|
||||||
$db->where('id', $row['materia_id'])->getOne('fs_materia'),
|
$db->where('id', $row['materia_id'])->getOne('fs_materia'),
|
||||||
$row
|
$row
|
||||||
),
|
),
|
||||||
queryAll(
|
queryAll(
|
||||||
"SELECT REPORTE.*
|
"SELECT REPORTE.*
|
||||||
FROM fs_asistencia_profesorreporte(null, :periodo, null, :fecha, :fecha) AS REPORTE
|
FROM fs_asistencia_profesorreporte(null, :periodo, null, :fecha, :fecha) AS REPORTE
|
||||||
JOIN PROFESOR P ON P.PROFESOR_ID = REPORTE.PROFESOR_ID
|
JOIN PROFESOR P ON P.PROFESOR_ID = REPORTE.PROFESOR_ID
|
||||||
WHERE HORA_CHECADO IS NULL
|
WHERE HORA_CHECADO IS NULL
|
||||||
AND HORA BETWEEN :inicio AND :fin
|
AND HORA BETWEEN :inicio AND :fin
|
||||||
AND P.PROFESOR_CLAVE ILIKE COALESCE(:clave, P.PROFESOR_CLAVE) and UNACCENT(P.PROFESOR_NOMBRE) ILIKE UNACCENT(COALESCE(:nombre, P.PROFESOR_NOMBRE))
|
AND P.PROFESOR_CLAVE ILIKE COALESCE(:clave, P.PROFESOR_CLAVE) and UNACCENT(P.PROFESOR_NOMBRE) ILIKE UNACCENT(COALESCE(:nombre, P.PROFESOR_NOMBRE))
|
||||||
AND FECHA = :fecha
|
AND FECHA = :fecha
|
||||||
ORDER BY HORA, MATERIA",
|
ORDER BY HORA, MATERIA",
|
||||||
[
|
[
|
||||||
'periodo' => $periodo,
|
'periodo' => $periodo,
|
||||||
'fecha' => $fecha,
|
'fecha' => $fecha,
|
||||||
'inicio' => $hora_inicio,
|
'inicio' => $hora_inicio,
|
||||||
'fin' => $hora_fin,
|
'fin' => $hora_fin,
|
||||||
'clave' => empty($clave) ? null : "%$clave%",
|
'clave' => empty($clave) ? null : "%$clave%",
|
||||||
'nombre' => empty($nombre) ? null : "%$nombre%"
|
'nombre' => empty($nombre) ? null : "%$nombre%"
|
||||||
]
|
]
|
||||||
))));
|
))));
|
||||||
|
|
||||||
|
|
||||||
#ECHO "$hora_inicio - $hora_fin";
|
#ECHO "$hora_inicio - $hora_fin";
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
$sql = "SELECT fu_estado_facultad_profesor(:idprofesor, :idfacultad, :estado)";
|
$sql = "SELECT fu_estado_facultad_profesor(:idprofesor, :idfacultad, :estado)";
|
||||||
$params = [':idprofesor' => $_POST['id_profesor'], ':idfacultad' => $_POST['id_facultad'], ':estado' => $_POST['estado']];
|
$params = [':idprofesor' => $_POST['id_profesor'], ':idfacultad' => $_POST['id_facultad'], ':estado' => $_POST['estado']];
|
||||||
echo json_encode(query($sql, $params, false));
|
echo json_encode(query($sql, $params, false));
|
||||||
?>
|
?>
|
||||||
@@ -1,75 +1,75 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
$id = trim(filter_input(INPUT_POST, "id", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));
|
$id = trim(filter_input(INPUT_POST, "id", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));
|
||||||
if(isset($_POST["dlfacultad"]))
|
if(isset($_POST["dlfacultad"]))
|
||||||
$facultad = trim(filter_input(INPUT_POST, "dlfacultad", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));
|
$facultad = trim(filter_input(INPUT_POST, "dlfacultad", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));
|
||||||
else
|
else
|
||||||
$facultad = trim(filter_input(INPUT_POST, "mfacultad", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));
|
$facultad = trim(filter_input(INPUT_POST, "mfacultad", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));
|
||||||
$clave = trim(filter_input(INPUT_POST, "mclave", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));
|
$clave = trim(filter_input(INPUT_POST, "mclave", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));
|
||||||
$grado = trim(filter_input(INPUT_POST, "grado", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));
|
$grado = trim(filter_input(INPUT_POST, "grado", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));
|
||||||
$nombre = trim(filter_input(INPUT_POST, "nombre", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));
|
$nombre = trim(filter_input(INPUT_POST, "nombre", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));
|
||||||
$grado = mb_strtoupper($grado);
|
$grado = mb_strtoupper($grado);
|
||||||
if(!empty($grado)){
|
if(!empty($grado)){
|
||||||
if(!ctype_space($grado)){
|
if(!ctype_space($grado)){
|
||||||
if($grado[strlen($grado)-1] != '.')
|
if($grado[strlen($grado)-1] != '.')
|
||||||
$grado.='.';
|
$grado.='.';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$grado="";
|
$grado="";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fs_profesores = query(//revisar si existe la clave del profesor
|
$fs_profesores = query(//revisar si existe la clave del profesor
|
||||||
"SELECT * FROM fs_profesor WHERE clave = :clave",
|
"SELECT * FROM fs_profesor WHERE clave = :clave",
|
||||||
array(":clave" => $_POST["mclave"]),
|
array(":clave" => $_POST["mclave"]),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
if(!$fs_profesores){//hay que crearlo desde 0 (profesor) y agregarlo a su facultad(facultad_profesor)
|
if(!$fs_profesores){//hay que crearlo desde 0 (profesor) y agregarlo a su facultad(facultad_profesor)
|
||||||
$profesor_id = query(
|
$profesor_id = query(
|
||||||
"SELECT public.fi_profesor(
|
"SELECT public.fi_profesor(
|
||||||
:nombre,
|
:nombre,
|
||||||
:clave,
|
:clave,
|
||||||
:facultad,
|
:facultad,
|
||||||
null,
|
null,
|
||||||
:grado
|
:grado
|
||||||
)",
|
)",
|
||||||
array(":nombre" => mb_strtoupper($nombre), ":clave" => $clave, ":facultad" => $facultad, ":grado" => $grado),
|
array(":nombre" => mb_strtoupper($nombre), ":clave" => $clave, ":facultad" => $facultad, ":grado" => $grado),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
header("Location: ../profesores.php");
|
header("Location: ../profesores.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
else{//el profesor ya existe
|
else{//el profesor ya existe
|
||||||
$profac = query(
|
$profac = query(
|
||||||
"SELECT * FROM facultad_profesor WHERE facultad_id = :facultad AND profesor_id = :profesor",
|
"SELECT * FROM facultad_profesor WHERE facultad_id = :facultad AND profesor_id = :profesor",
|
||||||
array(":facultad" => $facultad, ":profesor" => $fs_profesores["id"]),
|
array(":facultad" => $facultad, ":profesor" => $fs_profesores["id"]),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
if(!$profac){//agregarlo a la facultad (facultad_profesor)
|
if(!$profac){//agregarlo a la facultad (facultad_profesor)
|
||||||
query(
|
query(
|
||||||
"SELECT fi_facultad_profesor(
|
"SELECT fi_facultad_profesor(
|
||||||
:facultad,
|
:facultad,
|
||||||
:profesor
|
:profesor
|
||||||
)",
|
)",
|
||||||
array(":facultad" => $facultad, ":profesor" => $fs_profesores["id"]),
|
array(":facultad" => $facultad, ":profesor" => $fs_profesores["id"]),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
header("Location: ../profesores.php");
|
header("Location: ../profesores.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
else{//regresar error (ya existe este profesor en esta facultad)
|
else{//regresar error (ya existe este profesor en esta facultad)
|
||||||
//print_r($profac);
|
//print_r($profac);
|
||||||
if(!$profac['fp_activo']){
|
if(!$profac['fp_activo']){
|
||||||
query(
|
query(
|
||||||
"SELECT fu_estado_facultad_profesor(:idprofesor, :idfacultad, :estado)",
|
"SELECT fu_estado_facultad_profesor(:idprofesor, :idfacultad, :estado)",
|
||||||
array(":idprofesor" => $fs_profesores["id"], ":idfacultad" => $facultad, ":estado" => true),
|
array(":idprofesor" => $fs_profesores["id"], ":idfacultad" => $facultad, ":estado" => true),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
header("Location: ../profesores.php");
|
header("Location: ../profesores.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
header("Location: ../profesores.php?error=1");
|
header("Location: ../profesores.php?error=1");
|
||||||
#exit();
|
#exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
|
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
$sql = "SELECT * FROM profesor WHERE profesor_id = :idProfesor";
|
$sql = "SELECT * FROM profesor WHERE profesor_id = :idProfesor";
|
||||||
$params = [':idProfesor' => $_POST['profesor']];
|
$params = [':idProfesor' => $_POST['profesor']];
|
||||||
|
|
||||||
echo json_encode(query($sql, $params, false));
|
echo json_encode(query($sql, $params, false));
|
||||||
|
|||||||
@@ -1,36 +1,36 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
$profesor = query(
|
$profesor = query(
|
||||||
"SELECT * FROM profesor WHERE :clave = profesor_clave",
|
"SELECT * FROM profesor WHERE :clave = profesor_clave",
|
||||||
array(":clave" => $_POST["mclave"]),
|
array(":clave" => $_POST["mclave"]),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
if($profesor){
|
if($profesor){
|
||||||
if($profesor['profesor_id'] != $_POST['id']){
|
if($profesor['profesor_id'] != $_POST['id']){
|
||||||
echo "clave en uso";
|
echo "clave en uso";
|
||||||
header("Location: ../profesores.php?error=2");
|
header("Location: ../profesores.php?error=2");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$grado = $_POST['grado'];
|
$grado = $_POST['grado'];
|
||||||
$grado = mb_strtoupper($grado);
|
$grado = mb_strtoupper($grado);
|
||||||
if(!empty($grado)){
|
if(!empty($grado)){
|
||||||
if(!ctype_space($grado)){
|
if(!ctype_space($grado)){
|
||||||
if($grado[strlen($grado)-1] != '.')
|
if($grado[strlen($grado)-1] != '.')
|
||||||
$grado.='.';
|
$grado.='.';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$grado="";
|
$grado="";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print_r($_POST);
|
print_r($_POST);
|
||||||
$sql = "SELECT public.fu_updateprofesor(:id, :clave, :nombre, :grado)";
|
$sql = "SELECT public.fu_updateprofesor(:id, :clave, :nombre, :grado)";
|
||||||
$params = array(':id' => $_POST["id"], ':clave' => $_POST["mclave"], ':nombre' => mb_strtoupper($_POST["nombre"]), ':grado' => $grado);
|
$params = array(':id' => $_POST["id"], ':clave' => $_POST["mclave"], ':nombre' => mb_strtoupper($_POST["nombre"]), ':grado' => $grado);
|
||||||
$hecho = query($sql, $params, false);
|
$hecho = query($sql, $params, false);
|
||||||
|
|
||||||
header("Location: ../profesores.php", true, 307);
|
header("Location: ../profesores.php", true, 307);
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
||||||
@@ -1,54 +1,54 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
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 = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
|
|
||||||
// if method is get
|
// if method is get
|
||||||
header("Content-Type: application/json");
|
header("Content-Type: application/json");
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||||
$user->print_to_log("Acceso a reposiciones");
|
$user->print_to_log("Acceso a reposiciones");
|
||||||
$reposiciones = $db
|
$reposiciones = $db
|
||||||
->where('periodo_id', $_GET['periodo_id'] ?? null)
|
->where('periodo_id', $_GET['periodo_id'] ?? null)
|
||||||
->where('profesor_id', $_GET['profesor_id'] ?? [])
|
->where('profesor_id', $_GET['profesor_id'] ?? [])
|
||||||
->get("reposicion");
|
->get("reposicion");
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'status' => 'success',
|
'status' => 'success',
|
||||||
'reposiciones' => $reposiciones
|
'reposiciones' => $reposiciones
|
||||||
]);
|
]);
|
||||||
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
$user->print_to_log("Creación de reposición", new: $params);
|
$user->print_to_log("Creación de reposición", new: $params);
|
||||||
try {
|
try {
|
||||||
$requiredParams = ['horario_id', 'fecha', 'hora', 'duracion_id', 'descripcion', 'profesor_id', 'salon', 'unidad', 'periodo_id', 'fecha_clase'];
|
$requiredParams = ['horario_id', 'fecha', 'hora', 'duracion_id', 'descripcion', 'profesor_id', 'salon', 'unidad', 'periodo_id', 'fecha_clase'];
|
||||||
|
|
||||||
// Filter params based on requiredParams
|
// Filter params based on requiredParams
|
||||||
$params = array_filter($_POST, function ($key) use ($requiredParams) {
|
$params = array_filter($_POST, function ($key) use ($requiredParams) {
|
||||||
return in_array($key, $requiredParams);
|
return in_array($key, $requiredParams);
|
||||||
}, ARRAY_FILTER_USE_KEY);
|
}, ARRAY_FILTER_USE_KEY);
|
||||||
|
|
||||||
// Check if all required params are present
|
// Check if all required params are present
|
||||||
if (count($params) !== count($requiredParams)) {
|
if (count($params) !== count($requiredParams)) {
|
||||||
throw new Exception('Falta uno o más parámetros requeridos');
|
throw new Exception('Falta uno o más parámetros requeridos');
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->insert("reposicion", $params);
|
$db->insert("reposicion", $params);
|
||||||
|
|
||||||
// Return success response
|
// Return success response
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
"status" => "success",
|
"status" => "success",
|
||||||
"message" => "Reposición creada correctamente",
|
"message" => "Reposición creada correctamente",
|
||||||
]);
|
]);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
// Return error response
|
// Return error response
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
"status" => "error",
|
"status" => "error",
|
||||||
"message" => "No se pudo crear la reposición",
|
"message" => "No se pudo crear la reposición",
|
||||||
"error" => $e->getMessage(),
|
"error" => $e->getMessage(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,50 +1,50 @@
|
|||||||
<?php
|
<?php
|
||||||
#display PHP errors
|
#display PHP errors
|
||||||
|
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
require_once "../include/func_excel.php";
|
require_once "../include/func_excel.php";
|
||||||
require_once "../include/func_string.php";
|
require_once "../include/func_string.php";
|
||||||
|
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
||||||
$reader = IOFactory::createReader("Xlsx");
|
$reader = IOFactory::createReader("Xlsx");
|
||||||
$reader->setReadDataOnly(true);
|
$reader->setReadDataOnly(true);
|
||||||
|
|
||||||
$file = $_FILES['archivo'];
|
$file = $_FILES['archivo'];
|
||||||
|
|
||||||
|
|
||||||
$spreadsheet = $reader->load($file['tmp_name'][0]);
|
$spreadsheet = $reader->load($file['tmp_name'][0]);
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
foreach_sheet(
|
foreach_sheet(
|
||||||
$spreadsheet, // object $spreadsheet
|
$spreadsheet, // object $spreadsheet
|
||||||
function (array $row_data, int $i, string $sheet) {
|
function (array $row_data, int $i, string $sheet) {
|
||||||
global $horario, $data;
|
global $horario, $data;
|
||||||
|
|
||||||
if (renglón_vacío($row_data)) return;
|
if (renglón_vacío($row_data)) return;
|
||||||
validar_registro($row_data, $i);
|
validar_registro($row_data, $i);
|
||||||
|
|
||||||
$horario["horario"] = horario($row_data, $i, $sheet);
|
$horario["horario"] = horario($row_data, $i, $sheet);
|
||||||
|
|
||||||
foreach (array_filter($row_data) as $key => $value)
|
foreach (array_filter($row_data) as $key => $value)
|
||||||
$horario = array_merge($horario, ($key == 'maestro') ? columna_nombre($value) : [$key => $value]);
|
$horario = array_merge($horario, ($key == 'maestro') ? columna_nombre($value) : [$key => $value]);
|
||||||
|
|
||||||
$data[] = $horario;
|
$data[] = $horario;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
"status" => "success",
|
"status" => "success",
|
||||||
"message" => "Horario revisado con éxito, se leyeron: " . count($data) . " registros",
|
"message" => "Horario revisado con éxito, se leyeron: " . count($data) . " registros",
|
||||||
"data" => $data
|
"data" => $data
|
||||||
]));
|
]));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
die(json_encode([
|
die(json_encode([
|
||||||
"status" => "error",
|
"status" => "error",
|
||||||
"message" => $e->getMessage(),
|
"message" => $e->getMessage(),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
print_r($_POST);
|
print_r($_POST);
|
||||||
$sql = "INSERT INTO rol (rol_titulo) VALUES (:nombre)";
|
$sql = "INSERT INTO rol (rol_titulo) VALUES (:nombre)";
|
||||||
$params = [':nombre' => mb_strtoupper($_POST['mtitulo'])];
|
$params = [':nombre' => mb_strtoupper($_POST['mtitulo'])];
|
||||||
$hecho = query($sql, $params, true);
|
$hecho = query($sql, $params, true);
|
||||||
header("Location: ../roles.php");
|
header("Location: ../roles.php");
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
|
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
$sql = "SELECT * FROM rol WHERE rol_id = :idRol";
|
$sql = "SELECT * FROM rol WHERE rol_id = :idRol";
|
||||||
$params = [':idRol' => $_POST['rol']];
|
$params = [':idRol' => $_POST['rol']];
|
||||||
|
|
||||||
echo json_encode( query($sql, $params, true));
|
echo json_encode( query($sql, $params, true));
|
||||||
?>
|
?>
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
$sql = "UPDATE rol SET rol_titulo = :nombre WHERE rol_id = :id";
|
$sql = "UPDATE rol SET rol_titulo = :nombre WHERE rol_id = :id";
|
||||||
$params = array(':nombre' => mb_strtoupper($_POST['mtitulo']), ':id' => $_POST['id']);
|
$params = array(':nombre' => mb_strtoupper($_POST['mtitulo']), ':id' => $_POST['id']);
|
||||||
print_r($_POST);
|
print_r($_POST);
|
||||||
$hecho = query($sql, $params, false);
|
$hecho = query($sql, $params, false);
|
||||||
header("Location: ../roles.php", true, 307);
|
header("Location: ../roles.php", true, 307);
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
||||||
@@ -1,37 +1,37 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
print_r($_POST);
|
print_r($_POST);
|
||||||
|
|
||||||
$fs_tiempo = query(
|
$fs_tiempo = query(
|
||||||
"SELECT * FROM fs_tiempo_checado(:facultad, 1)", [':facultad' => $_POST['facultadT']], true
|
"SELECT * FROM fs_tiempo_checado(:facultad, 1)", [':facultad' => $_POST['facultadT']], true
|
||||||
);
|
);
|
||||||
|
|
||||||
if($fs_tiempo){
|
if($fs_tiempo){
|
||||||
$sql = "SELECT fu_update_tiempo_checado(:idfacultad, :idnivel, :antes, :despues, :retardo)";
|
$sql = "SELECT fu_update_tiempo_checado(:idfacultad, :idnivel, :antes, :despues, :retardo)";
|
||||||
$params = [':idfacultad' => $_POST['facultadT'], ':idnivel' => 1, ':antes' => -1*$_POST['antesL'], ':despues' => $_POST['despuesL']+1, ':retardo' => $_POST['retardoL']+$_POST['despuesL']+1];
|
$params = [':idfacultad' => $_POST['facultadT'], ':idnivel' => 1, ':antes' => -1*$_POST['antesL'], ':despues' => $_POST['despuesL']+1, ':retardo' => $_POST['retardoL']+$_POST['despuesL']+1];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$sql = "SELECT fi_tiempo_checado(:idfacultad, :idnivel, :antes, :despues, :retardo)";
|
$sql = "SELECT fi_tiempo_checado(:idfacultad, :idnivel, :antes, :despues, :retardo)";
|
||||||
$params = [':idfacultad' => $_POST['facultadT'], ':idnivel' => 1, ':antes' => -1*$_POST['antesL'], ':despues' => $_POST['despuesL']+1, ':retardo' => $_POST['retardoL']+$_POST['despuesL']+1];
|
$params = [':idfacultad' => $_POST['facultadT'], ':idnivel' => 1, ':antes' => -1*$_POST['antesL'], ':despues' => $_POST['despuesL']+1, ':retardo' => $_POST['retardoL']+$_POST['despuesL']+1];
|
||||||
}
|
}
|
||||||
query($sql, $params, false);
|
query($sql, $params, false);
|
||||||
|
|
||||||
|
|
||||||
$fs_tiempo2 = query(
|
$fs_tiempo2 = query(
|
||||||
"SELECT * FROM fs_tiempo_checado(:facultad, 2)", [':facultad' => $_POST['facultadT']], true
|
"SELECT * FROM fs_tiempo_checado(:facultad, 2)", [':facultad' => $_POST['facultadT']], true
|
||||||
);
|
);
|
||||||
|
|
||||||
if($fs_tiempo2){
|
if($fs_tiempo2){
|
||||||
$sql = "SELECT fu_update_tiempo_checado(:idfacultad, :idnivel, :antes, :despues, :retardo)";
|
$sql = "SELECT fu_update_tiempo_checado(:idfacultad, :idnivel, :antes, :despues, :retardo)";
|
||||||
$params = [':idfacultad' => $_POST['facultadT'], ':idnivel' => 2, ':antes' => -1*$_POST['antesP'], ':despues' => $_POST['despuesP']+1, ':retardo' => $_POST['retardoP']+$_POST['despuesP']+1];
|
$params = [':idfacultad' => $_POST['facultadT'], ':idnivel' => 2, ':antes' => -1*$_POST['antesP'], ':despues' => $_POST['despuesP']+1, ':retardo' => $_POST['retardoP']+$_POST['despuesP']+1];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$sql = "SELECT fi_tiempo_checado(:idfacultad, :idnivel, :antes, :despues, :retardo)";
|
$sql = "SELECT fi_tiempo_checado(:idfacultad, :idnivel, :antes, :despues, :retardo)";
|
||||||
$params = [':idfacultad' => $_POST['facultadT'], ':idnivel' => 2, ':antes' => -1*$_POST['antesP'], ':despues' => $_POST['despuesP']+1, ':retardo' => $_POST['retardoP']+$_POST['despuesP']+1];
|
$params = [':idfacultad' => $_POST['facultadT'], ':idnivel' => 2, ':antes' => -1*$_POST['antesP'], ':despues' => $_POST['despuesP']+1, ':retardo' => $_POST['retardoP']+$_POST['despuesP']+1];
|
||||||
}
|
}
|
||||||
query($sql, $params, false);
|
query($sql, $params, false);
|
||||||
|
|
||||||
header("Location: ../carreras.php?facultad=".$_POST['facultadT']);
|
header("Location: ../carreras.php?facultad=".$_POST['facultadT']);
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once '../class/c_login.php';
|
require_once '../class/c_login.php';
|
||||||
|
|
||||||
// print_r($_POST); exit;
|
// print_r($_POST); exit;
|
||||||
|
|
||||||
if (($user = Login::validUser($_POST['username'], $_POST['passwd'])) === false) {
|
if (($user = Login::validUser($_POST['username'], $_POST['passwd'])) === false) {
|
||||||
echo json_encode("error");
|
echo json_encode("error");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$facultades = queryAll("SELECT DISTINCT ID, FACULTAD FROM FS_FACULTAD WHERE ACTIVA");
|
$facultades = queryAll("SELECT DISTINCT ID, FACULTAD FROM FS_FACULTAD WHERE ACTIVA");
|
||||||
|
|
||||||
for ($i = 0; $i < count($facultades); $i++) {
|
for ($i = 0; $i < count($facultades); $i++) {
|
||||||
# print_r($facultades[$i]);
|
# print_r($facultades[$i]);
|
||||||
$facultades[$i]['usuarios'] = queryAll(
|
$facultades[$i]['usuarios'] = queryAll(
|
||||||
"SELECT ID, USERNAME FROM FS_USUARIO WHERE facultad = :facultad",
|
"SELECT ID, USERNAME FROM FS_USUARIO WHERE facultad = :facultad",
|
||||||
array(":facultad" => $facultades[$i]["id"])
|
array(":facultad" => $facultades[$i]["id"])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode($facultades);
|
echo json_encode($facultades);
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
if(isset($_POST['dlfacultad']))
|
if(isset($_POST['dlfacultad']))
|
||||||
$facultad=$_POST['dlfacultad'];
|
$facultad=$_POST['dlfacultad'];
|
||||||
else
|
else
|
||||||
$facultad=$_POST['mfacultad'];
|
$facultad=$_POST['mfacultad'];
|
||||||
|
|
||||||
$hecho = query("SELECT * FROM fs_usuario WHERE clave = :clave", [':clave' => $_POST['mclave']], true);
|
$hecho = query("SELECT * FROM fs_usuario WHERE clave = :clave", [':clave' => $_POST['mclave']], true);
|
||||||
if(!$hecho){
|
if(!$hecho){
|
||||||
$sql = "SELECT fi_usuario(:nombre, :correo, :clave, :rol, :facultad)";
|
$sql = "SELECT fi_usuario(:nombre, :correo, :clave, :rol, :facultad)";
|
||||||
$params = [':nombre' => mb_strtoupper($_POST['mnombre']), ':correo' => $_POST['mcorreo'], ':clave' => $_POST['mclave'], ':rol' => $_POST['mrol'], ':facultad' => $facultad];
|
$params = [':nombre' => mb_strtoupper($_POST['mnombre']), ':correo' => $_POST['mcorreo'], ':clave' => $_POST['mclave'], ':rol' => $_POST['mrol'], ':facultad' => $facultad];
|
||||||
$hecho = query($sql, $params, true);
|
$hecho = query($sql, $params, true);
|
||||||
header("Location: ../usuarios.php", true, 307);
|
header("Location: ../usuarios.php", true, 307);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
header("Location: ../usuarios.php?error=1");
|
header("Location: ../usuarios.php?error=1");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
$sql = "SELECT * FROM usuario WHERE usuario_id = :idUsuario";
|
$sql = "SELECT * FROM usuario WHERE usuario_id = :idUsuario";
|
||||||
$params = [':idUsuario' => $_POST['usuario']];
|
$params = [':idUsuario' => $_POST['usuario']];
|
||||||
echo json_encode(query($sql, $params, true));
|
echo json_encode(query($sql, $params, true));
|
||||||
?>
|
?>
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
global $pdo;
|
global $pdo;
|
||||||
if(isset($_POST['dlfacultad']))
|
if(isset($_POST['dlfacultad']))
|
||||||
$facultad=$_POST['dlfacultad'];
|
$facultad=$_POST['dlfacultad'];
|
||||||
else
|
else
|
||||||
$facultad=$_POST['mfacultad'];
|
$facultad=$_POST['mfacultad'];
|
||||||
$sql = "SELECT fu_update_usuario(:id, :nombre, :correo, :clave, :rol, :facultad)";
|
$sql = "SELECT fu_update_usuario(:id, :nombre, :correo, :clave, :rol, :facultad)";
|
||||||
$params = array(':id' => $_POST['id'], ':nombre' => mb_strtoupper($_POST['mnombre']), ':correo' => $_POST['mcorreo'], ':clave' => $_POST['mclave'], ':rol' => $_POST['mrol'], ':facultad' => $facultad);
|
$params = array(':id' => $_POST['id'], ':nombre' => mb_strtoupper($_POST['mnombre']), ':correo' => $_POST['mcorreo'], ':clave' => $_POST['mclave'], ':rol' => $_POST['mrol'], ':facultad' => $facultad);
|
||||||
#print_r($_POST);
|
#print_r($_POST);
|
||||||
$hecho = query($sql, $params, false);
|
$hecho = query($sql, $params, false);
|
||||||
header("Location: ../usuarios.php", true, 307);
|
header("Location: ../usuarios.php", true, 307);
|
||||||
exit();
|
exit();
|
||||||
?>
|
?>
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = '../';
|
$ruta = '../';
|
||||||
require_once '../include/bd_pdo.php';
|
require_once '../include/bd_pdo.php';
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
$sql = "SELECT * FROM fs_carreras(:fac, null, null)";
|
$sql = "SELECT * FROM fs_carreras(:fac, null, null)";
|
||||||
$params = [':fac' => $_POST['fac_id']];
|
$params = [':fac' => $_POST['fac_id']];
|
||||||
|
|
||||||
echo json_encode(query($sql, $params, false));
|
echo json_encode(query($sql, $params, false));
|
||||||
?>
|
?>
|
||||||
@@ -1,37 +1,37 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once '../class/c_login.php';
|
require_once '../class/c_login.php';
|
||||||
|
|
||||||
# print_r($_POST); exit;
|
# print_r($_POST); exit;
|
||||||
extract($_POST); // $usuario
|
extract($_POST); // $usuario
|
||||||
Login::log_out();
|
Login::log_out();
|
||||||
|
|
||||||
$user = query("SELECT * FROM FS_USUARIO WHERE ID = :id", [":id" => $usuario]);
|
$user = query("SELECT * FROM FS_USUARIO WHERE ID = :id", [":id" => $usuario]);
|
||||||
// die(json_encode($user));
|
// die(json_encode($user));
|
||||||
|
|
||||||
$facultad = [
|
$facultad = [
|
||||||
"facultad_id" => $user["facultad"],
|
"facultad_id" => $user["facultad"],
|
||||||
"facultad" => $user["facultad_nombre"]
|
"facultad" => $user["facultad_nombre"]
|
||||||
];
|
];
|
||||||
|
|
||||||
$rol = [
|
$rol = [
|
||||||
"rol_id" => $user["rol"],
|
"rol_id" => $user["rol"],
|
||||||
"rol" => $user["titulo"]
|
"rol" => $user["titulo"]
|
||||||
];
|
];
|
||||||
|
|
||||||
$admin = false;
|
$admin = false;
|
||||||
|
|
||||||
$periodo = $user["periodo"];
|
$periodo = $user["periodo"];
|
||||||
|
|
||||||
$user = [
|
$user = [
|
||||||
"id" => $user["id"],
|
"id" => $user["id"],
|
||||||
"nombre" => $user["username"]
|
"nombre" => $user["username"]
|
||||||
];
|
];
|
||||||
|
|
||||||
$user = new Login($user, $facultad, $rol, $admin, $periodo);
|
$user = new Login($user, $facultad, $rol, $admin, $periodo);
|
||||||
if (isset($_SESSION))
|
if (isset($_SESSION))
|
||||||
session_start();
|
session_start();
|
||||||
$_SESSION['user'] = serialize($user);
|
$_SESSION['user'] = serialize($user);
|
||||||
|
|
||||||
header("Location: ../main.php");
|
header("Location: ../main.php");
|
||||||
exit;
|
exit;
|
||||||
@@ -1,60 +1,60 @@
|
|||||||
<?
|
<?
|
||||||
#input $_GET['id_espacio_sgu']
|
#input $_GET['id_espacio_sgu']
|
||||||
define("INFORMATION", [
|
define("INFORMATION", [
|
||||||
'POST' => [
|
'POST' => [
|
||||||
'profesor_id',
|
'profesor_id',
|
||||||
'horario_id',
|
'horario_id',
|
||||||
'estado',
|
'estado',
|
||||||
'comentario',
|
'comentario',
|
||||||
'supervisor_id',
|
'supervisor_id',
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
#output rutas: [ ...ruta, salones: [{...salon}] ]
|
#output rutas: [ ...ruta, salones: [{...salon}] ]
|
||||||
header('Content-Type: application/json charset=utf-8');
|
header('Content-Type: application/json charset=utf-8');
|
||||||
#return html
|
#return html
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
// check method
|
// check method
|
||||||
try {
|
try {
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
// check parameters
|
// check parameters
|
||||||
$raw = file_get_contents('php://input');
|
$raw = file_get_contents('php://input');
|
||||||
$post_data = json_decode($raw, true);
|
$post_data = json_decode($raw, true);
|
||||||
// if it's a list
|
// if it's a list
|
||||||
// step 1: get subrutas
|
// step 1: get subrutas
|
||||||
if (empty($post_data)) {
|
if (empty($post_data)) {
|
||||||
http_response_code(400);
|
http_response_code(400);
|
||||||
echo json_encode(['error' => 'No hay clases pendientes']);
|
echo json_encode(['error' => 'No hay clases pendientes']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $db->query(
|
$data = $db->query(
|
||||||
'INSERT INTO registro (profesor_id, horario_id, registro_fecha_supervisor, estado_supervisor_id, registro_fecha_ideal, supervisor_id, comentario)
|
'INSERT INTO registro (profesor_id, horario_id, registro_fecha_supervisor, estado_supervisor_id, registro_fecha_ideal, supervisor_id, comentario)
|
||||||
VALUES' .
|
VALUES' .
|
||||||
implode(',', array_map(fn($x) => "({$x['profesor_id']} , {$x['horario_id']}, NOW()," . (is_null($x['estado']) ? 'null' : $x['estado']) . ", NOW(), {$x['supervisor_id']}," . (empty($x['comentario']) ? 'null' : "'{$x['comentario']}'") . ')', $post_data))
|
implode(',', array_map(fn($x) => "({$x['profesor_id']} , {$x['horario_id']}, NOW()," . (is_null($x['estado']) ? 'null' : $x['estado']) . ", NOW(), {$x['supervisor_id']}," . (empty($x['comentario']) ? 'null' : "'{$x['comentario']}'") . ')', $post_data))
|
||||||
. ' ON CONFLICT (profesor_id, horario_id, registro_fecha_ideal) DO UPDATE SET estado_supervisor_id = EXCLUDED.estado_supervisor_id, registro_fecha_supervisor = NOW(), comentario = EXCLUDED.comentario
|
. ' ON CONFLICT (profesor_id, horario_id, registro_fecha_ideal) DO UPDATE SET estado_supervisor_id = EXCLUDED.estado_supervisor_id, registro_fecha_supervisor = NOW(), comentario = EXCLUDED.comentario, supervisor_id = EXCLUDED.supervisor_id
|
||||||
RETURNING *'
|
RETURNING *'
|
||||||
);
|
);
|
||||||
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
} else {
|
} else {
|
||||||
http_response_code(405);
|
http_response_code(405);
|
||||||
echo json_encode(['error' => 'method not allowed']);
|
echo json_encode(['error' => 'method not allowed']);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (PDOException $th) {
|
} catch (PDOException $th) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => $th->getMessage(),
|
'error' => $th->getMessage(),
|
||||||
'query' => $db->getLastQuery(),
|
'query' => $db->getLastQuery(),
|
||||||
'post_data' => $post_data,
|
'post_data' => $post_data,
|
||||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
exit;
|
exit;
|
||||||
} catch (Exception $th) {
|
} catch (Exception $th) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => $th->getMessage(),
|
'error' => $th->getMessage(),
|
||||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@@ -1,28 +1,28 @@
|
|||||||
<?
|
<?
|
||||||
header('Content-Type: application/json charset=utf-8');
|
header('Content-Type: application/json charset=utf-8');
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
|
|
||||||
$universidad_la_salle = $db
|
$universidad_la_salle = $db
|
||||||
->where('salon', 'UNIVERSIDAD LA SALLE', 'ILIKE')
|
->where('salon', 'UNIVERSIDAD LA SALLE', 'ILIKE')
|
||||||
->getOne('salon_view');
|
->getOne('salon_view');
|
||||||
|
|
||||||
$rutas =
|
$rutas =
|
||||||
array_map(
|
array_map(
|
||||||
function (&$ruta) use ($db) {
|
function ($ruta) use ($db) {
|
||||||
$ruta['subrutas'] =
|
$ruta['subrutas'] =
|
||||||
$db
|
$db
|
||||||
->where('id_espacio_padre', $ruta['id_espacio_sgu'])
|
->where('id_espacio_padre', $ruta['id_espacio_sgu'])
|
||||||
->orderBy('salon')
|
->orderBy('salon')
|
||||||
->get('salon_view');
|
->get('salon_view');
|
||||||
return $ruta;
|
return $ruta;
|
||||||
|
|
||||||
},
|
},
|
||||||
$db
|
$db
|
||||||
->where('id_espacio_padre', $universidad_la_salle['id_espacio_sgu'])
|
->where('id_espacio_padre', $universidad_la_salle['id_espacio_sgu'])
|
||||||
->orderBy('salon')
|
->orderBy('salon')
|
||||||
->get('salon_view')
|
->get('salon_view')
|
||||||
);
|
);
|
||||||
|
|
||||||
// echo json_encode($universidad_la_salle, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); EXIT;
|
// echo json_encode($universidad_la_salle, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); EXIT;
|
||||||
echo json_encode($rutas, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
echo json_encode($rutas, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
@@ -1,73 +1,73 @@
|
|||||||
<?
|
<?
|
||||||
#input $_GET['id_espacio_sgu']
|
#input $_GET['id_espacio_sgu']
|
||||||
$information = [
|
$information = [
|
||||||
'GET' => [
|
'GET' => [
|
||||||
'id_espacio_sgu',
|
'id_espacio_sgu',
|
||||||
'bloque_horario_id',
|
'bloque_horario_id',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
#output rutas: [ ...ruta, salones: [{...salon}] ]
|
#output rutas: [ ...ruta, salones: [{...salon}] ]
|
||||||
header('Content-Type: application/json charset=utf-8');
|
header('Content-Type: application/json charset=utf-8');
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once "../class/c_login.php";
|
require_once "../class/c_login.php";
|
||||||
// check method
|
// check method
|
||||||
try {
|
try {
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||||
// check parameters
|
// check parameters
|
||||||
array_walk($information['GET'], function ($value) {
|
array_walk($information['GET'], function ($value) {
|
||||||
if (!array_key_exists($value, $_GET)) {
|
if (!array_key_exists($value, $_GET)) {
|
||||||
http_response_code(400);
|
http_response_code(400);
|
||||||
echo json_encode(['error' => "$value is required"]);
|
echo json_encode(['error' => "$value is required"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// step 1: get subrutas
|
// step 1: get subrutas
|
||||||
$data = $db
|
$data = $db
|
||||||
->where('tiene_salones')
|
->where('tiene_salones')
|
||||||
->where("{$_GET['id_espacio_sgu']} = ANY(id_espacio_sgu_array)")
|
->where("{$_GET['id_espacio_sgu']} = ANY(id_espacio_sgu_array)")
|
||||||
->get('salon_view');
|
->get('salon_view');
|
||||||
|
|
||||||
// step 3: get horarios
|
// step 3: get horarios
|
||||||
$data = array_map(
|
$data = array_map(
|
||||||
fn($ruta) => array_merge(
|
fn($ruta) => array_merge(
|
||||||
[
|
[
|
||||||
'horarios' => $db
|
'horarios' => $db
|
||||||
->join('periodo', 'periodo.periodo_id = horario_view.periodo_id')
|
->join('periodo', 'periodo.periodo_id = horario_view.periodo_id')
|
||||||
->join('bloque_horario', '(bloque_horario.hora_inicio, bloque_horario.hora_fin) OVERLAPS (horario_view.horario_hora, horario_view.horario_hora + horario_view.duracion)')
|
->join('bloque_horario', '(bloque_horario.hora_inicio, bloque_horario.hora_fin) OVERLAPS (horario_view.horario_hora, horario_view.horario_hora + horario_view.duracion)')
|
||||||
->join('salon_view', 'salon_view.salon_id = horario_view.salon_id')
|
->join('salon_view', 'salon_view.salon_id = horario_view.salon_id')
|
||||||
->join('horario_profesor', 'horario_profesor.horario_id = horario_view.horario_id')
|
->join('horario_profesor', 'horario_profesor.horario_id = horario_view.horario_id')
|
||||||
->join('profesor', 'profesor.profesor_id = horario_profesor.profesor_id')
|
->join('profesor', 'profesor.profesor_id = horario_profesor.profesor_id')
|
||||||
->join('registro', '(registro.profesor_id, registro.horario_id, registro.registro_fecha_ideal) = (profesor.profesor_id, horario_view.horario_id, CURRENT_DATE)', 'LEFT')
|
->join('registro', '(registro.profesor_id, registro.horario_id, registro.registro_fecha_ideal) = (profesor.profesor_id, horario_view.horario_id, CURRENT_DATE)', 'LEFT')
|
||||||
->where('CURRENT_DATE BETWEEN periodo.periodo_fecha_inicio AND periodo.periodo_fecha_fin')
|
->where('CURRENT_DATE BETWEEN periodo.periodo_fecha_inicio AND periodo.periodo_fecha_fin')
|
||||||
->where('horario_dia = EXTRACT(DOW FROM CURRENT_DATE)')
|
->where('horario_dia = EXTRACT(DOW FROM CURRENT_DATE)')
|
||||||
->where('bloque_horario.id', $_GET['bloque_horario_id'])
|
->where('bloque_horario.id', $_GET['bloque_horario_id'])
|
||||||
->where('id_espacio_padre', $ruta['id_espacio_sgu'])
|
->where('id_espacio_padre', $ruta['id_espacio_sgu'])
|
||||||
->get('horario_view', null, '*, horario_view.horario_id, profesor.profesor_id'),
|
->get('horario_view', null, '*, horario_view.horario_id, profesor.profesor_id'),
|
||||||
],
|
],
|
||||||
$ruta
|
$ruta
|
||||||
),
|
),
|
||||||
$data
|
$data
|
||||||
);
|
);
|
||||||
|
|
||||||
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
} else {
|
} else {
|
||||||
http_response_code(405);
|
http_response_code(405);
|
||||||
echo json_encode(['error' => 'method not allowed']);
|
echo json_encode(['error' => 'method not allowed']);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (PDOException $th) {
|
} catch (PDOException $th) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => $th->getMessage(),
|
'error' => $th->getMessage(),
|
||||||
'query' => $db->getLastQuery(),
|
'query' => $db->getLastQuery(),
|
||||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
exit;
|
exit;
|
||||||
} catch (Exception $th) {
|
} catch (Exception $th) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => $th->getMessage(),
|
'error' => $th->getMessage(),
|
||||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,24 @@
|
|||||||
{
|
{
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"profesor_id": {
|
"profesor_id": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"horario_id": {
|
"horario_id": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"estado": {
|
"estado": {
|
||||||
"type": ["integer", "null"]
|
"type": ["integer", "null"]
|
||||||
},
|
},
|
||||||
"comentario": {
|
"comentario": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"supervisor_id": {
|
"supervisor_id": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["profesor_id", "horario_id", "comentario", "supervisor_id"]
|
"required": ["profesor_id", "horario_id", "comentario", "supervisor_id"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
$ruta = '../';
|
$ruta = '../';
|
||||||
require_once '../include/bd_pdo.php';
|
require_once '../include/bd_pdo.php';
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
if($_POST['nombre']==""){
|
if($_POST['nombre']==""){
|
||||||
$nombre = null;
|
$nombre = null;
|
||||||
}else{
|
}else{
|
||||||
$nombre = $_POST['nombre'];
|
$nombre = $_POST['nombre'];
|
||||||
}
|
}
|
||||||
if($_POST['clave']==""){
|
if($_POST['clave']==""){
|
||||||
$clave = null;
|
$clave = null;
|
||||||
}else{
|
}else{
|
||||||
$clave = $_POST['clave'];
|
$clave = $_POST['clave'];
|
||||||
}
|
}
|
||||||
if($_POST['facultad']==""){
|
if($_POST['facultad']==""){
|
||||||
$facultad = null;
|
$facultad = null;
|
||||||
}else{
|
}else{
|
||||||
$facultad = $_POST['facultad'];
|
$facultad = $_POST['facultad'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT * FROM fs_profesores(:nombre, :clave, :facultad) ORDER BY profesor_nombre";
|
$sql = "SELECT * FROM fs_profesores(:nombre, :clave, :facultad) ORDER BY profesor_nombre";
|
||||||
$params = [':nombre' => $nombre, ':clave' => $clave, ':facultad' => $facultad];
|
$params = [':nombre' => $nombre, ':clave' => $clave, ':facultad' => $facultad];
|
||||||
|
|
||||||
echo json_encode(query($sql, $params, false));
|
echo json_encode(query($sql, $params, false));
|
||||||
?>
|
?>
|
||||||
@@ -1,286 +1,286 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'class/c_login.php';
|
require_once 'class/c_login.php';
|
||||||
if (!isset($_SESSION['user']))
|
if (!isset($_SESSION['user']))
|
||||||
die(header('Location: index.php'));
|
die(header('Location: index.php'));
|
||||||
|
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
$user->access();
|
$user->access();
|
||||||
if (!$user->admin && in_array($user->acceso, ['r', 'n']))
|
if (!$user->admin && in_array($user->acceso, ['r', 'n']))
|
||||||
die(header('Location: main.php?error=1'));
|
die(header('Location: main.php?error=1'));
|
||||||
|
|
||||||
$user->print_to_log('Consultar: Alta de horario');
|
$user->print_to_log('Consultar: Alta de horario');
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>Cargar horario desde Excel | <?= $user->facultad['facultad'] ?? 'General' ?></title>
|
<title>Cargar horario desde Excel | <?= $user->facultad['facultad'] ?? 'General' ?></title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<?php include_once "import/html_css_files.php"; ?>
|
<?php include_once "import/html_css_files.php"; ?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body style="display: block;">
|
<body style="display: block;">
|
||||||
<?php
|
<?php
|
||||||
include('include/constantes.php');
|
include('include/constantes.php');
|
||||||
include("import/html_header.php");
|
include("import/html_header.php");
|
||||||
html_header("Cargar horario desde Excel", "Sistema de gestión de checador");
|
html_header("Cargar horario desde Excel", "Sistema de gestión de checador");
|
||||||
?>
|
?>
|
||||||
<main class="container content marco content-margin" id="local-app">
|
<main class="container content marco content-margin" id="local-app">
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12 text-right">
|
<div class="col-12 text-right">
|
||||||
<button class="btn btn-outline-secondary" data-toggle="modal" data-target="#modalDescargarPlantilla">
|
<button class="btn btn-outline-secondary" data-toggle="modal" data-target="#modalDescargarPlantilla">
|
||||||
<span class="ing-descarga ing-fw"></span>
|
<span class="ing-descarga ing-fw"></span>
|
||||||
Descargar plantilla
|
Descargar plantilla
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<section id="message"></section>
|
<section id="message"></section>
|
||||||
<?php require('import/periodo.php') ?>
|
<?php require('import/periodo.php') ?>
|
||||||
<form>
|
<form>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<?php
|
<?php
|
||||||
$periodo = $db->where('id', $user->periodo)->getOne('fs_periodo');
|
$periodo = $db->where('id', $user->periodo)->getOne('fs_periodo');
|
||||||
$carreras = $db
|
$carreras = $db
|
||||||
->where('nivel', $periodo['nivel_id'])
|
->where('nivel', $periodo['nivel_id'])
|
||||||
->where('facultad', $user->facultad['facultad_id'])
|
->where('facultad', $user->facultad['facultad_id'])
|
||||||
->orderBy('carrera')
|
->orderBy('carrera')
|
||||||
->get('fs_carrera');
|
->get('fs_carrera');
|
||||||
?>
|
?>
|
||||||
<div class="form-group row" id="input-carrera">
|
<div class="form-group row" id="input-carrera">
|
||||||
|
|
||||||
<label for="filter_carrera" class="col-4 col-form-label">Carrera</label>
|
<label for="filter_carrera" class="col-4 col-form-label">Carrera</label>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<div id="dlcarrera" class="datalist datalist-select mb-1 w-100">
|
<div id="dlcarrera" class="datalist datalist-select mb-1 w-100">
|
||||||
<div class="datalist-input">Seleccionar carrera</div>
|
<div class="datalist-input">Seleccionar carrera</div>
|
||||||
<span class="ing-buscar icono"></span>
|
<span class="ing-buscar icono"></span>
|
||||||
<ul style="display:none">
|
<ul style="display:none">
|
||||||
<?php
|
<?php
|
||||||
foreach ($carreras as $carrera) {
|
foreach ($carreras as $carrera) {
|
||||||
?>
|
?>
|
||||||
<li data-id="<?= $carrera['id'] ?>">
|
<li data-id="<?= $carrera['id'] ?>">
|
||||||
<?= $carrera['carrera'] ?>
|
<?= $carrera['carrera'] ?>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
<input type="hidden" id="filter_carrera" name="carrera" value="">
|
<input type="hidden" id="filter_carrera" name="carrera" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row" id="input-file">
|
<div class="form-group row" id="input-file">
|
||||||
<label for="excel" class="col-4 col-form-label">Archivo de horarios</label>
|
<label for="excel" class="col-4 col-form-label">Archivo de horarios</label>
|
||||||
<div class="col-8 col-sm-6">
|
<div class="col-8 col-sm-6">
|
||||||
<input class="form-control-file" id="excel" name="archivo" accept=".xlsx, .xls" require>
|
<input class="form-control-file" id="excel" name="archivo" accept=".xlsx, .xls" require>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mt-5 row justify-content-center">
|
<div class="form-group mt-5 row justify-content-center">
|
||||||
<!-- on click reload -->
|
<!-- on click reload -->
|
||||||
<button id="btn-cancelar" type="button" class="btn btn-danger mx-2" onclick="location.reload()">
|
<button id="btn-cancelar" type="button" class="btn btn-danger mx-2" onclick="location.reload()">
|
||||||
<span class="ing-cancelar"></span>
|
<span class="ing-cancelar"></span>
|
||||||
Cancelar
|
Cancelar
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button id="btn-cargar" type="button" class="btn btn-primary" onclick="submit_files()">
|
<button id="btn-cargar" type="button" class="btn btn-primary" onclick="submit_files()">
|
||||||
<span class="ing-guardar"></span>
|
<span class="ing-guardar"></span>
|
||||||
Guardar horario
|
Guardar horario
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div class="modal fade" id="modalDescargarPlantilla" tabindex="-1" aria-labelledby="descargarPlantillaModalLabel" aria-hidden="true">
|
<div class="modal fade" id="modalDescargarPlantilla" tabindex="-1" aria-labelledby="descargarPlantillaModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable">
|
<div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="descargarPlantillaModalLabel">Instrucciones</h5>
|
<h5 class="modal-title" id="descargarPlantillaModalLabel">Instrucciones</h5>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<ol>
|
<ol>
|
||||||
<li> Los encabezados deberán mantenerse en todo momento, tal cual se encuentran en la plantilla. </li>
|
<li> Los encabezados deberán mantenerse en todo momento, tal cual se encuentran en la plantilla. </li>
|
||||||
<li> Las horas válidas son de 7:00 a 22:00 en bloques de 15 minutos. </li>
|
<li> Las horas válidas son de 7:00 a 22:00 en bloques de 15 minutos. </li>
|
||||||
<li> La columna DURACIÓN es la duración de una clase en horas. Si la clase es de 7:15–8:45 se pone que la hora de la clase es de 7:15 con una duración de 180. </li>
|
<li> La columna DURACIÓN es la duración de una clase en horas. Si la clase es de 7:15–8:45 se pone que la hora de la clase es de 7:15 con una duración de 180. </li>
|
||||||
<!-- <li> Únicamente las columnas de … </li> -->
|
<!-- <li> Únicamente las columnas de … </li> -->
|
||||||
<li> Si se encuentra un error en la revisión del archivo no se guardará ningún registro. </li>
|
<li> Si se encuentra un error en la revisión del archivo no se guardará ningún registro. </li>
|
||||||
<li> Una vez revisado el archivo haz clic en el botón [Guardar horario] para que se guarde la información. </li>
|
<li> Una vez revisado el archivo haz clic en el botón [Guardar horario] para que se guarde la información. </li>
|
||||||
|
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Aceptar</button>
|
<button type="button" class="btn btn-danger" data-dismiss="modal">Aceptar</button>
|
||||||
<button type="button" class="btn btn-primary" id="descargarPlantilla"><span class="ing-descarga"></span> Descargar</button>
|
<button type="button" class="btn btn-primary" id="descargarPlantilla"><span class="ing-descarga"></span> Descargar</button>
|
||||||
<button type="button" class="btn btn-primary" id="descargarPlantillaEjemplo"><span class="ing-descarga"></span> Descargar ejemplo</button>
|
<button type="button" class="btn btn-primary" id="descargarPlantillaEjemplo"><span class="ing-descarga"></span> Descargar ejemplo</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
<?php
|
<?php
|
||||||
require_once("import/html_footer.php");
|
require_once("import/html_footer.php");
|
||||||
require_once("js/messages.php")
|
require_once("js/messages.php")
|
||||||
?>
|
?>
|
||||||
<script src="js/scrollables.js"></script>
|
<script src="js/scrollables.js"></script>
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="js/bootstrap/bootstrap.min.js"></script>
|
<script src="js/bootstrap/bootstrap.min.js"></script>
|
||||||
|
|
||||||
<script src="js/custominputfile.min-es.js"></script>
|
<script src="js/custominputfile.min-es.js"></script>
|
||||||
<link rel="stylesheet" href="css/custominputfile.min.css">
|
<link rel="stylesheet" href="css/custominputfile.min.css">
|
||||||
<script src="js/fetchlib.js"></script>
|
<script src="js/fetchlib.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var datum = []
|
var datum = []
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('#excel').customFile({
|
$('#excel').customFile({
|
||||||
allowed: ['xlsx', 'xls'],
|
allowed: ['xlsx', 'xls'],
|
||||||
maxFiles: 1,
|
maxFiles: 1,
|
||||||
callbacks: {
|
callbacks: {
|
||||||
onSuccess: async function(item) {
|
onSuccess: async function(item) {
|
||||||
var formData = $.customFile.serialize('archivo');
|
var formData = $.customFile.serialize('archivo');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
status,
|
status,
|
||||||
message,
|
message,
|
||||||
data
|
data
|
||||||
} = await fetch('action/action_revisar_excel.php', {
|
} = await fetch('action/action_revisar_excel.php', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: formData,
|
body: formData,
|
||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
return {
|
return {
|
||||||
status: 'error',
|
status: 'error',
|
||||||
message: 'Error al cargar el archivo',
|
message: 'Error al cargar el archivo',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (status == 'error') {
|
if (status == 'error') {
|
||||||
triggerMessage(message, 'Error en el formato del archivo');
|
triggerMessage(message, 'Error en el formato del archivo');
|
||||||
item.destroy();
|
item.destroy();
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
triggerMessage(message + " Haz clic en el botón <b>Guardar horario</b> para guardar los datos", `Archivo revisado, aún <b>no guardado</b>`, 'primary');
|
triggerMessage(message + " Haz clic en el botón <b>Guardar horario</b> para guardar los datos", `Archivo revisado, aún <b>no guardado</b>`, 'primary');
|
||||||
datum = data;
|
datum = data;
|
||||||
// hide form
|
// hide form
|
||||||
document.querySelector('#input-file').classList.add('d-none');
|
document.querySelector('#input-file').classList.add('d-none');
|
||||||
document.querySelector('#input-carrera').classList.add('d-none');
|
document.querySelector('#input-carrera').classList.add('d-none');
|
||||||
|
|
||||||
// show button
|
// show button
|
||||||
document.querySelector('#btn-cargar').classList.remove('d-none');
|
document.querySelector('#btn-cargar').classList.remove('d-none');
|
||||||
document.querySelector('#btn-cancelar').classList.remove('d-none');
|
document.querySelector('#btn-cancelar').classList.remove('d-none');
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// hide
|
// hide
|
||||||
document.querySelector('#input-file').classList.add('d-none');
|
document.querySelector('#input-file').classList.add('d-none');
|
||||||
document.querySelector('#btn-cancelar').classList.add('d-none');
|
document.querySelector('#btn-cancelar').classList.add('d-none');
|
||||||
document.querySelector('#btn-cargar').classList.add('d-none');
|
document.querySelector('#btn-cargar').classList.add('d-none');
|
||||||
// on click in carrera
|
// on click in carrera
|
||||||
[... document.querySelectorAll('#dlcarrera ul li')].forEach(
|
[... document.querySelectorAll('#dlcarrera ul li')].forEach(
|
||||||
li => li.addEventListener('click', () => {
|
li => li.addEventListener('click', () => {
|
||||||
document.querySelector('#input-file').classList.remove('d-none')
|
document.querySelector('#input-file').classList.remove('d-none')
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
async function submit_files() {
|
async function submit_files() {
|
||||||
// disable button
|
// disable button
|
||||||
const button = document.querySelector('#btn-cargar');
|
const button = document.querySelector('#btn-cargar');
|
||||||
// add class disabled to button
|
// add class disabled to button
|
||||||
button.classList.add('disabled');
|
button.classList.add('disabled');
|
||||||
// disable button
|
// disable button
|
||||||
button.disabled = true;
|
button.disabled = true;
|
||||||
|
|
||||||
// add loading icon
|
// add loading icon
|
||||||
button.innerHTML = '<span class="ing-cargando"></span> Cargando...';
|
button.innerHTML = '<span class="ing-cargando"></span> Cargando...';
|
||||||
|
|
||||||
let missing = [];
|
let missing = [];
|
||||||
|
|
||||||
let carrera = $('#filter_carrera').val();
|
let carrera = $('#filter_carrera').val();
|
||||||
if (carrera == '') missing.push('Carrera');
|
if (carrera == '') missing.push('Carrera');
|
||||||
|
|
||||||
if (datum.length == 0) missing.push('Archivo de horarios');
|
if (datum.length == 0) missing.push('Archivo de horarios');
|
||||||
|
|
||||||
let facultad = <?= $user->facultad['facultad_id'] ?>;
|
let facultad = <?= $user->facultad['facultad_id'] ?>;
|
||||||
|
|
||||||
if (missing.length > 0) {
|
if (missing.length > 0) {
|
||||||
messageMissingInputs(missing);
|
messageMissingInputs(missing);
|
||||||
|
|
||||||
// remove class disabled to button
|
// remove class disabled to button
|
||||||
button.classList.remove('disabled');
|
button.classList.remove('disabled');
|
||||||
// enable button
|
// enable button
|
||||||
button.disabled = false;
|
button.disabled = false;
|
||||||
|
|
||||||
// remove loading icon
|
// remove loading icon
|
||||||
button.innerHTML = '<span class="ing-guardar"></span> Guardar horario';
|
button.innerHTML = '<span class="ing-guardar"></span> Guardar horario';
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
|
||||||
formData.append('carrera', carrera);
|
formData.append('carrera', carrera);
|
||||||
formData.append('facultad', facultad);
|
formData.append('facultad', facultad);
|
||||||
formData.append('periodo', <?= $user->periodo ?>);
|
formData.append('periodo', <?= $user->periodo ?>);
|
||||||
formData.append('data', JSON.stringify(datum));
|
formData.append('data', JSON.stringify(datum));
|
||||||
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
status,
|
status,
|
||||||
message
|
message
|
||||||
} = await fetch('action/action_horario_excel.php', {
|
} = await fetch('action/action_horario_excel.php', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: formData
|
body: formData
|
||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
return {
|
return {
|
||||||
status: 'error',
|
status: 'error',
|
||||||
message: 'Error al cargar el archivo',
|
message: 'Error al cargar el archivo',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
triggerMessage(message, (status == 'error') ? 'Error al guardar el archivo' : 'Horarios guardados', (status == 'error') ? 'danger' : 'success');
|
triggerMessage(message, (status == 'error') ? 'Error al guardar el archivo' : 'Horarios guardados', (status == 'error') ? 'danger' : 'success');
|
||||||
|
|
||||||
// await 1 second
|
// await 1 second
|
||||||
// await setTimeout(() => {}, 1000);
|
// await setTimeout(() => {}, 1000);
|
||||||
|
|
||||||
// remove class disabled to
|
// remove class disabled to
|
||||||
button.classList.remove('disabled');
|
button.classList.remove('disabled');
|
||||||
// enable button
|
// enable button
|
||||||
button.disabled = false;
|
button.disabled = false;
|
||||||
button.innerHTML = 'Cargar otro horario';
|
button.innerHTML = 'Cargar otro horario';
|
||||||
|
|
||||||
// refresh page
|
// refresh page
|
||||||
button.onclick = () => location.reload()
|
button.onclick = () => location.reload()
|
||||||
|
|
||||||
// hide button
|
// hide button
|
||||||
document.querySelector('#btn-cancelar').classList.add('d-none');
|
document.querySelector('#btn-cancelar').classList.add('d-none');
|
||||||
}
|
}
|
||||||
|
|
||||||
document.querySelector('#descargarPlantilla').addEventListener('click', function() {
|
document.querySelector('#descargarPlantilla').addEventListener('click', function() {
|
||||||
window.open('template/plantilla.xlsx', '_blank');
|
window.open('template/plantilla.xlsx', '_blank');
|
||||||
});
|
});
|
||||||
|
|
||||||
document.querySelector('#descargarPlantillaEjemplo').addEventListener('click', function() {
|
document.querySelector('#descargarPlantillaEjemplo').addEventListener('click', function() {
|
||||||
window.open('template/ejemplo.xlsx', '_blank');
|
window.open('template/ejemplo.xlsx', '_blank');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
797
auditoría.php
797
auditoría.php
@@ -1,377 +1,422 @@
|
|||||||
<!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>Supervisor</title>
|
<title>Supervisor</title>
|
||||||
<?php
|
<?php
|
||||||
include 'import/html_css_files.php';
|
include 'import/html_css_files.php';
|
||||||
?>
|
?>
|
||||||
<style>
|
<style>
|
||||||
[v-cloak] {
|
[v-cloak] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?
|
<?
|
||||||
$redirect = $_SERVER['PHP_SELF'];
|
$redirect = $_SERVER['PHP_SELF'];
|
||||||
include "import/html_header.php";
|
include "import/html_header.php";
|
||||||
global $user;
|
global $user;
|
||||||
html_header(
|
html_header(
|
||||||
"Registro de asistencia - Vicerrectoría Académica",
|
"Registro de asistencia - Vicerrectoría Académica",
|
||||||
"Sistema de gestión de checador",
|
"Sistema de gestión de checador",
|
||||||
);
|
);
|
||||||
|
?>
|
||||||
#include "import/periodo.php";
|
|
||||||
?>
|
<main class="container-fluid px-4 mt-4" id="app" v-cloak @vue:mounted="mounted">
|
||||||
|
<form action="">
|
||||||
<main class="container-fluid px-4 mt-4" id="app" v-cloak @vue:mounted="mounted">
|
<?php include "import/periodo.php" ?>
|
||||||
<form action="">
|
<div class="form-box">
|
||||||
<div class="form-box">
|
<div class="form-group row">
|
||||||
<div class="form-group row">
|
<label for="dlFacultad" class="col-4 col-form-label">Facultad</label>
|
||||||
<label for="periodo" class="col-4 col-form-label">Facultad</label>
|
<div class="col-6">
|
||||||
<div class="col-6">
|
<div id="dlFacultad" class="datalist datalist-select mb-1 w-100">
|
||||||
<div id="dlPeriodo" class="datalist datalist-select mb-1 w-100">
|
<div class="datalist-input">Selecciona una facultad</div>
|
||||||
<div class="datalist-input">Selecciona una facultad</div>
|
<span class="ing-buscar icono"></span>
|
||||||
<span class="ing-buscar icono"></span>
|
<ul style="display:none">
|
||||||
<ul style="display:none">
|
<li class="datalist-option" data-id="0" @click="store.filters.facultad_id = null;">
|
||||||
<li class="datalist-option" data-id="0" @click="store.filters.facultad_id = null;">
|
Todas las facultades
|
||||||
Todas las facultades
|
</li>
|
||||||
</li>
|
<li class="datalist-option" v-for="facultad in store.facultades.data"
|
||||||
<li class="datalist-option" v-for="facultad in store.facultades.data"
|
:key="facultad.facultad_id" :data-id="facultad.facultad_id"
|
||||||
:key="facultad.facultad_id" :data-id="facultad.facultad_id"
|
@click="store.filters.facultad_id = facultad.facultad_id">
|
||||||
@click="store.filters.facultad_id = facultad.facultad_id">
|
(<small> {{facultad.clave_dependencia}} </small>) {{ facultad.facultad_nombre }}
|
||||||
(<small> {{facultad.clave_dependencia}} </small>) {{ facultad.facultad_nombre }}
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
</ul>
|
<input type="hidden" id="facultad_id" name="id">
|
||||||
<input type="hidden" id="facultad_id" name="id">
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group row align-items-center">
|
||||||
<div class="form-group row align-items-center">
|
<label for="switchFecha" class="col-4 col-form-label">
|
||||||
<label for="switchFecha" class="col-4 col-form-label">
|
Fecha
|
||||||
Fecha
|
<!-- switch -->
|
||||||
<!-- switch -->
|
<div class="custom-control custom-switch">
|
||||||
<div class="custom-control custom-switch">
|
<input type="checkbox" class="custom-control-input" id="switchFecha"
|
||||||
<input type="checkbox" class="custom-control-input" id="switchFecha"
|
v-model="store.filters.switchFecha" @input="store.filters.switchFechas">
|
||||||
v-model="store.filters.switchFecha" @input="store.filters.switchFechas">
|
<label class="custom-control-label" for="switchFecha"></label>
|
||||||
<label class="custom-control-label" for="switchFecha"></label>
|
</div>
|
||||||
</div>
|
</label>
|
||||||
</label>
|
<div class="col-3" v-if="store.filters.switchFecha">
|
||||||
<div class="col-3" v-if="store.filters.switchFecha">
|
<div class="form-row">
|
||||||
<div class="form-row">
|
<input id="fecha_inicio" name="fecha_inicio" class="form-control date-picker"
|
||||||
<input id="fecha_inicio" name="fecha_inicio" class="form-control date-picker"
|
placeholder="Seleccione una fecha de inicio" readonly
|
||||||
placeholder="Seleccione una fecha de inicio" readonly
|
v-model="store.filters.fecha_inicio">
|
||||||
v-model="store.filters.fecha_inicio">
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col-3" v-if="store.filters.switchFecha">
|
||||||
<div class="col-3" v-if="store.filters.switchFecha">
|
<div class="form-row">
|
||||||
<div class="form-row">
|
<input id="fecha_fin" name="fecha_fin" class="form-control date-picker"
|
||||||
<input id="fecha_fin" name="fecha_fin" class="form-control date-picker"
|
placeholder="Seleccione una fecha final" readonly v-model="store.filters.fecha_fin">
|
||||||
placeholder="Seleccione una fecha final" readonly v-model="store.filters.fecha_fin">
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
<div class="col-6" v-if="!store.filters.switchFecha">
|
||||||
<div class="col-6" v-if="!store.filters.switchFecha">
|
<div class="form-row">
|
||||||
<div class="form-row">
|
<input id="fecha" name="fecha" class="form-control date-picker"
|
||||||
<input id="fecha" name="fecha" class="form-control date-picker"
|
placeholder="Seleccione una fecha" readonly v-model="store.filters.fecha">
|
||||||
placeholder="Seleccione una fecha" readonly v-model="store.filters.fecha">
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group row" v-if="store.bloques_horario.data.length > 0">
|
||||||
<div class="form-group row">
|
<label for="dlBloqueHorarios" class="col-4 col-form-label">Bloque horarios</label>
|
||||||
<label for="profesor" class="col-4 col-form-label">Profesor</label>
|
<div class="col-6">
|
||||||
<div class="col-6">
|
<div id="dlBloqueHorarios" class="datalist datalist-select mb-1 w-100">
|
||||||
<div class="form-row justify-content-around align-items-center">
|
<div class="datalist-input">
|
||||||
<input id="profesor" name="profesor" class="form-control col-11 mr-1 px-2"
|
{{ store.bloques_horario.data.find(bloque => bloque.selected).hora_inicio.substr(0,5)
|
||||||
placeholder="Seleccione una profesor" list="dlProfesor"
|
}} -
|
||||||
v-model="store.filters.profesor">
|
{{ store.bloques_horario.data.find(bloque => bloque.selected).hora_fin.substr(0,5) }}
|
||||||
<button type="button" class="btn btn-info btn-sm form-control col ml-auto"
|
</div>
|
||||||
@click="store.filters.profesor = null">
|
<span class="ing-buscar icono"></span>
|
||||||
<i class="ing-borrar"></i>
|
<ul style="display:none">
|
||||||
</button>
|
<li class="datalist-option not-selectable">
|
||||||
</div>
|
Mañana
|
||||||
<datalist id="dlProfesor">
|
</li>
|
||||||
<option v-for="profesor in profesores" :key="profesor.profesor_id"
|
|
||||||
:value="`(${profesor.profesor_clave}) ${profesor.profesor_nombre}`">
|
<li class="datalist-option" :class="{selected: bloque.selected}"
|
||||||
</datalist>
|
v-for="bloque in store.bloques_horario.data.filter(bloque => bloque.hora_inicio < '13:00:00')"
|
||||||
</div>
|
:key="bloque.id" :data-id="bloque.id" @click="store.filters.bloque_horario = bloque.id">
|
||||||
</div>
|
{{ bloque.hora_inicio.substr(0,5) }} - {{ bloque.hora_fin.substr(0,5) }}
|
||||||
<div class="form-group row">
|
</li>
|
||||||
<label for="periodo" class="col-4 col-form-label">Asistencia</label>
|
<li class="datalist-option not-selectable">
|
||||||
<div class="col-6">
|
Tarde
|
||||||
<div class="form-row justify-content-around align-items-center">
|
</li>
|
||||||
<div id="dlPeriodo" class="datalist datalist-select mb-1 w-100">
|
<li class="datalist-option" :class="{selected: bloque.selected}"
|
||||||
<div class="datalist-input" id="estados">Selecciona un estado de asistencia</div>
|
v-for="bloque in store.bloques_horario.data.filter(bloque => bloque.hora_inicio >= '13:00:00')"
|
||||||
<span class="ing-buscar icono"></span>
|
:key="bloque.id" :data-id="bloque.id" @click="store.filters.bloque_horario = bloque.id">
|
||||||
<ul style="display:none">
|
{{ bloque.hora_inicio.substr(0,5) }} - {{ bloque.hora_fin.substr(0,5) }}
|
||||||
<li class="datalist-option" data-id="0" @click="store.filters.estados = [];">
|
</li>
|
||||||
Todos los registros
|
|
||||||
</li>
|
</ul>
|
||||||
<li class="datalist-option" v-for="estado in store.estados.data"
|
<input type="hidden" id="bloque_id" name="id">
|
||||||
:key="estado.estado_supervisor_id" :data-id="estado.estado_supervisor_id"
|
</div>
|
||||||
@click="store.filters.estados = store.toggle(store.filters.estados, estado.estado_supervisor_id); ; setTimeout(store.estados.printEstados, 0);">
|
</div>
|
||||||
<span class="badge"
|
</div>
|
||||||
:class="`badge-${store.filters.estados.includes(estado.estado_supervisor_id) ? 'dark' : estado.estado_color}`"><i
|
<div class="form-group row">
|
||||||
:class="estado.estado_icon"></i> {{estado.nombre}}</span>
|
<label for="profesor" class="col-4 col-form-label">Profesor</label>
|
||||||
</li>
|
<div class="col-6">
|
||||||
</ul>
|
<div class="form-row justify-content-around align-items-center">
|
||||||
<input type="hidden" id="estado_id" name="estado_id">
|
<input id="profesor" name="profesor" class="form-control col-11 mr-1 px-2"
|
||||||
</div>
|
placeholder="Seleccione una profesor" list="dlProfesor"
|
||||||
</div>
|
v-model="store.filters.profesor">
|
||||||
</div>
|
<button type="button" class="btn btn-info btn-sm form-control col ml-auto"
|
||||||
</div>
|
@click="store.filters.profesor = null">
|
||||||
</div>
|
<i class="ing-borrar"></i>
|
||||||
|
</button>
|
||||||
</form>
|
</div>
|
||||||
<div class="mt-3 d-flex justify-content-center flex-wrap">
|
<datalist id="dlProfesor">
|
||||||
<!-- refresh -->
|
<option v-for="profesor in profesores" :key="profesor.profesor_id"
|
||||||
<div class="table-responsive">
|
:value="`(${profesor.profesor_clave}) ${profesor.profesor_nombre}`">
|
||||||
<table class="table table-hover table-striped table-bordered table-sm">
|
</datalist>
|
||||||
<thead class="thead-dark">
|
</div>
|
||||||
<tr>
|
</div>
|
||||||
<th scope="col" class="text-center align-middle px-2">
|
<div class="form-group row">
|
||||||
<button @click="registros.invertir" class="btn btn-info mr-3"
|
<label for="dlAsistencia" class="col-4 col-form-label">Asistencia</label>
|
||||||
v-if="registros.relevant.length > 1">
|
<div class="col-6">
|
||||||
<i class="ing-cambiar ing-rotate-90"></i>
|
<div class="form-row justify-content-around align-items-center">
|
||||||
</button>
|
<div id="dlAsitencia" class="datalist datalist-select mb-1 w-100">
|
||||||
Fecha
|
<div class="datalist-input" id="estados">Selecciona un estado de asistencia</div>
|
||||||
</th>
|
<span class="ing-buscar icono"></span>
|
||||||
<th scope="col" class="text-center align-middle px-2">Salón</th>
|
<ul style="display:none">
|
||||||
<th scope="col" class="text-center align-middle px-2">Profesor</th>
|
<li class="datalist-option" data-id="0" @click="store.filters.estados = [];">
|
||||||
|
Todos los registros
|
||||||
<th scope="col" class="text-center align-middle px-2">Horario</th>
|
</li>
|
||||||
<th scope="col" class="text-center align-middle px-2">Registro</th>
|
<li class="datalist-option" v-for="estado in store.estados.data"
|
||||||
<th scope="col" class="text-center align-middle px-2">Supervisor</th>
|
:key="estado.estado_supervisor_id" :data-id="estado.estado_supervisor_id"
|
||||||
</tr>
|
@click="store.filters.estados = store.toggle(store.filters.estados, estado.estado_supervisor_id); ; setTimeout(store.estados.printEstados, 0);">
|
||||||
</thead>
|
<span class="badge"
|
||||||
<tbody>
|
:class="`badge-${store.filters.estados.includes(estado.estado_supervisor_id) ? 'dark' : estado.estado_color}`"><i
|
||||||
<tr v-if="registros.relevant.length == 0">
|
:class="estado.estado_icon"></i> {{estado.nombre}}</span>
|
||||||
<td colspan="7" class="text-center">No hay clases en este horario</td>
|
</li>
|
||||||
</tr>
|
</ul>
|
||||||
<tr v-for="registro in registros.relevant" :key="registro.registro_id">
|
<input type="hidden" id="estado_id" name="estado_id">
|
||||||
<td class="text-center align-middle px-2">{{ registro.registro_fecha_ideal }}
|
</div>
|
||||||
</td>
|
</div>
|
||||||
<td class="text-center align-middle px-2">{{ registro.salon }}</td>
|
</div>
|
||||||
<td class="text-center align-middle px-2">
|
</div>
|
||||||
<div class="col-12">
|
</div>
|
||||||
<strong>{{ registro.profesor_clave }}</strong>
|
|
||||||
{{ registro.profesor_nombre }}
|
</form>
|
||||||
</div>
|
<div class="mt-3 d-flex justify-content-center flex-wrap">
|
||||||
<div class="col-12">
|
<!-- botón descargar -->
|
||||||
<button type="button" class="btn btn-outline-dark btn-sm"
|
|
||||||
@click="store.current.clase_vista = registro" data-toggle="modal"
|
<div class="btn-group my-3" v-if="registros.relevant.length">
|
||||||
data-target="#ver-detalle">
|
<button type="button" class="btn btn-info mr-3" @click="registros.descargar"
|
||||||
Ver detalle <i class="ing-ojo"></i>
|
:disabled="!registros.relevant.length">
|
||||||
</button>
|
<i class="ing-descarga"></i>
|
||||||
</div>
|
Descargar reporte
|
||||||
</td>
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<td class="text-center align-middle px-2">{{ registro.horario_hora.slice(0,5) }} - {{
|
<!-- refresh -->
|
||||||
registro.horario_fin.slice(0,5) }}</td>
|
<div class="table-responsive">
|
||||||
<!-- -->
|
<table class="table table-hover table-striped table-bordered table-sm">
|
||||||
<td class="text-center align-middle px-2">
|
<thead class="thead-dark">
|
||||||
<div v-if="registro.registro_fecha">
|
<tr>
|
||||||
<div class="col-12">
|
<th scope="col" class="text-center align-middle px-2">
|
||||||
Registro <small>{{ registro.registro_fecha.slice(11,16) }}</small>
|
<button @click="registros.invertir" class="btn btn-info mr-3"
|
||||||
</div>
|
v-if="registros.relevant.length > 1">
|
||||||
</div>
|
<i class="ing-cambiar ing-rotate-90"></i>
|
||||||
<div v-else>
|
</button>
|
||||||
<strong>
|
Fecha
|
||||||
<div class="col-12">
|
</th>
|
||||||
<span class="badge badge-danger"><i class="ing-cancelar"></i></span>
|
<th scope="col" class="text-center align-middle px-2">Salón</th>
|
||||||
</div>
|
<th scope="col" class="text-center align-middle px-2">Profesor</th>
|
||||||
<div class="col-12 mt-2">
|
|
||||||
Sin registro
|
<th scope="col" class="text-center align-middle px-2">Horario</th>
|
||||||
</div>
|
<th scope="col" class="text-center align-middle px-2">Registro</th>
|
||||||
</strong>
|
<th scope="col" class="text-center align-middle px-2">Supervisor</th>
|
||||||
</div>
|
</tr>
|
||||||
</td>
|
</thead>
|
||||||
|
<tbody>
|
||||||
<!-- Sí checó supervisor -->
|
<tr v-if="registros.relevant.length == 0">
|
||||||
<td class="text-center align-middle px-2">
|
<td colspan="7" class="text-center">No hay clases en este horario</td>
|
||||||
<div v-if="registro.registro_fecha_supervisor">
|
</tr>
|
||||||
<div class="row">
|
<tr v-for="registro in registros.relevant" :key="registro.registro_id">
|
||||||
<div class="col-12">
|
<td class="text-center align-middle px-2">{{ registro.registro_fecha_ideal }}
|
||||||
<strong>{{ registro.usuario_nombre }}</strong>
|
</td>
|
||||||
</div>
|
<td class="text-center align-middle px-2">{{ registro.salon }}</td>
|
||||||
<div class="col-12">
|
<td class="text-center align-middle px-2">
|
||||||
Hora
|
<div class="col-12">
|
||||||
<small>{{ registro.registro_fecha_supervisor.slice(11,19) }}</small>
|
<strong>{{ registro.profesor_clave }}</strong>
|
||||||
</div>
|
{{ registro.profesor_nombre }}
|
||||||
<div class="col-12 mt-2">
|
</div>
|
||||||
<span class="badge" :class="`badge-${registro.estado_color}`">
|
<div class="col-12">
|
||||||
<i :class="`${registro.estado_icon}`"></i>
|
<button type="button" class="btn btn-outline-dark btn-sm"
|
||||||
<strong>{{ registro.nombre }}</strong>
|
@click="store.current.clase_vista = registro" data-toggle="modal"
|
||||||
</span>
|
data-target="#ver-detalle">
|
||||||
</div>
|
Ver detalle <i class="ing-ojo"></i>
|
||||||
</div>
|
</button>
|
||||||
<!-- comentario -->
|
</div>
|
||||||
<hr v-if="registro.comentario">
|
</td>
|
||||||
<div class="col-12 " @click="registros.mostrarComentario(registro.registro_id)"
|
|
||||||
v-if="registro.comentario" style="cursor: pointer;">
|
|
||||||
<strong class="badge badge-primary">Observaciones:</strong>
|
<td class="text-center align-middle px-2">{{ registro.horario_hora.slice(0,5) }} - {{
|
||||||
<small class="text-truncate">{{registro.comentario.slice(0,
|
registro.horario_fin.slice(0,5) }}</td>
|
||||||
25)}}{{registro.comentario.length > 10 ? '...' : ''}}</small>
|
<!-- -->
|
||||||
</div>
|
<td class="text-center align-middle px-2">
|
||||||
</div>
|
<div v-if="registro.registro_fecha">
|
||||||
|
<div class="col-12">
|
||||||
<!-- No checó -->
|
Registro <small>{{ registro.registro_fecha.slice(11,16) }}</small>
|
||||||
<div v-else>
|
</div>
|
||||||
<div class="col-12">
|
</div>
|
||||||
<span class="badge badge-danger"><i class="ing-cancelar"></i></span>
|
<div v-else>
|
||||||
</div>
|
<strong>
|
||||||
<div class="col-12 mt-2">
|
<div class="col-12">
|
||||||
<strong>Sin registro</strong>
|
<span class="badge badge-danger"><i class="ing-cancelar"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col-12 mt-2">
|
||||||
</td>
|
Sin registro
|
||||||
</tr>
|
</div>
|
||||||
</tbody>
|
</strong>
|
||||||
</table>
|
</div>
|
||||||
</div>
|
</td>
|
||||||
</div>
|
|
||||||
|
<!-- Sí checó supervisor -->
|
||||||
|
<td class="text-center align-middle px-2">
|
||||||
<div class="modal" tabindex="-1" id="ver-comentario">
|
<div v-if="registro.registro_fecha_supervisor">
|
||||||
<div class="modal-dialog modal-dialog-centered modal-xl">
|
<div class="row">
|
||||||
<div class="modal-content">
|
<div class="col-12">
|
||||||
<div class="modal-header">
|
<strong>{{ registro.usuario_nombre }}</strong>
|
||||||
<h5 class="modal-title">Comentario</h5>
|
</div>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
<div class="col-12">
|
||||||
<span aria-hidden="true">×</span>
|
Hora
|
||||||
</button>
|
<small>{{ registro.registro_fecha_supervisor.slice(11,19) }}</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="col-12 mt-2">
|
||||||
<div class="container">
|
<span class="badge" :class="`badge-${registro.estado_color}`">
|
||||||
<div class="input-group">
|
<i :class="`${registro.estado_icon}`"></i>
|
||||||
<textarea class="form-control" aria-label="Comentarios de la clase" rows="5"
|
<strong>{{ registro.nombre }}</strong>
|
||||||
v-model="store.current.comentario" disabled></textarea>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- comentario -->
|
||||||
</div>
|
<hr v-if="registro.comentario">
|
||||||
<div class="modal-footer">
|
<div class="col-12 " @click="registros.mostrarComentario(registro.registro_id)"
|
||||||
<button type="button" class="btn btn-outline-primary" data-dismiss="modal">
|
v-if="registro.comentario" style="cursor: pointer;">
|
||||||
Aceptar
|
<strong class="badge badge-primary">Observaciones:</strong>
|
||||||
</button>
|
<small class="text-truncate">{{registro.comentario.slice(0,
|
||||||
</div>
|
25)}}{{registro.comentario.length > 10 ? '...' : ''}}</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="modal" tabindex="-1" id="ver-detalle">
|
<!-- No checó -->
|
||||||
<div class="modal-dialog modal-dialog-centered modal-xl" v-if="clase_vista">
|
<div v-else>
|
||||||
<div class="modal-content">
|
<div class="col-12">
|
||||||
<div class="modal-header">
|
<span class="badge badge-danger"><i class="ing-cancelar"></i></span>
|
||||||
<h2 class="modal-title" :data-id="clase_vista.horario_id">Detalle de la clase</h2>
|
</div>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
<div class="col-12 mt-2">
|
||||||
<span aria-hidden="true">×</span>
|
<strong>Sin registro</strong>
|
||||||
</button>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
</td>
|
||||||
<div class="container">
|
</tr>
|
||||||
<div class="row">
|
</tbody>
|
||||||
<section class="col-12 col-md-6">
|
</table>
|
||||||
<h4 class="h4">Profesor</h4>
|
</div>
|
||||||
<div class="row">
|
</div>
|
||||||
<div class="col-12">
|
|
||||||
<strong>Nombre:</strong>
|
|
||||||
{{ clase_vista.profesor_nombre }}
|
<div class="modal" tabindex="-1" id="ver-comentario">
|
||||||
</div>
|
<div class="modal-dialog modal-dialog-centered modal-xl">
|
||||||
<div class="col-12">
|
<div class="modal-content">
|
||||||
<strong>Correo:</strong>
|
<div class="modal-header">
|
||||||
<a :href="`mailto:${clase_vista.profesor_correo}`"><strong>{{
|
<h5 class="modal-title">Comentario</h5>
|
||||||
clase_vista.profesor_correo }}</strong></a>
|
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||||
</div>
|
<span aria-hidden="true">×</span>
|
||||||
<div class="col-12">
|
</button>
|
||||||
<strong>Clave:</strong>
|
</div>
|
||||||
{{ clase_vista.profesor_clave }}
|
<div class="modal-body">
|
||||||
</div>
|
<div class="container">
|
||||||
<div class="col-12">
|
<div class="input-group">
|
||||||
<strong>Facultad:</strong>
|
<textarea class="form-control" aria-label="Comentarios de la clase" rows="5"
|
||||||
{{ clase_vista.facultad }}
|
v-model="store.current.comentario" disabled></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
|
||||||
<section class="col-12 col-md-6">
|
</div>
|
||||||
<h4 class="h4">Clase</h4>
|
<div class="modal-footer">
|
||||||
<div class="row">
|
<button type="button" class="btn btn-outline-primary" data-dismiss="modal">
|
||||||
<div class="col-12">
|
Aceptar
|
||||||
<strong>Materia:</strong>
|
</button>
|
||||||
{{ clase_vista.materia }}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
</div>
|
||||||
<strong>Carrera:</strong>
|
</div>
|
||||||
{{ clase_vista.carrera }}
|
<div class="modal" tabindex="-1" id="ver-detalle">
|
||||||
</div>
|
<div class="modal-dialog modal-dialog-centered modal-xl" v-if="clase_vista">
|
||||||
<div class="col-12">
|
<div class="modal-content">
|
||||||
<strong>Nivel:</strong>
|
<div class="modal-header">
|
||||||
{{ clase_vista.nivel}}
|
<h2 class="modal-title" :data-id="clase_vista.horario_id">Detalle de la clase</h2>
|
||||||
</div>
|
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||||
<div class="col-12">
|
<span aria-hidden="true">×</span>
|
||||||
<strong>Grupo:</strong>
|
</button>
|
||||||
{{ clase_vista.horario_grupo }}
|
</div>
|
||||||
</div>
|
<div class="modal-body">
|
||||||
<div class="col-12">
|
<div class="container">
|
||||||
<strong>Horario:</strong>
|
<div class="row">
|
||||||
<!-- hora hh:mm:ss to hh:mm -->
|
<section class="col-12 col-md-6">
|
||||||
{{ clase_vista.horario_hora?.slice(0, 5) }} - {{
|
<h4 class="h4">Profesor</h4>
|
||||||
clase_vista.horario_fin?.slice(0, 5) }}
|
<div class="row">
|
||||||
</div>
|
<div class="col-12">
|
||||||
<div class="col-12">
|
<strong>Nombre:</strong>
|
||||||
<strong>Salón:</strong>
|
{{ clase_vista.profesor_nombre }}
|
||||||
{{ clase_vista.salon }}
|
</div>
|
||||||
</div>
|
<div class="col-12">
|
||||||
</div>
|
<strong>Correo:</strong>
|
||||||
</section>
|
<a :href="`mailto:${clase_vista.profesor_correo}`"><strong>{{
|
||||||
</div>
|
clase_vista.profesor_correo }}</strong></a>
|
||||||
<div class="row">
|
</div>
|
||||||
<section class="col-12">
|
<div class="col-12">
|
||||||
<h4 class="h4 mt-4">Registro</h4>
|
<strong>Clave:</strong>
|
||||||
<div class="row">
|
{{ clase_vista.profesor_clave }}
|
||||||
<div class="col-12 text-center" v-if="!clase_vista.registro_fecha">
|
</div>
|
||||||
<strong><span class="badge badge-danger"><i class="ing-cancelar"></i></span>
|
<div class="col-12">
|
||||||
El profesor aún no ha registrado su asistencia</strong>
|
<strong>Facultad:</strong>
|
||||||
</div>
|
{{ clase_vista.facultad }}
|
||||||
<div class="col-6 text-center" v-else>
|
</div>
|
||||||
El profesor registró su asistencia a las
|
</div>
|
||||||
<code>{{clase_vista.registro_fecha.slice(11, 16)}}</code>
|
</section>
|
||||||
<hr>
|
<section class="col-12 col-md-6">
|
||||||
<p v-if="!clase_vista.registro_retardo" class="text-center">
|
<h4 class="h4">Clase</h4>
|
||||||
<span class="badge badge-success"><i class="ing-aceptar"></i></span>
|
<div class="row">
|
||||||
A tiempo
|
<div class="col-12">
|
||||||
</p>
|
<strong>Materia:</strong>
|
||||||
<p v-else class="text-center">
|
{{ clase_vista.materia }}
|
||||||
<span class="badge badge-warning"><i class="ing-retardo"></i></span>
|
</div>
|
||||||
Con retardo
|
<div class="col-12">
|
||||||
</p>
|
<strong>Carrera:</strong>
|
||||||
</div>
|
{{ clase_vista.carrera }}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
<div class="col-12">
|
||||||
</div>
|
<strong>Nivel:</strong>
|
||||||
</div>
|
{{ clase_vista.nivel}}
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="col-12">
|
||||||
<!-- botón aceptar -->
|
<strong>Grupo:</strong>
|
||||||
<button type="button" class="btn btn-outline-primary" data-dismiss="modal">
|
{{ clase_vista.horario_grupo }}
|
||||||
<i class="ing-aceptar"></i>
|
</div>
|
||||||
Aceptar
|
<div class="col-12">
|
||||||
</button>
|
<strong>Horario:</strong>
|
||||||
</div>
|
<!-- hora hh:mm:ss to hh:mm -->
|
||||||
</div>
|
{{ clase_vista.horario_hora?.slice(0, 5) }} - {{
|
||||||
</div>
|
clase_vista.horario_fin?.slice(0, 5) }}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
<div class="col-12">
|
||||||
<script src="js/jquery.min.js"></script>
|
<strong>Salón:</strong>
|
||||||
<script src="js/jquery-ui.js"></script>
|
{{ clase_vista.salon }}
|
||||||
<script src="js/bootstrap/bootstrap.min.js"></script>
|
</div>
|
||||||
<script src="js/datalist.js"></script>
|
</div>
|
||||||
<script src="js/datepicker-es.js"></script>
|
</section>
|
||||||
<script src="js/auditoría.js" type="module"></script>
|
</div>
|
||||||
</body>
|
<div class="row">
|
||||||
|
<section class="col-12">
|
||||||
|
<h4 class="h4 mt-4">Registro</h4>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 text-center" v-if="!clase_vista.registro_fecha">
|
||||||
|
<strong><span class="badge badge-danger"><i class="ing-cancelar"></i></span>
|
||||||
|
El profesor aún no ha registrado su asistencia</strong>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 text-center" v-else>
|
||||||
|
El profesor registró su asistencia a las
|
||||||
|
<code>{{clase_vista.registro_fecha.slice(11, 16)}}</code>
|
||||||
|
<hr>
|
||||||
|
<p v-if="!clase_vista.registro_retardo" class="text-center">
|
||||||
|
<span class="badge badge-success"><i class="ing-aceptar"></i></span>
|
||||||
|
A tiempo
|
||||||
|
</p>
|
||||||
|
<p v-else class="text-center">
|
||||||
|
<span class="badge badge-warning"><i class="ing-retardo"></i></span>
|
||||||
|
Con retardo
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<!-- botón aceptar -->
|
||||||
|
<button type="button" class="btn btn-outline-primary" data-dismiss="modal">
|
||||||
|
<i class="ing-aceptar"></i>
|
||||||
|
Aceptar
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<script src="js/jquery.min.js"></script>
|
||||||
|
<script src="js/jquery-ui.js"></script>
|
||||||
|
<script src="js/bootstrap/bootstrap.min.js"></script>
|
||||||
|
<!-- <script src="js/datalist.js"></script> -->
|
||||||
|
<script src="js/datepicker-es.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"></script>
|
||||||
|
|
||||||
|
<script src="js/auditoría.js" type="module"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
528
avisos.php
528
avisos.php
@@ -1,265 +1,265 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'class/c_login.php';
|
require_once 'class/c_login.php';
|
||||||
require_once 'include/bd_pdo.php';
|
require_once 'include/bd_pdo.php';
|
||||||
include 'include/constantes.php';
|
include 'include/constantes.php';
|
||||||
|
|
||||||
if(!isset($_SESSION['user'])){
|
if(!isset($_SESSION['user'])){
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
$user->access();
|
$user->access();
|
||||||
if(!$user->admin && $user->acceso == 'n'){
|
if(!$user->admin && $user->acceso == 'n'){
|
||||||
header('Location: main.php?error=1');
|
header('Location: main.php?error=1');
|
||||||
}else{
|
}else{
|
||||||
$user->print_to_log('Avisos');
|
$user->print_to_log('Avisos');
|
||||||
}
|
}
|
||||||
$fac = $user->facultad['facultad_id'];
|
$fac = $user->facultad['facultad_id'];
|
||||||
if($user->admin){
|
if($user->admin){
|
||||||
$fac = null;
|
$fac = null;
|
||||||
}
|
}
|
||||||
$limit = 20;
|
$limit = 20;
|
||||||
if(isset($_POST['filter_fecha']) && $_POST['filter_fecha'] != ""){
|
if(isset($_POST['filter_fecha']) && $_POST['filter_fecha'] != ""){
|
||||||
$filter_fecha = $_POST['filter_fecha'];
|
$filter_fecha = $_POST['filter_fecha'];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$filter_fecha = null;
|
$filter_fecha = null;
|
||||||
}
|
}
|
||||||
if(isset($_GET['pag'])){
|
if(isset($_GET['pag'])){
|
||||||
$pag = $_GET['pag'] - 1;
|
$pag = $_GET['pag'] - 1;
|
||||||
}else{
|
}else{
|
||||||
$pag = 0;
|
$pag = 0;
|
||||||
}
|
}
|
||||||
if($user->admin){
|
if($user->admin){
|
||||||
$count = query("SELECT count(1) FROM fs_aviso(null, :fecha, :facultad_id, null, 0, null)", [':fecha' => $filter_fecha, ':facultad_id' => $fac], true);
|
$count = query("SELECT count(1) FROM fs_aviso(null, :fecha, :facultad_id, null, 0, null)", [':fecha' => $filter_fecha, ':facultad_id' => $fac], true);
|
||||||
$fs_avisos = query("SELECT * FROM fs_aviso(null, :fecha, :facultad_id, :limite, :offset, null)", [':fecha' => $filter_fecha, ':facultad_id' => $fac, ':limite' => $limit, ':offset' => $pag * $limit], false);
|
$fs_avisos = query("SELECT * FROM fs_aviso(null, :fecha, :facultad_id, :limite, :offset, null)", [':fecha' => $filter_fecha, ':facultad_id' => $fac, ':limite' => $limit, ':offset' => $pag * $limit], false);
|
||||||
}else{
|
}else{
|
||||||
$count = query("SELECT count(1) FROM fs_aviso(null, :fecha, :facultad_id, null, 0, true)", [':fecha' => $filter_fecha, ':facultad_id' => $fac], true);
|
$count = query("SELECT count(1) FROM fs_aviso(null, :fecha, :facultad_id, null, 0, true)", [':fecha' => $filter_fecha, ':facultad_id' => $fac], true);
|
||||||
$fs_avisos = query("SELECT * FROM fs_aviso(null, :fecha, :facultad_id, :limite, :offset, true)", [':fecha' => $filter_fecha, ':facultad_id' => $fac, ':limite' => $limit, ':offset' => $pag * $limit], false);
|
$fs_avisos = query("SELECT * FROM fs_aviso(null, :fecha, :facultad_id, :limite, :offset, true)", [':fecha' => $filter_fecha, ':facultad_id' => $fac, ':limite' => $limit, ':offset' => $pag * $limit], false);
|
||||||
}
|
}
|
||||||
$paginas = ceil($count['count'] / $limit);
|
$paginas = ceil($count['count'] / $limit);
|
||||||
?>
|
?>
|
||||||
<!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>Avisos</title>
|
<title>Avisos</title>
|
||||||
<link rel="stylesheet" href="css/jquery-ui.css">
|
<link rel="stylesheet" href="css/jquery-ui.css">
|
||||||
<link rel="stylesheet" href="css/calendar.css">
|
<link rel="stylesheet" href="css/calendar.css">
|
||||||
<?php
|
<?php
|
||||||
include 'import/html_css_files.php';
|
include 'import/html_css_files.php';
|
||||||
?>
|
?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
include "import/html_header.php";
|
include "import/html_header.php";
|
||||||
html_header(
|
html_header(
|
||||||
"Avisos",
|
"Avisos",
|
||||||
"Gestión de Checador "
|
"Gestión de Checador "
|
||||||
);
|
);
|
||||||
$user->access();
|
$user->access();
|
||||||
?>
|
?>
|
||||||
<main class="content marco">
|
<main class="content marco">
|
||||||
<?php if($user->acceso == 'w') {?>
|
<?php if($user->acceso == 'w') {?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 text-right">
|
<div class="col-12 text-right">
|
||||||
<a href="avisos_crear.php">
|
<a href="avisos_crear.php">
|
||||||
<button type="button" class="btn btn-outline-secondary"><span class="ing-mas ing-fw"></span>Crear Aviso</button>
|
<button type="button" class="btn btn-outline-secondary"><span class="ing-mas ing-fw"></span>Crear Aviso</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<!-- Filtro -->
|
<!-- Filtro -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<form action="avisos.php" method="post">
|
<form action="avisos.php" method="post">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_fecha" class="col-4 con-form-label">Fecha</label>
|
<label for="filter_fecha" class="col-4 con-form-label">Fecha</label>
|
||||||
<div class="col-8 col-sm-4">
|
<div class="col-8 col-sm-4">
|
||||||
<input id="filter_fecha" name="filter_fecha" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="" value="<?php if(isset($filter_fecha)){ echo $filter_fecha; } ?>">
|
<input id="filter_fecha" name="filter_fecha" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="" value="<?php if(isset($filter_fecha)){ echo $filter_fecha; } ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="offset-4">Se muestran los avisos posteriores a la fecha</p>
|
<p class="offset-4">Se muestran los avisos posteriores a la fecha</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-12 text-center">
|
<div class="col-12 text-center">
|
||||||
<button type="submit" class="btn btn-outline-primary">
|
<button type="submit" class="btn btn-outline-primary">
|
||||||
<span class="ing-buscar ing-fw"></span>
|
<span class="ing-buscar ing-fw"></span>
|
||||||
Filtrar
|
Filtrar
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-outline-danger btn-reset">
|
<button type="button" class="btn btn-outline-danger btn-reset">
|
||||||
<span class="ing-borrar ing-fw"></span>
|
<span class="ing-borrar ing-fw"></span>
|
||||||
Limpiar
|
Limpiar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="message"></div>
|
<div id="message"></div>
|
||||||
<!-- Tabla -->
|
<!-- Tabla -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 table-responsive">
|
<div class="col-12 table-responsive">
|
||||||
<table class="table table-sm table-striped table-white">
|
<table class="table table-sm table-striped table-white">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Estado</th>
|
<th>Estado</th>
|
||||||
<?php if($user->acceso == 'w') {?>
|
<?php if($user->acceso == 'w') {?>
|
||||||
<th>Facultad</th>
|
<th>Facultad</th>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<th>Fechas</th>
|
<th>Fechas</th>
|
||||||
<th>Mensaje</th>
|
<th>Mensaje</th>
|
||||||
<?php if($user->acceso == 'w') {?>
|
<?php if($user->acceso == 'w') {?>
|
||||||
<th>Acciones</th>
|
<th>Acciones</th>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $today = date('Y-m-j');
|
<?php $today = date('Y-m-j');
|
||||||
foreach($fs_avisos as $aviso){
|
foreach($fs_avisos as $aviso){
|
||||||
$color2 = 'danger';
|
$color2 = 'danger';
|
||||||
$title2 = 'Inactivo';
|
$title2 = 'Inactivo';
|
||||||
$color = 'danger';
|
$color = 'danger';
|
||||||
$title = 'Fuera de tiempo';
|
$title = 'Fuera de tiempo';
|
||||||
$icono = 'retardo';
|
$icono = 'retardo';
|
||||||
if($today >= $aviso['aviso_fecha_inicial'] && $today <= $aviso['aviso_fecha_final']){
|
if($today >= $aviso['aviso_fecha_inicial'] && $today <= $aviso['aviso_fecha_final']){
|
||||||
$color = 'success';
|
$color = 'success';
|
||||||
$title = 'En tiempo';
|
$title = 'En tiempo';
|
||||||
$icono = 'reloj';
|
$icono = 'reloj';
|
||||||
}else if($today < $aviso['aviso_fecha_inicial']){
|
}else if($today < $aviso['aviso_fecha_inicial']){
|
||||||
$color = 'warning';
|
$color = 'warning';
|
||||||
$title = 'Antes de tiempo';
|
$title = 'Antes de tiempo';
|
||||||
}
|
}
|
||||||
if($aviso['aviso_estado'] == true){
|
if($aviso['aviso_estado'] == true){
|
||||||
$color2 = 'success';
|
$color2 = 'success';
|
||||||
$title2 = 'Activo';
|
$title2 = 'Activo';
|
||||||
}
|
}
|
||||||
$day = explode("-", $aviso['aviso_fecha_inicial']);
|
$day = explode("-", $aviso['aviso_fecha_inicial']);
|
||||||
$dia_inicial = $day['2'].'/'.$day['1'].'/'.$day[0];
|
$dia_inicial = $day['2'].'/'.$day['1'].'/'.$day[0];
|
||||||
$day = explode("-", $aviso['aviso_fecha_final']);
|
$day = explode("-", $aviso['aviso_fecha_final']);
|
||||||
$dia_final = $day['2'].'/'.$day['1'].'/'.$day[0];
|
$dia_final = $day['2'].'/'.$day['1'].'/'.$day[0];
|
||||||
?>
|
?>
|
||||||
<tr data-id="<?= $aviso['aviso_id'] ?>" id="<?= $aviso['aviso_id'] ?>">
|
<tr data-id="<?= $aviso['aviso_id'] ?>" id="<?= $aviso['aviso_id'] ?>">
|
||||||
<td class="text-center"><?php if($user->admin){ ?> <span class="ing-bullet text-<?= $color2 ?>" title="<?= $title2 ?>"></span> <?php } ?> <span class="ing-<?= $icono ?> text-<?= $color ?>" title="<?= $title ?>"></span></td>
|
<td class="text-center"><?php if($user->admin){ ?> <span class="ing-bullet text-<?= $color2 ?>" title="<?= $title2 ?>"></span> <?php } ?> <span class="ing-<?= $icono ?> text-<?= $color ?>" title="<?= $title ?>"></span></td>
|
||||||
<?php if($user->acceso == 'w') {?>
|
<?php if($user->acceso == 'w') {?>
|
||||||
<td><?= $aviso['facultad_nombre'] ?></td>
|
<td><?= $aviso['facultad_nombre'] ?></td>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<td><?= $dia_inicial ?> - <?= $dia_final ?></td>
|
<td><?= $dia_inicial ?> - <?= $dia_final ?></td>
|
||||||
<td><?= $aviso['aviso_texto'] ?></td>
|
<td><?= $aviso['aviso_texto'] ?></td>
|
||||||
<?php if($user->acceso == 'w') {?>
|
<?php if($user->acceso == 'w') {?>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<a href="avisos_editar.php?id=<?= $aviso['aviso_id'] ?>" title="Editar"><span class="ing-editar"></span></a>
|
<a href="avisos_editar.php?id=<?= $aviso['aviso_id'] ?>" title="Editar"><span class="ing-editar"></span></a>
|
||||||
<?php if($aviso['aviso_estado'] == true){ ?>
|
<?php if($aviso['aviso_estado'] == true){ ?>
|
||||||
<a href="#" data-toggle="modal" data-target="#modal_confirm" title="Borrar"><span class="ing-basura"></span></a>
|
<a href="#" data-toggle="modal" data-target="#modal_confirm" title="Borrar"><span class="ing-basura"></span></a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<nav aria-label="paginas">
|
<nav aria-label="paginas">
|
||||||
<ul class="pagination justify-content-end">
|
<ul class="pagination justify-content-end">
|
||||||
<?php if($pag != 0){ ?>
|
<?php if($pag != 0){ ?>
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="avisos.php?pag=<?= $pag ?>" aria-label="Previous">
|
<a class="page-link" href="avisos.php?pag=<?= $pag ?>" aria-label="Previous">
|
||||||
<span aria-hidden="true">«</span>
|
<span aria-hidden="true">«</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php for($i = 0; $i < $paginas; $i++){ ?>
|
<?php for($i = 0; $i < $paginas; $i++){ ?>
|
||||||
<li class="page-item <?php if($i == $pag){ echo"active"; } ?>" <?php if($i == $pag){ echo 'aria-current="page"'; } ?>><a class="page-link" href="avisos.php?pag=<?= $i+1 ?>"><?= $i+1 ?></a></li>
|
<li class="page-item <?php if($i == $pag){ echo"active"; } ?>" <?php if($i == $pag){ echo 'aria-current="page"'; } ?>><a class="page-link" href="avisos.php?pag=<?= $i+1 ?>"><?= $i+1 ?></a></li>
|
||||||
|
|
||||||
<?php }
|
<?php }
|
||||||
if(($pag + 1) < $paginas){ ?>
|
if(($pag + 1) < $paginas){ ?>
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="avisos.php?pag=<?= $pag + 2 ?>" aria-label="Next">
|
<a class="page-link" href="avisos.php?pag=<?= $pag + 2 ?>" aria-label="Next">
|
||||||
<span aria-hidden="true">»</span>
|
<span aria-hidden="true">»</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</main>
|
</main>
|
||||||
<?php
|
<?php
|
||||||
include "import/html_footer.php";
|
include "import/html_footer.php";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if($user->acceso == 'w') {?>
|
<?php if($user->acceso == 'w') {?>
|
||||||
<div class="modal fade" id="modal_confirm" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
|
<div class="modal fade" id="modal_confirm" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="font-weight-bold">¿Estás seguro de que quieres borrar el aviso?</p>
|
<p class="font-weight-bold">¿Estás seguro de que quieres borrar el aviso?</p>
|
||||||
<p>Esta acción no se puede deshacer.</p>
|
<p>Esta acción no se puede deshacer.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<input type="hidden" id="id_borrar" value="">
|
<input type="hidden" id="id_borrar" value="">
|
||||||
<button type="button" class="btn btn-outline-primary btn-borrar"><?php echo $ICO["aceptar"];?> Borrar</button>
|
<button type="button" class="btn btn-outline-primary btn-borrar"><?php echo $ICO["aceptar"];?> Borrar</button>
|
||||||
<button type="button" class="btn btn-outline-danger" data-dismiss="modal" aria-label="Close"><?php echo $ICO["cancelar"];?> Cancelar</button>
|
<button type="button" class="btn btn-outline-danger" data-dismiss="modal" aria-label="Close"><?php echo $ICO["cancelar"];?> Cancelar</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="js/jquery-ui.js"></script>
|
<script src="js/jquery-ui.js"></script>
|
||||||
<script src="js/bootstrap/bootstrap.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/datepicker-es.js"></script>
|
<script src="js/datepicker-es.js"></script>
|
||||||
<?php
|
<?php
|
||||||
require_once 'js/messages.php';
|
require_once 'js/messages.php';
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
||||||
$(".date-picker").datepicker({
|
$(".date-picker").datepicker({
|
||||||
dateFormat: "dd/mm/yyyy",
|
dateFormat: "dd/mm/yyyy",
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on( "click", ".btn-reset", function(event){
|
$(document).on( "click", ".btn-reset", function(event){
|
||||||
var forma = $(this).parents("form");
|
var forma = $(this).parents("form");
|
||||||
forma.find("input[type=text]").val("");
|
forma.find("input[type=text]").val("");
|
||||||
forma.find("select").prop("selectedIndex",0);
|
forma.find("select").prop("selectedIndex",0);
|
||||||
forma.submit();
|
forma.submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#modal_confirm').on('show.bs.modal', function (event) {
|
$('#modal_confirm').on('show.bs.modal', function (event) {
|
||||||
var button = $(event.relatedTarget); // Button that triggered the modal
|
var button = $(event.relatedTarget); // Button that triggered the modal
|
||||||
var id = button.parents("tr").data("id");
|
var id = button.parents("tr").data("id");
|
||||||
$("#id_borrar").val(id);
|
$("#id_borrar").val(id);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.btn-borrar').click(function(){
|
$('.btn-borrar').click(function(){
|
||||||
var cid = $('#id_borrar').val();
|
var cid = $('#id_borrar').val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: './action/action_avisos_delete.php',
|
url: './action/action_avisos_delete.php',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: {id: cid},
|
data: {id: cid},
|
||||||
success: function(result){
|
success: function(result){
|
||||||
console.log("bien");
|
console.log("bien");
|
||||||
},
|
},
|
||||||
error: function(){
|
error: function(){
|
||||||
console.log(cid);
|
console.log(cid);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#modal_confirm').modal("hide");
|
$('#modal_confirm').modal("hide");
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
868
avisos_crear.php
868
avisos_crear.php
@@ -1,435 +1,435 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'class/c_login.php';
|
require_once 'class/c_login.php';
|
||||||
require_once 'include/bd_pdo.php';
|
require_once 'include/bd_pdo.php';
|
||||||
|
|
||||||
if(!isset($_SESSION['user'])){
|
if(!isset($_SESSION['user'])){
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
$user->access('Avisos');
|
$user->access('Avisos');
|
||||||
if(!$user->admin && $user->acceso == 'n'){
|
if(!$user->admin && $user->acceso == 'n'){
|
||||||
header('Location: main.php?error=1');
|
header('Location: main.php?error=1');
|
||||||
}else{
|
}else{
|
||||||
$user->print_to_log('Avisos Crear');
|
$user->print_to_log('Avisos Crear');
|
||||||
}
|
}
|
||||||
$fac = $user->facultad['facultad_id'];
|
$fac = $user->facultad['facultad_id'];
|
||||||
if($user->admin){
|
if($user->admin){
|
||||||
$fac = null;
|
$fac = null;
|
||||||
}
|
}
|
||||||
$fs_carreras = query('SELECT * FROM fs_carreras(:fac, null, null)', [':fac' => $fac], false);
|
$fs_carreras = query('SELECT * FROM fs_carreras(:fac, null, null)', [':fac' => $fac], false);
|
||||||
$fs_facultades = query('SELECT * FROM facultad WHERE facultad_activa = true', null, false);
|
$fs_facultades = query('SELECT * FROM facultad WHERE facultad_activa = true', null, false);
|
||||||
?>
|
?>
|
||||||
<!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>Avisos Crear</title>
|
<title>Avisos Crear</title>
|
||||||
<link rel="stylesheet" href="css/jquery-ui.css">
|
<link rel="stylesheet" href="css/jquery-ui.css">
|
||||||
<link rel="stylesheet" href="css/calendar.css">
|
<link rel="stylesheet" href="css/calendar.css">
|
||||||
<link rel="stylesheet" href="css/richtext.css" type="text/css">
|
<link rel="stylesheet" href="css/richtext.css" type="text/css">
|
||||||
<link rel="stylesheet" href="css/fa_all.css" type="text/css">
|
<link rel="stylesheet" href="css/fa_all.css" type="text/css">
|
||||||
<?php
|
<?php
|
||||||
include 'import/html_css_files.php';
|
include 'import/html_css_files.php';
|
||||||
?>
|
?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
include "import/html_header.php";
|
include "import/html_header.php";
|
||||||
html_header(
|
html_header(
|
||||||
"CREAR AVISO",
|
"CREAR AVISO",
|
||||||
"Gestión de Checador "
|
"Gestión de Checador "
|
||||||
);
|
);
|
||||||
$user->access('Avisos');
|
$user->access('Avisos');
|
||||||
?>
|
?>
|
||||||
<main class="content marco">
|
<main class="content marco">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<form action="./action/action_avisos_insert.php" method="post" id="formaModal" onsubmit="return validaCampos()">
|
<form action="./action/action_avisos_insert.php" method="post" id="formaModal" onsubmit="return validaCampos()">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<?php if($user->admin){ ?>
|
<?php if($user->admin){ ?>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="facultad" class="col-4 col-form-label">Facultad *</label>
|
<label for="facultad" class="col-4 col-form-label">Facultad *</label>
|
||||||
<div class="col-8 col-sm-4">
|
<div class="col-8 col-sm-4">
|
||||||
<div class="datalist datalist-select mb-1 w-100">
|
<div class="datalist datalist-select mb-1 w-100">
|
||||||
<div class="datalist-input">Mostrar todas</div>
|
<div class="datalist-input">Mostrar todas</div>
|
||||||
<span class="ing-buscar icono"></span>
|
<span class="ing-buscar icono"></span>
|
||||||
<ul style="display: none;">
|
<ul style="display: none;">
|
||||||
<?php foreach($fs_facultades as $facultad){ ?>
|
<?php foreach($fs_facultades as $facultad){ ?>
|
||||||
<li data-id="<?= $facultad['facultad_id'] ?>" class="pl-4"><?= $facultad['facultad_nombre'] ?></li>
|
<li data-id="<?= $facultad['facultad_id'] ?>" class="pl-4"><?= $facultad['facultad_nombre'] ?></li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
<input type="hidden" id="facultad" name="facultad" value="">
|
<input type="hidden" id="facultad" name="facultad" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php }else {?>
|
<?php }else {?>
|
||||||
<input type="hidden" name="facultad" id="facultad" value="<?= $fac ?>">
|
<input type="hidden" name="facultad" id="facultad" value="<?= $fac ?>">
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="fecha_inicial" class="col-4 col-form-label">Fecha inicial *</label>
|
<label for="fecha_inicial" class="col-4 col-form-label">Fecha inicial *</label>
|
||||||
<div class="col-8 col-sm-4">
|
<div class="col-8 col-sm-4">
|
||||||
<input id="fecha_inicial" name="fecha_inicial" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="readonly">
|
<input id="fecha_inicial" name="fecha_inicial" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="readonly">
|
||||||
<div class="invalid-feedback">No es una fecha valida</div>
|
<div class="invalid-feedback">No es una fecha valida</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="fecha_final" class="col-4 col-form-label">Fecha Final *</label>
|
<label for="fecha_final" class="col-4 col-form-label">Fecha Final *</label>
|
||||||
<div class="col-8 col-sm-4">
|
<div class="col-8 col-sm-4">
|
||||||
<input id="fecha_final" name="fecha_final" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="readonly">
|
<input id="fecha_final" name="fecha_final" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="readonly">
|
||||||
<div class="invalid-feedback">No es una fecha valida</div>
|
<div class="invalid-feedback">No es una fecha valida</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="texto" class="col-4 col-form-label">Aviso *</label>
|
<label for="texto" class="col-4 col-form-label">Aviso *</label>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<textarea name="texto" id="texto" class="richtext" rows="10"></textarea>
|
<textarea name="texto" id="texto" class="richtext" rows="10"></textarea>
|
||||||
<div class="invalid-feedback">No puede estar vacio</div>
|
<div class="invalid-feedback">No puede estar vacio</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row tipo_aviso">
|
<div class="form-group row tipo_aviso">
|
||||||
<label class="col-4 col-form-label">Enviar aviso:</label>
|
<label class="col-4 col-form-label">Enviar aviso:</label>
|
||||||
<div class="col-4 pt-2">
|
<div class="col-4 pt-2">
|
||||||
<div class="custom-control custom-switch">
|
<div class="custom-control custom-switch">
|
||||||
<input type="checkbox" class="custom-control-input tipo-switch" name="bloque_tipo" id="bloque_tipo" value="1" data-box="profesorBox" data-select="tipo_box">
|
<input type="checkbox" class="custom-control-input tipo-switch" name="bloque_tipo" id="bloque_tipo" value="1" data-box="profesorBox" data-select="tipo_box">
|
||||||
<label class="custom-control-label" for="bloque_tipo">Por carrera</label>
|
<label class="custom-control-label" for="bloque_tipo">Por carrera</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4 pt-2">
|
<div class="col-4 pt-2">
|
||||||
<div class="custom-control custom-switch">
|
<div class="custom-control custom-switch">
|
||||||
<input type="checkbox" class="custom-control-input tipo-switch" name="bloque_usr" id="bloque_usr" value="1" data-box="administrativoBox" data-select="usuario_box">
|
<input type="checkbox" class="custom-control-input tipo-switch" name="bloque_usr" id="bloque_usr" value="1" data-box="administrativoBox" data-select="usuario_box">
|
||||||
<label class="custom-control-label" for="bloque_usr">Por nombre</label>
|
<label class="custom-control-label" for="bloque_usr">Por nombre</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="invalid-feedback offset-4">No hay profesores para mandar el aviso</div>
|
<div class="invalid-feedback offset-4">No hay profesores para mandar el aviso</div>
|
||||||
<div class="collapse" id="profesorBox">
|
<div class="collapse" id="profesorBox">
|
||||||
<h3>Carreras</h3>
|
<h3>Carreras</h3>
|
||||||
<p>Utiliza el botón para asignar las carreras que recibirán el aviso.</p>
|
<p>Utiliza el botón para asignar las carreras que recibirán el aviso.</p>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-10">
|
<div class="col-10">
|
||||||
<select name="tipo[]" id="tipo_box" class="form-control" multiple="multiple" size="5">
|
<select name="tipo[]" id="tipo_box" class="form-control" multiple="multiple" size="5">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<p><button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#modal_carrera"><span class="ing-mas ing-fw"></span> Asignar</button></p>
|
<p><button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#modal_carrera"><span class="ing-mas ing-fw"></span> Asignar</button></p>
|
||||||
<p><button type="button" class="btn btn-outline-danger btn-quita-tipo"><span class="ing-menos ing-fw"></span> Quitar</button></p>
|
<p><button type="button" class="btn btn-outline-danger btn-quita-tipo"><span class="ing-menos ing-fw"></span> Quitar</button></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="collapse" id="administrativoBox">
|
<div class="collapse" id="administrativoBox">
|
||||||
<h3>Nombre de profesores</h3>
|
<h3>Nombre de profesores</h3>
|
||||||
<p>Utiliza el botón para asignar los profesores que recibirán el aviso.</p>
|
<p>Utiliza el botón para asignar los profesores que recibirán el aviso.</p>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-10">
|
<div class="col-10">
|
||||||
<select name="usuario[]" id="usuario_box" class="form-control" multiple="multiple" size="5">
|
<select name="usuario[]" id="usuario_box" class="form-control" multiple="multiple" size="5">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<p><button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#modal_usr"><span class="ing-mas ing-fw"></span> Asignar</button></p>
|
<p><button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#modal_usr"><span class="ing-mas ing-fw"></span> Asignar</button></p>
|
||||||
<p><button type="button" class="btn btn-outline-danger btn-quita-usr"><span class="ing-menos ing-fw"></span> Quitar</button></p>
|
<p><button type="button" class="btn btn-outline-danger btn-quita-usr"><span class="ing-menos ing-fw"></span> Quitar</button></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row mt-2">
|
<div class="form-group row mt-2">
|
||||||
<div class="col-12 text-center">
|
<div class="col-12 text-center">
|
||||||
<button type="submit" class="btn btn-outline-primary" id="submitBtn" data-tipo="1"><span class="ing-aceptar"></span> Guardar</button>
|
<button type="submit" class="btn btn-outline-primary" id="submitBtn" data-tipo="1"><span class="ing-aceptar"></span> Guardar</button>
|
||||||
<a href="avisos.php" class="btn btn-outline-danger"><span class="ing-cancelar"></span> Cancelar</a>
|
<a href="avisos.php" class="btn btn-outline-danger"><span class="ing-cancelar"></span> Cancelar</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<?php
|
<?php
|
||||||
include "import/html_footer.php";
|
include "import/html_footer.php";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div class="modal fade" id="modal_carrera" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true" data-backdrop="static" data-keyboard="false">
|
<div class="modal fade" id="modal_carrera" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true" data-backdrop="static" data-keyboard="false">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="col-12 modal-title text-center">Carreras
|
<h4 class="col-12 modal-title text-center">Carreras
|
||||||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div style="max-height:400px; overflow-y:auto; overflow-x:hidden;">
|
<div style="max-height:400px; overflow-y:auto; overflow-x:hidden;">
|
||||||
<table class="table table-sm table-striped table-white">
|
<table class="table table-sm table-striped table-white">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Carrera</th>
|
<th>Carrera</th>
|
||||||
<th>Asignar</th>
|
<th>Asignar</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="table-result-carrera">
|
<tbody id="table-result-carrera">
|
||||||
<tr class="tipo-row">
|
<tr class="tipo-row">
|
||||||
<td class="carrera-nombre"></td>
|
<td class="carrera-nombre"></td>
|
||||||
<td class="carrera-agrega text-center"><button type="button" class="btn btn-outline-primary btn-sm invisible btn-agrega-carrera"><span class="ing-mas"></span></button></td>
|
<td class="carrera-agrega text-center"><button type="button" class="btn btn-outline-primary btn-sm invisible btn-agrega-carrera"><span class="ing-mas"></span></button></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal fade" id="modal_usr" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true" data-backdrop="static" data-keyboard="false">
|
<div class="modal fade" id="modal_usr" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true" data-backdrop="static" data-keyboard="false">
|
||||||
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="col-12 modal-title text-center">Busca Usuarios
|
<h4 class="col-12 modal-title text-center">Busca Usuarios
|
||||||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form id="forma_buscar-usr" onsubmit="return false">
|
<form id="forma_buscar-usr" onsubmit="return false">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_desc" class="col-4 col-form-label">Nombre</label>
|
<label for="filter_desc" class="col-4 col-form-label">Nombre</label>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<input id="filter_desc" name="desc" type="text" class="form-control">
|
<input id="filter_desc" name="desc" type="text" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_clave" class="col-4 col-form-label">Clave ULSA</label>
|
<label for="filter_clave" class="col-4 col-form-label">Clave ULSA</label>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<input id="filter_clave" name="clave" type="text" class="form-control">
|
<input id="filter_clave" name="clave" type="text" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="for-group row">
|
<div class="for-group row">
|
||||||
<div class="offset-4">
|
<div class="offset-4">
|
||||||
<button type="submit" class="btn btn-outline-primary" id="btn-busca-usr"><span class="ing-buscar"></span> Buscar</button>
|
<button type="submit" class="btn btn-outline-primary" id="btn-busca-usr"><span class="ing-buscar"></span> Buscar</button>
|
||||||
<button type="button" class="btn btn-outline-danger" data-dismiss="modal" aria-label="Close"><span class="ing-cancelar"></span> Cerrar</button>
|
<button type="button" class="btn btn-outline-danger" data-dismiss="modal" aria-label="Close"><span class="ing-cancelar"></span> Cerrar</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div style="max-height:400px; overflow-y:auto; overflow-x:hidden;">
|
<div style="max-height:400px; overflow-y:auto; overflow-x:hidden;">
|
||||||
<table class="table table-sm table-striped table-white mt-3">
|
<table class="table table-sm table-striped table-white mt-3">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Usuario</th>
|
<th>Usuario</th>
|
||||||
<th style="width: 20%;">Asignar</th>
|
<th style="width: 20%;">Asignar</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="table-result-usr">
|
<tbody id="table-result-usr">
|
||||||
<tr class="usr-row">
|
<tr class="usr-row">
|
||||||
<td class="usr-nombre"></td>
|
<td class="usr-nombre"></td>
|
||||||
<td class="usr-agrega text-center"><button type="button" class="btn btn-outline-primary btn-sm invisible btn-agrega-usr"><span class="ing-mas"></span></button></td>
|
<td class="usr-agrega text-center"><button type="button" class="btn btn-outline-primary btn-sm invisible btn-agrega-usr"><span class="ing-mas"></span></button></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="js/jquery-ui.js"></script>
|
<script src="js/jquery-ui.js"></script>
|
||||||
<script src="js/bootstrap/bootstrap.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/datepicker-es.js"></script>
|
<script src="js/datepicker-es.js"></script>
|
||||||
<script src="./js/richtext.js"></script>
|
<script src="./js/richtext.js"></script>
|
||||||
<?php
|
<?php
|
||||||
require_once 'js/messages.php';
|
require_once 'js/messages.php';
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
||||||
$(".date-picker").datepicker({
|
$(".date-picker").datepicker({
|
||||||
dateFormat: "dd/mm/yyyy",
|
dateFormat: "dd/mm/yyyy",
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
});
|
});
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$('.richtext').richText();
|
$('.richtext').richText();
|
||||||
//var today = new Date();
|
//var today = new Date();
|
||||||
$("#fecha_inicial").datepicker("option", "minDate", today);
|
$("#fecha_inicial").datepicker("option", "minDate", today);
|
||||||
$("#fecha_final").datepicker("option", "minDate", today);
|
$("#fecha_final").datepicker("option", "minDate", today);
|
||||||
$('#fecha_inicial').datepicker("setDate", today);
|
$('#fecha_inicial').datepicker("setDate", today);
|
||||||
$('#fecha_final').datepicker("setDate", today);
|
$('#fecha_final').datepicker("setDate", today);
|
||||||
setDatalistFirst('#facultad');
|
setDatalistFirst('#facultad');
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on( "change", ".tipo-switch", function(event){
|
$(document).on( "change", ".tipo-switch", function(event){
|
||||||
if($(this).data("box") !== undefined){
|
if($(this).data("box") !== undefined){
|
||||||
if($(this).prop('checked')){
|
if($(this).prop('checked')){
|
||||||
$('#'+$(this).data("box")).collapse('show');
|
$('#'+$(this).data("box")).collapse('show');
|
||||||
}else{
|
}else{
|
||||||
$('#'+$(this).data("box")).collapse('hide');
|
$('#'+$(this).data("box")).collapse('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('#bloque_tipo').removeClass("is-invalid");
|
$('#bloque_tipo').removeClass("is-invalid");
|
||||||
$('#bloque_usr').removeClass("is-invalid");
|
$('#bloque_usr').removeClass("is-invalid");
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on( "click", ".btn-agrega-carrera", function(event){
|
$(document).on( "click", ".btn-agrega-carrera", function(event){
|
||||||
var id = $(this).data("id");
|
var id = $(this).data("id");
|
||||||
var text = $(this).data("text");
|
var text = $(this).data("text");
|
||||||
if($('#tipo_box option[value="' + id + '"]').length == 0){
|
if($('#tipo_box option[value="' + id + '"]').length == 0){
|
||||||
$("#tipo_box").append($("<option></option>").attr("value",id).text(text));
|
$("#tipo_box").append($("<option></option>").attr("value",id).text(text));
|
||||||
}
|
}
|
||||||
$(this).parents("tr").addClass("d-none");
|
$(this).parents("tr").addClass("d-none");
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on( "click", ".btn-quita-tipo", function(event){
|
$(document).on( "click", ".btn-quita-tipo", function(event){
|
||||||
var id = $("#tipo_box option:selected").val();
|
var id = $("#tipo_box option:selected").val();
|
||||||
$("#arow_"+id).removeClass("d-none");
|
$("#arow_"+id).removeClass("d-none");
|
||||||
$("#tipo_box option:selected").remove();
|
$("#tipo_box option:selected").remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on( "click", ".modal-open", function(event){
|
$(document).on( "click", ".modal-open", function(event){
|
||||||
$(".area-row").removeClass("d-none");
|
$(".area-row").removeClass("d-none");
|
||||||
$('#area > option').each(function() {
|
$('#area > option').each(function() {
|
||||||
$("#row_"+$(this).val()).addClass("d-none");
|
$("#row_"+$(this).val()).addClass("d-none");
|
||||||
});
|
});
|
||||||
$('#modal').modal("show");
|
$('#modal').modal("show");
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '#btn-busca-usr', function(event){
|
$(document).on('click', '#btn-busca-usr', function(event){
|
||||||
var nombre = $('#filter_desc').val();
|
var nombre = $('#filter_desc').val();
|
||||||
var clave = $('#filter_clave').val();
|
var clave = $('#filter_clave').val();
|
||||||
var fac = $('#facultad').val();
|
var fac = $('#facultad').val();
|
||||||
$('#table-result-usr').show();
|
$('#table-result-usr').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'action/usuario_find.php',
|
url: 'action/usuario_find.php',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: {nombre: nombre, clave: clave, facultad: fac},
|
data: {nombre: nombre, clave: clave, facultad: fac},
|
||||||
success: function(result){
|
success: function(result){
|
||||||
console.log(result.length);
|
console.log(result.length);
|
||||||
$("#table-result-usr").find(".usr-nombre").html("");
|
$("#table-result-usr").find(".usr-nombre").html("");
|
||||||
$("#table-result-usr").find(".usr-agrega button").addClass("invisible");
|
$("#table-result-usr").find(".usr-agrega button").addClass("invisible");
|
||||||
var rows = $("#table-result-usr > tr").length;//limpia tabla actual
|
var rows = $("#table-result-usr > tr").length;//limpia tabla actual
|
||||||
if(rows > result.length){
|
if(rows > result.length){
|
||||||
while(rows > result.length && rows > 1){
|
while(rows > result.length && rows > 1){
|
||||||
$("#table-result-usr .usr-row:last-child").remove();
|
$("#table-result-usr .usr-row:last-child").remove();
|
||||||
rows--;
|
rows--;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
for(var i=rows; i<result.length; i++){
|
for(var i=rows; i<result.length; i++){
|
||||||
$("#table-result-usr .usr-row:first-child").clone(true).appendTo("#table-result-usr");
|
$("#table-result-usr .usr-row:first-child").clone(true).appendTo("#table-result-usr");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(result.length != 0){
|
if(result.length != 0){
|
||||||
$('#table-result-usr').children().each(function(index){
|
$('#table-result-usr').children().each(function(index){
|
||||||
if(index < result.length){
|
if(index < result.length){
|
||||||
$(this).find('.usr-nombre').html(result[index]['profesor_nombre']);
|
$(this).find('.usr-nombre').html(result[index]['profesor_nombre']);
|
||||||
$(this).find('.usr-agrega button').data("id", result[index]['profesor_id']);
|
$(this).find('.usr-agrega button').data("id", result[index]['profesor_id']);
|
||||||
$(this).find('.usr-agrega button').data("text", result[index]['profesor_nombre']);
|
$(this).find('.usr-agrega button').data("text", result[index]['profesor_nombre']);
|
||||||
$(this).find(".usr-agrega button").removeClass("invisible");
|
$(this).find(".usr-agrega button").removeClass("invisible");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(){
|
error: function(){
|
||||||
console.log('error');
|
console.log('error');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on( "click", ".btn-agrega-usr", function(event){
|
$(document).on( "click", ".btn-agrega-usr", function(event){
|
||||||
var id = $(this).data("id");
|
var id = $(this).data("id");
|
||||||
var text = $(this).data("text");
|
var text = $(this).data("text");
|
||||||
var rows = $("#table-result-usr > tr").length;//limpia tabla actual
|
var rows = $("#table-result-usr > tr").length;//limpia tabla actual
|
||||||
|
|
||||||
if($('#usuario_box option[value="' + id + '"]').length == 0){
|
if($('#usuario_box option[value="' + id + '"]').length == 0){
|
||||||
$("#usuario_box").append($("<option></option>").attr("value",id).text(text));
|
$("#usuario_box").append($("<option></option>").attr("value",id).text(text));
|
||||||
}
|
}
|
||||||
if(rows > 1)
|
if(rows > 1)
|
||||||
$(this).parents("tr").remove();
|
$(this).parents("tr").remove();
|
||||||
else{
|
else{
|
||||||
$(this).parents("tr").hide();
|
$(this).parents("tr").hide();
|
||||||
$("#filter_desc-usr").val("");
|
$("#filter_desc-usr").val("");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on( "click", ".btn-quita-usr", function(event){
|
$(document).on( "click", ".btn-quita-usr", function(event){
|
||||||
$("#usuario_box option:selected").remove();
|
$("#usuario_box option:selected").remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
function validaCampos(){
|
function validaCampos(){
|
||||||
var error = false;
|
var error = false;
|
||||||
var inicio = $('#fecha_inicial').val();
|
var inicio = $('#fecha_inicial').val();
|
||||||
var fin = $('#fecha_final').val();
|
var fin = $('#fecha_final').val();
|
||||||
var aux = inicio.split('/');
|
var aux = inicio.split('/');
|
||||||
inicio = aux[2]+'-'+aux[1]+'-'+aux[0];
|
inicio = aux[2]+'-'+aux[1]+'-'+aux[0];
|
||||||
aux = fin.split('/');
|
aux = fin.split('/');
|
||||||
fin = aux[2]+'-'+aux[1]+'-'+aux[0];
|
fin = aux[2]+'-'+aux[1]+'-'+aux[0];
|
||||||
if(fin < inicio){
|
if(fin < inicio){
|
||||||
$('#fecha_final').addClass('is-invalid');
|
$('#fecha_final').addClass('is-invalid');
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
if($('#texto').val() == ""){
|
if($('#texto').val() == ""){
|
||||||
$('#texto').addClass('is-invalid');
|
$('#texto').addClass('is-invalid');
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
if($('select').find('option').length == 0){
|
if($('select').find('option').length == 0){
|
||||||
error = true;
|
error = true;
|
||||||
$('.tipo_aviso').addClass('is-invalid');
|
$('.tipo_aviso').addClass('is-invalid');
|
||||||
}else{
|
}else{
|
||||||
$('.tipo_aviso').removeClass('is-invalid');
|
$('.tipo_aviso').removeClass('is-invalid');
|
||||||
}
|
}
|
||||||
if(error == true){
|
if(error == true){
|
||||||
return false;
|
return false;
|
||||||
}else{
|
}else{
|
||||||
$('#tipo_box option').prop('selected', true);
|
$('#tipo_box option').prop('selected', true);
|
||||||
$('#usuario_box option').prop('selected', true);
|
$('#usuario_box option').prop('selected', true);
|
||||||
$('#formaModal').prop('action', './action/action_avisos_insert.php');
|
$('#formaModal').prop('action', './action/action_avisos_insert.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#modal_carrera').on('show.bs.modal', function(event){
|
$('#modal_carrera').on('show.bs.modal', function(event){
|
||||||
var fac_id = $('#facultad').val();
|
var fac_id = $('#facultad').val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'action/carrera_find.php',
|
url: 'action/carrera_find.php',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: {fac_id: fac_id},
|
data: {fac_id: fac_id},
|
||||||
success: function(result){
|
success: function(result){
|
||||||
$("#table-result-carrera").find(".carrera-nombre").html("");
|
$("#table-result-carrera").find(".carrera-nombre").html("");
|
||||||
$("#table-result-carrera").find(".carrera-agrega button").addClass("invisible");
|
$("#table-result-carrera").find(".carrera-agrega button").addClass("invisible");
|
||||||
var rows = $("#table-result-carrera > tr").length;
|
var rows = $("#table-result-carrera > tr").length;
|
||||||
if(rows > result.length){
|
if(rows > result.length){
|
||||||
while(rows > result.length && rows > 1){
|
while(rows > result.length && rows > 1){
|
||||||
$("#table-result-carrera .tipo-row:last-child").remove();
|
$("#table-result-carrera .tipo-row:last-child").remove();
|
||||||
rows--;
|
rows--;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
for(var i=rows; i<result.length; i++){
|
for(var i=rows; i<result.length; i++){
|
||||||
$("#table-result-carrera .tipo-row:first-child").clone(true).appendTo("#table-result-carrera");
|
$("#table-result-carrera .tipo-row:first-child").clone(true).appendTo("#table-result-carrera");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(result.length != 0){
|
if(result.length != 0){
|
||||||
$("#table-result-carrera").children().each(function(index){
|
$("#table-result-carrera").children().each(function(index){
|
||||||
if(index < result.length){
|
if(index < result.length){
|
||||||
$(this).find('.carrera-nombre').html(result[index]['carrera_nombre']);
|
$(this).find('.carrera-nombre').html(result[index]['carrera_nombre']);
|
||||||
$(this).find('.carrera-agrega button').data("id", result[index]['carrera_id']);
|
$(this).find('.carrera-agrega button').data("id", result[index]['carrera_id']);
|
||||||
$(this).find('.carrera-agrega button').data("text", result[index]['carrera_nombre']);
|
$(this).find('.carrera-agrega button').data("text", result[index]['carrera_nombre']);
|
||||||
$(this).find(".carrera-agrega button").removeClass("invisible");
|
$(this).find(".carrera-agrega button").removeClass("invisible");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(){
|
error: function(){
|
||||||
console.log("Error");
|
console.log("Error");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,437 +1,437 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'class/c_login.php';
|
require_once 'class/c_login.php';
|
||||||
require_once 'include/bd_pdo.php';
|
require_once 'include/bd_pdo.php';
|
||||||
|
|
||||||
if (!isset($_SESSION['user'])) {
|
if (!isset($_SESSION['user'])) {
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
exit;
|
exit;
|
||||||
} else
|
} else
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
$user->access('Avisos');
|
$user->access('Avisos');
|
||||||
if (!$user->admin && $user->acceso == 'n') {
|
if (!$user->admin && $user->acceso == 'n') {
|
||||||
header('Location: main.php?error=1');
|
header('Location: main.php?error=1');
|
||||||
} else {
|
} else {
|
||||||
$user->print_to_log('Avisos Editar');
|
$user->print_to_log('Avisos Editar');
|
||||||
}
|
}
|
||||||
$fac = $user->facultad['facultad_id'];
|
$fac = $user->facultad['facultad_id'];
|
||||||
if ($user->admin) {
|
if ($user->admin) {
|
||||||
$fac = null;
|
$fac = null;
|
||||||
}
|
}
|
||||||
$fs_aviso = query('SELECT * FROM fs_aviso(:aviso_id, null, :facultad_id, null, 0, null)', [':aviso_id' => $_GET['id'], ':facultad_id' => $fac], true);
|
$fs_aviso = query('SELECT * FROM fs_aviso(:aviso_id, null, :facultad_id, null, 0, null)', [':aviso_id' => $_GET['id'], ':facultad_id' => $fac], true);
|
||||||
$fs_carreras = query('SELECT * FROM fs_carreras(:fac, null, null)', [':fac' => $fs_aviso['facultad_id']], false);
|
$fs_carreras = query('SELECT * FROM fs_carreras(:fac, null, null)', [':fac' => $fs_aviso['facultad_id']], false);
|
||||||
$fs_usr = query('SELECT * FROM fs_profesor_aviso(:aviso_id)', [':aviso_id' => $_GET['id']], false);
|
$fs_usr = query('SELECT * FROM fs_profesor_aviso(:aviso_id)', [':aviso_id' => $_GET['id']], false);
|
||||||
$today = date('Y-m-d');
|
$today = date('Y-m-d');
|
||||||
$edit = $today < $fs_aviso['aviso_fecha_inicial'];
|
$edit = $today < $fs_aviso['aviso_fecha_inicial'];
|
||||||
?>
|
?>
|
||||||
<!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>Avisos Crear</title>
|
<title>Avisos Crear</title>
|
||||||
<link rel="stylesheet" href="css/jquery-ui.css">
|
<link rel="stylesheet" href="css/jquery-ui.css">
|
||||||
<link rel="stylesheet" href="css/calendar.css">
|
<link rel="stylesheet" href="css/calendar.css">
|
||||||
<link rel="stylesheet" href="css/richtext.css" type="text/css">
|
<link rel="stylesheet" href="css/richtext.css" type="text/css">
|
||||||
<link rel="stylesheet" href="css/fa_all.css" type="text/css">
|
<link rel="stylesheet" href="css/fa_all.css" type="text/css">
|
||||||
<?php
|
<?php
|
||||||
include 'import/html_css_files.php';
|
include 'import/html_css_files.php';
|
||||||
?>
|
?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
include "import/html_header.php";
|
include "import/html_header.php";
|
||||||
html_header(
|
html_header(
|
||||||
"EDITAR AVISO",
|
"EDITAR AVISO",
|
||||||
"Gestión de Checador "
|
"Gestión de Checador "
|
||||||
);
|
);
|
||||||
$user->access('Avisos');
|
$user->access('Avisos');
|
||||||
?>
|
?>
|
||||||
<main class="content marco">
|
<main class="content marco">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<form action="./action/action_avisos_update.php" method="post" id="formaModal" onsubmit="return validaCampos()">
|
<form action="./action/action_avisos_update.php" method="post" id="formaModal" onsubmit="return validaCampos()">
|
||||||
<input type="hidden" name="aviso_id" id="aviso_id" value="<?= $fs_aviso['aviso_id'] ?>">
|
<input type="hidden" name="aviso_id" id="aviso_id" value="<?= $fs_aviso['aviso_id'] ?>">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="fecha_inicial" class="col-4 col-form-label">Fecha inicial</label>
|
<label for="fecha_inicial" class="col-4 col-form-label">Fecha inicial</label>
|
||||||
<div class="col-8 col-sm-4">
|
<div class="col-8 col-sm-4">
|
||||||
<?php if ($edit) { ?>
|
<?php if ($edit) { ?>
|
||||||
<input id="fecha_inicial" name="fecha_inicial" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="readonly" value="<?php $day = explode("-", $fs_aviso['aviso_fecha_inicial']);
|
<input id="fecha_inicial" name="fecha_inicial" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="readonly" value="<?php $day = explode("-", $fs_aviso['aviso_fecha_inicial']);
|
||||||
$dia_inicial = $day['2'] . '/' . $day['1'] . '/' . $day[0];
|
$dia_inicial = $day['2'] . '/' . $day['1'] . '/' . $day[0];
|
||||||
echo $dia_inicial; ?>">
|
echo $dia_inicial; ?>">
|
||||||
<div class="invalid-feedback">No es una fecha valida</div>
|
<div class="invalid-feedback">No es una fecha valida</div>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<div>
|
<div>
|
||||||
<?php $day = explode("-", $fs_aviso['aviso_fecha_inicial']);
|
<?php $day = explode("-", $fs_aviso['aviso_fecha_inicial']);
|
||||||
$dia_inicial = $day['2'] . '/' . $day['1'] . '/' . $day[0];
|
$dia_inicial = $day['2'] . '/' . $day['1'] . '/' . $day[0];
|
||||||
echo $dia_inicial; ?>
|
echo $dia_inicial; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="fecha_final" class="col-4 col-form-label">Fecha Final *</label>
|
<label for="fecha_final" class="col-4 col-form-label">Fecha Final *</label>
|
||||||
<div class="col-8 col-sm-4">
|
<div class="col-8 col-sm-4">
|
||||||
<input id="fecha_final" name="fecha_final" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="readonly" value="<?php $day = explode("-", $fs_aviso['aviso_fecha_final']);
|
<input id="fecha_final" name="fecha_final" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="readonly" value="<?php $day = explode("-", $fs_aviso['aviso_fecha_final']);
|
||||||
$dia_final = $day['2'] . '/' . $day['1'] . '/' . $day[0];
|
$dia_final = $day['2'] . '/' . $day['1'] . '/' . $day[0];
|
||||||
echo $dia_final; ?>">
|
echo $dia_final; ?>">
|
||||||
<div class="invalid-feedback">No es una fecha valida</div>
|
<div class="invalid-feedback">No es una fecha valida</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="texto" class="col-4 col-form-label">Aviso *</label>
|
<label for="texto" class="col-4 col-form-label">Aviso *</label>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<?php if ($edit == true) { ?>
|
<?php if ($edit == true) { ?>
|
||||||
<textarea name="texto" id="texto" class="richtext" rows="10" readonly="readonly"><?= $fs_aviso['aviso_texto'] ?></textarea>
|
<textarea name="texto" id="texto" class="richtext" rows="10" readonly="readonly"><?= $fs_aviso['aviso_texto'] ?></textarea>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<p><?= $fs_aviso['aviso_texto'] ?></p>
|
<p><?= $fs_aviso['aviso_texto'] ?></p>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php if ($edit) { ?>
|
<?php if ($edit) { ?>
|
||||||
<div class="form-group row tipo_aviso">
|
<div class="form-group row tipo_aviso">
|
||||||
<label class="col-4 col-form-label">Enviar aviso:</label>
|
<label class="col-4 col-form-label">Enviar aviso:</label>
|
||||||
<div class="col-4 pt-2">
|
<div class="col-4 pt-2">
|
||||||
<div class="custom-control custom-switch">
|
<div class="custom-control custom-switch">
|
||||||
<input type="checkbox" class="custom-control-input tipo-switch" name="bloque_tipo" id="bloque_tipo" value="1" data-box="profesorBox" data-select="tipo_box">
|
<input type="checkbox" class="custom-control-input tipo-switch" name="bloque_tipo" id="bloque_tipo" value="1" data-box="profesorBox" data-select="tipo_box">
|
||||||
<label class="custom-control-label" for="bloque_tipo">Por carrera</label>
|
<label class="custom-control-label" for="bloque_tipo">Por carrera</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4 pt-2">
|
<div class="col-4 pt-2">
|
||||||
<div class="custom-control custom-switch">
|
<div class="custom-control custom-switch">
|
||||||
<input type="checkbox" class="custom-control-input tipo-switch" name="bloque_usr" id="bloque_usr" value="1" data-box="administrativoBox" data-select="usuario_box">
|
<input type="checkbox" class="custom-control-input tipo-switch" name="bloque_usr" id="bloque_usr" value="1" data-box="administrativoBox" data-select="usuario_box">
|
||||||
<label class="custom-control-label" for="bloque_usr">Por nombre</label>
|
<label class="custom-control-label" for="bloque_usr">Por nombre</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="invalid-feedback offset-4">No hay profesores para mandar el aviso</div>
|
<div class="invalid-feedback offset-4">No hay profesores para mandar el aviso</div>
|
||||||
<div class="collapse" id="profesorBox">
|
<div class="collapse" id="profesorBox">
|
||||||
<h3>Carreras</h3>
|
<h3>Carreras</h3>
|
||||||
<p>Utiliza el botón para asignar las carreras que recibirán el aviso.</p>
|
<p>Utiliza el botón para asignar las carreras que recibirán el aviso.</p>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-10">
|
<div class="col-10">
|
||||||
<select name="tipo[]" id="tipo_box" class="form-control" multiple="multiple" size="5">
|
<select name="tipo[]" id="tipo_box" class="form-control" multiple="multiple" size="5">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<p><button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#modal_carrera"><span class="ing-mas ing-fw"></span> Asignar</button></p>
|
<p><button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#modal_carrera"><span class="ing-mas ing-fw"></span> Asignar</button></p>
|
||||||
<p><button type="button" class="btn btn-outline-danger btn-quita-tipo"><span class="ing-menos ing-fw"></span> Quitar</button></p>
|
<p><button type="button" class="btn btn-outline-danger btn-quita-tipo"><span class="ing-menos ing-fw"></span> Quitar</button></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="collapse" id="administrativoBox">
|
<div class="collapse" id="administrativoBox">
|
||||||
<h3>Nombre de profesores</h3>
|
<h3>Nombre de profesores</h3>
|
||||||
<p>Utiliza el botón para asignar los profesores que recibirán el aviso.</p>
|
<p>Utiliza el botón para asignar los profesores que recibirán el aviso.</p>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-10">
|
<div class="col-10">
|
||||||
<select name="usuario[]" id="usuario_box" class="form-control" multiple="multiple" size="5">
|
<select name="usuario[]" id="usuario_box" class="form-control" multiple="multiple" size="5">
|
||||||
<?php
|
<?php
|
||||||
foreach ($fs_usr as $usuario) {
|
foreach ($fs_usr as $usuario) {
|
||||||
echo "<option value='" . $usuario['profesor_id'] . "'>" . $usuario['profesor_nombre'] . "</option>";
|
echo "<option value='" . $usuario['profesor_id'] . "'>" . $usuario['profesor_nombre'] . "</option>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<p><button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#modal_usr"><span class="ing-mas ing-fw"></span> Asignar</button></p>
|
<p><button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#modal_usr"><span class="ing-mas ing-fw"></span> Asignar</button></p>
|
||||||
<p><button type="button" class="btn btn-outline-danger btn-quita-usr"><span class="ing-menos ing-fw"></span> Quitar</button></p>
|
<p><button type="button" class="btn btn-outline-danger btn-quita-usr"><span class="ing-menos ing-fw"></span> Quitar</button></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } else {
|
<?php } else {
|
||||||
$num_prof = round(count($fs_usr) / 2);
|
$num_prof = round(count($fs_usr) / 2);
|
||||||
?>
|
?>
|
||||||
<h3>Profesores que recibirán el aviso</h3>
|
<h3>Profesores que recibirán el aviso</h3>
|
||||||
<div class="row" style="max-height:400px; overflow-y:auto; overflow-x:hidden;">
|
<div class="row" style="max-height:400px; overflow-y:auto; overflow-x:hidden;">
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
<div>
|
<div>
|
||||||
<ul>
|
<ul>
|
||||||
<?php for ($i = 0; $i < $num_prof; $i++) {
|
<?php for ($i = 0; $i < $num_prof; $i++) {
|
||||||
echo "<li>" . $fs_usr[$i]['profesor_nombre'] . "</li>";
|
echo "<li>" . $fs_usr[$i]['profesor_nombre'] . "</li>";
|
||||||
} ?>
|
} ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
<div>
|
<div>
|
||||||
<ul>
|
<ul>
|
||||||
<?php for ($i = $i; $i < count($fs_usr); $i++) {
|
<?php for ($i = $i; $i < count($fs_usr); $i++) {
|
||||||
echo "<li>" . $fs_usr[$i]['profesor_nombre'] . "</li>";
|
echo "<li>" . $fs_usr[$i]['profesor_nombre'] . "</li>";
|
||||||
} ?>
|
} ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<div class="form-group row mt-2">
|
<div class="form-group row mt-2">
|
||||||
<div class="col-12 text-center">
|
<div class="col-12 text-center">
|
||||||
<button type="submit" class="btn btn-outline-primary" id="submitBtn" data-tipo="1"><span class="ing-aceptar"></span> Guardar</button>
|
<button type="submit" class="btn btn-outline-primary" id="submitBtn" data-tipo="1"><span class="ing-aceptar"></span> Guardar</button>
|
||||||
<a href="avisos.php" class="btn btn-outline-danger"><span class="ing-cancelar"></span> Cancelar</a>
|
<a href="avisos.php" class="btn btn-outline-danger"><span class="ing-cancelar"></span> Cancelar</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<?php
|
<?php
|
||||||
include "import/html_footer.php";
|
include "import/html_footer.php";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div class="modal fade" id="modal_carrera" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true" data-backdrop="static" data-keyboard="false">
|
<div class="modal fade" id="modal_carrera" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true" data-backdrop="static" data-keyboard="false">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="col-12 modal-title text-center">Carreras
|
<h4 class="col-12 modal-title text-center">Carreras
|
||||||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<table class="table table-sm table-striped table-white">
|
<table class="table table-sm table-striped table-white">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Carrera</th>
|
<th>Carrera</th>
|
||||||
<th>Asignar</th>
|
<th>Asignar</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $count = 1;
|
<?php $count = 1;
|
||||||
foreach ($fs_carreras as $carrera) { ?>
|
foreach ($fs_carreras as $carrera) { ?>
|
||||||
<tr class="tipo-row" id="arow_<?= $carrera['carrera_id'] ?>">
|
<tr class="tipo-row" id="arow_<?= $carrera['carrera_id'] ?>">
|
||||||
<td><?= $carrera['carrera_nombre'] ?></td>
|
<td><?= $carrera['carrera_nombre'] ?></td>
|
||||||
<td class="text-center"><button type="button" class="btn btn-outline-primary btn-sm btn-agrega-tipo" data-id="<?= $carrera['carrera_id'] ?>" data-text="<?= $carrera['carrera_nombre'] ?>"><span class="ing-mas"></span></button></td>
|
<td class="text-center"><button type="button" class="btn btn-outline-primary btn-sm btn-agrega-tipo" data-id="<?= $carrera['carrera_id'] ?>" data-text="<?= $carrera['carrera_nombre'] ?>"><span class="ing-mas"></span></button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php $count++;
|
<?php $count++;
|
||||||
} ?>
|
} ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal fade" id="modal_usr" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true" data-backdrop="static" data-keyboard="false">
|
<div class="modal fade" id="modal_usr" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true" data-backdrop="static" data-keyboard="false">
|
||||||
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="col-12 modal-title text-center">Busca Usuarios
|
<h4 class="col-12 modal-title text-center">Busca Usuarios
|
||||||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form id="forma_buscar-usr" onsubmit="return false">
|
<form id="forma_buscar-usr" onsubmit="return false">
|
||||||
<input type="hidden" id="facultad" name="facultad" value="<?= $fac ?>">
|
<input type="hidden" id="facultad" name="facultad" value="<?= $fac ?>">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_desc" class="col-4 col-form-label">Nombre</label>
|
<label for="filter_desc" class="col-4 col-form-label">Nombre</label>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<input id="filter_desc" name="desc" type="text" class="form-control">
|
<input id="filter_desc" name="desc" type="text" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_clave" class="col-4 col-form-label">Clave ULSA</label>
|
<label for="filter_clave" class="col-4 col-form-label">Clave ULSA</label>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<input id="filter_clave" name="clave" type="text" class="form-control">
|
<input id="filter_clave" name="clave" type="text" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="for-group row">
|
<div class="for-group row">
|
||||||
<div class="col-12 text-center">
|
<div class="col-12 text-center">
|
||||||
<button type="submit" class="btn btn-outline-primary" id="btn-busca-usr"><span class="ing-buscar"></span> Buscar</button>
|
<button type="submit" class="btn btn-outline-primary" id="btn-busca-usr"><span class="ing-buscar"></span> Buscar</button>
|
||||||
<button type="button" class="btn btn-outline-danger" data-dismiss="modal" aria-label="Close"><span class="ing-cancelar"></span> Cerrar</button>
|
<button type="button" class="btn btn-outline-danger" data-dismiss="modal" aria-label="Close"><span class="ing-cancelar"></span> Cerrar</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div style="max-height:400px; overflow-y:auto; overflow-x:hidden;">
|
<div style="max-height:400px; overflow-y:auto; overflow-x:hidden;">
|
||||||
<table class="table table-sm table-striped table-white mt-3">
|
<table class="table table-sm table-striped table-white mt-3">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Usuario</th>
|
<th>Usuario</th>
|
||||||
<th style="width: 20%;">Asignar</th>
|
<th style="width: 20%;">Asignar</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="table-result-usr">
|
<tbody id="table-result-usr">
|
||||||
<tr class="usr-row">
|
<tr class="usr-row">
|
||||||
<td class="usr-nombre"></td>
|
<td class="usr-nombre"></td>
|
||||||
<td class="usr-agrega text-center"><button type="button" class="btn btn-outline-primary btn-sm invisible btn-agrega-usr"><span class="ing-mas"></span></button></td>
|
<td class="usr-agrega text-center"><button type="button" class="btn btn-outline-primary btn-sm invisible btn-agrega-usr"><span class="ing-mas"></span></button></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="js/jquery-ui.js"></script>
|
<script src="js/jquery-ui.js"></script>
|
||||||
<script src="js/bootstrap/bootstrap.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/datepicker-es.js"></script>
|
<script src="js/datepicker-es.js"></script>
|
||||||
<script src="./js/richtext.js"></script>
|
<script src="./js/richtext.js"></script>
|
||||||
<?php
|
<?php
|
||||||
require_once 'js/messages.php';
|
require_once 'js/messages.php';
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
||||||
$(".date-picker").datepicker({
|
$(".date-picker").datepicker({
|
||||||
dateFormat: "dd/mm/yyyy",
|
dateFormat: "dd/mm/yyyy",
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
});
|
});
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('.richtext').richText();
|
$('.richtext').richText();
|
||||||
$("#fecha_final").datepicker("option", "minDate", today);
|
$("#fecha_final").datepicker("option", "minDate", today);
|
||||||
$("#fecha_inicial").datepicker("option", "minDate", today);
|
$("#fecha_inicial").datepicker("option", "minDate", today);
|
||||||
<?php
|
<?php
|
||||||
if (count($fs_usr) > 0) { ?>
|
if (count($fs_usr) > 0) { ?>
|
||||||
$('#bloque_usr').prop("checked", true);
|
$('#bloque_usr').prop("checked", true);
|
||||||
$('#administrativoBox').collapse('show');
|
$('#administrativoBox').collapse('show');
|
||||||
<?php } if ($edit == false) { ?>
|
<?php } if ($edit == false) { ?>
|
||||||
$('.richText-editor').removeAttr("contentEditable");
|
$('.richText-editor').removeAttr("contentEditable");
|
||||||
<?php }
|
<?php }
|
||||||
?>
|
?>
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("change", ".tipo-switch", function(event) {
|
$(document).on("change", ".tipo-switch", function(event) {
|
||||||
if ($(this).data("box") !== undefined) {
|
if ($(this).data("box") !== undefined) {
|
||||||
if ($(this).prop('checked')) {
|
if ($(this).prop('checked')) {
|
||||||
$('#' + $(this).data("box")).collapse('show');
|
$('#' + $(this).data("box")).collapse('show');
|
||||||
} else {
|
} else {
|
||||||
$('#' + $(this).data("box")).collapse('hide');
|
$('#' + $(this).data("box")).collapse('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('#bloque_tipo').removeClass("is-invalid");
|
$('#bloque_tipo').removeClass("is-invalid");
|
||||||
$('#bloque_usr').removeClass("is-invalid");
|
$('#bloque_usr').removeClass("is-invalid");
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click", ".btn-agrega-tipo", function(event) {
|
$(document).on("click", ".btn-agrega-tipo", function(event) {
|
||||||
var id = $(this).data("id");
|
var id = $(this).data("id");
|
||||||
var text = $(this).data("text");
|
var text = $(this).data("text");
|
||||||
if ($('#tipo_box option[value="' + id + '"]').length == 0) {
|
if ($('#tipo_box option[value="' + id + '"]').length == 0) {
|
||||||
$("#tipo_box").append($("<option></option>").attr("value", id).text(text));
|
$("#tipo_box").append($("<option></option>").attr("value", id).text(text));
|
||||||
}
|
}
|
||||||
$(this).parents("tr").addClass("d-none");
|
$(this).parents("tr").addClass("d-none");
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click", ".btn-quita-tipo", function(event) {
|
$(document).on("click", ".btn-quita-tipo", function(event) {
|
||||||
var id = $("#tipo_box option:selected").val();
|
var id = $("#tipo_box option:selected").val();
|
||||||
$("#arow_" + id).removeClass("d-none");
|
$("#arow_" + id).removeClass("d-none");
|
||||||
$("#tipo_box option:selected").remove();
|
$("#tipo_box option:selected").remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click", ".modal-open", function(event) {
|
$(document).on("click", ".modal-open", function(event) {
|
||||||
$(".area-row").removeClass("d-none");
|
$(".area-row").removeClass("d-none");
|
||||||
$('#area > option').each(function() {
|
$('#area > option').each(function() {
|
||||||
$("#row_" + $(this).val()).addClass("d-none");
|
$("#row_" + $(this).val()).addClass("d-none");
|
||||||
});
|
});
|
||||||
$('#modal').modal("show");
|
$('#modal').modal("show");
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '#btn-busca-usr', function(event) {
|
$(document).on('click', '#btn-busca-usr', function(event) {
|
||||||
var nombre = $('#filter_desc').val();
|
var nombre = $('#filter_desc').val();
|
||||||
var clave = $('#filter_clave').val();
|
var clave = $('#filter_clave').val();
|
||||||
var fac = $('#facultad').val();
|
var fac = $('#facultad').val();
|
||||||
$('#table-result-usr').show();
|
$('#table-result-usr').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'action/usuario_find.php',
|
url: 'action/usuario_find.php',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: {
|
data: {
|
||||||
nombre: nombre,
|
nombre: nombre,
|
||||||
clave: clave,
|
clave: clave,
|
||||||
facultad: fac
|
facultad: fac
|
||||||
},
|
},
|
||||||
success: function(result) {
|
success: function(result) {
|
||||||
console.log(result.length);
|
console.log(result.length);
|
||||||
$("#table-result-usr").find(".usr-nombre").html("");
|
$("#table-result-usr").find(".usr-nombre").html("");
|
||||||
$("#table-result-usr").find(".usr-agrega button").addClass("invisible");
|
$("#table-result-usr").find(".usr-agrega button").addClass("invisible");
|
||||||
var rows = $("#table-result-usr > tr").length; //limpia tabla actual
|
var rows = $("#table-result-usr > tr").length; //limpia tabla actual
|
||||||
if (rows > result.length) {
|
if (rows > result.length) {
|
||||||
while (rows > result.length && rows > 1) {
|
while (rows > result.length && rows > 1) {
|
||||||
$("#table-result-usr .usr-row:last-child").remove();
|
$("#table-result-usr .usr-row:last-child").remove();
|
||||||
rows--;
|
rows--;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (var i = rows; i < result.length; i++) {
|
for (var i = rows; i < result.length; i++) {
|
||||||
$("#table-result-usr .usr-row:first-child").clone(true).appendTo("#table-result-usr");
|
$("#table-result-usr .usr-row:first-child").clone(true).appendTo("#table-result-usr");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result.length != 0) {
|
if (result.length != 0) {
|
||||||
$('#table-result-usr').children().each(function(index) {
|
$('#table-result-usr').children().each(function(index) {
|
||||||
if (index < result.length) {
|
if (index < result.length) {
|
||||||
$(this).find('.usr-nombre').html(result[index]['profesor_nombre']);
|
$(this).find('.usr-nombre').html(result[index]['profesor_nombre']);
|
||||||
$(this).find('.usr-agrega button').data("id", result[index]['profesor_id']);
|
$(this).find('.usr-agrega button').data("id", result[index]['profesor_id']);
|
||||||
$(this).find('.usr-agrega button').data("text", result[index]['profesor_nombre']);
|
$(this).find('.usr-agrega button').data("text", result[index]['profesor_nombre']);
|
||||||
$(this).show();
|
$(this).show();
|
||||||
$(this).find(".usr-agrega button").removeClass("invisible");
|
$(this).find(".usr-agrega button").removeClass("invisible");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
console.log('error');
|
console.log('error');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click", ".btn-agrega-usr", function(event) {
|
$(document).on("click", ".btn-agrega-usr", function(event) {
|
||||||
var id = $(this).data("id");
|
var id = $(this).data("id");
|
||||||
var text = $(this).data("text");
|
var text = $(this).data("text");
|
||||||
var rows = $("#table-result-usr > tr").length; //limpia tabla actual
|
var rows = $("#table-result-usr > tr").length; //limpia tabla actual
|
||||||
|
|
||||||
if ($('#usuario_box option[value="' + id + '"]').length == 0) {
|
if ($('#usuario_box option[value="' + id + '"]').length == 0) {
|
||||||
$("#usuario_box").append($("<option></option>").attr("value", id).text(text));
|
$("#usuario_box").append($("<option></option>").attr("value", id).text(text));
|
||||||
}
|
}
|
||||||
if (rows > 1)
|
if (rows > 1)
|
||||||
$(this).parents("tr").remove();
|
$(this).parents("tr").remove();
|
||||||
else {
|
else {
|
||||||
$(this).parents("tr").hide();
|
$(this).parents("tr").hide();
|
||||||
$("#filter_desc-usr").val("");
|
$("#filter_desc-usr").val("");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click", ".btn-quita-usr", function(event) {
|
$(document).on("click", ".btn-quita-usr", function(event) {
|
||||||
$("#usuario_box option:selected").remove();
|
$("#usuario_box option:selected").remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
function validaCampos() {
|
function validaCampos() {
|
||||||
var error = false;
|
var error = false;
|
||||||
var inicio = $('#fecha_inicial').val();
|
var inicio = $('#fecha_inicial').val();
|
||||||
var fin = $('#fecha_final').val();
|
var fin = $('#fecha_final').val();
|
||||||
var aux = inicio.split('/');
|
var aux = inicio.split('/');
|
||||||
inicio = aux[2] + '-' + aux[1] + '-' + aux[0];
|
inicio = aux[2] + '-' + aux[1] + '-' + aux[0];
|
||||||
aux = fin.split('/');
|
aux = fin.split('/');
|
||||||
fin = aux[2] + '-' + aux[1] + '-' + aux[0];
|
fin = aux[2] + '-' + aux[1] + '-' + aux[0];
|
||||||
if (fin < inicio) {
|
if (fin < inicio) {
|
||||||
$('#fecha_final').addClass('is-invalid');
|
$('#fecha_final').addClass('is-invalid');
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
if ($('select').find('option').length == 0) {
|
if ($('select').find('option').length == 0) {
|
||||||
error = true;
|
error = true;
|
||||||
$('.tipo_aviso').addClass('is-invalid');
|
$('.tipo_aviso').addClass('is-invalid');
|
||||||
} else {
|
} else {
|
||||||
$('.tipo_aviso').removeClass('is-invalid');
|
$('.tipo_aviso').removeClass('is-invalid');
|
||||||
}
|
}
|
||||||
if (error) {
|
if (error) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
$('#tipo_box option').prop('selected', true);
|
$('#tipo_box option').prop('selected', true);
|
||||||
$('#usuario_box option').prop('selected', true);
|
$('#usuario_box option').prop('selected', true);
|
||||||
$('#formaModal').prp('action', './action/action_avisos_update.php');
|
$('#formaModal').prp('action', './action/action_avisos_update.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
114
base.php
114
base.php
@@ -1,58 +1,58 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'class/c_login.php';
|
require_once 'class/c_login.php';
|
||||||
require_once 'include/bd_pdo.php';
|
require_once 'include/bd_pdo.php';
|
||||||
|
|
||||||
if(!isset($_SESSION['user'])){
|
if(!isset($_SESSION['user'])){
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
$user->access('usuarios');
|
$user->access('usuarios');
|
||||||
if(!$user->admin && $user->acceso == 'n'){
|
if(!$user->admin && $user->acceso == 'n'){
|
||||||
header('Location: main.php?error=1');
|
header('Location: main.php?error=1');
|
||||||
}else{
|
}else{
|
||||||
$user->print_to_log('Base');
|
$user->print_to_log('Base');
|
||||||
}
|
}
|
||||||
$fac = $user->facultad['facultad_id'] ?? -1;
|
$fac = $user->facultad['facultad_id'] ?? -1;
|
||||||
if($user->admin){
|
if($user->admin){
|
||||||
$fac=null;
|
$fac=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>Base</title>
|
<title>Base</title>
|
||||||
<?php
|
<?php
|
||||||
include 'import/html_css_files.php';
|
include 'import/html_css_files.php';
|
||||||
?>
|
?>
|
||||||
<script src="js/messages.js" defer></script>
|
<script src="js/messages.js" defer></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
include "import/html_header.php";
|
include "import/html_header.php";
|
||||||
html_header(
|
html_header(
|
||||||
"PROFESORES",
|
"PROFESORES",
|
||||||
"Gestión de Checador "
|
"Gestión de Checador "
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
<main class="content marco">
|
<main class="content marco">
|
||||||
</main>
|
</main>
|
||||||
<?php
|
<?php
|
||||||
include "import/html_footer.php";
|
include "import/html_footer.php";
|
||||||
?>
|
?>
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="js/bootstrap/bootstrap.min.js"></script>
|
<script src="js/bootstrap/bootstrap.min.js"></script>
|
||||||
<?php
|
<?php
|
||||||
require_once 'js/messages.php';
|
require_once 'js/messages.php';
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
276
bypass.php
276
bypass.php
@@ -1,139 +1,139 @@
|
|||||||
<?php
|
<?php
|
||||||
if (isset($_GET["error"]) && is_numeric($_GET["error"])) {
|
if (isset($_GET["error"]) && is_numeric($_GET["error"])) {
|
||||||
switch ($_GET["error"]) {
|
switch ($_GET["error"]) {
|
||||||
case 0:
|
case 0:
|
||||||
$errorDesc = "No se reciberon datos.";
|
$errorDesc = "No se reciberon datos.";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
$errorDesc = "El usuario y/o contraseña son incorrectos.";
|
$errorDesc = "El usuario y/o contraseña son incorrectos.";
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$errorDesc = "El usuario no tiene permisos de ingresar.";
|
$errorDesc = "El usuario no tiene permisos de ingresar.";
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$errorDesc = "El usuario y/o contraseña son incorrectos.";
|
$errorDesc = "El usuario y/o contraseña son incorrectos.";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="es" prefix="og: http://ogp.me/ns#">
|
<html lang="es" prefix="og: http://ogp.me/ns#">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<title>.: Administrador de checador :.</title>
|
<title>.: Administrador de checador :.</title>
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<link rel="icon" type="image/png" href="imagenes/favicon.png" />
|
<link rel="icon" type="image/png" href="imagenes/favicon.png" />
|
||||||
<link rel="stylesheet" href="css/bootstrap-ulsa.min.css" type="text/css">
|
<link rel="stylesheet" href="css/bootstrap-ulsa.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="css/indivisa.css" type="text/css">
|
<link rel="stylesheet" href="css/indivisa.css" type="text/css">
|
||||||
<link rel="stylesheet" href="css/sgi.css?rand=<?= rand() ?>" type="text/css">
|
<link rel="stylesheet" href="css/sgi.css?rand=<?= rand() ?>" type="text/css">
|
||||||
<link rel="stylesheet" href="css/index.css" type="text/css">
|
<link rel="stylesheet" href="css/index.css" type="text/css">
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<!-- HEADER -->
|
<!-- HEADER -->
|
||||||
<?php include "import/html_header.php";
|
<?php include "import/html_header.php";
|
||||||
html_header("Checador inicio de sesión"); ?>
|
html_header("Checador inicio de sesión"); ?>
|
||||||
<main class="container-fluid content d-flex justify-content-center align-items-center">
|
<main class="container-fluid content d-flex justify-content-center align-items-center">
|
||||||
<div class="logSize p-5 bg-white defaultShadow">
|
<div class="logSize p-5 bg-white defaultShadow">
|
||||||
<div class="row mb-4">
|
<div class="row mb-4">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<h1 class="mb-1">Iniciar sesión</h1>
|
<h1 class="mb-1">Iniciar sesión</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<form method="post" action="action/force_session.php" id="session">
|
<form method="post" action="action/force_session.php" id="session">
|
||||||
<div class="row user">
|
<div class="row user">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="text-center font-weight-bold text-info">Utiliza tu usuario y contraseña institucionales</p>
|
<p class="text-center font-weight-bold text-info">Utiliza tu usuario y contraseña institucionales</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row user">
|
<div class="form-group row user">
|
||||||
<div class="input-group px-4">
|
<div class="input-group px-4">
|
||||||
<div class="input-group-prepend secondary">
|
<div class="input-group-prepend secondary">
|
||||||
<div class="input-group-text bg-primary text-white"><i class="ing-usuario ing-fw"></i></div>
|
<div class="input-group-text bg-primary text-white"><i class="ing-usuario ing-fw"></i></div>
|
||||||
</div>
|
</div>
|
||||||
<input class="form-control form-control-lg" type="text" autocomplete="username" placeholder="Usuario (ad)" id="username" name="username" value="" autofocus="true" maxlength="10" />
|
<input class="form-control form-control-lg" type="text" autocomplete="username" placeholder="Usuario (ad)" id="username" name="username" value="" autofocus="true" maxlength="10" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row user">
|
<div class="form-group row user">
|
||||||
<div class="input-group mb-2 px-4">
|
<div class="input-group mb-2 px-4">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<div class="input-group-text bg-primary text-white"><i class="ing-pass ing-fw"></i></div>
|
<div class="input-group-text bg-primary text-white"><i class="ing-pass ing-fw"></i></div>
|
||||||
</div>
|
</div>
|
||||||
<input class="form-control form-control-lg" type="password" autocomplete="current-password" placeholder="Contraseña" id="passwd" name="passwd" value="" maxlength="50" />
|
<input class="form-control form-control-lg" type="password" autocomplete="current-password" placeholder="Contraseña" id="passwd" name="passwd" value="" maxlength="50" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Usuario -->
|
<!-- Usuario -->
|
||||||
<div class="form-group row" id="cold-bypass">
|
<div class="form-group row" id="cold-bypass">
|
||||||
<div class="input-group mb-2 px-4">
|
<div class="input-group mb-2 px-4">
|
||||||
<div id="dlUsuario" class="datalist datalist-select mb-1 w-100">
|
<div id="dlUsuario" class="datalist datalist-select mb-1 w-100">
|
||||||
<div class="datalist-input">Selecciona un usuario</div>
|
<div class="datalist-input">Selecciona un usuario</div>
|
||||||
<span class="ing-buscar icono"></span>
|
<span class="ing-buscar icono"></span>
|
||||||
<ul style="display:none">
|
<ul style="display:none">
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<input type="hidden" id="user" name="usuario" value="">
|
<input type="hidden" id="user" name="usuario" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="error">
|
<div class="error">
|
||||||
<?php if (isset($_GET["error"])) { ?>
|
<?php if (isset($_GET["error"])) { ?>
|
||||||
<p class="text-danger text-center font-weight-bold">¡ERROR! <?= $errorDesc ?></p>
|
<p class="text-danger text-center font-weight-bold">¡ERROR! <?= $errorDesc ?></p>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-center">
|
<p class="text-center">
|
||||||
<button type="submit" class="btn btn-lg btn-outline-primary btn-ing arrow">Ingresar</button>
|
<button type="submit" class="btn btn-lg btn-outline-primary btn-ing arrow">Ingresar</button>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<!--- FOOTER--->
|
<!--- FOOTER--->
|
||||||
<?php require_once("import/html_footer.php"); ?>
|
<?php require_once("import/html_footer.php"); ?>
|
||||||
|
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="js/bootstrap/bootstrap.min.js"></script>
|
<script src="js/bootstrap/bootstrap.min.js"></script>
|
||||||
<script src="js/bootstrap/popper.min.js"></script>
|
<script src="js/bootstrap/popper.min.js"></script>
|
||||||
<script src="js/sidebarmenu.js"></script>
|
<script src="js/sidebarmenu.js"></script>
|
||||||
<script src="js/datalist.js"></script>
|
<script src="js/datalist.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$("#cold-bypass").hide();
|
$("#cold-bypass").hide();
|
||||||
// on submit, prevent default
|
// on submit, prevent default
|
||||||
$("#session").submit(function(e) {
|
$("#session").submit(function(e) {
|
||||||
if ($("#user").val() != "") {
|
if ($("#user").val() != "") {
|
||||||
$(this).unbind('submit').submit();
|
$(this).unbind('submit').submit();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
// dlUsuario has a value force session and redirect to main.php
|
// dlUsuario has a value force session and redirect to main.php
|
||||||
// get the form data
|
// get the form data
|
||||||
var formData = {
|
var formData = {
|
||||||
'username': $('input[name=username]').val(),
|
'username': $('input[name=username]').val(),
|
||||||
'passwd': $('input[name=passwd]').val(),
|
'passwd': $('input[name=passwd]').val(),
|
||||||
};
|
};
|
||||||
|
|
||||||
$.post("action/action_usuario.php", formData, function(data) {
|
$.post("action/action_usuario.php", formData, function(data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
$(".error").html("");
|
$(".error").html("");
|
||||||
if (data == "error") {
|
if (data == "error") {
|
||||||
$(".error").html("<p class='text-danger text-center font-weight-bold'>¡ERROR! El usuario y/o contraseña son incorrectos.</p>");
|
$(".error").html("<p class='text-danger text-center font-weight-bold'>¡ERROR! El usuario y/o contraseña son incorrectos.</p>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$("#cold-bypass").show();
|
$("#cold-bypass").show();
|
||||||
data.forEach(function(element) {
|
data.forEach(function(element) {
|
||||||
// console.log(element);
|
// console.log(element);
|
||||||
$("#dlUsuario ul").append(`<li class="not-selectable" data-id="${element.id}">${element.facultad}</li>`);
|
$("#dlUsuario ul").append(`<li class="not-selectable" data-id="${element.id}">${element.facultad}</li>`);
|
||||||
element.usuarios.forEach(function(usuario) {
|
element.usuarios.forEach(function(usuario) {
|
||||||
$("#dlUsuario ul").append(`<li data-id="${usuario.id}">${usuario.username}</li>`);
|
$("#dlUsuario ul").append(`<li data-id="${usuario.id}">${usuario.username}</li>`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// hide username and password
|
// hide username and password
|
||||||
$(".user").hide();
|
$(".user").hide();
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
1624
carreras.php
1624
carreras.php
File diff suppressed because it is too large
Load Diff
@@ -1,73 +1,73 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Objeto para leer y escribir datos de log de intentos de asistencia realizadas por el usuario
|
* Objeto para leer y escribir datos de log de intentos de asistencia realizadas por el usuario
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace classes;
|
namespace classes;
|
||||||
|
|
||||||
define("MAX_LINES", 200);
|
define("MAX_LINES", 200);
|
||||||
class LogAsistencias
|
class LogAsistencias
|
||||||
{
|
{
|
||||||
//put your code here
|
//put your code here
|
||||||
private $file, $month, $year;
|
private $file, $month, $year;
|
||||||
private $dir;
|
private $dir;
|
||||||
|
|
||||||
function __construct($ruta = null)
|
function __construct($ruta = null)
|
||||||
{
|
{
|
||||||
// die ruta
|
// die ruta
|
||||||
$this->month = date("m");
|
$this->month = date("m");
|
||||||
$this->year = date("Y");
|
$this->year = date("Y");
|
||||||
$this->dir = ($ruta ?? '') . "log/";
|
$this->dir = ($ruta ?? '') . "log/";
|
||||||
$this->updateFilename();
|
$this->updateFilename();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setMes(string $mes)
|
function setMes(string $mes)
|
||||||
{
|
{
|
||||||
$this->month = $mes;
|
$this->month = $mes;
|
||||||
$this->updateFilename();
|
$this->updateFilename();
|
||||||
}
|
}
|
||||||
function setAno(string $ano)
|
function setAno(string $ano)
|
||||||
{
|
{
|
||||||
$this->year = $ano;
|
$this->year = $ano;
|
||||||
$this->updateFilename();
|
$this->updateFilename();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function updateFilename()
|
private function updateFilename()
|
||||||
{
|
{
|
||||||
$this->file = "asistencias_" . $this->year . "_" . $this->month . ".log";
|
$this->file = "asistencias_" . $this->year . "_" . $this->month . ".log";
|
||||||
}
|
}
|
||||||
private function cleanLog($text)
|
private function cleanLog($text)
|
||||||
{ //remueve || de los textos
|
{ //remueve || de los textos
|
||||||
return trim(str_ireplace("||", "", $text));
|
return trim(str_ireplace("||", "", $text));
|
||||||
}
|
}
|
||||||
|
|
||||||
function appendLog($claveULSA, $nombre, $desc)
|
function appendLog($claveULSA, $nombre, $desc)
|
||||||
{
|
{
|
||||||
$filename = $this->dir . $this->file;
|
$filename = $this->dir . $this->file;
|
||||||
if (!file_exists($this->dir)) {
|
if (!file_exists($this->dir)) {
|
||||||
mkdir($this->dir, 0755, true);
|
mkdir($this->dir, 0755, true);
|
||||||
}
|
}
|
||||||
if (file_exists($this->dir)) {
|
if (file_exists($this->dir)) {
|
||||||
$data = date('Y-m-d H:i:s') . "||" . $this->cleanLog($claveULSA) . "||" . $this->cleanLog($desc) . "||" . $this->cleanLog($nombre) . "\n";
|
$data = date('Y-m-d H:i:s') . "||" . $this->cleanLog($claveULSA) . "||" . $this->cleanLog($desc) . "||" . $this->cleanLog($nombre) . "\n";
|
||||||
/*echo*/
|
/*echo*/
|
||||||
file_put_contents($filename, $data, FILE_APPEND);
|
file_put_contents($filename, $data, FILE_APPEND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function getLog($mes = "", $ano = "")
|
function getLog($mes = "", $ano = "")
|
||||||
{
|
{
|
||||||
if ($mes != "") $this->setMes($mes);
|
if ($mes != "") $this->setMes($mes);
|
||||||
if ($ano != "") $this->setAno($ano);
|
if ($ano != "") $this->setAno($ano);
|
||||||
$filename = $this->dir . $this->file;
|
$filename = $this->dir . $this->file;
|
||||||
if (file_exists($filename)) {
|
if (file_exists($filename)) {
|
||||||
//return array_slice(file ($filename , FILE_SKIP_EMPTY_LINES) , -10);
|
//return array_slice(file ($filename , FILE_SKIP_EMPTY_LINES) , -10);
|
||||||
$lines = file($filename, FILE_SKIP_EMPTY_LINES);
|
$lines = file($filename, FILE_SKIP_EMPTY_LINES);
|
||||||
//echo "antes: ".count($lines);
|
//echo "antes: ".count($lines);
|
||||||
if (count($lines) > MAX_LINES) {
|
if (count($lines) > MAX_LINES) {
|
||||||
$lines = array_slice($lines, MAX_LINES * (-1));
|
$lines = array_slice($lines, MAX_LINES * (-1));
|
||||||
}
|
}
|
||||||
//echo "despues: ".count($lines);
|
//echo "despues: ".count($lines);
|
||||||
return $lines;
|
return $lines;
|
||||||
} else
|
} else
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,130 +1,143 @@
|
|||||||
<?php
|
<?php
|
||||||
date_default_timezone_set('America/Mexico_City');
|
ini_set('display_errors', 1);
|
||||||
$currentTime = time();
|
ini_set('display_startup_errors', 1);
|
||||||
$endOfDay = strtotime('tomorrow') - 1;
|
error_reporting(E_ALL);
|
||||||
$remainingTime = $endOfDay - $currentTime;
|
|
||||||
|
date_default_timezone_set('America/Mexico_City');
|
||||||
session_set_cookie_params($remainingTime, '/', $_SERVER['HTTP_HOST'], false, true);
|
$currentTime = time();
|
||||||
|
$endOfDay = strtotime('tomorrow') - 1;
|
||||||
require_once($ruta ?? '') . "include/bd_pdo.php";
|
$remainingTime = $endOfDay - $currentTime;
|
||||||
require_once($ruta ?? '') . "class/c_logasistencia.php";
|
|
||||||
require_once($ruta ?? '') . "include/nusoap/nusoap.php";
|
session_set_cookie_params($remainingTime, '/', $_SERVER['HTTP_HOST'], false, true);
|
||||||
|
session_start();
|
||||||
session_start();
|
|
||||||
class Login
|
require_once($ruta ?? '') . "include/bd_pdo.php";
|
||||||
{
|
require_once($ruta ?? '') . "class/c_logasistencia.php";
|
||||||
public string $acceso;
|
require_once($ruta ?? '') . "vendor/autoload.php";
|
||||||
public function __construct(public array $user, public array $facultad, public array $rol, public bool $admin, public ?int $periodo, public bool $supervisor, public bool $jefe_carrera, public bool $profesor)
|
|
||||||
{
|
|
||||||
}
|
class Login
|
||||||
public function print_to_log(string $desc, array $old = null, array $new = null): void
|
{
|
||||||
{
|
public string $acceso;
|
||||||
$log = new classes\LogAsistencias($_ENV["RUTA_RAIZ"]);
|
public function __construct(public array $user, public array $facultad, public array $rol, public bool $admin, public ?int $periodo, public bool $supervisor, public bool $jefe_carrera, public bool $profesor)
|
||||||
if ($old)
|
{
|
||||||
$desc .= " |#| OLD:" . json_encode($old);
|
}
|
||||||
if ($new)
|
public function print_to_log(string $desc, array $old = null, array $new = null): void
|
||||||
$desc .= " |#| NEW:" . json_encode($new);
|
{
|
||||||
$log->appendLog($this->user["id"], $this->user["nombre"], $desc);
|
$log = new classes\LogAsistencias($_ENV["RUTA_RAIZ"]);
|
||||||
}
|
if ($old)
|
||||||
public function access(string $pagina = null): void
|
$desc .= " |#| OLD:" . json_encode($old);
|
||||||
{
|
if ($new)
|
||||||
if ($this->admin) {
|
$desc .= " |#| NEW:" . json_encode($new);
|
||||||
$this->acceso = "w";
|
$log->appendLog($this->user["id"], $this->user["nombre"], $desc);
|
||||||
return;
|
}
|
||||||
}
|
public function access(string $pagina = null): void
|
||||||
|
{
|
||||||
# print_r( $access );
|
|
||||||
$this->acceso = query(
|
global $db;
|
||||||
'SELECT tipo FROM PERMISO_VIEW WHERE ID = :usr AND PAGINA_RUTA ILIKE :ruta',
|
|
||||||
array(
|
if ($this->admin) {
|
||||||
':usr' => $this->user["id"],
|
$this->acceso = "w";
|
||||||
':ruta' => $pagina ?? substr(basename($_SERVER['PHP_SELF']), 0, -4)
|
return;
|
||||||
)
|
}
|
||||||
)["tipo"] ?? 'n';
|
|
||||||
}
|
# print_r( $access );
|
||||||
public function __toString(): string
|
$this->acceso = $db->query(
|
||||||
{
|
'SELECT tipo FROM PERMISO_VIEW WHERE ID = :usr AND PAGINA_RUTA ILIKE :ruta',
|
||||||
return "Usuario: {$this->user["nombre"]} ({$this->user["id"]}), Es admin: {$this->admin}, supervisor: {$this->supervisor}, jefe carrera: {$this->jefe_carrera}, profesor: {$this->profesor}";
|
array(
|
||||||
}
|
':usr' => $this->user["id"],
|
||||||
private static function validaUsuario($user, $pass): bool
|
':ruta' => $pagina ?? substr(basename($_SERVER['PHP_SELF']), 0, -4)
|
||||||
{
|
)
|
||||||
file_put_contents('php://stderr', $user);
|
)["tipo"] ?? 'n';
|
||||||
if (in_array($user, ['ad017045']) and $pass == "admin")
|
}
|
||||||
return true;
|
public function __toString(): string
|
||||||
$client = new nusoap_client('http://200.13.89.2/validacion.php?wsdl', 'wsdl');
|
{
|
||||||
$client->getError() and die('Error al crear el cliente: ' . $client->getError());
|
return "Usuario: {$this->user["nombre"]} ({$this->user["id"]}), Es admin: {$this->admin}, supervisor: {$this->supervisor}, jefe carrera: {$this->jefe_carrera}, profesor: {$this->profesor}";
|
||||||
$pass = utf8_decode($pass);
|
}
|
||||||
$result = $client->call("valida_user", array($user, $pass));
|
private static function validaUsuario($user, $pass): bool
|
||||||
$client->fault and die('Error al llamar al servicio: ' . $client->getError());
|
{
|
||||||
return $result;
|
file_put_contents('php://stderr', $user);
|
||||||
}
|
if ($user == 'ad017045' and $pass == "admin")
|
||||||
public static function validUser(string $user, string $pass): Login|array
|
return true;
|
||||||
{
|
|
||||||
if (!Login::validaUsuario($user, $pass)) {
|
$client = new nusoap_client('http://200.13.89.2/validacion.php?wsdl', 'wsdl');
|
||||||
return [
|
$client->soap_defencoding = 'UTF-8';
|
||||||
'error' => true,
|
$client->decode_utf8 = FALSE;
|
||||||
'msg' => 'Error al autenticar usuario'
|
|
||||||
];
|
$client->getError() and die('Error al crear el cliente: ' . $client->getError());
|
||||||
}
|
// $pass = utf8_decode($pass);
|
||||||
global $db;
|
$result = $client->call("valida_user", array($user, $pass));
|
||||||
|
$client->fault and die('Error al llamar al servicio: ' . $client->getError());
|
||||||
if ($db->has("FS_VALIDACLAVEULSA('$user')")) {
|
return $result;
|
||||||
#die (Login::validaUsuario($user, $pass));
|
}
|
||||||
$fs_validaclaveulsa = $db->querySingle(
|
public static function validUser(string $user, string $pass): Login|array
|
||||||
'SELECT * FROM FS_VALIDACLAVEULSA(?)',
|
{
|
||||||
[$user]
|
if (Login::validaUsuario($user, $pass) === false) {
|
||||||
);
|
return [
|
||||||
|
'error' => true,
|
||||||
$user = array(
|
'msg' => 'Error al autenticar usuario'
|
||||||
'id' => $fs_validaclaveulsa["id"],
|
];
|
||||||
'nombre' => $fs_validaclaveulsa["nombre"],
|
}
|
||||||
);
|
global $db;
|
||||||
$facultad = array(
|
|
||||||
'facultad_id' => $fs_validaclaveulsa["facultad_id"],
|
if ($db->has("FS_VALIDACLAVEULSA('$user')")) {
|
||||||
'facultad' => $fs_validaclaveulsa["facultad"],
|
#die (Login::validaUsuario($user, $pass));
|
||||||
);
|
$fs_validaclaveulsa = $db->querySingle(
|
||||||
$rol = array(
|
'SELECT * FROM FS_VALIDACLAVEULSA(?)',
|
||||||
'id' => $fs_validaclaveulsa["rol_id"],
|
[$user]
|
||||||
'rol' => $fs_validaclaveulsa["rol"]
|
);
|
||||||
);
|
|
||||||
$supervisor = $db
|
$user = array(
|
||||||
->join('rol', 'rol.rol_id = usuario.rol_id')
|
'id' => $fs_validaclaveulsa["id"],
|
||||||
->where('usuario_id', $user["id"])
|
'nombre' => $fs_validaclaveulsa["nombre"],
|
||||||
->where('rol.rol_titulo', 'Supervisor')
|
'clave' => $db->where('usuario_id', $fs_validaclaveulsa["id"])->getOne("usuario")["usuario_clave"]
|
||||||
->has('usuario');
|
);
|
||||||
$jefe_carrera = $db->where('usuario_id', $user["id"])->has('usuario_carrera');
|
$facultad = array(
|
||||||
|
'facultad_id' => $fs_validaclaveulsa["facultad_id"],
|
||||||
$admin = $fs_validaclaveulsa["is_admin"];
|
'facultad' => $fs_validaclaveulsa["facultad"],
|
||||||
$periodo = $fs_validaclaveulsa["periodo_id"];
|
);
|
||||||
|
$rol = array(
|
||||||
return new Login($user, $facultad, $rol, $admin, $periodo, $supervisor, $jefe_carrera, false);
|
'id' => $fs_validaclaveulsa["rol_id"],
|
||||||
} else if ($db->where('profesor_clave', preg_replace('/^do0*/', '', $user))->has("profesor")) {
|
'rol' => $fs_validaclaveulsa["rol"]
|
||||||
$profesor = $db->where('profesor_clave', preg_replace('/^do0*/', '', $user))->getOne("profesor");
|
);
|
||||||
$user = array(
|
$supervisor = $db
|
||||||
'id' => $profesor["profesor_clave"],
|
->join('rol', 'rol.rol_id = usuario.rol_id')
|
||||||
'nombre' => $profesor["profesor_nombre"],
|
->where('usuario_id', $user["id"])
|
||||||
);
|
->where('rol.rol_titulo', 'Supervisor')
|
||||||
$facultad = $rol = array(
|
->has('usuario');
|
||||||
'facultad_id' => null,
|
$jefe_carrera = $db->where('usuario_id', $user["id"])->has('usuario_carrera');
|
||||||
'facultad' => 'Docente',
|
|
||||||
);
|
$admin = $fs_validaclaveulsa["is_admin"];
|
||||||
|
$periodo = $fs_validaclaveulsa["periodo_id"];
|
||||||
$supervisor = false;
|
|
||||||
$jefe_carrera = false;
|
return new Login($user, $facultad, $rol, $admin, $periodo, $supervisor, $jefe_carrera, false);
|
||||||
$admin = false;
|
} else if ($db->where('profesor_clave', preg_replace('/^do0*/', '', $user), 'ilike')->has("profesor")) {
|
||||||
$periodo = null;
|
$profesor = $db->where('profesor_clave', preg_replace('/^do0*/', '', $user), 'ilike')->getOne("profesor");
|
||||||
// CREATE A COOKIE FOR THE REST OF THE day for example: 23:00 then duration will be 1 hour
|
$user = array(
|
||||||
setcookie("profesor", $user["id"], strtotime('today midnight') + 86400, "/");
|
'id' => $profesor["profesor_clave"],
|
||||||
return new Login($user, $facultad, $rol, $admin, $periodo, $supervisor, $jefe_carrera, true);
|
'nombre' => $profesor["profesor_nombre"],
|
||||||
} else
|
);
|
||||||
return [
|
$facultad = array(
|
||||||
'error' => true,
|
'facultad_id' => null,
|
||||||
'msg' => 'Usuario no encontrado'
|
'facultad' => null,
|
||||||
];
|
);
|
||||||
}
|
$rol = array(
|
||||||
public static function log_out(): void
|
'id' => null,
|
||||||
{
|
'rol' => 'Docente'
|
||||||
session_start();
|
);
|
||||||
session_destroy();
|
|
||||||
}
|
// CREATE A COOKIE FOR THE REST OF THE day for example: 23:00 then duration will be 1 hour
|
||||||
|
setcookie("profesor", $user["id"], strtotime('today midnight') + 86400, "/");
|
||||||
|
return new Login($user, $facultad, $rol, admin: false, periodo: null, supervisor: false, jefe_carrera: false, profesor: true);
|
||||||
|
} else
|
||||||
|
return [
|
||||||
|
'error' => true,
|
||||||
|
'msg' => 'Usuario no encontrado'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
public static function log_out(): void
|
||||||
|
{
|
||||||
|
session_start();
|
||||||
|
session_destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
class Menu {
|
class Menu {
|
||||||
private array $menu = [];
|
private array $menu = [];
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->conn = new Connection();
|
$this->conn = new Connection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMenu() {
|
public function getMenu() {
|
||||||
$sql = "SELECT * FROM menu";
|
$sql = "SELECT * FROM menu";
|
||||||
$result = $this->conn->getConnection()->query($sql);
|
$result = $this->conn->getConnection()->query($sql);
|
||||||
$this->menu = $result->fetchAll();
|
$this->menu = $result->fetchAll();
|
||||||
return $this->menu;
|
return $this->menu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,57 +1,57 @@
|
|||||||
<?php
|
<?php
|
||||||
define("DB_HOST",($_SERVER["SERVER_NAME"] == "localhost") ? "200.13.89.27" : "localhost");
|
define("DB_HOST",($_SERVER["SERVER_NAME"] == "localhost") ? "200.13.89.27" : "localhost");
|
||||||
define('DB_USER', 'checa_usr');
|
define('DB_USER', 'checa_usr');
|
||||||
define('DB_PASS', 'Cr0n0m3tr4d0&$');
|
define('DB_PASS', 'Cr0n0m3tr4d0&$');
|
||||||
define('DB_NAME', 'checador');
|
define('DB_NAME', 'checador');
|
||||||
|
|
||||||
class Connection {
|
class Connection {
|
||||||
private $conn;
|
private $conn;
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->conn = new PDO(
|
$this->conn = new PDO(
|
||||||
"pgsql:host=".DB_HOST.";dbname=".DB_NAME, DB_USER, DB_PASS,
|
"pgsql:host=".DB_HOST.";dbname=".DB_NAME, DB_USER, DB_PASS,
|
||||||
array(PDO::ATTR_PERSISTENT => true)
|
array(PDO::ATTR_PERSISTENT => true)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public function getConnection() {
|
public function getConnection() {
|
||||||
return $this->conn;
|
return $this->conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function query() {}
|
public function query() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$pdo = new PDO(
|
$pdo = new PDO(
|
||||||
"pgsql:host=" . DB_HOST . ";dbname=" . DB_NAME, DB_USER, DB_PASS,
|
"pgsql:host=" . DB_HOST . ";dbname=" . DB_NAME, DB_USER, DB_PASS,
|
||||||
array(
|
array(
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
PDO::ATTR_PERSISTENT => true
|
PDO::ATTR_PERSISTENT => true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
print "Error!: " . $e->getMessage() . "<br/>";
|
print "Error!: " . $e->getMessage() . "<br/>";
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
function SQL(string $sql, array $params = [])
|
function SQL(string $sql, array $params = [])
|
||||||
{
|
{
|
||||||
global $pdo;
|
global $pdo;
|
||||||
$stmt = $pdo->prepare($sql);
|
$stmt = $pdo->prepare($sql);
|
||||||
foreach ($params as $key => $value) {
|
foreach ($params as $key => $value) {
|
||||||
// bind Parameter
|
// bind Parameter
|
||||||
$stmt->bindParam($key, $value);
|
$stmt->bindParam($key, $value);
|
||||||
}
|
}
|
||||||
$stmt->execute($params);
|
$stmt->execute($params);
|
||||||
return $stmt->fetchAll();
|
return $stmt->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
function filter_by(array $array, array $fields): array
|
function filter_by(array $array, array $fields): array
|
||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($array as $key => $value) {
|
foreach ($array as $key => $value) {
|
||||||
$result[$key] = [];
|
$result[$key] = [];
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$result[$key][$field] = $value[$field];
|
$result[$key][$field] = $value[$field];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,46 +1,46 @@
|
|||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: 'indivisa-text';
|
font-family: 'indivisa-text';
|
||||||
/*background-image: linear-gradient(rgba(0,29,104, 0.3), rgba(0,29,104, 0.3)), url('../imagenes/fondochecador.png');*/
|
/*background-image: linear-gradient(rgba(0,29,104, 0.3), rgba(0,29,104, 0.3)), url('../imagenes/fondochecador.png');*/
|
||||||
background-image: url('../imagenes/fondochecador.jpg');
|
background-image: url('../imagenes/fondochecador.jpg');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-attachment: fixed;
|
background-attachment: fixed;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hora{font-size: 4rem; border-right: 2px solid #d21034; line-height: 1.1; padding-bottom: 8px;}
|
.hora{font-size: 4rem; border-right: 2px solid #d21034; line-height: 1.1; padding-bottom: 8px;}
|
||||||
.fecha{font-size: 1.9rem; line-height: 1.2em; }
|
.fecha{font-size: 1.9rem; line-height: 1.2em; }
|
||||||
.facultad{font-size: 1.5rem; font-weight: bold; color: #aaa;}
|
.facultad{font-size: 1.5rem; font-weight: bold; color: #aaa;}
|
||||||
.checa-box{width:800px; min-height: 380px; -webkit-box-shadow: 0px 0px 5px 1px rgba(150,150,150,0.2); -moz-box-shadow: 0px 0px 5px 1px rgba(150,150,150,0.2); box-shadow: 0px 0px 5px 1px rgba(150,150,150,0.2);}
|
.checa-box{width:800px; min-height: 380px; -webkit-box-shadow: 0px 0px 5px 1px rgba(150,150,150,0.2); -moz-box-shadow: 0px 0px 5px 1px rgba(150,150,150,0.2); box-shadow: 0px 0px 5px 1px rgba(150,150,150,0.2);}
|
||||||
|
|
||||||
h1, h2, h3 {letter-spacing: 1px; position: relative; color: #001e61;}
|
h1, h2, h3 {letter-spacing: 1px; position: relative; color: #001e61;}
|
||||||
.subtitle:before{ content: ''; position: absolute; bottom: -8px; left: 0; width: 80px; display: block; background: #d21034; height: 3px; }
|
.subtitle:before{ content: ''; position: absolute; bottom: -8px; left: 0; width: 80px; display: block; background: #d21034; height: 3px; }
|
||||||
|
|
||||||
.text-big{font-size:3.6rem;}
|
.text-big{font-size:3.6rem;}
|
||||||
#list-result{font-size:1.15rem;}
|
#list-result{font-size:1.15rem;}
|
||||||
#list-result li{margin:0.2em 0; border-bottom: 1px dashed #969696;}
|
#list-result li{margin:0.2em 0; border-bottom: 1px dashed #969696;}
|
||||||
|
|
||||||
.text-clave{ outline: none; color: #b7b7b7 !important; background: transparent; border: 1px solid #dbdcdd; border-radius: 5px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; font-size: 12px; font-weight: 300; vertical-align: middle; text-align:center; padding: 10px 20px;}
|
.text-clave{ outline: none; color: #b7b7b7 !important; background: transparent; border: 1px solid #dbdcdd; border-radius: 5px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; font-size: 12px; font-weight: 300; vertical-align: middle; text-align:center; padding: 10px 20px;}
|
||||||
.text-clave:focus{ color: #001d68 !important; border-color: #001d68;}
|
.text-clave:focus{ color: #001d68 !important; border-color: #001d68;}
|
||||||
.sin-servicio, .text-clave{font-size:1.7rem;}
|
.sin-servicio, .text-clave{font-size:1.7rem;}
|
||||||
.aviso{ font-size:120%;}
|
.aviso{ font-size:120%;}
|
||||||
.mensaje{ font-size: 7vh; }
|
.mensaje{ font-size: 7vh; }
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.hora{ font-size: 3.2rem;}
|
.hora{ font-size: 3.2rem;}
|
||||||
.fecha{font-size: 1.4rem;}
|
.fecha{font-size: 1.4rem;}
|
||||||
.checa-box{width:100%;}
|
.checa-box{width:100%;}
|
||||||
.text-big{font-size:3rem;}
|
.text-big{font-size:3rem;}
|
||||||
.sin-servicio, .text-clave{font-size:1.2rem;}
|
.sin-servicio, .text-clave{font-size:1.2rem;}
|
||||||
}
|
}
|
||||||
@media (max-width: 576px) {
|
@media (max-width: 576px) {
|
||||||
.hora{font-size: 2rem !important;}
|
.hora{font-size: 2rem !important;}
|
||||||
.fecha, .titulo{font-size: 1rem;}
|
.fecha, .titulo{font-size: 1rem;}
|
||||||
#logo{width: 75%;}
|
#logo{width: 75%;}
|
||||||
.facultad{font-size: 1.2rem}
|
.facultad{font-size: 1.2rem}
|
||||||
.text-big{font-size:2.8rem;}
|
.text-big{font-size:2.8rem;}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
18
css/custominputfile.min.css
vendored
18
css/custominputfile.min.css
vendored
@@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
jQuery Custom Input File Plugin - version 1.0
|
jQuery Custom Input File Plugin - version 1.0
|
||||||
Copyright 2014, Ángel Espro, www.aesolucionesweb.com.ar,
|
Copyright 2014, Ángel Espro, www.aesolucionesweb.com.ar,
|
||||||
Licence : GNU General Public License
|
Licence : GNU General Public License
|
||||||
|
|
||||||
Site: www.aesolucionesweb.com.ar/plugins/custom-input-file
|
Site: www.aesolucionesweb.com.ar/plugins/custom-input-file
|
||||||
|
|
||||||
You must not remove these lines. Read gpl.txt for further legal information.
|
You must not remove these lines. Read gpl.txt for further legal information.
|
||||||
*/
|
*/
|
||||||
.cif-file-picker{position:relative;width:380px;height:180px;padding:0;border:4px dashed rgba(0,0,0,.2);display:table-cell;vertical-align:middle;text-align:center;opacity:.5;box-sizing:border-box;-moz-box-sizing:border-box}.cif-icon-picker{background:url(cif-icons-20xy.png) 0 0 no-repeat;width:80px;height:60px;display:inline-block}.cif-file-picker h3{margin:0;font-size:20px;text-align:center}.cif-file-picker p{margin:0 0 10px 0;font-size:16px;text-align:center}.cif-file-picker:hover{opacity:1}.cif-file-picker.dragover:not(.inactive){border-color:#46be5e;opacity:1;box-shadow:0 0 50px rgba(0,0,0,.5)}.cif-file-picker.inactive{opacity:.2}.cif-file-picker.inactive.dragover{cursor:pointer}.cif-parent{position:relative;margin-bottom:10px}.foto-file-row .field-wr-int{position:relative}.cif-close{opacity:.5;text-indent:-100000px;width:14px;height:14px;cursor:default;color:#555;background:url(cif-icons-20xy.png) 0px -60px no-repeat}.cif-file-container.cif-type-image .cif-close{top:0px;left:0px;position:absolute}.cif-close:hover{opacity:1}.cif-file-container.cif-container-all-type .cif-file-row{margin:10px 0}.cif-file-container.cif-container-all-type .cif-parent{max-width:380px;box-sizing:border-box;-moz-box-sizing:border-box;padding:10px 10px 10px 30px;border:1px solid #dfdfdf;background:#F4F4F4}.cif-file-container.cif-container-all-type .cif-all-type{font-size:13px;line-height:16px}.cif-file-container.cif-container-all-type .cif-close{top:50%;margin-top:-7px;left:5px;position:absolute}.cif-file-container.cif-container-all-type .cif-file-size{opacity:.8}.cif-file-container.cif-container-image-type .cif-file-row{border-bottom:1px solid #f2f2f2;padding:20px 0}.cif-file-container.cif-container-image-type .cif-parent{padding-top:30px}.cif-file-container.cif-container-image-type .cif-close{top:5px}.cif-img{max-height:300px;max-width:380px}#cif-msg-wr{font-size:13px;position:fixed;z-index:10000;top:100px;right:20px;max-width:50%;padding:15px;background:#fff;border:1px solid #dfdfdf;box-shadow:3px 3px 6px rgba(0,0,0,.5)}#cif-msg-wr .cif-msg-close{opacity:.5;position:absolute;right:0;top:0;width:16px;height:16px;text-indent:-100000px;background:url(cif-icons-20xy.png) 0 -75px no-repeat}#cif-msg-wr .cif-msg-close:hover{opacity:1}.cif-msg-icon{padding:0 10px;font-size:8px}.cif-msg-icon-error{background:url(cif-icons-20xy.png) 0 -120px no-repeat}.cif-msg-icon-ok{background:url(cif-icons-20xy.png) 0 -100px no-repeat}.cf-progressbar-wr{position:fixed;top:0;left:0;background:rgba(0,0,0,.7);width:100%;height:100%;z-index:50000}.cf-progressbar{height:12px;position:absolute;top:50%;margin-top:-6px;left:50%;margin-left:-125px;width:250px;background:#dadada;padding:2px;box-sizing:border-box;border:1px solid #000}.cf-progressbar>span{display:block;height:100%;background:rgb(43,194,83);background-image:url(bg-progress-bar.png);position:relative;transition:width 200ms;overflow:hidden}.jcrop-holder .preview-pane{display:block;position:absolute;z-index:2000;top:00px;left:102%;padding:6px;border:1px rgba(0,0,0,.4) solid;background-color:white;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:1px 1px 5px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:1px 1px 5px 2px rgba(0, 0, 0, 0.2);box-shadow:1px 1px 5px 2px rgba(0, 0, 0, 0.2)}.preview-pane .preview-container{overflow:hidden}
|
.cif-file-picker{position:relative;width:380px;height:180px;padding:0;border:4px dashed rgba(0,0,0,.2);display:table-cell;vertical-align:middle;text-align:center;opacity:.5;box-sizing:border-box;-moz-box-sizing:border-box}.cif-icon-picker{background:url(cif-icons-20xy.png) 0 0 no-repeat;width:80px;height:60px;display:inline-block}.cif-file-picker h3{margin:0;font-size:20px;text-align:center}.cif-file-picker p{margin:0 0 10px 0;font-size:16px;text-align:center}.cif-file-picker:hover{opacity:1}.cif-file-picker.dragover:not(.inactive){border-color:#46be5e;opacity:1;box-shadow:0 0 50px rgba(0,0,0,.5)}.cif-file-picker.inactive{opacity:.2}.cif-file-picker.inactive.dragover{cursor:pointer}.cif-parent{position:relative;margin-bottom:10px}.foto-file-row .field-wr-int{position:relative}.cif-close{opacity:.5;text-indent:-100000px;width:14px;height:14px;cursor:default;color:#555;background:url(cif-icons-20xy.png) 0px -60px no-repeat}.cif-file-container.cif-type-image .cif-close{top:0px;left:0px;position:absolute}.cif-close:hover{opacity:1}.cif-file-container.cif-container-all-type .cif-file-row{margin:10px 0}.cif-file-container.cif-container-all-type .cif-parent{max-width:380px;box-sizing:border-box;-moz-box-sizing:border-box;padding:10px 10px 10px 30px;border:1px solid #dfdfdf;background:#F4F4F4}.cif-file-container.cif-container-all-type .cif-all-type{font-size:13px;line-height:16px}.cif-file-container.cif-container-all-type .cif-close{top:50%;margin-top:-7px;left:5px;position:absolute}.cif-file-container.cif-container-all-type .cif-file-size{opacity:.8}.cif-file-container.cif-container-image-type .cif-file-row{border-bottom:1px solid #f2f2f2;padding:20px 0}.cif-file-container.cif-container-image-type .cif-parent{padding-top:30px}.cif-file-container.cif-container-image-type .cif-close{top:5px}.cif-img{max-height:300px;max-width:380px}#cif-msg-wr{font-size:13px;position:fixed;z-index:10000;top:100px;right:20px;max-width:50%;padding:15px;background:#fff;border:1px solid #dfdfdf;box-shadow:3px 3px 6px rgba(0,0,0,.5)}#cif-msg-wr .cif-msg-close{opacity:.5;position:absolute;right:0;top:0;width:16px;height:16px;text-indent:-100000px;background:url(cif-icons-20xy.png) 0 -75px no-repeat}#cif-msg-wr .cif-msg-close:hover{opacity:1}.cif-msg-icon{padding:0 10px;font-size:8px}.cif-msg-icon-error{background:url(cif-icons-20xy.png) 0 -120px no-repeat}.cif-msg-icon-ok{background:url(cif-icons-20xy.png) 0 -100px no-repeat}.cf-progressbar-wr{position:fixed;top:0;left:0;background:rgba(0,0,0,.7);width:100%;height:100%;z-index:50000}.cf-progressbar{height:12px;position:absolute;top:50%;margin-top:-6px;left:50%;margin-left:-125px;width:250px;background:#dadada;padding:2px;box-sizing:border-box;border:1px solid #000}.cf-progressbar>span{display:block;height:100%;background:rgb(43,194,83);background-image:url(bg-progress-bar.png);position:relative;transition:width 200ms;overflow:hidden}.jcrop-holder .preview-pane{display:block;position:absolute;z-index:2000;top:00px;left:102%;padding:6px;border:1px rgba(0,0,0,.4) solid;background-color:white;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:1px 1px 5px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:1px 1px 5px 2px rgba(0, 0, 0, 0.2);box-shadow:1px 1px 5px 2px rgba(0, 0, 0, 0.2)}.preview-pane .preview-container{overflow:hidden}
|
||||||
378
css/richtext.css
378
css/richtext.css
@@ -1,190 +1,190 @@
|
|||||||
.richText {
|
.richText {
|
||||||
position: relative;
|
position: relative;
|
||||||
border: 1px solid #D6D8D8;
|
border: 1px solid #D6D8D8;
|
||||||
background: #D6D8D8;
|
background: #D6D8D8;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul {
|
.richText .richText-toolbar ul {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: left;/*center*/
|
justify-content: left;/*center*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul li {
|
.richText .richText-toolbar ul li {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul li a {
|
.richText .richText-toolbar ul li a {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 0.25rem 0.5rem;
|
padding: 0.25rem 0.5rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
-webkit-transition: color 0.4s;
|
-webkit-transition: color 0.4s;
|
||||||
-moz-transition: color 0.4s;
|
-moz-transition: color 0.4s;
|
||||||
transition: color 0.4s;
|
transition: color 0.4s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul li a:hover {
|
.richText .richText-toolbar ul li a:hover {
|
||||||
color: #001d68;
|
color: #001d68;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul li a .fa, .richText .richText-toolbar ul li a .fas, .richText .richText-toolbar ul li a .far, .richText .richText-toolbar ul li a svg {
|
.richText .richText-toolbar ul li a .fa, .richText .richText-toolbar ul li a .fas, .richText .richText-toolbar ul li a .far, .richText .richText-toolbar ul li a svg {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul li[data-disable="true"] {
|
.richText .richText-toolbar ul li[data-disable="true"] {
|
||||||
opacity: 0.1;
|
opacity: 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul li[data-disable="true"] a {
|
.richText .richText-toolbar ul li[data-disable="true"] a {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul li:not([data-disable="true"]).is-selected .richText-dropdown-outer {
|
.richText .richText-toolbar ul li:not([data-disable="true"]).is-selected .richText-dropdown-outer {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul:after {
|
.richText .richText-toolbar ul:after {
|
||||||
display: block;
|
display: block;
|
||||||
content: "";
|
content: "";
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar:last-child {
|
.richText .richText-toolbar:last-child {
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar:after {
|
.richText .richText-toolbar:after {
|
||||||
display: block;
|
display: block;
|
||||||
clear: both;
|
clear: both;
|
||||||
content: "";
|
content: "";
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-form select {cursor: pointer;}
|
.richText .richText-form select {cursor: pointer;}
|
||||||
|
|
||||||
.richText .richText-editor {
|
.richText .richText-editor {
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
height: 15rem;
|
height: 15rem;
|
||||||
outline: none;
|
outline: none;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul li a .richText-dropdown-outer {
|
.richText .richText-toolbar ul li a .richText-dropdown-outer {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul li a .richText-dropdown-outer .richText-dropdown {
|
.richText .richText-toolbar ul li a .richText-dropdown-outer .richText-dropdown {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index:10;
|
z-index:10;
|
||||||
display: block;
|
display: block;
|
||||||
margin: 3% auto 0 auto;
|
margin: 3% auto 0 auto;
|
||||||
background-color: #D6D8D8;
|
background-color: #D6D8D8;
|
||||||
border: 0.1rem solid #777777;
|
border: 0.1rem solid #777777;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
padding: 0.75rem;
|
padding: 0.75rem;
|
||||||
padding-top: 1.5rem;
|
padding-top: 1.5rem;
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
-webkit-box-shadow: 0 0 5px 0 #777777;
|
-webkit-box-shadow: 0 0 5px 0 #777777;
|
||||||
-moz-box-shadow: 0 0 5px 0 #777777;
|
-moz-box-shadow: 0 0 5px 0 #777777;
|
||||||
box-shadow: 0 0 5px 0 #777777;
|
box-shadow: 0 0 5px 0 #777777;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul li a .richText-dropdown-outer .richText-dropdown .richText-dropdown-close {
|
.richText .richText-toolbar ul li a .richText-dropdown-outer .richText-dropdown .richText-dropdown-close {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0.25rem;
|
top: 0.25rem;
|
||||||
right: 0.5rem;
|
right: 0.5rem;
|
||||||
color: #CE0E2D;
|
color: #CE0E2D;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul li a .richText-dropdown-outer .richText-dropdown .richText-dropdown-close:hover {
|
.richText .richText-toolbar ul li a .richText-dropdown-outer .richText-dropdown .richText-dropdown-close:hover {
|
||||||
opacity: 0.5
|
opacity: 0.5
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText-form-item{
|
.richText-form-item{
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-form label {
|
.richText .richText-form label {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: left;/*center*/
|
align-items: left;/*center*/
|
||||||
padding: 0.375rem 0.75rem;
|
padding: 0.375rem 0.75rem;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
text-align: left;/*center*/
|
text-align: left;/*center*/
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-form input[type="text"], .richText .richText-form input[type="file"], .richText .richText-form input[type="number"], .richText .richText-form select {
|
.richText .richText-form input[type="text"], .richText .richText-form input[type="file"], .richText .richText-form input[type="number"], .richText .richText-form select {
|
||||||
display: block;
|
display: block;
|
||||||
height: calc(1.5em + 0.75rem + 2px);
|
height: calc(1.5em + 0.75rem + 2px);
|
||||||
padding: 0.375rem 0.75rem;
|
padding: 0.375rem 0.75rem;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
color: #777777;
|
color: #777777;
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
background-clip: padding-box;
|
background-clip: padding-box;
|
||||||
border: 1px solid #D6D8DB;
|
border: 1px solid #D6D8DB;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
||||||
position: relative;
|
position: relative;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
width: 1%;
|
width: 1%;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown {list-style: none;}
|
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown {list-style: none;}
|
||||||
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown li {display: block;float: none;font-family: Calibri,Verdana,Helvetica,sans-serif;}
|
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown li {display: block;float: none;font-family: Calibri,Verdana,Helvetica,sans-serif;}
|
||||||
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown li a {display: block;padding: 10px 15px;border-bottom: #EFEFEF solid 1px;}
|
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown li a {display: block;padding: 10px 15px;border-bottom: #EFEFEF solid 1px;}
|
||||||
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown li a:hover {background-color: #FFFFFF;}
|
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown li a:hover {background-color: #FFFFFF;}
|
||||||
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown li.inline {margin: 10px 6px;float: left;}
|
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown li.inline {margin: 10px 6px;float: left;}
|
||||||
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown li.inline a {display: block;padding: 0;margin: 0;border: none;-webkit-border-radius: 50%;-moz-border-radius: 50%;border-radius: 50%;-webkit-box-shadow: 0 0 10px 0 #999;-moz-box-shadow: 0 0 10px 0 #999;box-shadow: 0 0 10px 0 #999;}
|
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown li.inline a {display: block;padding: 0;margin: 0;border: none;-webkit-border-radius: 50%;-moz-border-radius: 50%;border-radius: 50%;-webkit-box-shadow: 0 0 10px 0 #999;-moz-box-shadow: 0 0 10px 0 #999;box-shadow: 0 0 10px 0 #999;}
|
||||||
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown li.inline a span {display: block;height: 30px;width: 30px;-webkit-border-radius: 50%;-moz-border-radius: 50%;border-radius: 50%;}
|
.richText .richText-toolbar ul li a .richText-dropdown-outer ul.richText-dropdown li.inline a span {display: block;height: 30px;width: 30px;-webkit-border-radius: 50%;-moz-border-radius: 50%;border-radius: 50%;}
|
||||||
|
|
||||||
|
|
||||||
.richText .richText-undo, .richText .richText-redo {
|
.richText .richText-undo, .richText .richText-redo {
|
||||||
float: left;
|
float: left;
|
||||||
display: block;
|
display: block;
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-undo.is-disabled, .richText .richText-redo.is-disabled {
|
.richText .richText-undo.is-disabled, .richText .richText-redo.is-disabled {
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.richText .richText-help {
|
.richText .richText-help {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
.richText .richText-initial {margin-bottom: -4px;padding: 10px;background-color: #282828;border: none;color: #33FF33;font-family: Monospace,Calibri,Verdana,Helvetica,sans-serif;max-width: 100%;min-width: 100%;width: 100%;min-height: 400px;height: 400px;}
|
.richText .richText-initial {margin-bottom: -4px;padding: 10px;background-color: #282828;border: none;color: #33FF33;font-family: Monospace,Calibri,Verdana,Helvetica,sans-serif;max-width: 100%;min-width: 100%;width: 100%;min-height: 400px;height: 400px;}
|
||||||
.richText .richText-editor ul, .richText .richText-editor ol {margin: 10px 25px;}
|
.richText .richText-editor ul, .richText .richText-editor ol {margin: 10px 25px;}
|
||||||
.richText .richText-editor:focus {border-left: #3498db solid 2px;}
|
.richText .richText-editor:focus {border-left: #3498db solid 2px;}
|
||||||
.richText .richText-editor table {margin: 10px 0;border-spacing: 0;width: 100%;}
|
.richText .richText-editor table {margin: 10px 0;border-spacing: 0;width: 100%;}
|
||||||
.richText .richText-editor table td, .richText .richText-editor table th {padding: 10px;border: #EFEFEF solid 1px;}
|
.richText .richText-editor table td, .richText .richText-editor table th {padding: 10px;border: #EFEFEF solid 1px;}
|
||||||
.richText .richText-help {float: right;display: block;padding: 10px 15px;cursor: pointer;}
|
.richText .richText-help {float: right;display: block;padding: 10px 15px;cursor: pointer;}
|
||||||
.richText .richText-help-popup a {color: #3498db;text-decoration: underline;}
|
.richText .richText-help-popup a {color: #3498db;text-decoration: underline;}
|
||||||
.richText .richText-help-popup hr {margin: 10px auto 5px auto;border: none;border-top: #EFEFEF solid 1px;}
|
.richText .richText-help-popup hr {margin: 10px auto 5px auto;border: none;border-top: #EFEFEF solid 1px;}
|
||||||
.richText .richText-list.list-rightclick {position: absolute;background-color: #FAFAFA;border-right: #EFEFEF solid 1px;border-bottom: #EFEFEF solid 1px;}
|
.richText .richText-list.list-rightclick {position: absolute;background-color: #FAFAFA;border-right: #EFEFEF solid 1px;border-bottom: #EFEFEF solid 1px;}
|
||||||
.richText .richText-list.list-rightclick li {padding: 5px 7px;cursor: pointer;list-style: none;}*/
|
.richText .richText-list.list-rightclick li {padding: 5px 7px;cursor: pointer;list-style: none;}*/
|
||||||
468
demo.html
468
demo.html
@@ -1,235 +1,235 @@
|
|||||||
<link rel="stylesheet" href="css/indivisa.css">
|
<link rel="stylesheet" href="css/indivisa.css">
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-fb1"></i> ing-fb1
|
<i class="ing-fb1"></i> ing-fb1
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-fb2"></i> ing-fb2
|
<i class="ing-fb2"></i> ing-fb2
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-tw1"></i> ing-tw1
|
<i class="ing-tw1"></i> ing-tw1
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-tw2"></i> ing-tw2
|
<i class="ing-tw2"></i> ing-tw2
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-in1"></i> ing-in1
|
<i class="ing-in1"></i> ing-in1
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-in2"></i> ing-in2
|
<i class="ing-in2"></i> ing-in2
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-instra1"></i> ing-instra1
|
<i class="ing-instra1"></i> ing-instra1
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-instra2"></i> ing-instra2
|
<i class="ing-instra2"></i> ing-instra2
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-youtube"></i> ing-youtube
|
<i class="ing-youtube"></i> ing-youtube
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-telefono"></i> ing-telefono
|
<i class="ing-telefono"></i> ing-telefono
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-mail"></i> ing-mail
|
<i class="ing-mail"></i> ing-mail
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-link"></i> ing-link
|
<i class="ing-link"></i> ing-link
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-ubicacion"></i> ing-ubicacion
|
<i class="ing-ubicacion"></i> ing-ubicacion
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-puntos"></i> ing-puntos
|
<i class="ing-puntos"></i> ing-puntos
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-usuario"></i> ing-usuario
|
<i class="ing-usuario"></i> ing-usuario
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-pass"></i> ing-pass
|
<i class="ing-pass"></i> ing-pass
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-menu"></i> ing-menu
|
<i class="ing-menu"></i> ing-menu
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-salir"></i> ing-salir
|
<i class="ing-salir"></i> ing-salir
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-flecha"></i> ing-flecha
|
<i class="ing-flecha"></i> ing-flecha
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-cambiar"></i> ing-cambiar
|
<i class="ing-cambiar"></i> ing-cambiar
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-caret"></i> ing-caret
|
<i class="ing-caret"></i> ing-caret
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-aceptar"></i> ing-aceptar
|
<i class="ing-aceptar"></i> ing-aceptar
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-cancelar"></i> ing-cancelar
|
<i class="ing-cancelar"></i> ing-cancelar
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-mas"></i> ing-mas
|
<i class="ing-mas"></i> ing-mas
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-menos"></i> ing-menos
|
<i class="ing-menos"></i> ing-menos
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-editar"></i> ing-editar
|
<i class="ing-editar"></i> ing-editar
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-buscar"></i> ing-buscar
|
<i class="ing-buscar"></i> ing-buscar
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-ojo"></i> ing-ojo
|
<i class="ing-ojo"></i> ing-ojo
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-borrar"></i> ing-borrar
|
<i class="ing-borrar"></i> ing-borrar
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-basura"></i> ing-basura
|
<i class="ing-basura"></i> ing-basura
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-camara"></i> ing-camara
|
<i class="ing-camara"></i> ing-camara
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-importante"></i> ing-importante
|
<i class="ing-importante"></i> ing-importante
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-bullet"></i> ing-bullet
|
<i class="ing-bullet"></i> ing-bullet
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-home"></i> ing-home
|
<i class="ing-home"></i> ing-home
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-formacion"></i> ing-formacion
|
<i class="ing-formacion"></i> ing-formacion
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-empleo"></i> ing-empleo
|
<i class="ing-empleo"></i> ing-empleo
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-insignia1"></i> ing-insignia1
|
<i class="ing-insignia1"></i> ing-insignia1
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-insignia2"></i> ing-insignia2
|
<i class="ing-insignia2"></i> ing-insignia2
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-insignia3"></i> ing-insignia3
|
<i class="ing-insignia3"></i> ing-insignia3
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-insignia4"></i> ing-insignia4
|
<i class="ing-insignia4"></i> ing-insignia4
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-eventos"></i> ing-eventos
|
<i class="ing-eventos"></i> ing-eventos
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-reporte"></i> ing-reporte
|
<i class="ing-reporte"></i> ing-reporte
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-catalogo"></i> ing-catalogo
|
<i class="ing-catalogo"></i> ing-catalogo
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-evalua-cartel"></i> ing-evalua-cartel
|
<i class="ing-evalua-cartel"></i> ing-evalua-cartel
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-revision-cartel"></i> ing-revision-cartel
|
<i class="ing-revision-cartel"></i> ing-revision-cartel
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-reporte-resultados"></i> ing-reporte-resultados
|
<i class="ing-reporte-resultados"></i> ing-reporte-resultados
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-mi-cartel"></i> ing-mi-cartel
|
<i class="ing-mi-cartel"></i> ing-mi-cartel
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-galeria1"></i> ing-galeria1
|
<i class="ing-galeria1"></i> ing-galeria1
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-galeria2"></i> ing-galeria2
|
<i class="ing-galeria2"></i> ing-galeria2
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-iniciar-sesion"></i> ing-iniciar-sesion
|
<i class="ing-iniciar-sesion"></i> ing-iniciar-sesion
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-finalistas"></i> ing-finalistas
|
<i class="ing-finalistas"></i> ing-finalistas
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-comite"></i> ing-comite
|
<i class="ing-comite"></i> ing-comite
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-administrador"></i> ing-administrador
|
<i class="ing-administrador"></i> ing-administrador
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-estrella1"></i> ing-estrella1
|
<i class="ing-estrella1"></i> ing-estrella1
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-estrella2"></i> ing-estrella2
|
<i class="ing-estrella2"></i> ing-estrella2
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-carga-archivo"></i> ing-carga-archivo
|
<i class="ing-carga-archivo"></i> ing-carga-archivo
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-carga-multiple"></i> ing-carga-multiple
|
<i class="ing-carga-multiple"></i> ing-carga-multiple
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-descarga"></i> ing-descarga
|
<i class="ing-descarga"></i> ing-descarga
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-autorizar"></i> ing-autorizar
|
<i class="ing-autorizar"></i> ing-autorizar
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-negar"></i> ing-negar
|
<i class="ing-negar"></i> ing-negar
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-no-cargado"></i> ing-no-cargado
|
<i class="ing-no-cargado"></i> ing-no-cargado
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-alumnos"></i> ing-alumnos
|
<i class="ing-alumnos"></i> ing-alumnos
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-cardex"></i> ing-cardex
|
<i class="ing-cardex"></i> ing-cardex
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-configuracion"></i> ing-configuracion
|
<i class="ing-configuracion"></i> ing-configuracion
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-listado-menus"></i> ing-listado-menus
|
<i class="ing-listado-menus"></i> ing-listado-menus
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-mi-cuenta"></i> ing-mi-cuenta
|
<i class="ing-mi-cuenta"></i> ing-mi-cuenta
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-ver"></i> ing-ver
|
<i class="ing-ver"></i> ing-ver
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-grafica"></i> ing-grafica
|
<i class="ing-grafica"></i> ing-grafica
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-clic"></i> ing-clic
|
<i class="ing-clic"></i> ing-clic
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-guardar"></i> ing-guardar
|
<i class="ing-guardar"></i> ing-guardar
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-regresar"></i> ing-regresar
|
<i class="ing-regresar"></i> ing-regresar
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-cuadrado"></i> ing-cuadrado
|
<i class="ing-cuadrado"></i> ing-cuadrado
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-imprimir"></i> ing-imprimir
|
<i class="ing-imprimir"></i> ing-imprimir
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-importante2"></i> ing-importante2
|
<i class="ing-importante2"></i> ing-importante2
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-copiar"></i> ing-copiar
|
<i class="ing-copiar"></i> ing-copiar
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-reloj"></i> ing-reloj
|
<i class="ing-reloj"></i> ing-reloj
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-retardo"></i> ing-retardo
|
<i class="ing-retardo"></i> ing-retardo
|
||||||
</p>
|
</p>
|
||||||
<p class="container">
|
<p class="container">
|
||||||
<i class="ing-justificar"></i> ing-justificar
|
<i class="ing-justificar"></i> ing-justificar
|
||||||
</p>
|
</p>
|
||||||
@@ -1,343 +1,343 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'class/c_login.php';
|
require_once 'class/c_login.php';
|
||||||
require_once 'include/bd_pdo.php';
|
require_once 'include/bd_pdo.php';
|
||||||
|
|
||||||
if(!isset($_SESSION['user'])){
|
if(!isset($_SESSION['user'])){
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
$user->access();
|
$user->access();
|
||||||
if(!$user->admin && $user->acceso == 'n'){
|
if(!$user->admin && $user->acceso == 'n'){
|
||||||
header('Location: main.php?error=1');
|
header('Location: main.php?error=1');
|
||||||
}else{
|
}else{
|
||||||
$user->print_to_log('Dias_festivos');
|
$user->print_to_log('Dias_festivos');
|
||||||
}
|
}
|
||||||
if(isset($_GET['facultad'])){
|
if(isset($_GET['facultad'])){
|
||||||
$fac = $_GET['facultad'];
|
$fac = $_GET['facultad'];
|
||||||
}else if($user->admin){
|
}else if($user->admin){
|
||||||
$fac = null;
|
$fac = null;
|
||||||
}else{
|
}else{
|
||||||
$fac = $user->facultad['facultad_id'];
|
$fac = $user->facultad['facultad_id'];
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!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>Días Festivos</title>
|
<title>Días Festivos</title>
|
||||||
<link rel="stylesheet" href="css/jquery-ui.css">
|
<link rel="stylesheet" href="css/jquery-ui.css">
|
||||||
<link rel="stylesheet" href="css/calendar.css">
|
<link rel="stylesheet" href="css/calendar.css">
|
||||||
<link rel="stylesheet" href="css/toggle.css" type="text/css">
|
<link rel="stylesheet" href="css/toggle.css" type="text/css">
|
||||||
<?php
|
<?php
|
||||||
include 'import/html_css_files.php';
|
include 'import/html_css_files.php';
|
||||||
?>
|
?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
include "import/html_header.php";
|
include "import/html_header.php";
|
||||||
html_header(
|
html_header(
|
||||||
"DÍAS FESTIVOS",
|
"DÍAS FESTIVOS",
|
||||||
"Gestión de Checador "
|
"Gestión de Checador "
|
||||||
);
|
);
|
||||||
$user->access();
|
$user->access();
|
||||||
$fs_dias_festivos = query("SELECT * FROM fs_diasfestivos(:facultad, null, null, null) ORDER BY diasfestivos_dia", [':facultad' => $fac], false);
|
$fs_dias_festivos = query("SELECT * FROM fs_diasfestivos(:facultad, null, null, null) ORDER BY diasfestivos_dia", [':facultad' => $fac], false);
|
||||||
$fs_periodos = query("SELECT * FROM fs_periodos(null, null) WHERE estado = 'Activo'", null, false);
|
$fs_periodos = query("SELECT * FROM fs_periodos(null, null) WHERE estado = 'Activo'", null, false);
|
||||||
$fs_dias_festivos_generales = query("SELECT * FROM fs_diasfestivos(null, null) ORDER BY diasfestivos_dia", null, false);
|
$fs_dias_festivos_generales = query("SELECT * FROM fs_diasfestivos(null, null) ORDER BY diasfestivos_dia", null, false);
|
||||||
?>
|
?>
|
||||||
<main class="content marco">
|
<main class="content marco">
|
||||||
<?php if($user->admin){ ?>
|
<?php if($user->admin){ ?>
|
||||||
<div class="col-12 text-right">
|
<div class="col-12 text-right">
|
||||||
<button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#modal" data-tipo="1"><span class="ing-mas ing-fw"></span> Agregar Día Festivo</button>
|
<button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#modal" data-tipo="1"><span class="ing-mas ing-fw"></span> Agregar Día Festivo</button>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<div id="message"></div>
|
<div id="message"></div>
|
||||||
<!-- Tabla -->
|
<!-- Tabla -->
|
||||||
<?php if($fs_dias_festivos || $fs_dias_festivos_generales){ ?>
|
<?php if($fs_dias_festivos || $fs_dias_festivos_generales){ ?>
|
||||||
<div class="row mt-3">
|
<div class="row mt-3">
|
||||||
<div class="col-12 table-responsive">
|
<div class="col-12 table-responsive">
|
||||||
<table class="table table-sm table-striped table-white">
|
<table class="table table-sm table-striped table-white">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Día</th>
|
<th>Día</th>
|
||||||
<th>Periodo</th>
|
<th>Periodo</th>
|
||||||
<th>Nivel</th>
|
<th>Nivel</th>
|
||||||
<?php if($user->admin){ ?>
|
<?php if($user->admin){ ?>
|
||||||
<th>Facultad</th>
|
<th>Facultad</th>
|
||||||
<th>Acciones</th>
|
<th>Acciones</th>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach($fs_dias_festivos as $dia){ ?>
|
<?php foreach($fs_dias_festivos as $dia){ ?>
|
||||||
<tr data-id="<?= $dia['diasfestivos_id'] ?>" id="<?= $dia['diasfestivos_id'] ?>" data-periodo="1">
|
<tr data-id="<?= $dia['diasfestivos_id'] ?>" id="<?= $dia['diasfestivos_id'] ?>" data-periodo="1">
|
||||||
<td class="text-center"><?php $day = explode("-", $dia['diasfestivos_dia']);
|
<td class="text-center"><?php $day = explode("-", $dia['diasfestivos_dia']);
|
||||||
echo $day['2']."-".$day['1']."-".$day['0'];
|
echo $day['2']."-".$day['1']."-".$day['0'];
|
||||||
?></td>
|
?></td>
|
||||||
<td class="text-center"><?= $dia['periodo_nombre'] ?></td>
|
<td class="text-center"><?= $dia['periodo_nombre'] ?></td>
|
||||||
<td class="text-center"><?= $dia['nivel_nombre'] ?></td>
|
<td class="text-center"><?= $dia['nivel_nombre'] ?></td>
|
||||||
<?php if($user->admin){ ?>
|
<?php if($user->admin){ ?>
|
||||||
<td class="text-center"><?= $dia['facultad_nombre'] ?></td>
|
<td class="text-center"><?= $dia['facultad_nombre'] ?></td>
|
||||||
<td class="text-center icono-acciones">
|
<td class="text-center icono-acciones">
|
||||||
<a href="#" data-toggle="modal" data-target="#modal" data-tipo="2" title="Editar"><span class="ing-editar ing-fw"></span></a>
|
<a href="#" data-toggle="modal" data-target="#modal" data-tipo="2" title="Editar"><span class="ing-editar ing-fw"></span></a>
|
||||||
<a href="#" data-toggle="modal" data-target="#modal_confirm" title="Borrar"><span class="ing-basura ing-fw"></span></a>
|
<a href="#" data-toggle="modal" data-target="#modal_confirm" title="Borrar"><span class="ing-basura ing-fw"></span></a>
|
||||||
</td>
|
</td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php foreach($fs_dias_festivos_generales as $dia){ ?>
|
<?php foreach($fs_dias_festivos_generales as $dia){ ?>
|
||||||
<tr data-id="<?= $dia['diasfestivos_id'] ?>" id="<?= $dia['diasfestivos_id'] ?>" data-periodo="0">
|
<tr data-id="<?= $dia['diasfestivos_id'] ?>" id="<?= $dia['diasfestivos_id'] ?>" data-periodo="0">
|
||||||
<td class="text-center"><?php $day = explode("-", $dia['diasfestivos_dia']);
|
<td class="text-center"><?php $day = explode("-", $dia['diasfestivos_dia']);
|
||||||
echo $day['2']."-".$day['1']."-".$day['0'];
|
echo $day['2']."-".$day['1']."-".$day['0'];
|
||||||
?></td>
|
?></td>
|
||||||
<td class="text-center">Todos</td>
|
<td class="text-center">Todos</td>
|
||||||
<td class="text-center">Todos</td>
|
<td class="text-center">Todos</td>
|
||||||
<?php if($user->admin){ ?>
|
<?php if($user->admin){ ?>
|
||||||
<td class="text-center">Todas</td>
|
<td class="text-center">Todas</td>
|
||||||
<td class="text-center icono-acciones">
|
<td class="text-center icono-acciones">
|
||||||
<a href="#" data-toggle="modal" data-target="#modal" data-tipo="2" title="Editar"><span class="ing-editar ing-fw"></span></a>
|
<a href="#" data-toggle="modal" data-target="#modal" data-tipo="2" title="Editar"><span class="ing-editar ing-fw"></span></a>
|
||||||
<a href="#" data-toggle="modal" data-target="#modal_confirm" title="Borrar"><span class="ing-basura ing-fw"></span></a>
|
<a href="#" data-toggle="modal" data-target="#modal_confirm" title="Borrar"><span class="ing-basura ing-fw"></span></a>
|
||||||
</td>
|
</td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</main>
|
</main>
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<?php
|
<?php
|
||||||
include "import/html_footer.php";
|
include "import/html_footer.php";
|
||||||
?>
|
?>
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
|
<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-dialog modal-dialog-centered" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="col-12 modal-title text-center">
|
<h4 class="col-12 modal-title text-center">
|
||||||
<span id="modalLabel">
|
<span id="modalLabel">
|
||||||
Editar Día Festivo
|
Editar Día Festivo
|
||||||
</span>
|
</span>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form action="" method="post" id="formaModal" onsubmit="return valida_campos()">
|
<form action="" method="post" id="formaModal" onsubmit="return valida_campos()">
|
||||||
<input type="hidden" name="id" id="id">
|
<input type="hidden" name="id" id="id">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="periodo" class="col-3 col-form-label">Periodo *</label>
|
<label for="periodo" class="col-3 col-form-label">Periodo *</label>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<div class="datalist datalist-select mb-1 w-100">
|
<div class="datalist datalist-select mb-1 w-100">
|
||||||
<div class="datalist-input" id="fac">Mostrar todos</div>
|
<div class="datalist-input" id="fac">Mostrar todos</div>
|
||||||
<span class="ing-buscar icono"></span>
|
<span class="ing-buscar icono"></span>
|
||||||
<ul style="display:none">
|
<ul style="display:none">
|
||||||
<li data-id="0" class="pl4-">Todos</li>
|
<li data-id="0" class="pl4-">Todos</li>
|
||||||
<?php foreach($fs_periodos as $periodo){ ?>
|
<?php foreach($fs_periodos as $periodo){ ?>
|
||||||
<li data-id="<?= $periodo['id'] ?>" class="pl4-"> <?php echo $periodo['periodo']." ".$periodo['facultad']." - ".$periodo['nivel']; ?></li>
|
<li data-id="<?= $periodo['id'] ?>" class="pl4-"> <?php echo $periodo['periodo']." ".$periodo['facultad']." - ".$periodo['nivel']; ?></li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
<input type="hidden" id="periodo" name="periodo" value="">
|
<input type="hidden" id="periodo" name="periodo" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row" id="rangoDiv">
|
<div class="form-group row" id="rangoDiv">
|
||||||
<label for="rango" class="col-3 col-form-label">Rango</label>
|
<label for="rango" class="col-3 col-form-label">Rango</label>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<input type="checkbox" data-toggle="toggle" data-onstyle="success" data-offstyle="danger" data-on="SI" data-off="NO" data-size="s" id="rango" name="rango">
|
<input type="checkbox" data-toggle="toggle" data-onstyle="success" data-offstyle="danger" data-on="SI" data-off="NO" data-size="s" id="rango" name="rango">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row" id="diasFestivos">
|
<div class="form-group row" id="diasFestivos">
|
||||||
<label for="diaFestivo" class="col-3 col-form-label">Día festivo *</label>
|
<label for="diaFestivo" class="col-3 col-form-label">Día festivo *</label>
|
||||||
<div class="col-4" id="dia">
|
<div class="col-4" id="dia">
|
||||||
<input id="diaFestivo" name="diaFestivo" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="">
|
<input id="diaFestivo" name="diaFestivo" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-1 diaFestivoRango">
|
<div class="col-1 diaFestivoRango">
|
||||||
-
|
-
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4 diaFestivoRango" id="diaFestivoRango">
|
<div class="col-4 diaFestivoRango" id="diaFestivoRango">
|
||||||
<input id="diaFestivoFin" name="diaFestivoFin" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="">
|
<input id="diaFestivoFin" name="diaFestivoFin" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="">
|
||||||
</div>
|
</div>
|
||||||
<div class="invalid-feedback">Debe seleccionar una fecha</div>
|
<div class="invalid-feedback">Debe seleccionar una fecha</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="offset-4 col-8">
|
<div class="offset-4 col-8">
|
||||||
<button type="submit" class="btn btn-outline-primary" id="submitBtn" data-tipo="1">
|
<button type="submit" class="btn btn-outline-primary" id="submitBtn" data-tipo="1">
|
||||||
<span class="ing-aceptar ing-fw"></span> Guardar
|
<span class="ing-aceptar ing-fw"></span> Guardar
|
||||||
</button>
|
</button>
|
||||||
<button type="reset" class="btn btn-outline-danger" data-dismiss="modal">
|
<button type="reset" class="btn btn-outline-danger" data-dismiss="modal">
|
||||||
<span class="ing-cancelar ing-fw"></span> Cancelar
|
<span class="ing-cancelar ing-fw"></span> Cancelar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal fade" id="modal_confirm" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
|
<div class="modal fade" id="modal_confirm" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="font-weight-bold">¿Estás seguro de querer borrar el día festivo?</p>
|
<p class="font-weight-bold">¿Estás seguro de querer borrar el día festivo?</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<input type="hidden" id="id_borrar" value="">
|
<input type="hidden" id="id_borrar" value="">
|
||||||
<button type="button" class="btn btn-outline-primary btn-borrar"><span class="ing-aceptar ing-fw"></span> Borrar</button>
|
<button type="button" class="btn btn-outline-primary btn-borrar"><span class="ing-aceptar ing-fw"></span> Borrar</button>
|
||||||
<button type="button" class="btn btn-outline-danger" data-dismiss="modal" aria-label="Close"><span class="ing-cancelar ing-fw"></span> Cancelar</button>
|
<button type="button" class="btn btn-outline-danger" data-dismiss="modal" aria-label="Close"><span class="ing-cancelar ing-fw"></span> Cancelar</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="js/jquery-ui.js"></script>
|
<script src="js/jquery-ui.js"></script>
|
||||||
<script src="js/bootstrap/bootstrap.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/datepicker-es.js"></script>
|
<script src="js/datepicker-es.js"></script>
|
||||||
<script src="js/toggle.js"></script>
|
<script src="js/toggle.js"></script>
|
||||||
<?php
|
<?php
|
||||||
require_once 'js/messages.php';
|
require_once 'js/messages.php';
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$('.diaFestivoRango').hide();
|
$('.diaFestivoRango').hide();
|
||||||
});
|
});
|
||||||
$('#rango').change(function(){
|
$('#rango').change(function(){
|
||||||
if($(this).is(':checked')){
|
if($(this).is(':checked')){
|
||||||
$('#diaFestivoFin').val('');
|
$('#diaFestivoFin').val('');
|
||||||
$('.diaFestivoRango').show();
|
$('.diaFestivoRango').show();
|
||||||
$('#diaFestivoFin').datepicker("setDate", today);
|
$('#diaFestivoFin').datepicker("setDate", today);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$('.diaFestivoRango').hide();
|
$('.diaFestivoRango').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#modal_confirm').on('show.bs.modal', function(event){
|
$('#modal_confirm').on('show.bs.modal', function(event){
|
||||||
var button = $(event.relatedTarget);
|
var button = $(event.relatedTarget);
|
||||||
var id = button.parents("tr").data("id");
|
var id = button.parents("tr").data("id");
|
||||||
$("#id_borrar").val(id);
|
$("#id_borrar").val(id);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".btn-borrar").click(function(){
|
$(".btn-borrar").click(function(){
|
||||||
var id = $("#id_borrar").val();
|
var id = $("#id_borrar").val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'action/action_diasfestivos_borra.php',
|
url: 'action/action_diasfestivos_borra.php',
|
||||||
type: 'post',
|
type: 'post',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data:{id: id},
|
data:{id: id},
|
||||||
success:function(result){
|
success:function(result){
|
||||||
location.reload();
|
location.reload();
|
||||||
},
|
},
|
||||||
error: function(){console.log("Error")}
|
error: function(){console.log("Error")}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
||||||
$(".date-picker").datepicker({
|
$(".date-picker").datepicker({
|
||||||
dateFormat: "dd/mm/yyyy",
|
dateFormat: "dd/mm/yyyy",
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
<?php if(!$fs_dias_festivos && !$fs_dias_festivos_generales){ ?>
|
<?php if(!$fs_dias_festivos && !$fs_dias_festivos_generales){ ?>
|
||||||
triggerMessage("No se encontraron días festivos", "Error");
|
triggerMessage("No se encontraron días festivos", "Error");
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
$('#modal').on('show.bs.modal', function (event){
|
$('#modal').on('show.bs.modal', function (event){
|
||||||
var button = $(event.relatedTarget);
|
var button = $(event.relatedTarget);
|
||||||
var tipo = button.data('tipo');
|
var tipo = button.data('tipo');
|
||||||
var modal = $(this);
|
var modal = $(this);
|
||||||
if(tipo==1){//agregar
|
if(tipo==1){//agregar
|
||||||
$('#modalLabel').html("Agregar Día Festivo");
|
$('#modalLabel').html("Agregar Día Festivo");
|
||||||
$('#submitBtn').data('tipo', 1);
|
$('#submitBtn').data('tipo', 1);
|
||||||
$('#diaFestivo').datepicker("setDate", today);
|
$('#diaFestivo').datepicker("setDate", today);
|
||||||
$('#diaFestivoFin').datepicker("setDate", today);
|
$('#diaFestivoFin').datepicker("setDate", today);
|
||||||
setDatalistFirst("#periodo");
|
setDatalistFirst("#periodo");
|
||||||
$('#rangoDiv').show();
|
$('#rangoDiv').show();
|
||||||
$('#dia').removeClass('col-9');
|
$('#dia').removeClass('col-9');
|
||||||
$('#dia').addClass('col-4');
|
$('#dia').addClass('col-4');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$('#modalLabel').html("Editar Día Festivo");
|
$('#modalLabel').html("Editar Día Festivo");
|
||||||
$('#submitBtn').data('tipo', 2);
|
$('#submitBtn').data('tipo', 2);
|
||||||
$('#rangoDiv').hide();
|
$('#rangoDiv').hide();
|
||||||
$('#dia').removeClass('col-4');
|
$('#dia').removeClass('col-4');
|
||||||
$('#dia').addClass('col-9');
|
$('#dia').addClass('col-9');
|
||||||
var id = $(event.relatedTarget).parents('tr').data('id');
|
var id = $(event.relatedTarget).parents('tr').data('id');
|
||||||
var periodo = $(event.relatedTarget).parents('tr').data('periodo');
|
var periodo = $(event.relatedTarget).parents('tr').data('periodo');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:"action/action_diasfestivos_select.php",
|
url:"action/action_diasfestivos_select.php",
|
||||||
type:"post",
|
type:"post",
|
||||||
dataType:"json",
|
dataType:"json",
|
||||||
data:{id: id, periodo: periodo},
|
data:{id: id, periodo: periodo},
|
||||||
success:function(result){
|
success:function(result){
|
||||||
console.log(result);
|
console.log(result);
|
||||||
$('#id').val(result['diasfestivos_id']);
|
$('#id').val(result['diasfestivos_id']);
|
||||||
if(!result['periodo_id']){
|
if(!result['periodo_id']){
|
||||||
setDatalist('#periodo', 0);
|
setDatalist('#periodo', 0);
|
||||||
}else{
|
}else{
|
||||||
setDatalist('#periodo', result['periodo_id']);
|
setDatalist('#periodo', result['periodo_id']);
|
||||||
}
|
}
|
||||||
var date = new Date(result['diasfestivos_dia']);
|
var date = new Date(result['diasfestivos_dia']);
|
||||||
date.setDate(date.getDate() + 1);
|
date.setDate(date.getDate() + 1);
|
||||||
$('#diaFestivo').datepicker("setDate", date);
|
$('#diaFestivo').datepicker("setDate", date);
|
||||||
},
|
},
|
||||||
error: function(){console.log("Error")}
|
error: function(){console.log("Error")}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function valida_campos(){
|
function valida_campos(){
|
||||||
var error=false;
|
var error=false;
|
||||||
if($("#diaFestivo").val()==""){
|
if($("#diaFestivo").val()==""){
|
||||||
$("#diaFestivo").addClass("is-invalid");
|
$("#diaFestivo").addClass("is-invalid");
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
var inicio = $("#diaFestivo").val();
|
var inicio = $("#diaFestivo").val();
|
||||||
var fin = $("#diaFestivoFin").val();
|
var fin = $("#diaFestivoFin").val();
|
||||||
var aux = inicio.split("/");
|
var aux = inicio.split("/");
|
||||||
inicio = aux[2] +"-"+ aux[1] +"-"+ aux[0];
|
inicio = aux[2] +"-"+ aux[1] +"-"+ aux[0];
|
||||||
aux = fin.split("/");
|
aux = fin.split("/");
|
||||||
fin = aux[2] +"-"+ aux[1] +"-"+ aux[0];
|
fin = aux[2] +"-"+ aux[1] +"-"+ aux[0];
|
||||||
console.log(inicio);
|
console.log(inicio);
|
||||||
if((fin < inicio || fin == inicio) && $("#rango").is(':checked')){
|
if((fin < inicio || fin == inicio) && $("#rango").is(':checked')){
|
||||||
$('#diaFestivoFin').addClass("is-invalid");
|
$('#diaFestivoFin').addClass("is-invalid");
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
if(error){
|
if(error){
|
||||||
return false;
|
return false;
|
||||||
}else{
|
}else{
|
||||||
var btn = $("#submitBtn");
|
var btn = $("#submitBtn");
|
||||||
if(btn.data("tipo") == 2){//update
|
if(btn.data("tipo") == 2){//update
|
||||||
$("#formaModal").prop("action", "./action/action_diasfestivos_update.php");
|
$("#formaModal").prop("action", "./action/action_diasfestivos_update.php");
|
||||||
}
|
}
|
||||||
else{//insert
|
else{//insert
|
||||||
$("#formaModal").prop("action", "./action/action_diasfestivos_insert.php");
|
$("#formaModal").prop("action", "./action/action_diasfestivos_insert.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<?php if(isset($_GET['error'])){
|
<?php if(isset($_GET['error'])){
|
||||||
if($_GET['error'] == 1){ ?>
|
if($_GET['error'] == 1){ ?>
|
||||||
triggerMessage("Este dia festivo ya existe", "Error");
|
triggerMessage("Este dia festivo ya existe", "Error");
|
||||||
<?php }
|
<?php }
|
||||||
} ?>
|
} ?>
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,111 +1,111 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'class/c_login.php';
|
require_once 'class/c_login.php';
|
||||||
|
|
||||||
if (!isset($_SESSION['user'])) {
|
if (!isset($_SESSION['user'])) {
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
exit;
|
exit;
|
||||||
} else
|
} else
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
header('Location: main.php?error=1');
|
header('Location: main.php?error=1');
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Editar Horarios | <?php echo $_SESSION['facultad'] ?? "Administrador"; ?></title>
|
<title>Editar Horarios | <?php echo $_SESSION['facultad'] ?? "Administrador"; ?></title>
|
||||||
<link rel="icon" type="image/png" href="imagenes/favicon.png" />
|
<link rel="icon" type="image/png" href="imagenes/favicon.png" />
|
||||||
<link rel="stylesheet" href="css/bootstrap-ulsa.min.css" type="text/css">
|
<link rel="stylesheet" href="css/bootstrap-ulsa.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="css/indivisa.css" type="text/css">
|
<link rel="stylesheet" href="css/indivisa.css" type="text/css">
|
||||||
<link rel="stylesheet" href="css/sgi.css?rand=<?php echo rand(); ?>" type="text/css">
|
<link rel="stylesheet" href="css/sgi.css?rand=<?php echo rand(); ?>" type="text/css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
include "import/html_header.php";
|
include "import/html_header.php";
|
||||||
html_header("Editar Horarios", "Gestión de Checador");
|
html_header("Editar Horarios", "Gestión de Checador");
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Create a schedule design -->
|
<!-- Create a schedule design -->
|
||||||
<main class="content marco">
|
<main class="content marco">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<!-- Nivel select option -->
|
<!-- Nivel select option -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="nivel">Nivel</label>
|
<label for="nivel">Nivel</label>
|
||||||
<select class="form-control" id="nivel">
|
<select class="form-control" id="nivel">
|
||||||
<option value="0">Selecciona un nivel</option>
|
<option value="0">Selecciona un nivel</option>
|
||||||
<option value="1">Nivel 1</option>
|
<option value="1">Nivel 1</option>
|
||||||
<option value="2">Nivel 2</option>
|
<option value="2">Nivel 2</option>
|
||||||
<option value="3">Nivel 3</option>
|
<option value="3">Nivel 3</option>
|
||||||
<option value="4">Nivel 4</option>
|
<option value="4">Nivel 4</option>
|
||||||
<option value="5">Nivel 5</option>
|
<option value="5">Nivel 5</option>
|
||||||
<option value="6">Nivel 6</option>
|
<option value="6">Nivel 6</option>
|
||||||
<option value="7">Nivel 7</option>
|
<option value="7">Nivel 7</option>
|
||||||
<option value="8">Nivel 8</option>
|
<option value="8">Nivel 8</option>
|
||||||
<option value="9">Nivel 9</option>
|
<option value="9">Nivel 9</option>
|
||||||
<option value="10">Nivel 10</option>
|
<option value="10">Nivel 10</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Table Schedule -->
|
<!-- Table Schedule -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<table class="table table-bordered table-hover">
|
<table class="table table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">Hora</th>
|
<th scope="col">Hora</th>
|
||||||
<th scope="col">Lunes</th>
|
<th scope="col">Lunes</th>
|
||||||
<th scope="col">Martes</th>
|
<th scope="col">Martes</th>
|
||||||
<th scope="col">Miércoles</th>
|
<th scope="col">Miércoles</th>
|
||||||
<th scope="col">Jueves</th>
|
<th scope="col">Jueves</th>
|
||||||
<th scope="col">Viernes</th>
|
<th scope="col">Viernes</th>
|
||||||
<th scope="col">Sábado</th>
|
<th scope="col">Sábado</th>
|
||||||
<th scope="col">Domingo</th>
|
<th scope="col">Domingo</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">7:00 - 8:00</th>
|
<th scope="row">7:00 - 8:00</th>
|
||||||
<!-- Matemáticas Martes id horario: 3 edit -->
|
<!-- Matemáticas Martes id horario: 3 edit -->
|
||||||
<td>
|
<td>
|
||||||
</td>
|
</td>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<?php
|
<?php
|
||||||
include "import/html_footer.php";
|
include "import/html_footer.php";
|
||||||
?>
|
?>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function get_horarios($facultad_id): array
|
function get_horarios($facultad_id): array
|
||||||
{
|
{
|
||||||
$dias = array("lun", "mar", "mié", "jue", "vie", "sáb",);
|
$dias = array("lun", "mar", "mié", "jue", "vie", "sáb",);
|
||||||
foreach ($dias as $dia) {
|
foreach ($dias as $dia) {
|
||||||
$horarios = query(
|
$horarios = query(
|
||||||
"SELECT * FROM HORARIO_VIEW
|
"SELECT * FROM HORARIO_VIEW
|
||||||
WHERE FACULTAD_ID = :facultad_id AND DIA = :dia
|
WHERE FACULTAD_ID = :facultad_id AND DIA = :dia
|
||||||
ORDER BY HORA",
|
ORDER BY HORA",
|
||||||
array(":facultad_id" => $facultad_id, ":dia" => $dia)
|
array(":facultad_id" => $facultad_id, ":dia" => $dia)
|
||||||
);
|
);
|
||||||
foreach ($horarios as $h)
|
foreach ($horarios as $h)
|
||||||
$horario[$dia][] = $h;
|
$horario[$dia][] = $h;
|
||||||
}
|
}
|
||||||
return $horario;
|
return $horario;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -1,209 +1,209 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'class/c_login.php';
|
require_once 'class/c_login.php';
|
||||||
if (!isset($_SESSION['user'])) {
|
if (!isset($_SESSION['user'])) {
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
exit;
|
exit;
|
||||||
} else
|
} else
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
|
|
||||||
|
|
||||||
$user->access('excel_horario');
|
$user->access('excel_horario');
|
||||||
|
|
||||||
if (!$user->admin && in_array($user->acceso, ['r', 'n'])) {
|
if (!$user->admin && in_array($user->acceso, ['r', 'n'])) {
|
||||||
// die($access);
|
// die($access);
|
||||||
header('Location: main.php?error=1');
|
header('Location: main.php?error=1');
|
||||||
} else {
|
} else {
|
||||||
$user->print_to_log('Consultar asistencia');
|
$user->print_to_log('Consultar asistencia');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>Cargar horario desde Excel | <?= $user->facultad['facultad'] ?? 'General' ?></title>
|
<title>Cargar horario desde Excel | <?= $user->facultad['facultad'] ?? 'General' ?></title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<?php include_once "import/html_css_files.php"; ?>
|
<?php include_once "import/html_css_files.php"; ?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body style="display: block;">
|
<body style="display: block;">
|
||||||
<?php
|
<?php
|
||||||
include('include/constantes.php');
|
include('include/constantes.php');
|
||||||
include("import/html_header.php");
|
include("import/html_header.php");
|
||||||
html_header("Cargar horario desde Excel", "Gestión de Checador");
|
html_header("Cargar horario desde Excel", "Gestión de Checador");
|
||||||
?>
|
?>
|
||||||
<main class="container content content-margin" id="local-app">
|
<main class="container content content-margin" id="local-app">
|
||||||
<section id="message"></section>
|
<section id="message"></section>
|
||||||
<?php require('import/periodo.php') ?>
|
<?php require('import/periodo.php') ?>
|
||||||
<form>
|
<form>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<?php
|
<?php
|
||||||
$carreras = query("SELECT * FROM FS_CARRERA WHERE FACULTAD = COALESCE(:fac, FACULTAD) AND PERIODO = COALESCE(:per, PERIODO) ORDER BY CARRERA", [":fac" => $user->facultad['facultad_id'], ":per" => $user->periodo], single: false);
|
$carreras = query("SELECT * FROM FS_CARRERA WHERE FACULTAD = COALESCE(:fac, FACULTAD) AND PERIODO = COALESCE(:per, PERIODO) ORDER BY CARRERA", [":fac" => $user->facultad['facultad_id'], ":per" => $user->periodo], single: false);
|
||||||
#die(print_r($carreras, true));
|
#die(print_r($carreras, true));
|
||||||
?>
|
?>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_carrera" class="col-4 col-form-label">Carrera</label>
|
<label for="filter_carrera" class="col-4 col-form-label">Carrera</label>
|
||||||
<div class="col-6 ">
|
<div class="col-6 ">
|
||||||
<div id="dlcarrera" class="datalist datalist-select mb-1 w-100">
|
<div id="dlcarrera" class="datalist datalist-select mb-1 w-100">
|
||||||
<div class="datalist-input">Seleccionar carrera</div>
|
<div class="datalist-input">Seleccionar carrera</div>
|
||||||
<span class="ing-buscar icono"></span>
|
<span class="ing-buscar icono"></span>
|
||||||
<ul style="display:none">
|
<ul style="display:none">
|
||||||
<?php
|
<?php
|
||||||
foreach ($carreras as $carrera) {
|
foreach ($carreras as $carrera) {
|
||||||
?>
|
?>
|
||||||
<li data-id="<?= $carrera['id'] ?>">
|
<li data-id="<?= $carrera['id'] ?>">
|
||||||
<?= $carrera['carrera'] ?>
|
<?= $carrera['carrera'] ?>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
<input type="hidden" id="filter_carrera" name="carrera" value="">
|
<input type="hidden" id="filter_carrera" name="carrera" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="excel" class="col-4 col-form-label">Archivo de horarios</label>
|
<label for="excel" class="col-4 col-form-label">Archivo de horarios</label>
|
||||||
<div class="col-8 col-sm-6">
|
<div class="col-8 col-sm-6">
|
||||||
<input class="form-control-file" id="excel" name="archivo" accept=".xlsx, .xls" require>
|
<input class="form-control-file" id="excel" name="archivo" accept=".xlsx, .xls" require>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mt-5 row justify-content-center">
|
<div class="form-group mt-5 row justify-content-center">
|
||||||
|
|
||||||
<button id="btn-cargar" type="button" class="btn btn-primary" onclick="submit_files()">
|
<button id="btn-cargar" type="button" class="btn btn-primary" onclick="submit_files()">
|
||||||
<span class="ing-guardar"></span>
|
<span class="ing-guardar"></span>
|
||||||
Cargar horario
|
Cargar horario
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
<?php
|
<?php
|
||||||
require_once("import/html_footer.php");
|
require_once("import/html_footer.php");
|
||||||
require_once("js/messages.php")
|
require_once("js/messages.php")
|
||||||
?>
|
?>
|
||||||
<script src="js/scrollables.js"></script>
|
<script src="js/scrollables.js"></script>
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="js/bootstrap/bootstrap.min.js"></script>
|
<script src="js/bootstrap/bootstrap.min.js"></script>
|
||||||
|
|
||||||
<script src="js/custominputfile.min-es.js"></script>
|
<script src="js/custominputfile.min-es.js"></script>
|
||||||
<link rel="stylesheet" href="css/custominputfile.min.css">
|
<link rel="stylesheet" href="css/custominputfile.min.css">
|
||||||
<script src="js/fetchlib.js"></script>
|
<script src="js/fetchlib.js"></script>
|
||||||
<script lang="jquery">
|
<script lang="jquery">
|
||||||
var datum = []
|
var datum = []
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('#excel').customFile({
|
$('#excel').customFile({
|
||||||
allowed: ['xlsx', 'xls'],
|
allowed: ['xlsx', 'xls'],
|
||||||
maxFiles: 1,
|
maxFiles: 1,
|
||||||
callbacks: {
|
callbacks: {
|
||||||
onSuccess: async function(item) {
|
onSuccess: async function(item) {
|
||||||
var formData = $.customFile.serialize('archivo');
|
var formData = $.customFile.serialize('archivo');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
status,
|
status,
|
||||||
message,
|
message,
|
||||||
data
|
data
|
||||||
} = await fetch('action/action_revisar_excel.php', {
|
} = await fetch('action/action_revisar_excel.php', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: formData
|
body: formData
|
||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
return {
|
return {
|
||||||
status: 'error',
|
status: 'error',
|
||||||
message: 'Error al cargar el archivo',
|
message: 'Error al cargar el archivo',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (status == 'error') {
|
if (status == 'error') {
|
||||||
triggerMessage(message, 'Error en el formato del archivo');
|
triggerMessage(message, 'Error en el formato del archivo');
|
||||||
item.destroy();
|
item.destroy();
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
triggerMessage(message, `Archivo revisado`, 'success');
|
triggerMessage(message, `Archivo revisado`, 'success');
|
||||||
datum = data;
|
datum = data;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
async function submit_files() {
|
async function submit_files() {
|
||||||
// disable button
|
// disable button
|
||||||
const button = document.querySelector('#btn-cargar');
|
const button = document.querySelector('#btn-cargar');
|
||||||
// add class disabled to button
|
// add class disabled to button
|
||||||
button.classList.add('disabled');
|
button.classList.add('disabled');
|
||||||
// disable button
|
// disable button
|
||||||
button.disabled = true;
|
button.disabled = true;
|
||||||
|
|
||||||
// add loading icon
|
// add loading icon
|
||||||
button.innerHTML = '<span class="ing-cargando"></span> Cargando...';
|
button.innerHTML = '<span class="ing-cargando"></span> Cargando...';
|
||||||
|
|
||||||
let missing = [];
|
let missing = [];
|
||||||
|
|
||||||
let carrera = $('#filter_carrera').val();
|
let carrera = $('#filter_carrera').val();
|
||||||
if (carrera == '') missing.push('Carrera');
|
if (carrera == '') missing.push('Carrera');
|
||||||
|
|
||||||
if (datum.length == 0) missing.push('Archivo de horarios');
|
if (datum.length == 0) missing.push('Archivo de horarios');
|
||||||
|
|
||||||
let facultad = <?= $user->facultad['facultad_id'] ?>;
|
let facultad = <?= $user->facultad['facultad_id'] ?>;
|
||||||
|
|
||||||
if (missing.length > 0) {
|
if (missing.length > 0) {
|
||||||
messageMissingInputs(missing);
|
messageMissingInputs(missing);
|
||||||
|
|
||||||
// remove class disabled to button
|
// remove class disabled to button
|
||||||
button.classList.remove('disabled');
|
button.classList.remove('disabled');
|
||||||
// enable button
|
// enable button
|
||||||
button.disabled = false;
|
button.disabled = false;
|
||||||
|
|
||||||
// remove loading icon
|
// remove loading icon
|
||||||
button.innerHTML = '<span class="ing-guardar"></span> Cargar horario';
|
button.innerHTML = '<span class="ing-guardar"></span> Cargar horario';
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
formData.append('carrera', carrera);
|
formData.append('carrera', carrera);
|
||||||
formData.append('facultad', facultad);
|
formData.append('facultad', facultad);
|
||||||
formData.append('data', JSON.stringify(datum));
|
formData.append('data', JSON.stringify(datum));
|
||||||
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
status,
|
status,
|
||||||
message
|
message
|
||||||
} = await fetch('action/action_horario_excel.php', {
|
} = await fetch('action/action_horario_excel.php', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: formData
|
body: formData
|
||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
return {
|
return {
|
||||||
status: 'error',
|
status: 'error',
|
||||||
message: 'Error al cargar el archivo',
|
message: 'Error al cargar el archivo',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (status == 'error') {
|
if (status == 'error') {
|
||||||
triggerMessage(message, 'Error al guardar el archivo');
|
triggerMessage(message, 'Error al guardar el archivo');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
triggerMessage(message, `Horarios guardados`, 'success');
|
triggerMessage(message, `Horarios guardados`, 'success');
|
||||||
|
|
||||||
// await 1 second
|
// await 1 second
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||||
|
|
||||||
// reload page
|
// reload page
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
564
facultades.php
564
facultades.php
@@ -1,283 +1,283 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'class/c_login.php';
|
require_once 'class/c_login.php';
|
||||||
require_once 'include/bd_pdo.php';
|
require_once 'include/bd_pdo.php';
|
||||||
|
|
||||||
if (!isset($_SESSION['user'])){
|
if (!isset($_SESSION['user'])){
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
$user->access();
|
$user->access();
|
||||||
if(!$user->admin && $user->acceso == 'n'){
|
if(!$user->admin && $user->acceso == 'n'){
|
||||||
header('Location: main.php?error=1');
|
header('Location: main.php?error=1');
|
||||||
}else{
|
}else{
|
||||||
$user->print_to_log('Facultades');
|
$user->print_to_log('Facultades');
|
||||||
}
|
}
|
||||||
if($user->admin!=true){
|
if($user->admin!=true){
|
||||||
header('Location: carreras.php?facultad='.$user->facultad['facultad_id']);
|
header('Location: carreras.php?facultad='.$user->facultad['facultad_id']);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!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>Facultades</title>
|
<title>Facultades</title>
|
||||||
<?php
|
<?php
|
||||||
include 'import/html_css_files.php';
|
include 'import/html_css_files.php';
|
||||||
?>
|
?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
include "import/html_header.php";
|
include "import/html_header.php";
|
||||||
html_header(
|
html_header(
|
||||||
"FACULTADES",
|
"FACULTADES",
|
||||||
"Gestión de Checador "
|
"Gestión de Checador "
|
||||||
);
|
);
|
||||||
$user->access();
|
$user->access();
|
||||||
if(isset($_POST["estado"])){
|
if(isset($_POST["estado"])){
|
||||||
echo "estado=".$_POST["estado"];
|
echo "estado=".$_POST["estado"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST["desc"])){
|
if(isset($_POST["desc"])){
|
||||||
$desc=$_POST["desc"];
|
$desc=$_POST["desc"];
|
||||||
$filter_desc = trim(filter_input(INPUT_POST, "desc", FILTER_SANITIZE_STRING, array('flags' => FILTER_FLAG_STRIP_LOW)));
|
$filter_desc = trim(filter_input(INPUT_POST, "desc", FILTER_SANITIZE_STRING, array('flags' => FILTER_FLAG_STRIP_LOW)));
|
||||||
}else{
|
}else{
|
||||||
$desc=null;
|
$desc=null;
|
||||||
}
|
}
|
||||||
if($user->admin==true){
|
if($user->admin==true){
|
||||||
$fs_facultades = query(
|
$fs_facultades = query(
|
||||||
"SELECT * FROM fs_facultades(:nombre)",
|
"SELECT * FROM fs_facultades(:nombre)",
|
||||||
array(":nombre" => $desc),
|
array(":nombre" => $desc),
|
||||||
single:false
|
single:false
|
||||||
);
|
);
|
||||||
}else{
|
}else{
|
||||||
$fs_facultades = query(
|
$fs_facultades = query(
|
||||||
"SELECT * FROM fs_facultades(:nombre) where facultad_id = :facultad",
|
"SELECT * FROM fs_facultades(:nombre) where facultad_id = :facultad",
|
||||||
array(":nombre" => $desc, ":facultad" => $user->facultad["facultad_id"]),
|
array(":nombre" => $desc, ":facultad" => $user->facultad["facultad_id"]),
|
||||||
single:false
|
single:false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<main class="content marco">
|
<main class="content marco">
|
||||||
<?php if($user->admin==true) {?>
|
<?php if($user->admin==true) {?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 text-right">
|
<div class="col-12 text-right">
|
||||||
<button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#modal" data-tipo="1"><span class="ing-mas ing-fw"></span>Crear facultad</button>
|
<button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#modal" data-tipo="1"><span class="ing-mas ing-fw"></span>Crear facultad</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
<!-- Filtro -->
|
<!-- Filtro -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<form action="facultades.php" method="post">
|
<form action="facultades.php" method="post">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_desc" class="col-4 col-form-label">Facultad</label>
|
<label for="filter_desc" class="col-4 col-form-label">Facultad</label>
|
||||||
<div class="col-8 col-sm-4">
|
<div class="col-8 col-sm-4">
|
||||||
<input id="filter_desc" name="desc" type="text" class="form-control"<?php if(isset($filter_desc)){ echo'value="'.$filter_desc.'"';}?>>
|
<input id="filter_desc" name="desc" type="text" class="form-control"<?php if(isset($filter_desc)){ echo'value="'.$filter_desc.'"';}?>>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-12 text-center">
|
<div class="col-12 text-center">
|
||||||
<button type="submit" class="btn btn-outline-primary">
|
<button type="submit" class="btn btn-outline-primary">
|
||||||
<span class="ing-buscar ing-fw"></span>
|
<span class="ing-buscar ing-fw"></span>
|
||||||
Filtrar
|
Filtrar
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" class="btn btn-outline-danger btn-reset">
|
<button type="submit" class="btn btn-outline-danger btn-reset">
|
||||||
<span class="ing-borrar ing-fw"></span>
|
<span class="ing-borrar ing-fw"></span>
|
||||||
Limpiar
|
Limpiar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Tabla -->
|
<!-- Tabla -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 table-responsive">
|
<div class="col-12 table-responsive">
|
||||||
<table class="table table-sm table-striped table-white">
|
<table class="table table-sm table-striped table-white">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Estado</th>
|
<th>Estado</th>
|
||||||
<th>Facultad</th>
|
<th>Facultad</th>
|
||||||
<?php if($user->acceso == 'w') {?>
|
<?php if($user->acceso == 'w') {?>
|
||||||
<th>Acciones</th>
|
<th>Acciones</th>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
foreach($fs_facultades as $facultad){
|
foreach($fs_facultades as $facultad){
|
||||||
?>
|
?>
|
||||||
<tr data-id="<?php echo $facultad["facultad_id"];?>" id="<?php echo $facultad["facultad_id"];?>">
|
<tr data-id="<?php echo $facultad["facultad_id"];?>" id="<?php echo $facultad["facultad_id"];?>">
|
||||||
<?php
|
<?php
|
||||||
$color = "danger";
|
$color = "danger";
|
||||||
$title = "Inactiva";
|
$title = "Inactiva";
|
||||||
if($facultad["facultad_activa"]==1){
|
if($facultad["facultad_activa"]==1){
|
||||||
$color ="success";
|
$color ="success";
|
||||||
$title="Activa";
|
$title="Activa";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<td class="text-<?php echo $color;?> text-center" title="<?php echo $title;?>">
|
<td class="text-<?php echo $color;?> text-center" title="<?php echo $title;?>">
|
||||||
<span class="ing-bullet"></span>
|
<span class="ing-bullet"></span>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-primary"><?php echo $facultad["facultad_nombre"];?></td>
|
<td class="text-primary"><?php echo $facultad["facultad_nombre"];?></td>
|
||||||
<?php if($user->acceso == 'w') {?>
|
<?php if($user->acceso == 'w') {?>
|
||||||
<td class="text-center icono-acciones">
|
<td class="text-center icono-acciones">
|
||||||
<a href="#" data-toggle="modal" data-target="#modal" data-tipo="2" title="Editar"><span class="ing-editar ing-fw"></span></a>
|
<a href="#" data-toggle="modal" data-target="#modal" data-tipo="2" title="Editar"><span class="ing-editar ing-fw"></span></a>
|
||||||
<a href="carreras.php?facultad=<?php echo $facultad["facultad_id"];?>" title="Agregar carreras o periodos"><span class="ing-mas inf-fw"></span></a>
|
<a href="carreras.php?facultad=<?php echo $facultad["facultad_id"];?>" title="Agregar carreras o periodos"><span class="ing-mas inf-fw"></span></a>
|
||||||
</td>
|
</td>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div id="message"></div>
|
<div id="message"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<?php
|
<?php
|
||||||
include "import/html_footer.php";
|
include "import/html_footer.php";
|
||||||
?>
|
?>
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div class="modal fade" id="modal" tabindex="-1" role="dialog" arialabelledby="modal" aria-hidden="true">
|
<div class="modal fade" id="modal" tabindex="-1" role="dialog" arialabelledby="modal" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="col-12 modal-title text-center">
|
<h4 class="col-12 modal-title text-center">
|
||||||
<span id="modalLabel">
|
<span id="modalLabel">
|
||||||
Editar nombre de Facultad
|
Editar nombre de Facultad
|
||||||
</span>
|
</span>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form action="" method="post" id="formaModal" onsubmit="return valida_campos()">
|
<form action="" method="post" id="formaModal" onsubmit="return valida_campos()">
|
||||||
<input type="hidden" name="id" id="id">
|
<input type="hidden" name="id" id="id">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="nombre" class="col-4 col-form-label">Nombre *</label>
|
<label for="nombre" class="col-4 col-form-label">Nombre *</label>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<input id="nombre" name="nombre" type="text" class="form-control" maxlength="100">
|
<input id="nombre" name="nombre" type="text" class="form-control" maxlength="100">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="estado" class="col-4 col-form-label">Estado *</label>
|
<label for="estado" class="col-4 col-form-label">Estado *</label>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div class="form-check form-check-inline">
|
<div class="form-check form-check-inline">
|
||||||
<input class="form-check-input radio-lg" type="radio" id="estado_activo" name="estado" value="1" checked="checked">
|
<input class="form-check-input radio-lg" type="radio" id="estado_activo" name="estado" value="1" checked="checked">
|
||||||
<label for="estado_activo" class="col-form-label">Activo</label>
|
<label for="estado_activo" class="col-form-label">Activo</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div class="form-check form-check-inline">
|
<div class="form-check form-check-inline">
|
||||||
<input class="form-check-input radio-lg" type="radio" id="estado_inactivo" name="estado" value="0">
|
<input class="form-check-input radio-lg" type="radio" id="estado_inactivo" name="estado" value="0">
|
||||||
<label for="estado_inactivo" class="col-form-label">Inactivo</label>
|
<label for="estado_inactivo" class="col-form-label">Inactivo</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class ="form-group row mt-3">
|
<div class ="form-group row mt-3">
|
||||||
<div class="offset-4 col-8">
|
<div class="offset-4 col-8">
|
||||||
<button type="submit" class="btn btn-outline-primary" id="submitBtn" data-tipo="1">
|
<button type="submit" class="btn btn-outline-primary" id="submitBtn" data-tipo="1">
|
||||||
<span class="ing-aceptar ing-fw"></span> Guardar
|
<span class="ing-aceptar ing-fw"></span> Guardar
|
||||||
</button>
|
</button>
|
||||||
<button type="reset" class="btn btn-outline-danger" data-dismiss="modal">
|
<button type="reset" class="btn btn-outline-danger" data-dismiss="modal">
|
||||||
<span class="ing-cancelar ing-fw"></span> Cancelar
|
<span class="ing-cancelar ing-fw"></span> Cancelar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="js/bootstrap/bootstrap.min.js"></script>
|
<script src="js/bootstrap/bootstrap.min.js"></script>
|
||||||
<?php
|
<?php
|
||||||
require_once 'js/messages.php';
|
require_once 'js/messages.php';
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
<?php if(!$fs_facultades){?>
|
<?php if(!$fs_facultades){?>
|
||||||
triggerMessage("No se encontraron facultades con estos datos", "Error");
|
triggerMessage("No se encontraron facultades con estos datos", "Error");
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
|
||||||
function valida_campos(){
|
function valida_campos(){
|
||||||
var error=false;
|
var error=false;
|
||||||
if($("#nombre").val()==""){
|
if($("#nombre").val()==""){
|
||||||
$("#nombre").addClass("is-invalid");
|
$("#nombre").addClass("is-invalid");
|
||||||
error=true;
|
error=true;
|
||||||
}else{
|
}else{
|
||||||
$("#nombre").removeClass("is-invalid");
|
$("#nombre").removeClass("is-invalid");
|
||||||
}
|
}
|
||||||
if($('#estado_activo').prop('checked') == false && $('#estado_inactivo').prop('checked') == false){
|
if($('#estado_activo').prop('checked') == false && $('#estado_inactivo').prop('checked') == false){
|
||||||
error=true;
|
error=true;
|
||||||
}
|
}
|
||||||
if(error){
|
if(error){
|
||||||
return false;
|
return false;
|
||||||
}else{
|
}else{
|
||||||
var btn = $('#submitBtn');
|
var btn = $('#submitBtn');
|
||||||
if(btn.data("tipo")==2)//update
|
if(btn.data("tipo")==2)//update
|
||||||
$('#formaModal').prop("action", "./action/action_facultades_update.php");
|
$('#formaModal').prop("action", "./action/action_facultades_update.php");
|
||||||
else//insert
|
else//insert
|
||||||
$('#formaModal').prop("action", "./action/action_facultades_insert.php");
|
$('#formaModal').prop("action", "./action/action_facultades_insert.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on("click", ".btn-reset", function(event){
|
$(document).on("click", ".btn-reset", function(event){
|
||||||
var forma = $(this).parents("form");
|
var forma = $(this).parents("form");
|
||||||
forma.find("input[type=text]").val("");
|
forma.find("input[type=text]").val("");
|
||||||
setDatalistFirst("#filter_desc");
|
setDatalistFirst("#filter_desc");
|
||||||
forma.submit();
|
forma.submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#modal').on('show.bs.modal', function(event){
|
$('#modal').on('show.bs.modal', function(event){
|
||||||
var button = $(event.relatedTarget);
|
var button = $(event.relatedTarget);
|
||||||
var tipo = button.data('tipo');
|
var tipo = button.data('tipo');
|
||||||
var modal = $(this);
|
var modal = $(this);
|
||||||
if(tipo == 1){//crear
|
if(tipo == 1){//crear
|
||||||
$("#submitBtn").data('tipo', 1);
|
$("#submitBtn").data('tipo', 1);
|
||||||
$("#modalLabel").html("Crear Facultad");
|
$("#modalLabel").html("Crear Facultad");
|
||||||
$("#nombre").val("");
|
$("#nombre").val("");
|
||||||
$('#estado_inactivo').prop('checked', false);
|
$('#estado_inactivo').prop('checked', false);
|
||||||
$('#estado_activo').prop('checked', true);
|
$('#estado_activo').prop('checked', true);
|
||||||
}else{//editar
|
}else{//editar
|
||||||
$("#submitBtn").data('tipo', 2);
|
$("#submitBtn").data('tipo', 2);
|
||||||
$("#modalLabel").html("Editar Facultad");
|
$("#modalLabel").html("Editar Facultad");
|
||||||
$("#nombre").val("");
|
$("#nombre").val("");
|
||||||
$('#estado_inactivo').prop('checked', false);
|
$('#estado_inactivo').prop('checked', false);
|
||||||
$('#estado_activo').prop('checked', true);
|
$('#estado_activo').prop('checked', true);
|
||||||
var id = $(event.relatedTarget).parents("tr").data("id");
|
var id = $(event.relatedTarget).parents("tr").data("id");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:"action/action_facultades_select.php",
|
url:"action/action_facultades_select.php",
|
||||||
type:"post",
|
type:"post",
|
||||||
dataType:"json",
|
dataType:"json",
|
||||||
data:{id_facultad: id},
|
data:{id_facultad: id},
|
||||||
success:function(result){
|
success:function(result){
|
||||||
$("#id").val(result[0]["facultad_id"]);
|
$("#id").val(result[0]["facultad_id"]);
|
||||||
$("#nombre").val(result[0]["facultad_nombre"]);
|
$("#nombre").val(result[0]["facultad_nombre"]);
|
||||||
if(result[0]["facultad_activa"]==1){
|
if(result[0]["facultad_activa"]==1){
|
||||||
$('#estado_inactivo').prop('checked', false);
|
$('#estado_inactivo').prop('checked', false);
|
||||||
$('#estado_activo').prop('checked', true);
|
$('#estado_activo').prop('checked', true);
|
||||||
}else{
|
}else{
|
||||||
$('#estado_inactivo').prop('checked', true);
|
$('#estado_inactivo').prop('checked', true);
|
||||||
$('#estado_activo').prop('checked', false);
|
$('#estado_activo').prop('checked', false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(){console.log("Error")}
|
error: function(){console.log("Error")}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -1,135 +1,135 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'class/c_login.php';
|
require_once 'class/c_login.php';
|
||||||
if (!isset($_SESSION['user']))
|
if (!isset($_SESSION['user']))
|
||||||
die(header('Location: index.php'));
|
die(header('Location: index.php'));
|
||||||
|
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
$user->access();
|
$user->access();
|
||||||
if (!$user->admin && in_array($user->acceso, ['n']))
|
if (!$user->admin && in_array($user->acceso, ['n']))
|
||||||
die(header('Location: main.php?error=1'));
|
die(header('Location: main.php?error=1'));
|
||||||
|
|
||||||
$user->print_to_log('Consultar horario');
|
$user->print_to_log('Consultar horario');
|
||||||
|
|
||||||
$write = $user->admin || in_array($user->acceso, ['w']);
|
$write = $user->admin || in_array($user->acceso, ['w']);
|
||||||
// var_dump($user);
|
// var_dump($user);
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>Consultar horario | <?= $user->facultad['facultad'] ?? 'General' ?></title>
|
<title>Consultar horario | <?= $user->facultad['facultad'] ?? 'General' ?></title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="content-type" content="text/plain; charset=UTF-8" />
|
<meta http-equiv="content-type" content="text/plain; charset=UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<?php include_once "import/html_css_files.php"; ?>
|
<?php include_once "import/html_css_files.php"; ?>
|
||||||
|
|
||||||
<script src="js/scrollables.js" defer></script>
|
<script src="js/scrollables.js" defer></script>
|
||||||
<script src="js/jquery.min.js" defer></script>
|
<script src="js/jquery.min.js" defer></script>
|
||||||
<script src="js/bootstrap/bootstrap.min.js" defer></script>
|
<script src="js/bootstrap/bootstrap.min.js" defer></script>
|
||||||
|
|
||||||
<script src="js/messages.js" defer></script>
|
<script src="js/messages.js" defer></script>
|
||||||
<script>
|
<script>
|
||||||
const write = <?= $write ? 'true' : 'false' ?>;
|
const write = <?= $write ? 'true' : 'false' ?>;
|
||||||
</script>
|
</script>
|
||||||
<script src="js/moment.js" defer></script>
|
<script src="js/moment.js" defer></script>
|
||||||
<script src="js/horario_profesor.js" defer></script>
|
<script src="js/horario_profesor.js" defer></script>
|
||||||
</head>
|
</head>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<body style="display: block;">
|
<body style="display: block;">
|
||||||
<?php
|
<?php
|
||||||
include('include/constantes.php');
|
include('include/constantes.php');
|
||||||
include("import/html_header.php");
|
include("import/html_header.php");
|
||||||
html_header("Consultar horario", "Sistema de gestión de checador");
|
html_header("Consultar horario", "Sistema de gestión de checador");
|
||||||
?>
|
?>
|
||||||
<?= "<!-- $user -->" ?>
|
<?= "<!-- $user -->" ?>
|
||||||
<main class="container content marco content-margin" id="local-app">
|
<main class="container content marco content-margin" id="local-app">
|
||||||
<section id="message"></section>
|
<section id="message"></section>
|
||||||
<?php require('import/periodo.php') ?>
|
<?php require('import/periodo.php') ?>
|
||||||
|
|
||||||
<form id="form" class="form-horizontal">
|
<form id="form" class="form-horizontal">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<input type="hidden" name="periodo" value="<?= $user->periodo ?>" />
|
<input type="hidden" name="periodo" value="<?= $user->periodo ?>" />
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="clave_profesor" class="col-4 col-form-label">Profesor</label>
|
<label for="clave_profesor" class="col-4 col-form-label">Profesor</label>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<input list="lista_profesores" name="clave_profesor" id="clave_profesor" class="form-control" placeholder="Profesor" required="required">
|
<input list="lista_profesores" name="clave_profesor" id="clave_profesor" class="form-control" placeholder="Profesor" required="required">
|
||||||
<div class="valid-feedback">
|
<div class="valid-feedback">
|
||||||
Profesor encontrado
|
Profesor encontrado
|
||||||
</div>
|
</div>
|
||||||
<div class="invalid-feedback">
|
<div class="invalid-feedback">
|
||||||
Profesor no encontrado
|
Profesor no encontrado
|
||||||
</div>
|
</div>
|
||||||
<datalist id="lista_profesores">
|
<datalist id="lista_profesores">
|
||||||
<?php
|
<?php
|
||||||
$profesores = $db->where('facultad_id', $user->facultad['facultad_id'])->get("fs_profesor");
|
$profesores = $db->where('facultad_id', $user->facultad['facultad_id'])->get("fs_profesor");
|
||||||
foreach ($profesores as $profesor) {
|
foreach ($profesores as $profesor) {
|
||||||
extract($profesor);
|
extract($profesor);
|
||||||
?>
|
?>
|
||||||
<option data-grado="<?= $grado ?>" data-clave="<?= $clave ?>" data-profesor="<?= $profesor ?>" data-id="<?= $id; ?>" value="<?= "$clave | $grado $profesor" ?>"></option>
|
<option data-grado="<?= $grado ?>" data-clave="<?= $clave ?>" data-profesor="<?= $profesor ?>" data-id="<?= $id; ?>" value="<?= "$clave | $grado $profesor" ?>"></option>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</datalist>
|
</datalist>
|
||||||
<ul class="list-group" id="profesores"></ul>
|
<ul class="list-group" id="profesores"></ul>
|
||||||
<input type="hidden" id="periodo_id" name="periodo_id" value="<?= $user->periodo ?>">
|
<input type="hidden" id="periodo_id" name="periodo_id" value="<?= $user->periodo ?>">
|
||||||
<input type="hidden" id="profesor_id" name="profesor_id" value="">
|
<input type="hidden" id="profesor_id" name="profesor_id" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ICO-BUSCAR FILTRAR & ICO-BORRAR LIMPIAR -->
|
<!-- ICO-BUSCAR FILTRAR & ICO-BORRAR LIMPIAR -->
|
||||||
<div class="form-group row justify-content-center">
|
<div class="form-group row justify-content-center">
|
||||||
<button class="btn btn-outline-primary mr-2">
|
<button class="btn btn-outline-primary mr-2">
|
||||||
<span class="ing-buscar icono"></span>
|
<span class="ing-buscar icono"></span>
|
||||||
Buscar horario
|
Buscar horario
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-outline-danger" onclick="location.reload()">
|
<button type="button" class="btn btn-outline-danger" onclick="location.reload()">
|
||||||
<span class="ing-borrar icono"></span>
|
<span class="ing-borrar icono"></span>
|
||||||
Limpiar
|
Limpiar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="form-group mt-4 row justify-content-center">
|
<div class="form-group mt-4 row justify-content-center">
|
||||||
<?php if ($write) { ?>
|
<?php if ($write) { ?>
|
||||||
<button type="button" id="nuevo" class="btn btn-outline-primary ml-4 d-none" title="Nuevo horario" data-toggle="modal" data-target="#modal-editar">
|
<button type="button" id="nuevo" class="btn btn-outline-primary ml-4 d-none" title="Nuevo horario" data-toggle="modal" data-target="#modal-editar">
|
||||||
<span class="ing-mas ing-fw"></span> Nuevo
|
<span class="ing-mas ing-fw"></span> Nuevo
|
||||||
</button>
|
</button>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
<!-- Horario is a (table with one a cell) within a table
|
<!-- Horario is a (table with one a cell) within a table
|
||||||
7:15 - 8:45, 8:45 - 10:15, 10:30 - 12:00, 12:00 - 13:30
|
7:15 - 8:45, 8:45 - 10:15, 10:30 - 12:00, 12:00 - 13:30
|
||||||
de lunes a viernes, a excepción de que tenga sábado
|
de lunes a viernes, a excepción de que tenga sábado
|
||||||
-->
|
-->
|
||||||
<div id="btn-excel-horario" class="mb-2 float-right hidden">
|
<div id="btn-excel-horario" class="mb-2 float-right hidden">
|
||||||
<button class="btn btn-outline-secondary " title="Exportar a Excel">
|
<button class="btn btn-outline-secondary " title="Exportar a Excel">
|
||||||
<span class="ing-descarga ing-fw"></span> Exportar a Excel
|
<span class="ing-descarga ing-fw"></span> Exportar a Excel
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<!-- Table responsive -->
|
<!-- Table responsive -->
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-bordered table-sm table-responsive-md" id="table-horario">
|
<table class="table table-bordered table-sm table-responsive-md" id="table-horario">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
<tr id="headers">
|
<tr id="headers">
|
||||||
<th scope="col" class="text-center">Hora</th>
|
<th scope="col" class="text-center">Hora</th>
|
||||||
<th scope="col" class="text-center">Lunes</th>
|
<th scope="col" class="text-center">Lunes</th>
|
||||||
<th scope="col" class="text-center">Martes</th>
|
<th scope="col" class="text-center">Martes</th>
|
||||||
<th scope="col" class="text-center">Miércoles</th>
|
<th scope="col" class="text-center">Miércoles</th>
|
||||||
<th scope="col" class="text-center">Jueves</th>
|
<th scope="col" class="text-center">Jueves</th>
|
||||||
<th scope="col" class="text-center">Viernes</th>
|
<th scope="col" class="text-center">Viernes</th>
|
||||||
<th scope="col" class="text-center">Sábado</th>
|
<th scope="col" class="text-center">Sábado</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="horario"></tbody>
|
<tbody id="horario"></tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<link rel="icon" type="image/png" href="imagenes/favicon.png" />
|
<link rel="icon" type="image/png" href="imagenes/favicon.png" />
|
||||||
<link rel="stylesheet" href="css/bootstrap-ulsa.min.css" type="text/css">
|
<link rel="stylesheet" href="css/bootstrap-ulsa.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="css/indivisa.css" type="text/css">
|
<link rel="stylesheet" href="css/indivisa.css" type="text/css">
|
||||||
<link rel="stylesheet" href="css/sgi.css?rand=<?php echo rand(); ?>" type="text/css">
|
<link rel="stylesheet" href="css/sgi.css?rand=<?php echo rand(); ?>" type="text/css">
|
||||||
<link rel="stylesheet" href="css/style.css">
|
<link rel="stylesheet" href="css/style.css">
|
||||||
<link rel="stylesheet" href="css/jquery-ui.css">
|
<link rel="stylesheet" href="css/jquery-ui.css">
|
||||||
@@ -1,105 +1,105 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<footer class="footer" >
|
<footer class="footer" >
|
||||||
<div class="footerTop">
|
<div class="footerTop">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="logotipo">
|
<div class="logotipo">
|
||||||
<img src="imagenes/lasalle-logo-blanco.png" alt="Universidad La Salle" width="15%">
|
<img src="imagenes/lasalle-logo-blanco.png" alt="Universidad La Salle" width="15%">
|
||||||
<h3> <span>Profesionales</span>con <strong>Valor</strong></h3>
|
<h3> <span>Profesionales</span>con <strong>Valor</strong></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="ubicacion">
|
<div class="ubicacion">
|
||||||
<div class="address">
|
<div class="address">
|
||||||
<div class="tabs">
|
<div class="tabs">
|
||||||
<ul class="nav list-inline" id="tabsFooter" role="tablist">
|
<ul class="nav list-inline" id="tabsFooter" role="tablist">
|
||||||
<li class="list-inline-item">
|
<li class="list-inline-item">
|
||||||
<a class="nav-link active" id="unidad1-tab" data-toggle="tab" href="#unidad1" role="tab" aria-controls="calendario" aria-selected="true">Unidad Condesa</a>
|
<a class="nav-link active" id="unidad1-tab" data-toggle="tab" href="#unidad1" role="tab" aria-controls="calendario" aria-selected="true">Unidad Condesa</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-inline-item">
|
<li class="list-inline-item">
|
||||||
<a class="nav-link " id="unidad2-tab" data-toggle="tab" href="#unidad2" role="tab" aria-controls="lista" aria-selected="false">Unidad Santa Teresa</a>
|
<a class="nav-link " id="unidad2-tab" data-toggle="tab" href="#unidad2" role="tab" aria-controls="lista" aria-selected="false">Unidad Santa Teresa</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-inline-item">
|
<li class="list-inline-item">
|
||||||
<a class="nav-link " id="unidad3-tab" data-toggle="tab" href="#unidad3" role="tab" aria-controls="lista" aria-selected="false">Unidad San Fernando</a>
|
<a class="nav-link " id="unidad3-tab" data-toggle="tab" href="#unidad3" role="tab" aria-controls="lista" aria-selected="false">Unidad San Fernando</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-inline-item">
|
<li class="list-inline-item">
|
||||||
<a class="nav-link" id="unidad4-tab" data-toggle="tab" href="#unidad4" role="tab" aria-controls="lista" aria-selected="false">Unidad Santa Lucía</a>
|
<a class="nav-link" id="unidad4-tab" data-toggle="tab" href="#unidad4" role="tab" aria-controls="lista" aria-selected="false">Unidad Santa Lucía</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content" id="tabsCont">
|
<div class="tab-content" id="tabsCont">
|
||||||
<div class="tab-pane fade show active" id="unidad1" role="tabpanel" aria-labelledby="unidad1-tab">
|
<div class="tab-pane fade show active" id="unidad1" role="tabpanel" aria-labelledby="unidad1-tab">
|
||||||
<p>Benjamín Franklin No 45, Col. Condesa, Alc. Cuauhtémoc, CDMX, CP 06140 <span class="tel">Tel. <a href="tel:+525552789500">55 5278-9500</a> / <a href="tel:+8005272553">800 LASALLE</a></span><br>
|
<p>Benjamín Franklin No 45, Col. Condesa, Alc. Cuauhtémoc, CDMX, CP 06140 <span class="tel">Tel. <a href="tel:+525552789500">55 5278-9500</a> / <a href="tel:+8005272553">800 LASALLE</a></span><br>
|
||||||
<a class="btnMap " href="https://www.google.com/maps/place/Universidad+La+Salle/@19.4085702,-99.1810039,15z/data=!4m5!3m4!1s0x0:0x3108b5797f9c9ecd!8m2!3d19.4085702!4d-99.1810039" target="_blank"> <span class="fas fa-map-marker-alt mr-1"></span>¿Cómo llegar?</a></p>
|
<a class="btnMap " href="https://www.google.com/maps/place/Universidad+La+Salle/@19.4085702,-99.1810039,15z/data=!4m5!3m4!1s0x0:0x3108b5797f9c9ecd!8m2!3d19.4085702!4d-99.1810039" target="_blank"> <span class="fas fa-map-marker-alt mr-1"></span>¿Cómo llegar?</a></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade" id="unidad2" role="tabpanel" aria-labelledby="unidad2-tab">
|
<div class="tab-pane fade" id="unidad2" role="tabpanel" aria-labelledby="unidad2-tab">
|
||||||
<p>Camino a Santa Teresa 811, Col. Rinconada del Pedregal, Alc. Tlalpan, CDMX, CP 14010 <span class="tel">Tel. <a href="tel:5552789500">55 5278-9500</a> / <a href="tel:+8005272553">800 LASALLE</a></span><br>
|
<p>Camino a Santa Teresa 811, Col. Rinconada del Pedregal, Alc. Tlalpan, CDMX, CP 14010 <span class="tel">Tel. <a href="tel:5552789500">55 5278-9500</a> / <a href="tel:+8005272553">800 LASALLE</a></span><br>
|
||||||
<a class="btnMap " href="https://www.google.com/maps/place/Universidad+La+Salle+Unidad+Santa+Teresa/@19.299013,-99.196093,15z/data=!4m5!3m4!1s0x0:0xdfc2b61c9b67aac2!8m2!3d19.299013!4d-99.196093" target="_blank"> <span class="fas fa-map-marker-alt mr-1"></span>¿Cómo llegar?</a></p>
|
<a class="btnMap " href="https://www.google.com/maps/place/Universidad+La+Salle+Unidad+Santa+Teresa/@19.299013,-99.196093,15z/data=!4m5!3m4!1s0x0:0xdfc2b61c9b67aac2!8m2!3d19.299013!4d-99.196093" target="_blank"> <span class="fas fa-map-marker-alt mr-1"></span>¿Cómo llegar?</a></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade" id="unidad3" role="tabpanel" aria-labelledby="unidad3-tab">
|
<div class="tab-pane fade" id="unidad3" role="tabpanel" aria-labelledby="unidad3-tab">
|
||||||
<p>Av. De Las Fuentes 17, Col. Tlalpan, Alc. Tlalpan, CDMX, CP 14000 <span class="tel">Tel. <a href="tel:+525552789500">55 5278-9500</a> / <a href="tel:+8005272553">800 LASALLE</a></span><br>
|
<p>Av. De Las Fuentes 17, Col. Tlalpan, Alc. Tlalpan, CDMX, CP 14000 <span class="tel">Tel. <a href="tel:+525552789500">55 5278-9500</a> / <a href="tel:+8005272553">800 LASALLE</a></span><br>
|
||||||
<a class="btnMap " href="https://www.google.com/maps/place/Universidad+La+Salle+Facultad+de+Medicina/@19.2930318,-99.1720808,15z/data=!4m5!3m4!1s0x0:0x29b7725e5a004277!8m2!3d19.2930318!4d-99.1720808" target="_blank"> <span class="fas fa-map-marker-alt mr-1"></span>¿Cómo llegar?</a></p>
|
<a class="btnMap " href="https://www.google.com/maps/place/Universidad+La+Salle+Facultad+de+Medicina/@19.2930318,-99.1720808,15z/data=!4m5!3m4!1s0x0:0x29b7725e5a004277!8m2!3d19.2930318!4d-99.1720808" target="_blank"> <span class="fas fa-map-marker-alt mr-1"></span>¿Cómo llegar?</a></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade" id="unidad4" role="tabpanel" aria-labelledby="unidad4-tab">
|
<div class="tab-pane fade" id="unidad4" role="tabpanel" aria-labelledby="unidad4-tab">
|
||||||
<p>Av. Tamaulipas 3, Col. Zona Federal, Alc. Álvaro Obregón, CDMX, CP 01357 <span class="tel">Tel. <a href="tel:5556021130">55 5602-1130</a> </span><br>
|
<p>Av. Tamaulipas 3, Col. Zona Federal, Alc. Álvaro Obregón, CDMX, CP 01357 <span class="tel">Tel. <a href="tel:5556021130">55 5602-1130</a> </span><br>
|
||||||
<a class="btnMap " href="https://www.google.com/maps/place/Unidad+Deportiva+La+Salle/@19.3662852,-99.2421597,15z/data=!4m5!3m4!1s0x0:0x88e0334f044bc518!8m2!3d19.3662852!4d-99.2421597" target="_blank"> <span class="fas fa-map-marker-alt mr-1"></span>¿Cómo llegar?</a></p>
|
<a class="btnMap " href="https://www.google.com/maps/place/Unidad+Deportiva+La+Salle/@19.3662852,-99.2421597,15z/data=!4m5!3m4!1s0x0:0x88e0334f044bc518!8m2!3d19.3662852!4d-99.2421597" target="_blank"> <span class="fas fa-map-marker-alt mr-1"></span>¿Cómo llegar?</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="redes">
|
<div class="redes">
|
||||||
<h4>Compartir :</h4>
|
<h4>Compartir :</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://www.facebook.com/LaSalleMXIngenieria" target="_blank"><i class="fab fa-facebook-f fa-fw"></i></a></li>
|
<li><a href="https://www.facebook.com/LaSalleMXIngenieria" target="_blank"><i class="fab fa-facebook-f fa-fw"></i></a></li>
|
||||||
<!--<li><a href="https://twitter.com/lasalle_mx" target="_blank"><i class="fab fa-twitter fa-fw"></i></a></li>-->
|
<!--<li><a href="https://twitter.com/lasalle_mx" target="_blank"><i class="fab fa-twitter fa-fw"></i></a></li>-->
|
||||||
<li><a href="https://www.youtube.com/user/IngenieriaLaSalle/" target="_blank"><i class="fab fa-youtube fa-fw"></i></a></li>
|
<li><a href="https://www.youtube.com/user/IngenieriaLaSalle/" target="_blank"><i class="fab fa-youtube fa-fw"></i></a></li>
|
||||||
<!--<li><a href="https://www.instagram.com/lasalle_mx/" target="_blank"><i class="fab fa-instagram fa-fw"></i></a></li>-->
|
<!--<li><a href="https://www.instagram.com/lasalle_mx/" target="_blank"><i class="fab fa-instagram fa-fw"></i></a></li>-->
|
||||||
<!--<li><a href="https://www.linkedin.com/school/universidad-la-salle?pathWildcard=24227" target="_blank"><i class="fab fa-linkedin-in fa-fw"></i></a></li>-->
|
<!--<li><a href="https://www.linkedin.com/school/universidad-la-salle?pathWildcard=24227" target="_blank"><i class="fab fa-linkedin-in fa-fw"></i></a></li>-->
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="footerMiddle">
|
<div class="footerMiddle">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row justify-content-md-center">
|
<div class="row justify-content-md-center">
|
||||||
<nav class="col-12 col-md-10">
|
<nav class="col-12 col-md-10">
|
||||||
<a class="footerMore menuMore" href="#">Sistema y Red La Salle</a>
|
<a class="footerMore menuMore" href="#">Sistema y Red La Salle</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="http://bajio.delasalle.edu.mx/" target="_blank">Bajío</a></li>
|
<li><a href="http://bajio.delasalle.edu.mx/" target="_blank">Bajío</a></li>
|
||||||
<li><a href="http://www.lasalle.mx/" target="_blank">Ciudad de México</a></li>
|
<li><a href="http://www.lasalle.mx/" target="_blank">Ciudad de México</a></li>
|
||||||
<li><a href="http://lasallecancun.edu.mx/" target="_blank">Cancún</a></li>
|
<li><a href="http://lasallecancun.edu.mx/" target="_blank">Cancún</a></li>
|
||||||
<li><a href="http://www.ulsapuebla.mx/" target="_blank">Puebla</a></li>
|
<li><a href="http://www.ulsapuebla.mx/" target="_blank">Puebla</a></li>
|
||||||
<li><a href="http://www.ulsapuebla.mx/" target="_blank">Chihuahua</a></li>
|
<li><a href="http://www.ulsapuebla.mx/" target="_blank">Chihuahua</a></li>
|
||||||
<li><a href="http://www.lasallecuernavaca.edu.mx/wp/" target="_blank">Cuernavaca</a></li>
|
<li><a href="http://www.lasallecuernavaca.edu.mx/wp/" target="_blank">Cuernavaca</a></li>
|
||||||
<li><a href="http://www.ulsalaguna.edu.mx/" target="_blank">Laguna</a></li>
|
<li><a href="http://www.ulsalaguna.edu.mx/" target="_blank">Laguna</a></li>
|
||||||
<li><a href="http://www.lasallemorelia.edu.mx/" target="_blank">Morelia</a></li>
|
<li><a href="http://www.lasallemorelia.edu.mx/" target="_blank">Morelia</a></li>
|
||||||
<li><a href="http://www.ulsaneza.edu.mx/" target="_blank">Nezahualcóyotl</a></li>
|
<li><a href="http://www.ulsaneza.edu.mx/" target="_blank">Nezahualcóyotl</a></li>
|
||||||
<li><a href="http://www.ulsa-noroeste.edu.mx/n2015/" target="_blank">Noroeste</a></li>
|
<li><a href="http://www.ulsa-noroeste.edu.mx/n2015/" target="_blank">Noroeste</a></li>
|
||||||
<li><a href="http://www.ulsaoaxaca.edu.mx/" target="_blank">Oaxaca</a></li>
|
<li><a href="http://www.ulsaoaxaca.edu.mx/" target="_blank">Oaxaca</a></li>
|
||||||
<li><a href="http://www.lasallep.edu.mx/" target="_blank">Pachuca</a></li>
|
<li><a href="http://www.lasallep.edu.mx/" target="_blank">Pachuca</a></li>
|
||||||
<li><a href="https://www.ulsasaltillo.edu.mx/" target="_blank">Saltillo</a></li>
|
<li><a href="https://www.ulsasaltillo.edu.mx/" target="_blank">Saltillo</a></li>
|
||||||
<li><a href="https://www.lasallevictoria.edu.mx/" target="_blank">Victoria</a></li>
|
<li><a href="https://www.lasallevictoria.edu.mx/" target="_blank">Victoria</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="footerBottom">
|
<div class="footerBottom">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="logotipos">
|
<div class="logotipos">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="http://redlasalle.mx/" target="_blank"><img src="imagenes/la-salle-logo-red-universidades.png" alt="La Salle - logotipo" class="img-responsive" width="80"></a></li>
|
<li><a href="http://redlasalle.mx/" target="_blank"><img src="imagenes/la-salle-logo-red-universidades.png" alt="La Salle - logotipo" class="img-responsive" width="80"></a></li>
|
||||||
<li><a href="http://ialu.org/english/" target="_blank"><img src="imagenes/la-salle-logo-international-ia.png" alt="La Salle - logotipo" class="img-responsive" width="80"></a></li>
|
<li><a href="http://ialu.org/english/" target="_blank"><img src="imagenes/la-salle-logo-international-ia.png" alt="La Salle - logotipo" class="img-responsive" width="80"></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="legales">
|
<div class="legales">
|
||||||
<a class="footerMore menuMore" href="#">Legales</a>
|
<a class="footerMore menuMore" href="#">Legales</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://lasalle.mx/globales/contacto.html" target="_blank">Contacto</a></li>
|
<li><a href="https://lasalle.mx/globales/contacto.html" target="_blank">Contacto</a></li>
|
||||||
<li><a href="https://lasalle.mx/globales/terminos-y-condiciones.html" target="_blank">Términos y condiciones</a></li>
|
<li><a href="https://lasalle.mx/globales/terminos-y-condiciones.html" target="_blank">Términos y condiciones</a></li>
|
||||||
<li><a href="https://lasalle.mx/globales/aviso-de-privacidad.html" target="_blank">Aviso de Privacidad</a></li>
|
<li><a href="https://lasalle.mx/globales/aviso-de-privacidad.html" target="_blank">Aviso de Privacidad</a></li>
|
||||||
<!--<li><a href="https://lasalle.mx/globales/mapa-de-sitio.html" target="_blank">Mapa de sitio</a></li>
|
<!--<li><a href="https://lasalle.mx/globales/mapa-de-sitio.html" target="_blank">Mapa de sitio</a></li>
|
||||||
<li><a href="https://lasalle.mx/globales/preguntas-frecuentes/" target="_blank">Preguntas frecuentes</a></li>-->
|
<li><a href="https://lasalle.mx/globales/preguntas-frecuentes/" target="_blank">Preguntas frecuentes</a></li>-->
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
<?php // Necesita sesión y BD abiertas
|
<?php // Necesita sesión y BD abiertas
|
||||||
require_once "include/constantes.php";
|
require_once "include/constantes.php";
|
||||||
?>
|
?>
|
||||||
<link rel="stylesheet" href="css/jquery-ui.css">
|
<link rel="stylesheet" href="css/jquery-ui.css">
|
||||||
<link rel="stylesheet" href="css/calendar.css">
|
<link rel="stylesheet" href="css/calendar.css">
|
||||||
<?php
|
<?php
|
||||||
require_once "import/periodo.php";
|
require_once "import/periodo.php";
|
||||||
?>
|
?>
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="js/jquery-ui.js"></script>
|
<script src="js/jquery-ui.js"></script>
|
||||||
<script src="js/datepicker-es.js"></script>
|
<script src="js/datepicker-es.js"></script>
|
||||||
|
|
||||||
<?php include_once "js/messages.php"; ?>
|
<?php include_once "js/messages.php"; ?>
|
||||||
|
|
||||||
|
|
||||||
<!-- <script>
|
<!-- <script>
|
||||||
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
||||||
$(".date-picker").datepicker({
|
$(".date-picker").datepicker({
|
||||||
dateFormat: "dd/mm/yyyy",
|
dateFormat: "dd/mm/yyyy",
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
});
|
});
|
||||||
</script> -->
|
</script> -->
|
||||||
@@ -1,139 +1,139 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once "import/html_forms.php";
|
include_once "import/html_forms.php";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<form id="asistencia">
|
<form id="asistencia">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<input type="hidden" name="facultad" value="<?= $user->facultad['facultad_id']; ?>">
|
<input type="hidden" name="facultad" value="<?= $user->facultad['facultad_id']; ?>">
|
||||||
<?php
|
<?php
|
||||||
$periodo = $db->where('id', $user->periodo)->getOne('fs_periodo');
|
$periodo = $db->where('id', $user->periodo)->getOne('fs_periodo');
|
||||||
$carreras = $db
|
$carreras = $db
|
||||||
->where('nivel', $periodo['nivel_id'])
|
->where('nivel', $periodo['nivel_id'])
|
||||||
->where('facultad', $user->facultad['facultad_id'])
|
->where('facultad', $user->facultad['facultad_id'])
|
||||||
->orderBy('carrera')
|
->orderBy('carrera')
|
||||||
->get('fs_carrera');
|
->get('fs_carrera');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_carrera" class="col-4 col-form-label">Carrera</label>
|
<label for="filter_carrera" class="col-4 col-form-label">Carrera</label>
|
||||||
<div class="col-6 ">
|
<div class="col-6 ">
|
||||||
<div id="dlcarrera" class="datalist datalist-select mb-1 w-100">
|
<div id="dlcarrera" class="datalist datalist-select mb-1 w-100">
|
||||||
<div class="datalist-input">Seleccionar todas las carreras</div>
|
<div class="datalist-input">Seleccionar todas las carreras</div>
|
||||||
<span class="ing-buscar icono"></span>
|
<span class="ing-buscar icono"></span>
|
||||||
<ul style="display:none">
|
<ul style="display:none">
|
||||||
<li data-id="">Seleccionar todas las carreras</li>
|
<li data-id="">Seleccionar todas las carreras</li>
|
||||||
<?php
|
<?php
|
||||||
foreach ($carreras as $carrera) {
|
foreach ($carreras as $carrera) {
|
||||||
?>
|
?>
|
||||||
<li data-id="<?= $carrera['id'] ?>">
|
<li data-id="<?= $carrera['id'] ?>">
|
||||||
<?= $carrera['carrera'] ?>
|
<?= $carrera['carrera'] ?>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
<input type="hidden" id="filter_carrera" name="carrera" value="">
|
<input type="hidden" id="filter_carrera" name="carrera" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filterClave" class="col-4 col-form-label">Clave</label>
|
<label for="filterClave" class="col-4 col-form-label">Clave</label>
|
||||||
<div class="col-6 ">
|
<div class="col-6 ">
|
||||||
<input type="text" class="form-control" id="filterClave" name="clave" placeholder="Clave del profesor (opcional)" value="<?= $clave ?? '' ?>" pattern="(do)?[0-9]{3,6}" title="La clave debe tener 8 caracteres, los primeros 2 deben ser letras y los últimos 6 números" minlength="3" maxlength="8">
|
<input type="text" class="form-control" id="filterClave" name="clave" placeholder="Clave del profesor (opcional)" value="<?= $clave ?? '' ?>" pattern="(do)?[0-9]{3,6}" title="La clave debe tener 8 caracteres, los primeros 2 deben ser letras y los últimos 6 números" minlength="3" maxlength="8">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filterNombre" class="col-4 col-form-label">Nombre</label>
|
<label for="filterNombre" class="col-4 col-form-label">Nombre</label>
|
||||||
<div class="col-6 ">
|
<div class="col-6 ">
|
||||||
<input type="text" class="form-control" id="filterNombre" name="nombre" placeholder="Nombre del profesor (opcional)">
|
<input type="text" class="form-control" id="filterNombre" name="nombre" placeholder="Nombre del profesor (opcional)">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="fecha_inicial" class="col-4 col-form-label">Fecha inicial</label>
|
<label for="fecha_inicial" class="col-4 col-form-label">Fecha inicial</label>
|
||||||
<div class="col-8 col-sm-4">
|
<div class="col-8 col-sm-4">
|
||||||
<input id="fecha_inicial" name="fecha_inicial" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly>
|
<input id="fecha_inicial" name="fecha_inicial" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly>
|
||||||
<div class="invalid-feedback">No es una fecha válida.</div>
|
<div class="invalid-feedback">No es una fecha válida.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="fecha_final" class="col-4 col-form-label">Fecha final</label>
|
<label for="fecha_final" class="col-4 col-form-label">Fecha final</label>
|
||||||
<div class="col-8 col-sm-4">
|
<div class="col-8 col-sm-4">
|
||||||
<input id="fecha_final" name="fecha_final" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly>
|
<input id="fecha_final" name="fecha_final" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly>
|
||||||
<div class="invalid-feedback">No es una fecha válida o el rango es incorrecto.</div>
|
<div class="invalid-feedback">No es una fecha válida o el rango es incorrecto.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row justify-content-center">
|
<div class="form-group row justify-content-center">
|
||||||
<button type="submit" class="btn btn-outline-primary mr-2" id="btn-buscar"><?php echo $ICO["buscar"]; ?> Buscar asistencias</button>
|
<button type="submit" class="btn btn-outline-primary mr-2" id="btn-buscar"><?php echo $ICO["buscar"]; ?> Buscar asistencias</button>
|
||||||
<button type="button" class="btn btn-outline-danger" onclick="window.location.href = window.location.href"><?php echo $ICO["borrar"]; ?> Limpiar</button>
|
<button type="button" class="btn btn-outline-danger" onclick="window.location.href = window.location.href"><?php echo $ICO["borrar"]; ?> Limpiar</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
||||||
$(".date-picker").datepicker({
|
$(".date-picker").datepicker({
|
||||||
dateFormat: "dd/mm/yyyy",
|
dateFormat: "dd/mm/yyyy",
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
});
|
});
|
||||||
<?php
|
<?php
|
||||||
$periodo = query("SELECT * FROM FS_PERIODO WHERE ID = :periodo", [":periodo" => $user->periodo]);
|
$periodo = query("SELECT * FROM FS_PERIODO WHERE ID = :periodo", [":periodo" => $user->periodo]);
|
||||||
echo "// Período: {$periodo["inicio"]} - {$periodo["fin"]}\n";
|
echo "// Período: {$periodo["inicio"]} - {$periodo["fin"]}\n";
|
||||||
echo "// Fecha inicial: " . ($fecha_inicial ?? 'n/a') . " - Fecha final: " . ($fecha_final ?? 'n/a') . "\n";
|
echo "// Fecha inicial: " . ($fecha_inicial ?? 'n/a') . " - Fecha final: " . ($fecha_final ?? 'n/a') . "\n";
|
||||||
?>
|
?>
|
||||||
// $periodo format = Y-m-d
|
// $periodo format = Y-m-d
|
||||||
const inicio = new Date(<?= date('Y, m-1, d', strtotime($periodo['inicio'])) ?>);
|
const inicio = new Date(<?= date('Y, m-1, d', strtotime($periodo['inicio'])) ?>);
|
||||||
var fecha_inicial = new Date(<?= date('Y, m-1, d', strtotime($fecha_inicial ?? $periodo['inicio'])) ?>)
|
var fecha_inicial = new Date(<?= date('Y, m-1, d', strtotime($fecha_inicial ?? $periodo['inicio'])) ?>)
|
||||||
var fecha_final = new Date(<?= date('Y, m-1, d', strtotime($fecha_final ?? $periodo['fin'])) ?>)
|
var fecha_final = new Date(<?= date('Y, m-1, d', strtotime($fecha_final ?? $periodo['fin'])) ?>)
|
||||||
const limit = new Date(Math.min(today, fecha_final));
|
const limit = new Date(Math.min(today, fecha_final));
|
||||||
|
|
||||||
console.log(`today: ${today}, fecha_inicial: ${fecha_inicial}, fecha_final: ${fecha_final}`);
|
console.log(`today: ${today}, fecha_inicial: ${fecha_inicial}, fecha_final: ${fecha_final}`);
|
||||||
$("#fecha_inicial").datepicker("option", "minDate", inicio);
|
$("#fecha_inicial").datepicker("option", "minDate", inicio);
|
||||||
$("#fecha_inicial").datepicker("option", "maxDate", limit);
|
$("#fecha_inicial").datepicker("option", "maxDate", limit);
|
||||||
$("#fecha_final").datepicker("option", "minDate", fecha_inicial);
|
$("#fecha_final").datepicker("option", "minDate", fecha_inicial);
|
||||||
$("#fecha_final").datepicker("option", "maxDate", limit);
|
$("#fecha_final").datepicker("option", "maxDate", limit);
|
||||||
// if today is in the period, set the initial date to today
|
// if today is in the period, set the initial date to today
|
||||||
$("#fecha_inicial").datepicker("setDate", fecha_inicial);
|
$("#fecha_inicial").datepicker("setDate", fecha_inicial);
|
||||||
$("#fecha_final").datepicker("setDate", today <= fecha_final ? today : fecha_final);
|
$("#fecha_final").datepicker("setDate", today <= fecha_final ? today : fecha_final);
|
||||||
|
|
||||||
// if the datepicker is changed, check if the range is valid
|
// if the datepicker is changed, check if the range is valid
|
||||||
makeRequiredDatalist("#filter_facultad", true);
|
makeRequiredDatalist("#filter_facultad", true);
|
||||||
makeRequiredDatalist("#filter_carrera", true);
|
makeRequiredDatalist("#filter_carrera", true);
|
||||||
|
|
||||||
|
|
||||||
$(document).on('click', '#dlFacultad ul li', function() {
|
$(document).on('click', '#dlFacultad ul li', function() {
|
||||||
var id = $(this).data('id');
|
var id = $(this).data('id');
|
||||||
// remove all option
|
// remove all option
|
||||||
$('#dlcarrera ul').empty();
|
$('#dlcarrera ul').empty();
|
||||||
disableDatalist("#filter_carrera", false);
|
disableDatalist("#filter_carrera", false);
|
||||||
$.post(
|
$.post(
|
||||||
'action/action_carreras.php', {
|
'action/action_carreras.php', {
|
||||||
facultad: id,
|
facultad: id,
|
||||||
periodo: $('#periodo').val()
|
periodo: $('#periodo').val()
|
||||||
},
|
},
|
||||||
function(data) {
|
function(data) {
|
||||||
$('#dlcarrera ul').append("<li>Seleccionar todas</li>");
|
$('#dlcarrera ul').append("<li>Seleccionar todas</li>");
|
||||||
for (var i = 0; i < data.length; i++)
|
for (var i = 0; i < data.length; i++)
|
||||||
$('#dlcarrera ul').append(`<li data-id="${data[i].id}">${data[i].carrera}</li>`);
|
$('#dlcarrera ul').append(`<li data-id="${data[i].id}">${data[i].carrera}</li>`);
|
||||||
setDatalistFirst("#filter_carrera")
|
setDatalistFirst("#filter_carrera")
|
||||||
},
|
},
|
||||||
'json'
|
'json'
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('change', '#fecha_inicial', function() {
|
$(document).on('change', '#fecha_inicial', function() {
|
||||||
var fi = $(this).datepicker("getDate");
|
var fi = $(this).datepicker("getDate");
|
||||||
$("#fecha_final").datepicker("option", "minDate", fi);
|
$("#fecha_final").datepicker("option", "minDate", fi);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('change', '#fecha_final', function() {
|
$(document).on('change', '#fecha_final', function() {
|
||||||
var ff = $(this).datepicker("getDate");
|
var ff = $(this).datepicker("getDate");
|
||||||
$("#fecha_inicial").datepicker("option", "maxDate", ff);
|
$("#fecha_inicial").datepicker("option", "maxDate", ff);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -1,111 +1,111 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once "import/html_forms.php";
|
include_once "import/html_forms.php";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<link rel="stylesheet" href="css/clockpicker.css">
|
<link rel="stylesheet" href="css/clockpicker.css">
|
||||||
<form id="justificar">
|
<form id="justificar">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="col-md-6 col-sm-12 text-center mb-3">
|
<div class="col-md-6 col-sm-12 text-center mb-3">
|
||||||
Selecciona la fecha que deseas justificar.
|
Selecciona la fecha que deseas justificar.
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_fecha" class="col-4 col-form-label">Fecha *</label>
|
<label for="filter_fecha" class="col-4 col-form-label">Fecha *</label>
|
||||||
<div class="col-6 ">
|
<div class="col-6 ">
|
||||||
<input id="filter_fecha" name="fecha" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly>
|
<input id="filter_fecha" name="fecha" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly>
|
||||||
<div class="invalid-feedback">No es una fecha válida.</div>
|
<div class="invalid-feedback">No es una fecha válida.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Hora inicio CLOCKPICKER -->
|
<!-- Hora inicio CLOCKPICKER -->
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_hora_inicio" class="col-4 col-form-label">Hora estimada *</label>
|
<label for="filter_hora_inicio" class="col-4 col-form-label">Hora estimada *</label>
|
||||||
<div class="input-group clockpicker col-6 ">
|
<div class="input-group clockpicker col-6 ">
|
||||||
<input id="filter_hora_inicio" name="hora_inicio" type="text" class="form-control" placeholder="hh:mm" maxlength="5" required="required" readonly>
|
<input id="filter_hora_inicio" name="hora_inicio" type="text" class="form-control" placeholder="hh:mm" maxlength="5" required="required" readonly>
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<span class="input-group-text" onclick="$('#filter_hora_inicio').focus();">
|
<span class="input-group-text" onclick="$('#filter_hora_inicio').focus();">
|
||||||
<i class="ing-reloj"></i>
|
<i class="ing-reloj"></i>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="invalid-feedback">No es una hora válida.</div>
|
<div class="invalid-feedback">No es una hora válida.</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Hora fin -->
|
<!-- Hora fin -->
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_hora_fin" class="col-4 col-form-label">Hora límite</label>
|
<label for="filter_hora_fin" class="col-4 col-form-label">Hora límite</label>
|
||||||
<div class="input-group clockpicker col-6">
|
<div class="input-group clockpicker col-6">
|
||||||
<input id="filter_hora_fin" name="hora_fin" type="text" class="form-control" placeholder="hh:mm" maxlength="5" readonly>
|
<input id="filter_hora_fin" name="hora_fin" type="text" class="form-control" placeholder="hh:mm" maxlength="5" readonly>
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<span class="input-group-text" onclick="$('#filter_hora_fin').focus();">
|
<span class="input-group-text" onclick="$('#filter_hora_fin').focus();">
|
||||||
<i class="ing-reloj"></i>
|
<i class="ing-reloj"></i>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="invalid-feedback">No es una hora válida.</div>
|
<div class="invalid-feedback">No es una hora válida.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- ClaveULSA -->
|
<!-- ClaveULSA -->
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_clave" class="col-4 col-form-label">Clave</label>
|
<label for="filter_clave" class="col-4 col-form-label">Clave</label>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<input id="filter_clave" name="clave" type="text" class="form-control" pattern="(do)?[0-9]{3,6}" placeholder="Clave del profesor (do)" maxlength="8" title="Clave del profesor (do)">
|
<input id="filter_clave" name="clave" type="text" class="form-control" pattern="(do)?[0-9]{3,6}" placeholder="Clave del profesor (do)" maxlength="8" title="Clave del profesor (do)">
|
||||||
<div class="invalid-feedback">No es una clave válida.</div>
|
<div class="invalid-feedback">No es una clave válida.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Nombre -->
|
<!-- Nombre -->
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_nombre" class="col-4 col-form-label">Nombre</label>
|
<label for="filter_nombre" class="col-4 col-form-label">Nombre</label>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<input id="filter_nombre" name="nombre" type="text" class="form-control" placeholder="Nombre del profesor" maxlength="50" title="Nombre del profesor">
|
<input id="filter_nombre" name="nombre" type="text" class="form-control" placeholder="Nombre del profesor" maxlength="50" title="Nombre del profesor">
|
||||||
<div class="invalid-feedback">No es un nombre válido.</div>
|
<div class="invalid-feedback">No es un nombre válido.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- button center -->
|
<!-- button center -->
|
||||||
<div class="form-group row justify-content-center p-3">
|
<div class="form-group row justify-content-center p-3">
|
||||||
<button class="btn btn-primary mr-3" id="main-button" type="button">
|
<button class="btn btn-primary mr-3" id="main-button" type="button">
|
||||||
<?= $ICO['buscar'] ?>
|
<?= $ICO['buscar'] ?>
|
||||||
Buscar profesores
|
Buscar profesores
|
||||||
</button>
|
</button>
|
||||||
<!-- reload page -->
|
<!-- reload page -->
|
||||||
<button type="button" class="btn btn-outline-danger" onclick="location.reload();">
|
<button type="button" class="btn btn-outline-danger" onclick="location.reload();">
|
||||||
<span class="ing-borrar icono"></span>
|
<span class="ing-borrar icono"></span>
|
||||||
Limpiar
|
Limpiar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script src="js/clockpicker.js"></script>
|
<script src="js/clockpicker.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
||||||
$(".date-picker").datepicker({
|
$(".date-picker").datepicker({
|
||||||
dateFormat: "dd/mm/yyyy",
|
dateFormat: "dd/mm/yyyy",
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.clockpicker').clockpicker({
|
$('.clockpicker').clockpicker({
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
donetext: 'Aceptar',
|
donetext: 'Aceptar',
|
||||||
autoclose: true,
|
autoclose: true,
|
||||||
'default': 'now',
|
'default': 'now',
|
||||||
|
|
||||||
afterShow: function() {
|
afterShow: function() {
|
||||||
$('.clockpicker-minutes').find('.clockpicker-tick').filter(function() {
|
$('.clockpicker-minutes').find('.clockpicker-tick').filter(function() {
|
||||||
return $(this).text() % 5 !== 0;
|
return $(this).text() % 5 !== 0;
|
||||||
}).remove();
|
}).remove();
|
||||||
|
|
||||||
$('.clockpicker-hours').find('.clockpicker-tick').filter(function(index, element) {
|
$('.clockpicker-hours').find('.clockpicker-tick').filter(function(index, element) {
|
||||||
let num = parseInt($(element).text());
|
let num = parseInt($(element).text());
|
||||||
let condition = num < 7 || num > 22;
|
let condition = num < 7 || num > 22;
|
||||||
return condition;
|
return condition;
|
||||||
}).remove();
|
}).remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
// only accept from 7:00 to 22:00
|
// only accept from 7:00 to 22:00
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -1,163 +1,163 @@
|
|||||||
<section id="message"></section>
|
<section id="message"></section>
|
||||||
<?php
|
<?php
|
||||||
$target = '/checador_otros/admin_checador/reporte_de_asistencias.php';
|
$target = '/checador_otros/admin_checador/reporte_de_asistencias.php';
|
||||||
$id = $_POST['id'];
|
$id = $_POST['id'];
|
||||||
include_once "import/html_forms.php";
|
include_once "import/html_forms.php";
|
||||||
|
|
||||||
$carreras = queryAll("SELECT DISTINCT carrera, id, facultad FROM FS_CARRERA WHERE ID IN (SELECT distinct CARRERA_ID FROM FS_HORARIO_BASIC WHERE :id IN (SELECT HORARIO_ID FROM HORARIO_PROFESOR WHERE PROFESOR_ID = :id) AND PERIODO_ID = :per)", [':id' => $id, ':per' => $user->periodo]);
|
$carreras = queryAll("SELECT DISTINCT carrera, id, facultad FROM FS_CARRERA WHERE ID IN (SELECT distinct CARRERA_ID FROM FS_HORARIO_BASIC WHERE :id IN (SELECT HORARIO_ID FROM HORARIO_PROFESOR WHERE PROFESOR_ID = :id) AND PERIODO_ID = :per)", [':id' => $id, ':per' => $user->periodo]);
|
||||||
// materia por carrera
|
// materia por carrera
|
||||||
#print_r($carreras);
|
#print_r($carreras);
|
||||||
$materias = queryAll("SELECT DISTINCT * FROM FS_MATERIA WHERE CARRERA = COALESCE(:car, CARRERA) AND ID IN (SELECT distinct materia_id FROM HORARIO WHERE :id IN (SELECT HORARIO_ID FROM HORARIO_PROFESOR WHERE PROFESOR_ID = :id) AND PERIODO_ID = :per) ORDER BY NOMBRE", [":car" => empty($carrera) ? null : $carrera, ':id' => $id, ':per' => $user->periodo]);
|
$materias = queryAll("SELECT DISTINCT * FROM FS_MATERIA WHERE CARRERA = COALESCE(:car, CARRERA) AND ID IN (SELECT distinct materia_id FROM HORARIO WHERE :id IN (SELECT HORARIO_ID FROM HORARIO_PROFESOR WHERE PROFESOR_ID = :id) AND PERIODO_ID = :per) ORDER BY NOMBRE", [":car" => empty($carrera) ? null : $carrera, ':id' => $id, ':per' => $user->periodo]);
|
||||||
#exit();
|
#exit();
|
||||||
$periodo = query("SELECT inicio, fin FROM FS_PERIODO WHERE ID = :per", [':per' => $user->periodo]);
|
$periodo = query("SELECT inicio, fin FROM FS_PERIODO WHERE ID = :per", [':per' => $user->periodo]);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<form action="#" method="post" id="form" class="form-horizontal">
|
<form action="#" method="post" id="form" class="form-horizontal">
|
||||||
<input type="hidden" name="id" value="<?= $id; ?>" />
|
<input type="hidden" name="id" value="<?= $id; ?>" />
|
||||||
<input type="hidden" name="periodo" value="<?= $user->periodo ?>" />
|
<input type="hidden" name="periodo" value="<?= $user->periodo ?>" />
|
||||||
<input type="hidden" name="facultad" value="<?= $user->facultad['facultad_id'] ?>" />
|
<input type="hidden" name="facultad" value="<?= $user->facultad['facultad_id'] ?>" />
|
||||||
<input type="hidden" name="clave" value="<?= $profesor['clave'] ?>" />
|
<input type="hidden" name="clave" value="<?= $profesor['clave'] ?>" />
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_carrera" class="col-4 col-form-label">Carrera</label>
|
<label for="filter_carrera" class="col-4 col-form-label">Carrera</label>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<div id="dlcarrera" class="datalist datalist-select mb-1 w-100">
|
<div id="dlcarrera" class="datalist datalist-select mb-1 w-100">
|
||||||
<div class="datalist-input">Todas las carreras</div>
|
<div class="datalist-input">Todas las carreras</div>
|
||||||
<span class="ing-buscar icono"></span>
|
<span class="ing-buscar icono"></span>
|
||||||
<ul style="display:none">
|
<ul style="display:none">
|
||||||
<!-- Seleccionar todas -->
|
<!-- Seleccionar todas -->
|
||||||
<li data-value="0">Todas las carreras</li>
|
<li data-value="0">Todas las carreras</li>
|
||||||
<?php foreach ($carreras as $car) {
|
<?php foreach ($carreras as $car) {
|
||||||
?>
|
?>
|
||||||
<li data-id="<?= $car['id'] ?>" class="<?= ($car['id'] == $carrera) ? "selected" : '' ?>" onclick="carreras(<?= $car['id'] ?>)">
|
<li data-id="<?= $car['id'] ?>" class="<?= ($car['id'] == $carrera) ? "selected" : '' ?>" onclick="carreras(<?= $car['id'] ?>)">
|
||||||
<?= $car['carrera'] ?>
|
<?= $car['carrera'] ?>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
<input type="hidden" id="filter_carrera" name="carrera" value="">
|
<input type="hidden" id="filter_carrera" name="carrera" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Materia -->
|
<!-- Materia -->
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="filter_materia" class="col-4 col-form-label">Materia</label>
|
<label for="filter_materia" class="col-4 col-form-label">Materia</label>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<div id="dlmateria" class="datalist datalist-select mb-1 w-100">
|
<div id="dlmateria" class="datalist datalist-select mb-1 w-100">
|
||||||
<div class="datalist-input">Todas las materias</div>
|
<div class="datalist-input">Todas las materias</div>
|
||||||
<span class="ing-buscar icono"></span>
|
<span class="ing-buscar icono"></span>
|
||||||
<ul style="display:none">
|
<ul style="display:none">
|
||||||
<li data-value="0">Todas las materias</li>
|
<li data-value="0">Todas las materias</li>
|
||||||
<?php foreach ($materias as $materia) { ?>
|
<?php foreach ($materias as $materia) { ?>
|
||||||
<li data-id="<?= $materia['id']; ?>" class="<?= ($materia['id'] == $_POST['materia']) ? "selected" : '' ?>">
|
<li data-id="<?= $materia['id']; ?>" class="<?= ($materia['id'] == $_POST['materia']) ? "selected" : '' ?>">
|
||||||
<?= $materia['nombre']; ?>
|
<?= $materia['nombre']; ?>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
<input type="hidden" id="filter_materia" name="materia" value="">
|
<input type="hidden" id="filter_materia" name="materia" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Fecha inicial y fecha final -->
|
<!-- Fecha inicial y fecha final -->
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="fecha_inicial" class="col-4 col-form-label">Fecha inicial</label>
|
<label for="fecha_inicial" class="col-4 col-form-label">Fecha inicial</label>
|
||||||
<div class="col-8 col-sm-4">
|
<div class="col-8 col-sm-4">
|
||||||
<input id="fecha_inicial" name="fecha_inicial" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly>
|
<input id="fecha_inicial" name="fecha_inicial" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly>
|
||||||
<div class="invalid-feedback">No es una fecha válida.</div>
|
<div class="invalid-feedback">No es una fecha válida.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="fecha_final" class="col-4 col-form-label">Fecha final</label>
|
<label for="fecha_final" class="col-4 col-form-label">Fecha final</label>
|
||||||
<div class="col-8 col-sm-4">
|
<div class="col-8 col-sm-4">
|
||||||
<input id="fecha_final" name="fecha_final" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly>
|
<input id="fecha_final" name="fecha_final" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly>
|
||||||
<div class="invalid-feedback">No es una fecha válida o el rango es incorrecto.</div>
|
<div class="invalid-feedback">No es una fecha válida o el rango es incorrecto.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ICO-BUSCAR FILTRAR & ICO-BORRAR LIMPIAR -->
|
<!-- ICO-BUSCAR FILTRAR & ICO-BORRAR LIMPIAR -->
|
||||||
<div class="form-group row justify-content-center">
|
<div class="form-group row justify-content-center">
|
||||||
<button type="button" class="btn btn-outline-primary mr-2" onclick="if(validateForm) submit('vista_profesor.php')">
|
<button type="button" class="btn btn-outline-primary mr-2" onclick="if(validateForm) submit('vista_profesor.php')">
|
||||||
<span class="ing-buscar icono"></span>
|
<span class="ing-buscar icono"></span>
|
||||||
Filtrar
|
Filtrar
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-outline-danger" onclick="reset_form(); submit('vista_profesor.php')">
|
<button type="button" class="btn btn-outline-danger" onclick="reset_form(); submit('vista_profesor.php')">
|
||||||
<span class="ing-borrar icono"></span>
|
<span class="ing-borrar icono"></span>
|
||||||
Limpiar
|
Limpiar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
include_once "js/messages.php";
|
include_once "js/messages.php";
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
$(".date-picker").datepicker($.datepicker.regional["es"]);
|
||||||
$(".date-picker").datepicker({
|
$(".date-picker").datepicker({
|
||||||
dateFormat: "dd/mm/yyyy",
|
dateFormat: "dd/mm/yyyy",
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
});
|
});
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
|
|
||||||
var fecha_inicial = new Date(<?= $fecha_inicial->format("Y, m-1, d") ?>);
|
var fecha_inicial = new Date(<?= $fecha_inicial->format("Y, m-1, d") ?>);
|
||||||
var fecha_inicial_periodo = new Date(<?= date("Y, m-1, d", strtotime($periodo['inicio'])) ?>);
|
var fecha_inicial_periodo = new Date(<?= date("Y, m-1, d", strtotime($periodo['inicio'])) ?>);
|
||||||
var fecha_final = new Date(<?= $fecha_final->format("Y, m-1, d") ?>);
|
var fecha_final = new Date(<?= $fecha_final->format("Y, m-1, d") ?>);
|
||||||
var fecha_final_periodo = new Date(<?= date("Y, m-1, d", strtotime($periodo['fin'])) ?>);
|
var fecha_final_periodo = new Date(<?= date("Y, m-1, d", strtotime($periodo['fin'])) ?>);
|
||||||
var limit = new Date(Math.min(today, fecha_final_periodo));
|
var limit = new Date(Math.min(today, fecha_final_periodo));
|
||||||
// if today is in the period, set the initial date to today
|
// if today is in the period, set the initial date to today
|
||||||
$("#fecha_inicial").datepicker("option", "minDate", fecha_inicial_periodo);
|
$("#fecha_inicial").datepicker("option", "minDate", fecha_inicial_periodo);
|
||||||
$("#fecha_inicial").datepicker("option", "maxDate", limit);
|
$("#fecha_inicial").datepicker("option", "maxDate", limit);
|
||||||
$("#fecha_final").datepicker("option", "minDate", fecha_inicial_periodo);
|
$("#fecha_final").datepicker("option", "minDate", fecha_inicial_periodo);
|
||||||
$("#fecha_final").datepicker("option", "maxDate", limit);
|
$("#fecha_final").datepicker("option", "maxDate", limit);
|
||||||
|
|
||||||
$("#fecha_inicial").datepicker("setDate", fecha_inicial);
|
$("#fecha_inicial").datepicker("setDate", fecha_inicial);
|
||||||
$("#fecha_final").datepicker("setDate", today <= fecha_final ? today : fecha_final);
|
$("#fecha_final").datepicker("setDate", today <= fecha_final ? today : fecha_final);
|
||||||
|
|
||||||
function reset_form() {
|
function reset_form() {
|
||||||
$("#fecha_inicial").datepicker("setDate", fecha_inicial_periodo);
|
$("#fecha_inicial").datepicker("setDate", fecha_inicial_periodo);
|
||||||
$("#fecha_final").datepicker("setDate", today <= fecha_inicial_periodo ? today : fecha_final_periodo);
|
$("#fecha_final").datepicker("setDate", today <= fecha_inicial_periodo ? today : fecha_final_periodo);
|
||||||
setDatalistFirst("#filter_carrera");
|
setDatalistFirst("#filter_carrera");
|
||||||
setDatalistFirst("#filter_materia");
|
setDatalistFirst("#filter_materia");
|
||||||
disableDatalist("#filter_materia");
|
disableDatalist("#filter_materia");
|
||||||
}
|
}
|
||||||
|
|
||||||
<?php if (empty($carrera)) { ?>
|
<?php if (empty($carrera)) { ?>
|
||||||
disableDatalist("#filter_materia", true);
|
disableDatalist("#filter_materia", true);
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
// $("#fecha_inicial").on("change", function() {
|
// $("#fecha_inicial").on("change", function() {
|
||||||
// var fecha_inicial = $("#fecha_inicial").datepicker("getDate");
|
// var fecha_inicial = $("#fecha_inicial").datepicker("getDate");
|
||||||
// var fecha_final = $("#fecha_final").datepicker("getDate");
|
// var fecha_final = $("#fecha_final").datepicker("getDate");
|
||||||
// if (fecha_final < fecha_inicial) {
|
// if (fecha_final < fecha_inicial) {
|
||||||
// $("#fecha_final").datepicker("setDate", fecha_inicial);
|
// $("#fecha_final").datepicker("setDate", fecha_inicial);
|
||||||
// }
|
// }
|
||||||
// $("#fecha_final").datepicker("option", "minDate", fecha_inicial);
|
// $("#fecha_final").datepicker("option", "minDate", fecha_inicial);
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// $("#fecha_final").on("change", function() {
|
// $("#fecha_final").on("change", function() {
|
||||||
// var fecha_inicial = $("#fecha_inicial").datepicker("getDate");
|
// var fecha_inicial = $("#fecha_inicial").datepicker("getDate");
|
||||||
// var fecha_final = $("#fecha_final").datepicker("getDate");
|
// var fecha_final = $("#fecha_final").datepicker("getDate");
|
||||||
// if (fecha_final < fecha_inicial) {
|
// if (fecha_final < fecha_inicial) {
|
||||||
// $("#fecha_inicial").datepicker("setDate", fecha_final);
|
// $("#fecha_inicial").datepicker("setDate", fecha_final);
|
||||||
// }
|
// }
|
||||||
// $("#fecha_inicial").datepicker("option", "maxDate", fecha_final);
|
// $("#fecha_inicial").datepicker("option", "maxDate", fecha_final);
|
||||||
// });
|
// });
|
||||||
// Datalist carrera then select materia
|
// Datalist carrera then select materia
|
||||||
$(document).on('click', '#dlcarrera li', function() {
|
$(document).on('click', '#dlcarrera li', function() {
|
||||||
// if this is empty
|
// if this is empty
|
||||||
// console.log($(this).attr('data-value'));
|
// console.log($(this).attr('data-value'));
|
||||||
if ($(this).attr('data-value') == '0')
|
if ($(this).attr('data-value') == '0')
|
||||||
disableDatalist("#filter_materia", true);
|
disableDatalist("#filter_materia", true);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('change', '#fecha_inicial', function() {
|
$(document).on('change', '#fecha_inicial', function() {
|
||||||
let fi = $(this).datepicker("getDate");
|
let fi = $(this).datepicker("getDate");
|
||||||
$("#fecha_final").datepicker("option", "minDate", fi);
|
$("#fecha_final").datepicker("option", "minDate", fi);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('change', '#fecha_final', function() {
|
$(document).on('change', '#fecha_final', function() {
|
||||||
let ff = $(this).datepicker("getDate");
|
let ff = $(this).datepicker("getDate");
|
||||||
$("#fecha_inicial").datepicker("option", "maxDate", ff);
|
$("#fecha_inicial").datepicker("option", "maxDate", ff);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -1,160 +1,149 @@
|
|||||||
<script defer src="js/sidebarmenu.js"></script>
|
<script defer src="js/sidebarmenu.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
require_once 'class/c_login.php';
|
require_once 'class/c_login.php';
|
||||||
$ruta = "../";
|
$ruta = "../";
|
||||||
require_once 'include/bd_pdo.php';
|
require_once 'include/bd_pdo.php';
|
||||||
|
|
||||||
if (!isset($_SESSION['user'])) {
|
if (!isset($_SESSION['user'])) {
|
||||||
if (isset($redirect))
|
if (isset($redirect))
|
||||||
$_SESSION['ruta'] = $redirect;
|
$_SESSION['ruta'] = $redirect;
|
||||||
|
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = unserialize($_SESSION['user']);
|
$user = unserialize($_SESSION['user']);
|
||||||
|
if ($user->admin):
|
||||||
function html_header($title, $header = null)
|
?><!-- <pre><? var_dump($user) ?></pre> -->
|
||||||
{
|
<?
|
||||||
global $user;
|
endif;
|
||||||
$grupos = queryAll("SELECT * FROM GRUPO ORDER BY grupo_nombre");
|
$grupos = $user->admin ? queryAll("SELECT * FROM GRUPO ORDER BY grupo_nombre") : $db->query("SELECT * FROM GRUPO WHERE grupo_id IN (SELECT grupo_id FROM PERMISO_VIEW WHERE id = :id) ORDER BY grupo_nombre", array(":id" => $user->user['id']));
|
||||||
|
|
||||||
if ($user->admin)
|
function html_header($title, $header = null)
|
||||||
$paginas = queryAll("SELECT * FROM pagina ORDER BY pagina_ruta");
|
{
|
||||||
else
|
global $grupos, $user, $db;
|
||||||
$paginas = queryAll("SELECT * FROM PERMISO_VIEW WHERE id = :id ORDER BY pagina_ruta", array(":id" => $user->user['id']));
|
?>
|
||||||
|
<aside id="sidebar" class="bg-light defaultShadow d-flex flex-column p-4">
|
||||||
?>
|
<div class="d-flex align-items-center mb-5">
|
||||||
<aside id="sidebar" class="bg-light defaultShadow d-flex flex-column p-4">
|
<div class="logotipo"><a href="https://lasalle.mx/" target="_blank"><img src="imagenes/logo_lasalle.png"></a>
|
||||||
<div class="d-flex align-items-center mb-5">
|
</div>
|
||||||
<div class="logotipo"><a href="https://lasalle.mx/" target="_blank"><img src="imagenes/logo_lasalle.png"></a>
|
<div class="flex-grow-1 d-flex justify-content-end">
|
||||||
</div>
|
<nav class="navbar navbar-expand d-none d-flex">
|
||||||
<div class="flex-grow-1 d-flex justify-content-end">
|
<ul class="navbar-nav">
|
||||||
<nav class="navbar navbar-expand d-none d-flex">
|
|
||||||
<ul class="navbar-nav">
|
</ul>
|
||||||
|
</nav>
|
||||||
</ul>
|
<div class="d-flex mainMenu justify-content-center align-items-center">
|
||||||
</nav>
|
<div class="max-h iconSesion">
|
||||||
<div class="d-flex mainMenu justify-content-center align-items-center">
|
<a href="salir.php" class="iconOff max-h pl-3 d-flex justify-content-start align-items-center"><i
|
||||||
<div class="max-h iconSesion">
|
class="ing-salir"></i></a>
|
||||||
<a href="salir.php" class="iconOff max-h pl-3 d-flex justify-content-start align-items-center"><i
|
</div>
|
||||||
class="ing-salir"></i></a>
|
<div class="max-h">
|
||||||
</div>
|
<div class="bg-primary rounded-circle pointer max-h max-w d-flex justify-content-center align-items-center"
|
||||||
<div class="max-h">
|
id="dismiss">
|
||||||
<div class="bg-primary rounded-circle pointer max-h max-w d-flex justify-content-center align-items-center"
|
<span class="text-white iconMenuSidebar ing-cancelar"></span>
|
||||||
id="dismiss">
|
</div>
|
||||||
<span class="text-white iconMenuSidebar ing-cancelar"></span>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="accordion px-2" id="accordionMenu">
|
||||||
</div>
|
<p class="mb-0 mt-3 ml-4 pl-1">
|
||||||
<div class="accordion px-2" id="accordionMenu">
|
<a class="d-block side-menu" href="main.php">
|
||||||
<p class="mb-0 mt-3 ml-4 pl-1">
|
<span class="ing-home"></span> Menú
|
||||||
<a class="d-block side-menu" href="main.php">
|
</a>
|
||||||
<span class="ing-home"></span> Menú
|
</p>
|
||||||
</a>
|
|
||||||
</p>
|
<?php
|
||||||
|
if ($user->admin) { ?>
|
||||||
<?php
|
<p class="mb-0 mt-3 ml-4 pl-1">
|
||||||
if ($user->admin) { ?>
|
<a href="permisos.php" class="d-block side-menu">
|
||||||
<p class="mb-0 mt-3 ml-4 pl-1">
|
<span class="ing-pass"></span> Permisos
|
||||||
<a href="permisos.php" class="d-block side-menu">
|
</a>
|
||||||
<span class="ing-pass"></span> Permisos
|
</p>
|
||||||
</a>
|
<?php }
|
||||||
</p>
|
foreach ($grupos as $key => $grupo) {
|
||||||
<?php }
|
?>
|
||||||
$cont = 0;
|
<p class="mb-0 mt-3">
|
||||||
foreach ($grupos as $grupo) {
|
<a class="d-block side-menu collapsed" data-toggle="collapse" href="#menu_<?= $key ?>" role="button"
|
||||||
?>
|
aria-expanded="false">
|
||||||
<p class="mb-0 mt-3">
|
<i class="ing-caret ing-fw mr-2"></i>
|
||||||
<a class="d-block side-menu collapsed" data-toggle="collapse" href="#menu_<?= $cont ?>" role="button"
|
<span class="<?= $grupo['grupo_icon'] ?>"></span>
|
||||||
aria-expanded="false">
|
<?= ucfirst($grupo['grupo_nombre']) ?>
|
||||||
<i class="ing-caret ing-fw mr-2"></i>
|
</a>
|
||||||
<span class="<?= $grupo['grupo_icon'] ?>"></span>
|
</p>
|
||||||
<?= ucfirst($grupo['grupo_nombre']) ?>
|
<div id="menu_<?= $key ?>" class="collapse" data-parent="#accordionMenu" style>
|
||||||
</a>
|
<ul class="fa-ul">
|
||||||
</p>
|
<?
|
||||||
<div id="menu_<?= $cont ?>" class="collapse" data-parent="#accordionMenu" style>
|
foreach ($user->admin ? $db->query("SELECT * FROM PAGINA WHERE grupo_id = :grupo_id ORDER BY pagina_titulo", array(":grupo_id" => $grupo['grupo_id'])) : $db->query("SELECT * FROM PAGINA WHERE grupo_id = :grupo_id and pagina_id IN (SELECT pagina_id FROM PERMISO_VIEW WHERE id = :id) ORDER BY pagina_titulo", array(":grupo_id" => $grupo['grupo_id'], ":id" => $user->user['id']))
|
||||||
<ul class="fa-ul">
|
as $pagina):
|
||||||
<?php
|
?>
|
||||||
foreach ($paginas as $pagina) {
|
<li class="mt-1">
|
||||||
#print_r($paginas);
|
<a href="<?= $pagina['pagina_ruta'] ?>.php">
|
||||||
$page = ucfirst(str_replace('_', ' ', $pagina['pagina_ruta']));
|
<?= $pagina['pagina_titulo'] ?>
|
||||||
$user->access($pagina['pagina_ruta'] ?? '');
|
</a>
|
||||||
if ($grupo['grupo_id'] == $pagina['grupo_id']) {
|
</li>
|
||||||
if ($user->admin || $user->acceso != 'n') {
|
<? endforeach; ?>
|
||||||
?>
|
</ul>
|
||||||
<li class="mt-1">
|
</div>
|
||||||
<a href="<?= $pagina['pagina_ruta'] ?>.php">
|
<?php
|
||||||
<?= $page ?>
|
}
|
||||||
</a>
|
?>
|
||||||
</li>
|
</div>
|
||||||
<?php }
|
</aside>
|
||||||
}
|
<div class="overlay"></div>
|
||||||
}
|
<header class="sticky-top bg-white">
|
||||||
?>
|
<div class="container marco menu d-flex align-items-center">
|
||||||
</ul>
|
<div class="logotipo">
|
||||||
</div>
|
<a href="https://lasalle.mx/" target="_blank">
|
||||||
<?php $cont++;
|
<img src="imagenes/logo_lasalle.png">
|
||||||
}
|
</a>
|
||||||
?>
|
</div>
|
||||||
</div>
|
<div class="flex-grow-1 d-flex justify-content-end">
|
||||||
</aside>
|
<nav class="navbar navbar-expand-lg d-flex">
|
||||||
<div class="overlay"></div>
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
|
||||||
<header class="sticky-top bg-white">
|
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<div class="container marco menu d-flex align-items-center">
|
<span class="navbar-toggler-icon"></span>
|
||||||
<div class="logotipo">
|
</button>
|
||||||
<a href="https://lasalle.mx/" target="_blank">
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
<img src="imagenes/logo_lasalle.png">
|
<ul class="navbar-nav">
|
||||||
</a>
|
<!-- Add your navigation items here -->
|
||||||
</div>
|
</ul>
|
||||||
<div class="flex-grow-1 d-flex justify-content-end">
|
</div>
|
||||||
<nav class="navbar navbar-expand-lg d-flex">
|
</nav>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
|
<div class="d-flex mainMenu justify-content-center align-items-center">
|
||||||
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
<div class="max-h iconSesion">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<a href="salir.php" class="iconOff max-h pl-3 d-flex justify-content-start align-items-center">
|
||||||
</button>
|
<i class="ing-salir"></i>
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
</a>
|
||||||
<ul class="navbar-nav">
|
</div>
|
||||||
<!-- Add your navigation items here -->
|
<div class="max-h">
|
||||||
</ul>
|
<span id="sidebarCollapse" style="font-size: 44px;"
|
||||||
</div>
|
class="ing-menu bg-white rounded-circle pointer max-w d-flex justify-content-center align-items-center"></span>
|
||||||
</nav>
|
</div>
|
||||||
<div class="d-flex mainMenu justify-content-center align-items-center">
|
</div>
|
||||||
<div class="max-h iconSesion">
|
</div>
|
||||||
<a href="salir.php" class="iconOff max-h pl-3 d-flex justify-content-start align-items-center">
|
</div>
|
||||||
<i class="ing-salir"></i>
|
</header>
|
||||||
</a>
|
|
||||||
</div>
|
<div class="row bg-info mx-0 barra-gris d-flex flex-column">
|
||||||
<div class="max-h">
|
<?php
|
||||||
<span id="sidebarCollapse" style="font-size: 44px;"
|
if ($header != null) {
|
||||||
class="ing-menu bg-white rounded-circle pointer max-w d-flex justify-content-center align-items-center"></span>
|
?>
|
||||||
</div>
|
<div class="marco">
|
||||||
</div>
|
<div class="col-sm-12">
|
||||||
</div>
|
<h2 class="text-muted">
|
||||||
</div>
|
<?= $header; ?>
|
||||||
</header>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row bg-info mx-0 barra-gris d-flex flex-column">
|
<?php } ?>
|
||||||
<?php
|
<div class="marco">
|
||||||
if ($header != null) {
|
<div class="col-sm-12 py-3">
|
||||||
?>
|
<h2 class="text-uppercase">
|
||||||
<div class="marco">
|
<?= $title; ?>
|
||||||
<div class="col-sm-12">
|
</h2>
|
||||||
<h2 class="text-muted">
|
</div>
|
||||||
<?= $header; ?>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<? } ?>
|
||||||
<?php } ?>
|
|
||||||
<div class="marco">
|
|
||||||
<div class="col-sm-12 py-3">
|
|
||||||
<h2 class="text-uppercase">
|
|
||||||
<?= $title; ?>
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php }
|
|
||||||
?>
|
|
||||||
@@ -1,32 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
require "include/constantes.php";
|
require "include/constantes.php";
|
||||||
function html_header($title, $header = null, $links = [])
|
function html_header($title, $header = null, $links = [])
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<nav class="navbar sticky-top navbar-light bg-white">
|
<nav class="navbar sticky-top navbar-light bg-white">
|
||||||
<header class="container-fluid">
|
<header class="container-fluid">
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
<a class="navbar-brand" href="/"><img id="logo" src="imagenes/logo_lasalle.png" border="0" class="img-fluid" /></a>
|
<a class="navbar-brand" href="/"><img id="logo" src="imagenes/logo_lasalle.png" class="img-fluid" /></a>
|
||||||
|
</div>
|
||||||
</div>
|
</header>
|
||||||
</header>
|
</nav>
|
||||||
</nav>
|
<!-- Barra azul -->
|
||||||
<!-- Barra azul -->
|
<div class="row bg-info mx-0 barra-gris">
|
||||||
<div class="row bg-info mx-0 barra-gris">
|
<?php
|
||||||
<?php
|
if ($header != null) {
|
||||||
if ($header != null) {
|
?>
|
||||||
?>
|
<div class="marco">
|
||||||
<div class="marco">
|
<div class="col-sm-12">
|
||||||
<div class="col-sm-12">
|
<h2 class="text-muted"><?= $header; ?>
|
||||||
<h2 class="text-muted"><?= $header; ?>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<?php } ?>
|
||||||
<?php } ?>
|
<div class="marco">
|
||||||
<div class="marco">
|
<div class="col-sm-12 py-3">
|
||||||
<div class="col-sm-12 py-3">
|
<h2 class="text-uppercase"><?= $title; ?></h2>
|
||||||
<h2 class="text-uppercase"><?= $title; ?></h2>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<?php
|
||||||
<?php
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,47 +1,47 @@
|
|||||||
<?php
|
<?php
|
||||||
# Componente, desplegable para la barra de navegación con los contenidos del menú (i.e. módulos con sus páginas)
|
# Componente, desplegable para la barra de navegación con los contenidos del menú (i.e. módulos con sus páginas)
|
||||||
|
|
||||||
require_once 'class/c_login.php';
|
require_once 'class/c_login.php';
|
||||||
|
|
||||||
if (!isset($_SESSION['user'])) {
|
if (!isset($_SESSION['user'])) {
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$user = $_SESSION['user'];
|
$user = $_SESSION['user'];
|
||||||
|
|
||||||
$pages = query('SELECT * FROM FS_MODULOS', single: false);
|
$pages = query('SELECT * FROM FS_MODULOS', single: false);
|
||||||
$modules = query('SELECT DISTINCT id, titulo FROM FS_MODULOS', single: false);
|
$modules = query('SELECT DISTINCT id, titulo FROM FS_MODULOS', single: false);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Cuando se le hace click al hamburguer button se despliega un menú en la derecha -->
|
<!-- Cuando se le hace click al hamburguer button se despliega un menú en la derecha -->
|
||||||
|
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
<?php
|
<?php
|
||||||
foreach ($modules as $module) {
|
foreach ($modules as $module) {
|
||||||
?>
|
?>
|
||||||
<li class="nav-item dropdown">
|
<li class="nav-item dropdown">
|
||||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
<?php echo ucfirst($module['titulo']); ?>
|
<?php echo ucfirst($module['titulo']); ?>
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||||
<?php
|
<?php
|
||||||
foreach ($pages as $page)
|
foreach ($pages as $page)
|
||||||
if ($page['id'] == $module['id']) {
|
if ($page['id'] == $module['id']) {
|
||||||
?>
|
?>
|
||||||
<a class="dropdown-item" href="<?php echo $page['ruta'] . ".php"; ?>">
|
<a class="dropdown-item" href="<?php echo $page['ruta'] . ".php"; ?>">
|
||||||
<?php echo ucfirst(str_replace('_', ' ', $page['ruta'])); ?>
|
<?php echo ucfirst(str_replace('_', ' ', $page['ruta'])); ?>
|
||||||
</a>
|
</a>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,42 +1,42 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once "include/constantes.php";
|
include_once "include/constantes.php";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<a href="#top" id="scroll-up" class="btn btn-primary btn-sm" role="button" aria-pressed="true" style="display: none; position: fixed; bottom: 3rem; right: 1rem;">
|
<a href="#top" id="scroll-up" class="btn btn-primary btn-sm" role="button" aria-pressed="true" style="display: none; position: fixed; bottom: 3rem; right: 1rem;">
|
||||||
<?= $ICO['arriba'] ?>
|
<?= $ICO['arriba'] ?>
|
||||||
</a>
|
</a>
|
||||||
<!-- Scroll down -->
|
<!-- Scroll down -->
|
||||||
<a href="#bottom" id="scroll-down" class="btn btn-primary btn-sm" role="button" aria-pressed="true" style="display: none; position: fixed; bottom: 1rem; right: 1rem;">
|
<a href="#bottom" id="scroll-down" class="btn btn-primary btn-sm" role="button" aria-pressed="true" style="display: none; position: fixed; bottom: 1rem; right: 1rem;">
|
||||||
<?= $ICO['abajo'] ?>
|
<?= $ICO['abajo'] ?>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$(window).scroll(function() {
|
$(window).scroll(function() {
|
||||||
if ($(this).scrollTop() > 100) {
|
if ($(this).scrollTop() > 100) {
|
||||||
$('#scroll-up').fadeIn();
|
$('#scroll-up').fadeIn();
|
||||||
} else {
|
} else {
|
||||||
$('#scroll-up').fadeOut();
|
$('#scroll-up').fadeOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(this).scrollTop() < $(document).height() - $(window).height() - 100) {
|
if ($(this).scrollTop() < $(document).height() - $(window).height() - 100) {
|
||||||
$('#scroll-down').fadeIn();
|
$('#scroll-down').fadeIn();
|
||||||
} else {
|
} else {
|
||||||
$('#scroll-down').fadeOut();
|
$('#scroll-down').fadeOut();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#scroll-up').click(function() {
|
$('#scroll-up').click(function() {
|
||||||
$("html, body").animate({
|
$("html, body").animate({
|
||||||
scrollTop: 0
|
scrollTop: 0
|
||||||
}, 600);
|
}, 600);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#scroll-down').click(function() {
|
$('#scroll-down').click(function() {
|
||||||
$("html, body").animate({
|
$("html, body").animate({
|
||||||
scrollTop: $(document).height()
|
scrollTop: $(document).height()
|
||||||
}, 600);
|
}, 600);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -1,64 +1,65 @@
|
|||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
|
|
||||||
<form action="action/action_periodousuario_update.php" method="post" id="formaPeriodo">
|
<form action="action/action_periodousuario_update.php" method="post" id="formaPeriodo">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<?php
|
<?php
|
||||||
$target = $target ?? strtok($_SERVER["REQUEST_URI"], '?');
|
$target = $target ?? strtok($_SERVER["REQUEST_URI"], '?');
|
||||||
$niveles = array_map(
|
$niveles = array_map(
|
||||||
fn($nivel) => array_merge(
|
fn($nivel) => array_merge(
|
||||||
$nivel,
|
$nivel,
|
||||||
['periodos' => $db->where('nivel_id', $nivel['nivel_id'])->get('periodo_view')]
|
['periodos' => $db->where('nivel_id', $nivel['nivel_id'])->get('periodo_view')]
|
||||||
), $db->get("nivel")
|
), $db->get("nivel")
|
||||||
);
|
);
|
||||||
|
|
||||||
// collect facultad_id's with facultad from $periodos
|
// collect facultad_id's with facultad from $periodos
|
||||||
?>
|
?>
|
||||||
<input type="hidden" name="target" value="<?= $target ?>">
|
<input type="hidden" name="target" value="<?= $target ?>">
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="periodo" class="col-4 col-form-label">Cambiar de periodo</label>
|
<label for="periodo" class="col-4 col-form-label">Cambiar de periodo</label>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<div id="dlPeriodo" class="datalist datalist-select mb-1 w-100">
|
<div id="dlPeriodo" class="datalist datalist-select mb-1 w-100">
|
||||||
<div class="datalist-input">Selecciona un periodo</div>
|
<div class="datalist-input">Selecciona un periodo</div>
|
||||||
<span class="ing-buscar icono"></span>
|
<span class="ing-buscar icono"></span>
|
||||||
<ul style="display:none">
|
<ul style="display:none">
|
||||||
<?php
|
<?php
|
||||||
foreach ($niveles as $nivel) {
|
foreach ($niveles as $nivel) {
|
||||||
?>
|
?>
|
||||||
<li data-id="<?= $nivel['nivel_id'] ?>" class="not-selectable disable">
|
<li data-id="<?= $nivel['nivel_id'] ?>" class="not-selectable disable">
|
||||||
<?= $nivel['nivel_nombre'] ?>
|
<?= $nivel['nivel_nombre'] ?>
|
||||||
</li>
|
</li>
|
||||||
<?
|
<?
|
||||||
$periodos_rs = $db->query(
|
$periodos_rs = $db->query(
|
||||||
'SELECT * FROM fs_periodo(NULL, :nivel, 4)',
|
'SELECT * FROM fs_periodo(NULL, :nivel, 4)',
|
||||||
[':nivel' => $nivel['nivel_id']]
|
[':nivel' => $nivel['nivel_id']]
|
||||||
);
|
);
|
||||||
foreach ($periodos_rs as $per) {
|
array_walk($periodos_rs, function ($per) {
|
||||||
?>
|
global $user;
|
||||||
<li data-id="<?= $per['periodo_id'] ?>" <?php if ($user->periodo == $per["periodo_id"]) {
|
?>
|
||||||
echo 'class="selected"';
|
<li data-id="<?= $per['periodo_id'] ?>" <?php if ($user->periodo == $per["periodo_id"]) {
|
||||||
} ?>>
|
echo 'class="selected"';
|
||||||
<?= $per['periodo_nombre'] ?>
|
} ?>>
|
||||||
</li>
|
<?= $per['periodo_nombre'] ?>
|
||||||
<?php } ?>
|
</li>
|
||||||
<?php } ?>
|
<?php }); ?>
|
||||||
</ul>
|
<?php } ?>
|
||||||
<input type="hidden" id="periodo" name="id" value="">
|
</ul>
|
||||||
</div>
|
<input type="hidden" id="periodo" name="id" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
|
</form>
|
||||||
<script src="./js/datalist.js"></script>
|
|
||||||
<script>
|
<script src="./js/datalist.js"></script>
|
||||||
setDatalist('#periodo', <?php echo $user->periodo; ?>)
|
<script defer>
|
||||||
makeRequiredDatalist("#periodo", true);
|
setDatalist('#periodo', <?php echo $user->periodo; ?>)
|
||||||
|
makeRequiredDatalist("#periodo", true);
|
||||||
$(document).on('click', '#dlPeriodo ul li', function () {
|
|
||||||
$('#formaPeriodo').submit();
|
$(document).on('click', '#dlPeriodo ul li:not(.not-selectable)', function () {
|
||||||
});
|
$('#formaPeriodo').submit();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -1,63 +1,63 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once ($ruta ?? "./") . "vendor/autoload.php";
|
require_once ($ruta ?? "./") . "vendor/autoload.php";
|
||||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
||||||
$dotenv->load();
|
$dotenv->load();
|
||||||
use \SeinopSys\PostgresDb;
|
use \SeinopSys\PostgresDb;
|
||||||
|
|
||||||
# Connect to the database
|
# Connect to the database
|
||||||
try {
|
try {
|
||||||
// Postgres
|
// Postgres
|
||||||
$pdo = new PDO("pgsql:host=" . $_ENV['DB_HOST'] . ";dbname=" . $_ENV['DB_NAME'], $_ENV['DB_USER'], $_ENV['DB_PASS']);
|
$pdo = new PDO("pgsql:host=" . $_ENV['DB_HOST'] . ";dbname=" . $_ENV['DB_NAME'], $_ENV['DB_USER'], $_ENV['DB_PASS']);
|
||||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
|
|
||||||
$db = new PostgresDb();
|
$db = new PostgresDb();
|
||||||
$db->setConnection($pdo);
|
$db->setConnection($pdo);
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
echo "Error: " . $e->getMessage();
|
echo "Error: " . $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
// check recursivelly if the array has only empty strings
|
// check recursivelly if the array has only empty strings
|
||||||
function is_response_empty($array)
|
function is_response_empty($array)
|
||||||
{
|
{
|
||||||
foreach ($array as $value) {
|
foreach ($array as $value) {
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
if (!is_response_empty($value)) {
|
if (!is_response_empty($value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!empty($value)) {
|
if (!empty($value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SQL function
|
// SQL function
|
||||||
function query(string $sql, array $params = null, bool $single = true)
|
function query(string $sql, array $params = null, bool $single = true)
|
||||||
{
|
{
|
||||||
global $pdo;
|
global $pdo;
|
||||||
try {
|
try {
|
||||||
$stmt = $pdo->prepare($sql);
|
$stmt = $pdo->prepare($sql);
|
||||||
$stmt->execute($params);
|
$stmt->execute($params);
|
||||||
$response = $single ? $stmt->fetch(PDO::FETCH_ASSOC) : $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$response = $single ? $stmt->fetch(PDO::FETCH_ASSOC) : $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
echo "Error: " . $e->getMessage();
|
echo "Error: " . $e->getMessage();
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
$stmt = null;
|
$stmt = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function queryAll(string $sql, array $params = null)
|
function queryAll(string $sql, array $params = null)
|
||||||
{
|
{
|
||||||
return query($sql, $params, false);
|
return query($sql, $params, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function toSQLArray(array $array): string
|
function toSQLArray(array $array): string
|
||||||
{
|
{
|
||||||
return sprintf("{%s}", implode(", ", $array));
|
return sprintf("{%s}", implode(", ", $array));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,165 +1,165 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
require_once "../vendor/autoload.php";
|
require_once "../vendor/autoload.php";
|
||||||
require_once "../include/bd_pdo.php";
|
require_once "../include/bd_pdo.php";
|
||||||
|
|
||||||
$columnas = array(
|
$columnas = array(
|
||||||
"SALÓN",
|
"SALÓN",
|
||||||
"GRUPO",
|
"GRUPO",
|
||||||
"CLAVE",
|
"CLAVE",
|
||||||
"DOCENTE",
|
"DOCENTE",
|
||||||
"MATERIA",
|
"MATERIA",
|
||||||
"LUNES",
|
"LUNES",
|
||||||
"MARTES",
|
"MARTES",
|
||||||
"MIÉRCOLES",
|
"MIÉRCOLES",
|
||||||
"JUEVES",
|
"JUEVES",
|
||||||
"VIERNES",
|
"VIERNES",
|
||||||
"SÁBADO",
|
"SÁBADO",
|
||||||
"DURACIÓN",
|
"DURACIÓN",
|
||||||
);
|
);
|
||||||
|
|
||||||
$cl = ['salon', 'grupo', 'clave', 'maestro', 'materia',];
|
$cl = ['salon', 'grupo', 'clave', 'maestro', 'materia',];
|
||||||
|
|
||||||
define('HORARIO', 5);
|
define('HORARIO', 5);
|
||||||
define('COLUMNA_MAXIMA', chr(count($columnas) + ord('A') - 1));
|
define('COLUMNA_MAXIMA', chr(count($columnas) + ord('A') - 1));
|
||||||
function columna_nombre(string $columna): array
|
function columna_nombre(string $columna): array
|
||||||
{
|
{
|
||||||
$nombre = "";
|
$nombre = "";
|
||||||
$datos_nombre = explode(" ", str_replace(array("\n", chr(10), chr(13)), " ", trim(preg_replace('/_x([0-9a-fA-F]{4})_/', ' ', $columna))));
|
$datos_nombre = explode(" ", str_replace(array("\n", chr(10), chr(13)), " ", trim(preg_replace('/_x([0-9a-fA-F]{4})_/', ' ', $columna))));
|
||||||
$temp_nombre = explode(".", $datos_nombre[0]);
|
$temp_nombre = explode(".", $datos_nombre[0]);
|
||||||
if (count($temp_nombre) > 1) {
|
if (count($temp_nombre) > 1) {
|
||||||
$nombre .= $temp_nombre[1] . " ";
|
$nombre .= $temp_nombre[1] . " ";
|
||||||
$grado = $temp_nombre[0] . ".";
|
$grado = $temp_nombre[0] . ".";
|
||||||
array_shift($datos_nombre);
|
array_shift($datos_nombre);
|
||||||
} else
|
} else
|
||||||
$grado = strpos($datos_nombre[0], ".") !== false ? array_shift($datos_nombre) : null;
|
$grado = strpos($datos_nombre[0], ".") !== false ? array_shift($datos_nombre) : null;
|
||||||
|
|
||||||
$email = strpos($columna, "@") !== false ? array_pop($datos_nombre) : null;
|
$email = strpos($columna, "@") !== false ? array_pop($datos_nombre) : null;
|
||||||
$nombre .= implode(" ", $datos_nombre);
|
$nombre .= implode(" ", $datos_nombre);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
"grado" => $grado,
|
"grado" => $grado,
|
||||||
"nombre" => trim($nombre),
|
"nombre" => trim($nombre),
|
||||||
"correo" => $email,
|
"correo" => $email,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
###
|
###
|
||||||
function validar_columnas(object $sheet): void
|
function validar_columnas(object $sheet): void
|
||||||
{
|
{
|
||||||
global $columnas;
|
global $columnas;
|
||||||
$diff = array_diff(array_map(fn ($col) => trim($col), get_columns($sheet)), $columnas);
|
$diff = array_diff(array_map(fn ($col) => trim($col), get_columns($sheet)), $columnas);
|
||||||
#array clean
|
#array clean
|
||||||
if (!empty($diff)) {
|
if (!empty($diff)) {
|
||||||
$diff = array_filter($diff, fn ($col) => !empty($col));
|
$diff = array_filter($diff, fn ($col) => !empty($col));
|
||||||
throw new Exception("Error en el formato del archivo: " . (empty($diff) ? "Columnas vacías" : "Columnas incorrectas: [" . implode(", ", $diff) . "]"));
|
throw new Exception("Error en el formato del archivo: " . (empty($diff) ? "Columnas vacías" : "Columnas incorrectas: [" . implode(", ", $diff) . "]"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
###
|
###
|
||||||
function get_columns(object $sheet)
|
function get_columns(object $sheet)
|
||||||
{
|
{
|
||||||
global $columnas;
|
global $columnas;
|
||||||
$columns = array();
|
$columns = array();
|
||||||
foreach ($sheet->getRowIterator(1, 1) as $row)
|
foreach ($sheet->getRowIterator(1, 1) as $row)
|
||||||
foreach ($row->getCellIterator() as $index => $cell) {
|
foreach ($row->getCellIterator() as $index => $cell) {
|
||||||
$columns[$index] = mb_strtoupper($cell->getValue() ?? "");
|
$columns[$index] = mb_strtoupper($cell->getValue() ?? "");
|
||||||
if ($index == COLUMNA_MAXIMA) break;
|
if ($index == COLUMNA_MAXIMA) break;
|
||||||
}
|
}
|
||||||
return $columns;
|
return $columns;
|
||||||
}
|
}
|
||||||
###
|
###
|
||||||
function foreach_sheet(object $workbook, callable $callback = null): void
|
function foreach_sheet(object $workbook, callable $callback = null): void
|
||||||
{
|
{
|
||||||
|
|
||||||
$sheets = $workbook->getSheetNames();
|
$sheets = $workbook->getSheetNames();
|
||||||
// validate columns
|
// validate columns
|
||||||
foreach ($sheets as $sheet) {
|
foreach ($sheets as $sheet) {
|
||||||
$worksheet = $workbook->getSheetByName($sheet);
|
$worksheet = $workbook->getSheetByName($sheet);
|
||||||
validar_columnas($worksheet);
|
validar_columnas($worksheet);
|
||||||
foreach_register($worksheet, $callback, $sheet);
|
foreach_register($worksheet, $callback, $sheet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
###
|
###
|
||||||
function foreach_register(object $worksheet, callable $callback = null, string $sheet): void
|
function foreach_register(object $worksheet, callable $callback = null, string $sheet): void
|
||||||
{
|
{
|
||||||
foreach ($worksheet->getRowIterator(2) as $key => $row) {
|
foreach ($worksheet->getRowIterator(2) as $key => $row) {
|
||||||
$row_data = array();
|
$row_data = array();
|
||||||
foreach ($row->getCellIterator() as $index => $cell) {
|
foreach ($row->getCellIterator() as $index => $cell) {
|
||||||
$row_data[] = str_replace(' ', '', $cell->getValue() ?? "");
|
$row_data[] = str_replace(' ', '', $cell->getValue() ?? "");
|
||||||
if ($index == COLUMNA_MAXIMA) break;
|
if ($index == COLUMNA_MAXIMA) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($callback !== null) {
|
if ($callback !== null) {
|
||||||
$callback($row_data, $key, $sheet);
|
$callback($row_data, $key, $sheet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function horario(array &$row, int $fila, string $sheet): string
|
function horario(array &$row, int $fila, string $sheet): string
|
||||||
{
|
{
|
||||||
global $cl, $db;
|
global $cl, $db;
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
$horario_tostring = "";
|
$horario_tostring = "";
|
||||||
for ($i = HORARIO; $i < count($row) - 1; $i++) {
|
for ($i = HORARIO; $i < count($row) - 1; $i++) {
|
||||||
// echo $row[$i] . " $i\n";
|
// echo $row[$i] . " $i\n";
|
||||||
if (!empty(trim($row[$i] ?? ""))) {
|
if (!empty(trim($row[$i] ?? ""))) {
|
||||||
$row[$i] = str_replace(array(" -", "- ", " - "), "-", $row[$i]);
|
$row[$i] = str_replace(array(" -", "- ", " - "), "-", $row[$i]);
|
||||||
$separar_por_espacios = EXPLODE(" ", trim(preg_replace('!\s+!', ' ', $row[$i])));
|
$separar_por_espacios = EXPLODE(" ", trim(preg_replace('!\s+!', ' ', $row[$i])));
|
||||||
foreach ($separar_por_espacios as $horario) {
|
foreach ($separar_por_espacios as $horario) {
|
||||||
$hora = // if string includes : then is string else is excel date
|
$hora = // if string includes : then is string else is excel date
|
||||||
(strpos($horario, ":") === false)
|
(strpos($horario, ":") === false)
|
||||||
? \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($horario)->format('H:i')
|
? \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($horario)->format('H:i')
|
||||||
: preg_replace('/[^0-9:]/', '', str_replace('.', ':', trim((strpos($horario, "-") !== false) ? explode("-", $horario)[0] : $horario)));
|
: preg_replace('/[^0-9:]/', '', str_replace('.', ':', trim((strpos($horario, "-") !== false) ? explode("-", $horario)[0] : $horario)));
|
||||||
|
|
||||||
if (
|
if (
|
||||||
$hora > "22:00" || $hora < "07:00" || explode(":", $hora)[1] % 15 !== 0
|
$hora > "22:00" || $hora < "07:00" || explode(":", $hora)[1] % 15 !== 0
|
||||||
) {
|
) {
|
||||||
throw new Exception("Error en el formato del archivo: Hora incorrecta [$hora] en la fila $fila, hoja $sheet.");
|
throw new Exception("Error en el formato del archivo: Hora incorrecta [$hora] en la fila $fila, hoja $sheet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
$duración = end($row);
|
$duración = end($row);
|
||||||
if ($duración <= 180 and $duración >= 30 and $duración % 15 == 0)
|
if ($duración <= 180 and $duración >= 30 and $duración % 15 == 0)
|
||||||
$bloques = $duración / 15;
|
$bloques = $duración / 15;
|
||||||
else if ($duración <= 3 and $duración >= 0.5)
|
else if ($duración <= 3 and $duración >= 0.5)
|
||||||
$bloques = $duración * 60 / 15;
|
$bloques = $duración * 60 / 15;
|
||||||
else
|
else
|
||||||
throw new Exception("Error en el formato del archivo: Duración [$duración] incorrecta en la fila $fila, hoja $sheet.");
|
throw new Exception("Error en el formato del archivo: Duración [$duración] incorrecta en la fila $fila, hoja $sheet.");
|
||||||
|
|
||||||
$duraciónID = $db->where("duracion_bloques", $bloques)->get("duracion", 1, "duracion_id")[0]["duracion_id"];
|
$duraciónID = $db->where("duracion_bloques", $bloques)->get("duracion", 1, "duracion_id")[0]["duracion_id"];
|
||||||
$horario_tostring .= ($i - 4) . ",$hora,$duraciónID;";
|
$horario_tostring .= ($i - 4) . ",$hora,$duraciónID;";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$row = array_combine($cl, array_intersect_key($row, array_keys($cl)));
|
$row = array_combine($cl, array_intersect_key($row, array_keys($cl)));
|
||||||
$horario_tostring = substr($horario_tostring, 0, -1);
|
$horario_tostring = substr($horario_tostring, 0, -1);
|
||||||
if (empty($horario_tostring))
|
if (empty($horario_tostring))
|
||||||
throw new Exception("Error en el formato del archivo: No se encontró horario en la fila $fila, hoja $sheet.");
|
throw new Exception("Error en el formato del archivo: No se encontró horario en la fila $fila, hoja $sheet.");
|
||||||
|
|
||||||
return $horario_tostring;
|
return $horario_tostring;
|
||||||
}
|
}
|
||||||
|
|
||||||
function validar_registro(array $row, int $fila): void
|
function validar_registro(array $row, int $fila): void
|
||||||
{
|
{
|
||||||
$tiene_horario = false;
|
$tiene_horario = false;
|
||||||
for ($i = 0; $i < HORARIO - 1; $i++)
|
for ($i = 0; $i < HORARIO - 1; $i++)
|
||||||
if (empty(trim($row[$i])))
|
if (empty(trim($row[$i])))
|
||||||
throw new Exception("Error faltan datos en la fila $fila de la hoja");
|
throw new Exception("Error faltan datos en la fila $fila de la hoja");
|
||||||
|
|
||||||
for ($i = HORARIO; $i < COLUMNA_MAXIMA; $i++)
|
for ($i = HORARIO; $i < COLUMNA_MAXIMA; $i++)
|
||||||
if ($tiene_horario = !empty($row[$i]))
|
if ($tiene_horario = !empty($row[$i]))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!$tiene_horario)
|
if (!$tiene_horario)
|
||||||
throw new Exception("Error en el formato del archivo: No se encontró horario en la fila $fila.");
|
throw new Exception("Error en el formato del archivo: No se encontró horario en la fila $fila.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function renglón_vacío(array $row)
|
function renglón_vacío(array $row)
|
||||||
{
|
{
|
||||||
foreach ($row as $columna)
|
foreach ($row as $columna)
|
||||||
if (!empty($columna))
|
if (!empty($columna))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace utils;
|
namespace utils;
|
||||||
function simpify_string(string $string): string
|
function simpify_string(string $string): string
|
||||||
{
|
{
|
||||||
$string = mb_strtolower($string);
|
$string = mb_strtolower($string);
|
||||||
|
|
||||||
$string_without_accents = str_replace(array('á', 'é', 'í', 'ó', 'ú', 'ñ'), array('a', 'e', 'i', 'o', 'u', 'n'), $string);
|
$string_without_accents = str_replace(array('á', 'é', 'í', 'ó', 'ú', 'ñ'), array('a', 'e', 'i', 'o', 'u', 'n'), $string);
|
||||||
$string_without_spaces = str_replace(' ', '', $string_without_accents);
|
$string_without_spaces = str_replace(' ', '', $string_without_accents);
|
||||||
return $string_without_spaces;
|
return $string_without_spaces;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Headers apra evitar caché de la página
|
* Headers apra evitar caché de la página
|
||||||
*/
|
*/
|
||||||
//no index
|
//no index
|
||||||
header("X-Robots-Tag: noindex, nofollow", true);
|
header("X-Robots-Tag: noindex, nofollow", true);
|
||||||
//no caché
|
//no caché
|
||||||
header('Expires: Sun, 01 Jan 2014 00:00:00 GMT');
|
header('Expires: Sun, 01 Jan 2014 00:00:00 GMT');
|
||||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||||
header('Pragma: no-cache');
|
header('Pragma: no-cache');
|
||||||
date_default_timezone_set('America/Mexico_City');
|
date_default_timezone_set('America/Mexico_City');
|
||||||
?>
|
?>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user