Merged
This commit is contained in:
@@ -1,24 +1,5 @@
|
||||
<?php
|
||||
require_once 'class/c_login.php';
|
||||
<<<<<<< HEAD
|
||||
require_once 'include/bd_pdo.php';
|
||||
|
||||
$user = Login::get_user();
|
||||
|
||||
$user->access();
|
||||
if($user->acceso == null){
|
||||
header('Location: main.php?error=1');
|
||||
}else{
|
||||
$user->print_to_log('Dias_festivos');
|
||||
}
|
||||
if(isset($_GET['facultad'])){
|
||||
$fac = $_GET['facultad'];
|
||||
}else if($user->admin){
|
||||
$fac = null;
|
||||
}else{
|
||||
$fac = $user->facultad['facultad_id'];
|
||||
}
|
||||
=======
|
||||
if (!isset($_SESSION['user'])){
|
||||
die(header('Location: index.php'));
|
||||
}
|
||||
@@ -73,38 +54,11 @@ $write = true;
|
||||
$fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inicio, periodo_fecha_fin FROM periodo WHERE CURRENT_DATE < periodo_fecha_fin order by id_periodo_sgu");
|
||||
|
||||
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<<<<<<< HEAD
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Días Festivos</title>
|
||||
<link rel="stylesheet" href="css/jquery-ui.css">
|
||||
<link rel="stylesheet" href="css/calendar.css">
|
||||
<link rel="stylesheet" href="css/toggle.css" type="text/css">
|
||||
<?php
|
||||
include 'import/html_css_files.php';
|
||||
?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
include "import/html_header.php";
|
||||
html_header(
|
||||
"DÍAS FESTIVOS",
|
||||
"Gestión de Checador "
|
||||
);
|
||||
$user->access();
|
||||
$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_dias_festivos_generales = query("SELECT * FROM fs_diasfestivos(null, null) ORDER BY diasfestivos_dia", null, false);
|
||||
?>
|
||||
<main class="content marco">
|
||||
=======
|
||||
<title>Días festivos</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
@@ -140,17 +94,12 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
|
||||
<section id="message"></section>
|
||||
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
<?php if($user->admin){ ?>
|
||||
<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>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div id="message"></div>
|
||||
<<<<<<< HEAD
|
||||
<!-- Tabla -->
|
||||
<?php if($fs_dias_festivos || $fs_dias_festivos_generales){ ?>
|
||||
=======
|
||||
<form action="días_festivos.php" method="post" class="">
|
||||
<div class="form-box">
|
||||
<div class="form-group row">
|
||||
@@ -182,7 +131,6 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
<!-- Tabla -->
|
||||
<?php
|
||||
if(count($dias_arr) > 0){ ?>
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
<div class="row mt-3">
|
||||
<div class="col-12 table-responsive">
|
||||
<table class="table table-sm table-striped table-white">
|
||||
@@ -190,30 +138,12 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
<tr>
|
||||
<th>Día</th>
|
||||
<th>Periodo</th>
|
||||
<<<<<<< HEAD
|
||||
<th>Nivel</th>
|
||||
<?php if($user->admin){ ?>
|
||||
<th>Facultad</th>
|
||||
=======
|
||||
<?php if($user->admin){ ?>
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
<th>Acciones</th>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<<<<<<< HEAD
|
||||
<?php foreach($fs_dias_festivos as $dia){ ?>
|
||||
<tr data-id="<?= $dia['diasfestivos_id'] ?>" id="<?= $dia['diasfestivos_id'] ?>" data-periodo="1">
|
||||
<td class="text-center"><?php $day = explode("-", $dia['diasfestivos_dia']);
|
||||
echo $day['2']."-".$day['1']."-".$day['0'];
|
||||
?></td>
|
||||
<td class="text-center"><?= $dia['periodo_nombre'] ?></td>
|
||||
<td class="text-center"><?= $dia['nivel_nombre'] ?></td>
|
||||
<?php if($user->admin){ ?>
|
||||
<td class="text-center"><?= $dia['facultad_nombre'] ?></td>
|
||||
<td class="text-center icono-acciones">
|
||||
=======
|
||||
<?php foreach($dias_arr as $dia){ ?>
|
||||
<tr data-id="<?= $dia['diasfestivos_id'] ?>" id="<?= $dia['diasfestivos_id'] ?>" data-periodo="1">
|
||||
<td class="text-center text-nowrap align-middle">
|
||||
@@ -232,33 +162,13 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
</td>
|
||||
<?php if($user->admin){ ?>
|
||||
<td class="text-center icono-acciones align-middle">
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
<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>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<<<<<<< HEAD
|
||||
<?php foreach($fs_dias_festivos_generales as $dia){ ?>
|
||||
<tr data-id="<?= $dia['diasfestivos_id'] ?>" id="<?= $dia['diasfestivos_id'] ?>" data-periodo="0">
|
||||
<td class="text-center"><?php $day = explode("-", $dia['diasfestivos_dia']);
|
||||
echo $day['2']."-".$day['1']."-".$day['0'];
|
||||
?></td>
|
||||
<td class="text-center">Todos</td>
|
||||
<td class="text-center">Todos</td>
|
||||
<?php if($user->admin){ ?>
|
||||
<td class="text-center">Todas</td>
|
||||
<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_confirm" title="Borrar"><span class="ing-basura ing-fw"></span></a>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
=======
|
||||
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -287,25 +197,6 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
<form action="" method="post" id="formaModal" onsubmit="return valida_campos()">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-box">
|
||||
<<<<<<< HEAD
|
||||
<div class="form-group row">
|
||||
<label for="periodo" class="col-3 col-form-label">Periodo *</label>
|
||||
<div class="col-8">
|
||||
<div class="datalist datalist-select mb-1 w-100">
|
||||
<div class="datalist-input" id="fac">Mostrar todos</div>
|
||||
<span class="ing-buscar icono"></span>
|
||||
<ul style="display:none">
|
||||
<li data-id="0" class="pl4-">Todos</li>
|
||||
<?php foreach($fs_periodos as $periodo){ ?>
|
||||
<li data-id="<?= $periodo['id'] ?>" class="pl4-"> <?php echo $periodo['periodo']." ".$periodo['facultad']." - ".$periodo['nivel']; ?></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<input type="hidden" id="periodo" name="periodo" value="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
=======
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
<div class="form-group row" id="rangoDiv">
|
||||
<label for="rango" class="col-3 col-form-label">Rango</label>
|
||||
<div class="col-8">
|
||||
@@ -318,19 +209,13 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
<input id="diaFestivo" name="diaFestivo" type="text" class="form-control date-picker" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="">
|
||||
</div>
|
||||
<div class="col-1 diaFestivoRango">
|
||||
<<<<<<< HEAD
|
||||
-
|
||||
=======
|
||||
<span class="ing-menos pt-2"></span>
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
</div>
|
||||
<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="">
|
||||
</div>
|
||||
<div class="invalid-feedback">Debe seleccionar una fecha</div>
|
||||
</div>
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
<div class="form-group row" id="periodos">
|
||||
<label for="periodos" class="col-3 col-form-label">Periodos</label>
|
||||
@@ -349,7 +234,6 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
|
||||
</div>
|
||||
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
<div class="form-group row">
|
||||
<div class="offset-4 col-8">
|
||||
<button type="submit" class="btn btn-outline-primary" id="submitBtn" data-tipo="1">
|
||||
@@ -367,11 +251,7 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<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_confirm" aria-hidden="true">
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
@@ -393,19 +273,13 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/jquery-ui.js"></script>
|
||||
<script src="js/bootstrap/bootstrap.min.js"></script>
|
||||
<<<<<<< HEAD
|
||||
<script src="js/datalist.js"></script>
|
||||
=======
|
||||
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
<script src="js/datepicker-es.js"></script>
|
||||
<script src="js/toggle.js"></script>
|
||||
<?php
|
||||
require_once 'js/messages.php';
|
||||
?>
|
||||
<script>
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
$(document).on( "click", ".btn-reset", function(event){
|
||||
var forma = $(this).parents("form");
|
||||
forma.find("input[type=text]").val("");
|
||||
@@ -413,7 +287,6 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
});
|
||||
|
||||
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
$(document).ready(function(){
|
||||
$('.diaFestivoRango').hide();
|
||||
});
|
||||
@@ -455,12 +328,6 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
changeMonth: true,
|
||||
});
|
||||
|
||||
<<<<<<< HEAD
|
||||
<?php if(!$fs_dias_festivos && !$fs_dias_festivos_generales){ ?>
|
||||
triggerMessage("No se encontraron días festivos", "Error");
|
||||
<?php } ?>
|
||||
|
||||
=======
|
||||
<?php if(count($dias_arr) == 0){ ?>
|
||||
triggerMessage("No se encontraron días festivos", "Error");
|
||||
<?php } ?>
|
||||
@@ -483,32 +350,21 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
$('#modal .date-picker').change(function(){
|
||||
actualizaPeriodos($(this).val());
|
||||
});
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
$('#modal').on('show.bs.modal', function (event){
|
||||
var button = $(event.relatedTarget);
|
||||
var tipo = button.data('tipo');
|
||||
var modal = $(this);
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
$("#formaModal .text-danger").removeClass("text-danger");
|
||||
$("#diaFestivoFin").removeClass("is-invalid");
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
if(tipo==1){//agregar
|
||||
$('#modalLabel').html("Agregar Día Festivo");
|
||||
$('#submitBtn').data('tipo', 1);
|
||||
$('#diaFestivo').datepicker("setDate", today);
|
||||
$('#diaFestivoFin').datepicker("setDate", today);
|
||||
<<<<<<< HEAD
|
||||
setDatalistFirst("#periodo");
|
||||
$('#rangoDiv').show();
|
||||
$('#dia').removeClass('col-9');
|
||||
$('#dia').addClass('col-4');
|
||||
=======
|
||||
$('#rangoDiv').show();
|
||||
$('#dia').removeClass('col-9');
|
||||
$('#dia').addClass('col-4');
|
||||
actualizaPeriodos($("#diaFestivo").val());
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
}
|
||||
else{
|
||||
$('#modalLabel').html("Editar Día Festivo");
|
||||
@@ -526,15 +382,7 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
success:function(result){
|
||||
console.log(result);
|
||||
$('#id').val(result['diasfestivos_id']);
|
||||
<<<<<<< HEAD
|
||||
if(!result['periodo_id']){
|
||||
setDatalist('#periodo', 0);
|
||||
}else{
|
||||
setDatalist('#periodo', result['periodo_id']);
|
||||
}
|
||||
=======
|
||||
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
var date = new Date(result['diasfestivos_dia']);
|
||||
date.setDate(date.getDate() + 1);
|
||||
$('#diaFestivo').datepicker("setDate", date);
|
||||
@@ -546,11 +394,8 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
|
||||
function valida_campos(){
|
||||
var error=false;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
$("#modal .text-danger").removeClass("text-danger");
|
||||
$("#diaFestivoFin").removeClass("is-invalid");
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
if($("#diaFestivo").val()==""){
|
||||
$("#diaFestivo").addClass("is-invalid");
|
||||
error=true;
|
||||
@@ -566,13 +411,10 @@ $fs_periodos = $db->query("SELECT periodo_id, periodo_nombre, periodo_fecha_inic
|
||||
$('#diaFestivoFin').addClass("is-invalid");
|
||||
error=true;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
if($("#modal .form-check-input:checked").length<=0){
|
||||
$("#modal .form-check-input").siblings().addClass("text-danger");
|
||||
error=true;
|
||||
}
|
||||
>>>>>>> 7688f1aac1824c234bc5f19b154e9ad1f4808d4f
|
||||
if(error){
|
||||
return false;
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user