All
This commit is contained in:
@@ -1,16 +1,27 @@
|
||||
<?php
|
||||
|
||||
require_once 'class/c_login.php';
|
||||
$user = Login::get_user();
|
||||
|
||||
print_r($user);
|
||||
print_r($user->profesor);
|
||||
print_r($user->acceso);//null sin permisos, w o r
|
||||
//profesor, admin, rol, facultad
|
||||
if (!$user->profesor && !$user->admin){
|
||||
if (!isset($_SESSION['user'])){
|
||||
die(header('Location: index.php'));
|
||||
}
|
||||
|
||||
//$user = unserialize($_SESSION['user']);
|
||||
$user = Login::get_user();
|
||||
print_r($user);
|
||||
print_r($user->user["id"]);
|
||||
echo "****|";
|
||||
$user->access();
|
||||
print_r($user->acceso);//null sin permisos, w o r
|
||||
echo "|****|";
|
||||
print_r($user->profesor);
|
||||
echo "|****|";
|
||||
print_r($user->facultad["facultad_id"]);
|
||||
//profesor, admin, rol, facultad
|
||||
/*if ($user->acceso === null || !$user->admin){
|
||||
die(header('Location: index.php'));
|
||||
exit();
|
||||
}*/
|
||||
|
||||
|
||||
//if (!$user->admin && in_array($user->acceso, ['n']))
|
||||
//die(header('Location: main.php?error=1'));
|
||||
@@ -21,10 +32,10 @@ $write = true; //
|
||||
|
||||
$en_fecha = $db->querySingle("SELECT ESTA_EN_PERIODO(NOW()::DATE, :periodo_id)", [':periodo_id' => $user->periodo_id])['esta_en_periodo'];
|
||||
|
||||
$prof_rs = $db->query('SELECT * FROM profesor A WHERE EXISTS (
|
||||
SELECT * FROM horario_view hv join HORARIO_PROFESOR ON hv.HORARIO_ID = HORARIO_PROFESOR.horario_id WHERE HORARIO_PROFESOR.profesor_id = A.profesor_id AND hv.periodo_id = :periodo_id
|
||||
) ORDER BY profesor_nombre', [':periodo_id' => $user->periodo_id]);
|
||||
if($user->jefe_carrera){
|
||||
|
||||
$prof_rs = $db->query('SELECT DISTINCT * FROM fs_profesores(null, null, :fac) ORDER BY PROFESOR_NOMBRE', [':fac' => $user->facultad["facultad_id"]]);
|
||||
}
|
||||
|
||||
//Periodo
|
||||
$periodo_rs = $db->querySingle('SELECT periodo_fecha_inicio, periodo_fecha_fin FROM periodo WHERE periodo_id = :periodo_id', [':periodo_id' => $user->periodo_id]);
|
||||
@@ -42,12 +53,12 @@ else{
|
||||
|
||||
$fecha_man = date("d/m/Y", strtotime("+".$dias." day"));
|
||||
}
|
||||
|
||||
/*
|
||||
// Materias
|
||||
$id_prof = $user->user["id"];
|
||||
$id_prof = $user->profesor;
|
||||
//$facultad_id = 28;
|
||||
$materias_rs = $db->query('SELECT * FROM fs_materiasprofesor(:id)', [':id' => $id_prof]);
|
||||
|
||||
*/
|
||||
if(isset($_POST["fecha_inicial"]))
|
||||
$fecha_ini = $_POST["fecha_inicial"];
|
||||
else
|
||||
@@ -65,36 +76,28 @@ $fecha_fin_db= date("Y-m-d", strtotime($fecha_fin));
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Reposiciones crear | <?= $user->facultad['facultad'] ?? 'General' ?></title>
|
||||
|
||||
<meta 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">
|
||||
<?php include_once "import/html_css_files.php"; ?>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Reposiciones crear |
|
||||
<?= $user->facultad['facultad'] ?? "Administrador"; ?>
|
||||
</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
|
||||
integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw=="
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<?php
|
||||
include 'import/html_css_files.php';
|
||||
?>
|
||||
<link rel="stylesheet" href="css/jquery-ui.css">
|
||||
<link rel="stylesheet" href="css/richtext.css" type="text/css">
|
||||
<link rel="stylesheet" href="css/clockpicker.css">
|
||||
<link rel="stylesheet" href="css/calendar.css">
|
||||
<link rel="stylesheet" href="css/fa_all.css" type="text/css">
|
||||
|
||||
<script src="js/scrollables.js" defer></script>
|
||||
<script>
|
||||
const write = <?= $write ? 'true' : 'false' ?>;
|
||||
</script>
|
||||
<script src="js/moment.js" defer></script>
|
||||
<style>
|
||||
.wizard { height: 20px; width: 80%; background: #D0D0D0; }
|
||||
.wizard.full { background: #D0D0D0; }
|
||||
.wizard.active > div:first-child { background: #00A6CE; }
|
||||
.wizard.active > div:last-child { width: 0px; height: 0px; border-style: solid; border-width: 10px 0 10px 6px; border-color: transparent transparent transparent #00a6ce; transform: rotate(0deg); }
|
||||
</style>
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/bootstrap/popper.min.js"></script>
|
||||
<script src="js/bootstrap/bootstrap.min.js"></script>
|
||||
<script src="js/jquery-ui.js"></script>
|
||||
<script src="js/datepicker-es.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<!-- -->
|
||||
|
||||
<body style="display: block;">
|
||||
@@ -105,11 +108,11 @@ $fecha_fin_db= date("Y-m-d", strtotime($fecha_fin));
|
||||
?>
|
||||
|
||||
<main class="container content marco content-margin" id="local-app">
|
||||
<?php if($write==true ) {?>
|
||||
<?php if($write==true && isset($prof_rs) && count($prof_rs)>0) {?>
|
||||
<!-- Botón para abrir el modal -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-12 text-right">
|
||||
<button type="button" class="btn btn-outline-secondary" data-tipo="1" data-toggle="modal" data-target="#modal" <?php if (!$en_fecha || (empty($materias_rs) || count($materias_rs)==0 ) ){ echo "disabled"; } ?>><span class="ing-mas ing-fw"></span>Crear reposición</button>
|
||||
<button type="button" class="btn btn-outline-secondary" data-tipo="1" data-toggle="modal" data-target="#modal" <?php if (!$en_fecha ) { echo "disabled"; } ?>><span class="ing-mas ing-fw"></span>Crear reposición</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
@@ -243,23 +246,23 @@ $fecha_fin_db= date("Y-m-d", strtotime($fecha_fin));
|
||||
<input type="hidden" name="estado" value="1">
|
||||
<div class="form-box">
|
||||
|
||||
<div class="form-group row <?php if(true){ echo "d-none"; }?>" id="profBlock">
|
||||
<div class="form-group row" id="profBlock">
|
||||
<label for="prof" class="col-4 col-form-label">Profesor *</label>
|
||||
<div class="col-8">
|
||||
<div class="datalist datalist-select mb-1 w-100" id="dlProfesor">
|
||||
<div class="datalist-input">Profesores del área</div>
|
||||
<div class="datalist-input">Selecciona un profesor</div>
|
||||
<span class="ing-buscar icono"></span>
|
||||
<ul style="display:none">
|
||||
<?php foreach($prof_rs as $prof){?>
|
||||
<li data-id="<?php echo $prof["id"];?>" <?php if($prof["id"]==$_SESSION["usuario_id"]){ echo "class='selected'";} ?> ><?php echo $prof["profesor"];?></li>
|
||||
<li data-id="<?php echo $prof["profesor_id"];?>" <?php if($prof["profesor_id"]==$user->profesor){ echo "class='selected'";} ?> ><?php echo $prof["profesor_nombre"];?></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<input type="hidden" id="prof" name="prof" value="<?php echo $id_prof;?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-box prof-selected">
|
||||
<div class="form-group row" id="materiaBlock">
|
||||
<label for="horario" class="col-4 col-form-label">Materia *</label>
|
||||
<div class="col-8">
|
||||
@@ -267,11 +270,7 @@ $fecha_fin_db= date("Y-m-d", strtotime($fecha_fin));
|
||||
<div class="datalist-input">Selecciona una materia</div>
|
||||
<span class="ing-buscar icono"></span>
|
||||
<ul style="display:none">
|
||||
<?php foreach($materias_rs as $mat){ ?>
|
||||
<li data-id="<?php echo $mat["horario_id"];?>" data-dia="<?php echo $mat["horario_dia"];?>" data-hr="<?php echo substr($mat["horario_hora"], 0, 2);?>" data-min="<?php echo substr($mat["horario_hora"], 3, 2);?>">
|
||||
<?php echo $mat["materia_nombre"].' - '.$mat["horario_dia_nombre"]." ".substr($mat["horario_hora"], 0, -3);?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
<input type="hidden" id="horario" name="horario" value="">
|
||||
</div>
|
||||
@@ -363,8 +362,8 @@ $fecha_fin_db= date("Y-m-d", strtotime($fecha_fin));
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-box form-box-info materia-block">
|
||||
<div class="form-group row">
|
||||
<div class="form-box form-box-info prof-selected">
|
||||
<div class="form-group row materia-block">
|
||||
<label for="comentario" class="col-4 col-form-label">Comentarios</label>
|
||||
<div class="col-8">
|
||||
<p><i>Requerimientos específicos del salón, software especializado, etc.</i></p>
|
||||
@@ -513,32 +512,11 @@ $fecha_fin_db= date("Y-m-d", strtotime($fecha_fin));
|
||||
<button class="btn btn-secondary" type="button" id="prev-button">Anterior</button>
|
||||
<button class="btn btn-secondary" type="button" id="next-button" disabled data-toggle="modal" data-target="#confirmationModal">Proponer reposición</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal confirmación -->
|
||||
<div class="modal fade" id="confirmationModal" tabindex="-1" role="dialog" aria-labelledby="confirmationModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-sm" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="confirmationModalLabel">Confirmación</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>¿Estás seguro de que deseas proponer la reposición?</p>
|
||||
<small>Recuerda que la aprobará tu jefe de carrera.</small>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-info" onclick="$('#confirmationModal').modal('hide');">Cancelar</button>
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">Aceptar</button>
|
||||
</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-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
@@ -714,6 +692,7 @@ $fecha_fin_db= date("Y-m-d", strtotime($fecha_fin));
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$(".prof-selected").hide();
|
||||
//fecha de clase
|
||||
$(".date-picker" ).datepicker(datepickerOptions);
|
||||
$(".date-picker" ).datepicker( $.datepicker.regional[ "es" ] );
|
||||
@@ -726,20 +705,22 @@ $fecha_fin_db= date("Y-m-d", strtotime($fecha_fin));
|
||||
$(".date-picker-future" ).datepicker(datepickerOptions_future);
|
||||
$(".date-picker-future" ).datepicker( $.datepicker.regional[ "es" ] );
|
||||
|
||||
<?php if(/*$_SESSION["jefe_carrera"] ||*/ $user->admin){ ?>
|
||||
function creaOpcion(id_lista, nombre, gpo, dia, hora){
|
||||
return '<li data-id="'+id_lista+'" >'+nombre+' ('+gpo+') - '+dia+' '+hora.substr(0, 5)+'</li>';
|
||||
|
||||
function creaOpcion(id_horario, dia, hora, min, nombre){
|
||||
return '<li data-id="'+id_horario+'" data-dia="'+dia+'" data-hr="'+hora+'" data-min="'+min+'">'+nombre+'</li>';
|
||||
}
|
||||
|
||||
$('#filtro_final').focus(function(){
|
||||
$("#filtro_final").removeClass("is-invalid");
|
||||
});
|
||||
|
||||
//****TODO NO SE ACTIVA AL HACER CLICK */
|
||||
$("#dlProfesor ul li").click(function(){//cambia datalist
|
||||
console.log("CLICK");
|
||||
var pid = $(this).data('id');
|
||||
//busca materias del profesor
|
||||
$.ajax({
|
||||
url: './action/materiasdiaprofesor_select.php',
|
||||
url: './action/reposicion_profesor_materias.php',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: { id: pid, },
|
||||
@@ -747,14 +728,16 @@ $fecha_fin_db= date("Y-m-d", strtotime($fecha_fin));
|
||||
if(result["error"]!= "" && result["error"] !== undefined){
|
||||
triggerMessage(result["error"], "Error");
|
||||
$("#modal").modal('hide');
|
||||
$(".prof-selected").hide();
|
||||
}else{
|
||||
$(".prof-selected").show();
|
||||
$("#dlMateria ul").html("");
|
||||
for(i=0; i<result["materias"].length; i++){
|
||||
var html = creaOpcion(result["materias"][i]["Horario_id"],
|
||||
result["materias"][i]["Materia_desc"],
|
||||
result["materias"][i]["Grupo_desc"]+" "+result["materias"][i]["Carrera_prefijo"],
|
||||
result["materias"][i]["Dia_desc"],
|
||||
result["materias"][i]["Hora_inicio"]
|
||||
var html = creaOpcion(result["materias"][i]["horario_id"],
|
||||
result["materias"][i]["horario_dia"],
|
||||
result["materias"][i]["horario_hora"],
|
||||
result["materias"][i]["horario_min"],
|
||||
result["materias"][i]["materia_nombre"]
|
||||
);
|
||||
$("#dlMateria ul").append(html);
|
||||
}
|
||||
@@ -767,7 +750,7 @@ $fecha_fin_db= date("Y-m-d", strtotime($fecha_fin));
|
||||
});//ajax
|
||||
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
|
||||
//Actualiza días elegibles de calendario
|
||||
$("#dlMateria ul li").click(function(){//cambia datalist
|
||||
@@ -841,6 +824,9 @@ $fecha_fin_db= date("Y-m-d", strtotime($fecha_fin));
|
||||
$("#modal .is-invalid").removeClass("is-invalid");
|
||||
//$(this).find(".form-control:first-child").focus();
|
||||
|
||||
|
||||
|
||||
|
||||
$("#errorBox").collapse('hide');
|
||||
$("#errorBox_text").html("");
|
||||
if(tipo == 1){//alta
|
||||
|
||||
Reference in New Issue
Block a user