Fixes and improvements to main.php, test.php, c_login.php, reposicion_profesor_materias.php, puesto.php, action_usuarios_insert.php, periodos.php, reposicion_autoriza.php, profesor_faltas.php
This commit is contained in:
@@ -37,8 +37,9 @@ $en_fecha = $db->querySingle("SELECT ESTA_EN_PERIODO(NOW()::DATE, :periodo_id)",
|
||||
|
||||
//$prof_rs = $db->query('SELECT DISTINCT * FROM fs_profesores(null, null, :fac) ORDER BY PROFESOR_NOMBRE', [':fac' => $user->facultad["facultad_id"]]);
|
||||
$prof_rs = $db->query('SELECT DISTINCT PROFESOR.* FROM PROFESOR
|
||||
JOIN HORARIO_VIEW USING (PROFESOR_ID_ID)
|
||||
WHERE FACULTAD_ID = :fac', [':fac' => $user->facultad["facultad_id"]]);
|
||||
JOIN horario_profesor USING (profesor_id)
|
||||
JOIN HORARIO_VIEW USING (horario_id)
|
||||
WHERE FACULTAD_ID = :fac ORDER BY profesor.profesor_nombre', [':fac' => $user->facultad["facultad_id"]]);
|
||||
//}
|
||||
|
||||
//Duraciones
|
||||
@@ -51,13 +52,14 @@ if(!is_null($user->periodo_id)){
|
||||
if(strtotime($periodo_rs["periodo_fecha_inicio"])>strtotime(date("Y-m-d")) )
|
||||
$fecha_man = date("d/m/Y", strtotime($periodo_rs["periodo_fecha_inicio"]));
|
||||
else{
|
||||
$dias = 3;
|
||||
if( intval(date("w")) >=3 && intval(date("w"))<=5 )//Mie a Vie
|
||||
$dias+=3;
|
||||
else if( intval(date("w")) ==6 )//Sab
|
||||
$dias+=2;
|
||||
else if( intval(date("w")) ==0 )//Do
|
||||
$dias+=1;
|
||||
$dia_actual = intval(date("w"));
|
||||
$dias = 1;//días mínimos Lun a Jue
|
||||
if($dia_actual ==5 )//Vie
|
||||
$dias=4;
|
||||
else if( $dia_actual ==6 )//Sab
|
||||
$dias=3;
|
||||
else if( $dia_actual ==0 )//Do
|
||||
$dias=2;
|
||||
|
||||
$fecha_man = date("d/m/Y", strtotime("+".$dias." day"));
|
||||
}
|
||||
@@ -131,7 +133,7 @@ if(!is_null($user->periodo_id)){
|
||||
<!-- 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 ) { 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 solicitud</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
@@ -164,7 +166,6 @@ if(!is_null($user->periodo_id)){
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
$reposiciones_rs = $db->query('SELECT * FROM fs_reposiciones_solicitud(:f_ini, :f_fin, :usr ,NULL, NULL)', [':f_ini' => $fecha_ini_db, ':f_fin' => $fecha_fin_db, ':usr' => $user->user["id"]]);
|
||||
}
|
||||
?>
|
||||
@@ -179,8 +180,7 @@ if(!is_null($user->periodo_id)){
|
||||
<tr >
|
||||
<th>Estado</th>
|
||||
<th>Responsable</th>
|
||||
<th style="width:160px">Fecha falta</th>
|
||||
<th style="width:160px">Fecha reposición</th>
|
||||
<th style="width:160px">Fecha solicitada</th>
|
||||
<th style="width:160px">Duración</th>
|
||||
<th>Salón</th>
|
||||
<?php if($write){ ?><th>Acciones</th><?php } ?>
|
||||
@@ -207,11 +207,7 @@ if(!is_null($user->periodo_id)){
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="align-middle"><?php echo $reposicion["materia_nombre"]; ?></td>
|
||||
<td class="align-middle text-center"><?php
|
||||
echo date("d/m/Y", strtotime($reposicion["fecha_clase"]))."<br>".substr($reposicion["horario_hora"],0,-3)." a ".substr($reposicion["horario_hora_fin"],0,-3)." hrs.";;
|
||||
?>
|
||||
</td>
|
||||
<td class="align-middle"><?php echo $reposicion["profesor_nombre"]; ?></td>
|
||||
<td class="align-middle text-center"><?php
|
||||
|
||||
echo date("d/m/Y", strtotime($reposicion["fecha_nueva"])) ."<br>".substr($reposicion["hora_nueva"],0,-3)." a ".substr($reposicion["hora_nueva_fin"],0,-3)." hrs.";
|
||||
@@ -234,7 +230,7 @@ if(!is_null($user->periodo_id)){
|
||||
<?php
|
||||
|
||||
//no se ha aprobado
|
||||
if($reposicion["estado_reposicion_id"] == 1){?>
|
||||
if(($reposicion["estado_reposicion_id"] == 1 && $user->jefe_carrera) || ($reposicion["estado_reposicion_id"] == 2 && !$user->jefe_carrera)){?>
|
||||
<a href="#" data-tipo="2" title="Editar" data-toggle="modal" data-target="#modal"><?php echo $ICO["editar"];?></a>
|
||||
<a href="#" data-toggle="modal" data-target="#modal_confirm" title="Borrar"><?php echo $ICO["cancelar"];?></a>
|
||||
<?php } ?>
|
||||
@@ -263,7 +259,7 @@ if(!is_null($user->periodo_id)){
|
||||
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="col-12 modal-title text-center"><span id="modalLabel">Crear Reposición</span>
|
||||
<h4 class="col-12 modal-title text-center"><span id="modalLabel">Crear asignación</span>
|
||||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button></h4>
|
||||
@@ -294,20 +290,6 @@ if(!is_null($user->periodo_id)){
|
||||
</div>
|
||||
<div class="form-box prof-selected">
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="tipo" class="col-4 col-form-label">Tipo *</label>
|
||||
<div class="col-8">
|
||||
<div class="datalist datalist-select mb-1 w-100" id="dlTipo">
|
||||
<div class="datalist-input">Reposición</div>
|
||||
<span class="ing-buscar icono"></span>
|
||||
<ul style="display:none">
|
||||
<li data-id="1">Reposición</li>
|
||||
<li data-id="2">Cambio de salón</li>
|
||||
</ul>
|
||||
<input type="hidden" id="tipo" name="tipo" value="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row materia-block">
|
||||
<label for="duracion" class="col-4 col-form-label">Duración</label>
|
||||
@@ -324,13 +306,13 @@ if(!is_null($user->periodo_id)){
|
||||
<label for="fecha_inicial" class="col-4 col-form-label">Fecha de asignación *</label>
|
||||
<div class="col-8">
|
||||
<input id="fecha_inicial" name="fecha_inicial" type="text" class="form-control date-picker-future" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="readonly" value="">
|
||||
<small class="form-text text-muted">Las solicitudes de asignación se deben solicitar con al menos 72hrs de anticipación.<br>
|
||||
<small class="form-text text-muted">Las solicitudes de asignación se deben solicitar con al menos 24hrs de anticipación.<br>
|
||||
Recuerda que en sábado el límite para terminar la clase es a las 15:00hrs.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row materia-block">
|
||||
<label for="hora_ini" class="col-4 col-form-label" id="hora_nombre">Hora reposición *</label>
|
||||
<label for="hora_ini" class="col-4 col-form-label" id="hora_nombre">Hora *</label>
|
||||
<?php
|
||||
//define("HORA_FINAL", 22);
|
||||
//define("FRACCION_HORA", 15);
|
||||
@@ -404,7 +386,7 @@ if(!is_null($user->periodo_id)){
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="font-weight-bold">¿Estás seguro de que quieres borrar la reposición?</p>
|
||||
<p class="font-weight-bold">¿Estás seguro de que quieres borrar la solicitud de asignación de salón?</p>
|
||||
<p>Esta acción no se puede deshacer.</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -555,26 +537,7 @@ if(!is_null($user->periodo_id)){
|
||||
return !error;
|
||||
}
|
||||
|
||||
function cambiaTipo(tipo){
|
||||
if (tipo == 1){//reposición
|
||||
$(".repo_block").show();
|
||||
$(".cambio_block").hide();
|
||||
$(".repo_block").find("input[type=text]").attr("required", true);
|
||||
$(".cambio_block").find("input[type=text]").removeAttr("required");
|
||||
$("#hora_nombre").text("Hora reposición *");
|
||||
}else{//Cambio de salón
|
||||
$(".repo_block").hide();
|
||||
$(".cambio_block").show();
|
||||
$(".repo_block").find("input[type=text]").removeAttr("required");
|
||||
$(".cambio_block").find("input[type=text]").attr("required", true);
|
||||
$("#hora_nombre").text("Hora cambio *");
|
||||
var hora = $("#dlMateria ul li.selected").data("hr");
|
||||
var min = $("#dlMateria ul li.selected").data("min");
|
||||
$("#hora_ini").val(hora)
|
||||
$("#min_ini").val(min)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
$(".prof-selected").hide();
|
||||
@@ -685,10 +648,6 @@ if(!is_null($user->periodo_id)){
|
||||
|
||||
});
|
||||
|
||||
$("#dlTipo ul li").click(function(){//cambia datalist
|
||||
cambiaTipo($(this).data('id'));
|
||||
$(".date-picker" ).datepicker(datepickerOptions);
|
||||
});
|
||||
|
||||
$('#modal_confirm').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget); // Button that triggered the modal
|
||||
@@ -732,7 +691,7 @@ if(!is_null($user->periodo_id)){
|
||||
$("#errorBox_text").html("");
|
||||
if(tipo == 1){//alta
|
||||
$("#submitBtn").data('tipo', 1);
|
||||
$("#modalLabel").html("Crear Reposición");
|
||||
$("#modalLabel").html("Solicitar Asignación");
|
||||
modal.find("input[type=text]").val("");
|
||||
modal.find("#alumnos").val("15");
|
||||
$("#plan").attr("readonly", false);
|
||||
@@ -751,7 +710,7 @@ if(!is_null($user->periodo_id)){
|
||||
|
||||
}else{//editar
|
||||
$("#submitBtn").data('tipo', 2);
|
||||
$("#modalLabel").html("Editar Reposición");
|
||||
$("#modalLabel").html("Editar solicitud");
|
||||
$("#plan").attr("readonly", true);
|
||||
$("#sem").attr("readonly", true);
|
||||
$("#gpo").attr("readonly", true);
|
||||
@@ -820,7 +779,7 @@ if(!is_null($user->periodo_id)){
|
||||
})
|
||||
</script>
|
||||
<script src="js/messages.js"></script>
|
||||
<script type="module" src="js/reposiciones.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user