|
@@ -0,0 +1,1024 @@
|
|
|
|
|
+<?php
|
|
|
|
|
+require_once 'class/mailer.php';
|
|
|
|
|
+require_once 'class/c_login.php';
|
|
|
|
|
+if (!isset($_SESSION['user'])){
|
|
|
|
|
+ die(header('Location: index.php'));
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//$user = unserialize($_SESSION['user']);
|
|
|
|
|
+$user = Login::get_user();
|
|
|
|
|
+
|
|
|
|
|
+$user->access();
|
|
|
|
|
+//echo $user;
|
|
|
|
|
+/*print_r($user);
|
|
|
|
|
+print_r($user->user["id"]);
|
|
|
|
|
+echo "****|";
|
|
|
|
|
+print_r($user->acceso);//null sin permisos, w o r
|
|
|
|
|
+echo "|****|";
|
|
|
|
|
+print_r($user->profesor);
|
|
|
|
|
+echo "|****|";
|
|
|
|
|
+print_r($user->facultad["facultad_id"]);
|
|
|
|
|
+exit();*/
|
|
|
|
|
+//profesor, admin, rol, facultad
|
|
|
|
|
+if ($user->acceso === null && !$user->admin){
|
|
|
|
|
+ die(header('Location: index.php'));
|
|
|
|
|
+ exit();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+$supervisor = false;
|
|
|
|
|
+$coordinador = false;
|
|
|
|
|
+if($user->rol["rol_id"]==7 || $user->rol["rol_id"]==8){
|
|
|
|
|
+ $supervisor = true;
|
|
|
|
|
+}
|
|
|
|
|
+if($user->rol["rol_id"]==9 || $user->rol["rol_id"]==8){
|
|
|
|
|
+ $coordinador = true;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//$user->print_to_log('Reposiciones');
|
|
|
|
|
+//$write = $user->admin || in_array($user->acceso, ['w']);
|
|
|
|
|
+$write = true; //
|
|
|
|
|
+
|
|
|
|
|
+function duracionMinutos($fechahora_i, $fechahora_f){
|
|
|
|
|
+ return round((strtotime($fechahora_f) - strtotime($fechahora_i)) / 60,2);
|
|
|
|
|
+}
|
|
|
|
|
+if($user->periodo_id!= ""){
|
|
|
|
|
+ $en_fecha = $db->querySingle("SELECT ESTA_EN_PERIODO(NOW()::DATE, :periodo_id)", [':periodo_id' => $user->periodo_id])['esta_en_periodo'];
|
|
|
|
|
+
|
|
|
|
|
+ $profesores_rs = array();
|
|
|
|
|
+ $tab_inicial = 1;
|
|
|
|
|
+ if(!$supervisor){
|
|
|
|
|
+ $fac_id = $user->facultad["facultad_id"];
|
|
|
|
|
+ $carrera_rs = $db->query('SELECT * FROM fs_profesor_facultad(:fac, :periodo)', [':fac'=>$fac_id, ':periodo' => $user->periodo_id]);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $carrera_rs = $db->query('SELECT * FROM fs_profesor_facultad(NULL, :periodo)', [ ':periodo' => $user->periodo_id]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $salones_rs = $db->query('SELECT * from salon_view where es_salon is true');
|
|
|
|
|
+
|
|
|
|
|
+ //Periodo
|
|
|
|
|
+ $periodo_rs = $db->querySingle('SELECT periodo_fecha_inicio, periodo_fecha_fin FROM periodo WHERE periodo_id = :periodo_id', [':periodo_id' => $user->periodo_id]);
|
|
|
|
|
+ $periodo_fin = $periodo_rs["periodo_fecha_fin"];
|
|
|
|
|
+ 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;
|
|
|
|
|
+
|
|
|
|
|
+ $fecha_man = date("d/m/Y", strtotime("+".$dias." day"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Fechas filtro
|
|
|
|
|
+ if(isset($_POST["fecha_inicial"]))
|
|
|
|
|
+ $fecha_ini = $_POST["fecha_inicial"];
|
|
|
|
|
+ else
|
|
|
|
|
+ $fecha_ini = date("d/m/Y", strtotime($periodo_rs["periodo_fecha_inicio"]));
|
|
|
|
|
+
|
|
|
|
|
+ if(isset($_POST["fecha_final"]))
|
|
|
|
|
+ $fecha_fin = $_POST["fecha_final"];
|
|
|
|
|
+ else
|
|
|
|
|
+ $fecha_fin = date("d/m/Y", strtotime($periodo_rs["periodo_fecha_fin"]));
|
|
|
|
|
+
|
|
|
|
|
+ //Reposiciones
|
|
|
|
|
+ $repEdo_rs = $db->query('SELECT * FROM fs_estado_reposicion' );
|
|
|
|
|
+
|
|
|
|
|
+ $repoParams = array();
|
|
|
|
|
+ $asigParams = array();
|
|
|
|
|
+ $query = "";
|
|
|
|
|
+
|
|
|
|
|
+ if($user->rol["rol_id"] == 9){//es coordinador
|
|
|
|
|
+ $query .= ":facultad, ";
|
|
|
|
|
+ $repoParams[":facultad"] = $user->facultad["facultad_id"];
|
|
|
|
|
+ }else{//supervisor
|
|
|
|
|
+ $query .= "NULL, ";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(isset($_POST["prof"]) ){
|
|
|
|
|
+ $query .= ":prof,";
|
|
|
|
|
+ $profesor = trim($_POST["prof"]);//limpia texto
|
|
|
|
|
+ $repoParams[":prof"] = $profesor;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $query .= "NULL,";
|
|
|
|
|
+ }
|
|
|
|
|
+ $query .= ":f_ini, :f_fin, ";
|
|
|
|
|
+ $queryAsig = ":f_ini, :f_fin,";
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $date = DateTime::createFromFormat('d/m/Y', $fecha_ini);
|
|
|
|
|
+ $fecha_ini_db = $date->format('Y-m-d');
|
|
|
|
|
+
|
|
|
|
|
+ $date = DateTime::createFromFormat('d/m/Y', $fecha_fin);
|
|
|
|
|
+ $fecha_fin_db = $date->format('Y-m-d');
|
|
|
|
|
+ $repoParams[":f_ini"] = $fecha_ini_db;
|
|
|
|
|
+ $repoParams[":f_fin"] = $fecha_fin_db;
|
|
|
|
|
+ $repoParams[":edo"] = 1;//se sobreescribe
|
|
|
|
|
+
|
|
|
|
|
+ $asigParams[":f_ini"] = $fecha_ini_db;
|
|
|
|
|
+ $asigParams[":f_fin"] = $fecha_fin_db;
|
|
|
|
|
+}
|
|
|
|
|
+?>
|
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
|
+<html lang="en">
|
|
|
|
|
+
|
|
|
|
|
+<head>
|
|
|
|
|
+ <title>Reposiciones autorizar | <?= $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 'import/html_css_files.php';
|
|
|
|
|
+ ?>
|
|
|
|
|
+
|
|
|
|
|
+ <script src="js/scrollables.js" defer></script>
|
|
|
|
|
+ <script>
|
|
|
|
|
+ const write = <?= $write ? 'true' : 'false' ?>;
|
|
|
|
|
+ </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>
|
|
|
|
|
+ <script src="js/messages.js"></script>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+</head>
|
|
|
|
|
+<!-- -->
|
|
|
|
|
+
|
|
|
|
|
+<body style="display: block;">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ include('include/constantes.php');
|
|
|
|
|
+ include("import/html_header.php");
|
|
|
|
|
+ html_header("Reposiciones de clase", "Sistema de gestión de checador");
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <?= "<!-- $user -->" ?>
|
|
|
|
|
+ <main class="container content marco content-margin" id="local-app">
|
|
|
|
|
+
|
|
|
|
|
+ <section id="message"></section>
|
|
|
|
|
+ <?php require('import/periodo.php') ?>
|
|
|
|
|
+
|
|
|
|
|
+ <?php if($user->periodo_id!= ""){ ?>
|
|
|
|
|
+ <form action="reposiciones_autorizar.php" id="asistencia" method="post" onsubmit="return validaFechas()">
|
|
|
|
|
+ <div class="form-box">
|
|
|
|
|
+ <input type="hidden" name="facultad" value="5">
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group row">
|
|
|
|
|
+ <label for="filtro_inicial" class="col-4 col-form-label">Fecha inicial</label>
|
|
|
|
|
+ <div class="col-8 col-sm-4">
|
|
|
|
|
+ <input id="filtro_inicial" name="fecha_inicial" type="text" class="form-control date-picker-filtro" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="" value="<?php echo $fecha_ini;?>">
|
|
|
|
|
+ <div class="invalid-feedback">No es una fecha válida.</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group row">
|
|
|
|
|
+ <label for="filtro_final" class="col-4 col-form-label">Fecha final</label>
|
|
|
|
|
+ <div class="col-8 col-sm-4">
|
|
|
|
|
+ <input id="filtro_final" name="fecha_final" type="text" class="form-control date-picker-filtro" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="" value="<?php echo $fecha_fin;?>">
|
|
|
|
|
+ <div class="invalid-feedback">El rango de fechas no es válido.</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group row">
|
|
|
|
|
+ <label class="col-4 col-form-label" for="prof">Profesor</label>
|
|
|
|
|
+ <div class="col-8 col-sm-4">
|
|
|
|
|
+ <input type="text" name="prof" id="prof" class="form-control" placeholder="Profesor" value="<?php if(isset($profesor)) echo $profesor; ?>">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group row justify-content-center">
|
|
|
|
|
+ <button type="submit" class="btn btn-outline-primary mr-2" id="btn-buscar"><span class="ing-buscar ing-fw"></span> Buscar</button>
|
|
|
|
|
+ <button type="button" class="btn btn-outline-danger" onclick="window.location.href = window.location.href"><span class="ing-borrar ing-fw"></span> Limpiar</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!--<p class="text-right">
|
|
|
|
|
+ <button class="btn btn-secondary" id="exportar"><span class="ing-descargar"></span>Descargar xls</button>
|
|
|
|
|
+ </p>-->
|
|
|
|
|
+ </form>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <ul class="nav nav-tabs d-print-none mb-4" id="myTab" role="tablist">
|
|
|
|
|
+ <li class="nav-item">
|
|
|
|
|
+ <a class="nav-link" id="tab1-tab" data-toggle="tab" href="#tab1" role="tab" aria-controls="calendario" aria-selected="true">Nuevas reposiciones</a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li class="nav-item">
|
|
|
|
|
+ <a class="nav-link" id="tab2-tab" data-toggle="tab" href="#tab2" role="tab" aria-controls="lista" aria-selected="false">Aprobadas por Facultad</a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li class="nav-item">
|
|
|
|
|
+ <a class="nav-link" id="tab3-tab" data-toggle="tab" href="#tab3" role="tab" aria-controls="lista" aria-selected="false">Autorizadas por Vicerrectoría</a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li class="nav-item">
|
|
|
|
|
+ <a class="nav-link" id="tab4-tab" data-toggle="tab" href="#tab4" role="tab" aria-controls="lista" aria-selected="false">Declinadas</a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ <div class="tab-content" id="TabContent">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ $i=1;
|
|
|
|
|
+ foreach($repEdo_rs as $redo){ ?>
|
|
|
|
|
+ <div class="tab-pane fade" id="tab<?php echo $i;?>" role="tabpanel" aria-labelledby="tab<?php echo $i;?>-tab">
|
|
|
|
|
+ <?php
|
|
|
|
|
+
|
|
|
|
|
+ $repoParams[":edo"]=$redo["estado_reposicion_id"];
|
|
|
|
|
+ $asigParams[":edo"]=$redo["estado_reposicion_id"];
|
|
|
|
|
+ if($user->rol["rol_id"] == 7){//es supervisor
|
|
|
|
|
+ $repoParams[":sup"] = $user->user["id"];
|
|
|
|
|
+ $solicitudes_rs = $db->query('SELECT * FROM fs_solicitud(NULL, '.$query.':edo, NULL, :sup) ', $repoParams );
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $solicitudes_rs = $db->query('SELECT * FROM fs_solicitud(NULL, '.$query.':edo, NULL, NULL) ', $repoParams );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(count($solicitudes_rs)==0){
|
|
|
|
|
+ echo "<h3 class='text-center text-danger'>No hay reposiciones en este estado</h3>";
|
|
|
|
|
+ }else{
|
|
|
|
|
+ ?>
|
|
|
|
|
+
|
|
|
|
|
+ <h4 class="mb-4" <?php echo "style='color:".$redo["estado_color"]."'";?> > <?php echo $redo["estado_nombre"]; ?> </h4>
|
|
|
|
|
+
|
|
|
|
|
+ <table class="table table-sm table-striped table-white">
|
|
|
|
|
+ <thead class="thead-dark">
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>Estado</th>
|
|
|
|
|
+ <th>Tipo</th>
|
|
|
|
|
+ <th>Profesor/Materia</th>
|
|
|
|
|
+ <th style="width:160px">Fecha falta</th>
|
|
|
|
|
+ <th style="width:160px">Fecha reposición</th>
|
|
|
|
|
+ <th>Salón</th>
|
|
|
|
|
+ <?php if($write){ ?><th>Acciones</th><?php } ?>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ if(isset($solicitudes_rs)){
|
|
|
|
|
+ foreach($solicitudes_rs as $reposicion){
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <tr data-id="<?php echo $reposicion["solicitud_id"]; ?>" data-edo="<?php echo $reposicion["estado_reposicion_id"];?>" id="id<?php echo $reposicion["solicitud_id"]; ?>">
|
|
|
|
|
+ <td class="align-middle">
|
|
|
|
|
+ <?php if($reposicion["estado_reposicion_id"]<3){ ?>
|
|
|
|
|
+ <div class="wizard <?php if(intval($reposicion["estado_reposicion_id"])==2) echo "active";?> d-flex mx-auto">
|
|
|
|
|
+ <div class="w-50 h-100"></div>
|
|
|
|
|
+ <div class=""></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php } else if($reposicion["estado_reposicion_id"]==3){?>
|
|
|
|
|
+ <div class="text-success text-center pt-1">
|
|
|
|
|
+ <span class="ing-autorizar ing-lg"></span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php } else {?>
|
|
|
|
|
+ <div class="text-danger text-center pt-1">
|
|
|
|
|
+ <span class="ing-negar ing-lg"></span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php } ?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="align-middle">
|
|
|
|
|
+ <?php echo $reposicion["solicitudtipo_nombre"]; ?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td><?php
|
|
|
|
|
+ echo $reposicion["profesor_clave"]." - ".$reposicion["profesor_nombre"];
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <br>
|
|
|
|
|
+ <small>
|
|
|
|
|
+ <?php echo $reposicion["materia_nombre"]; ?>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ if($reposicion["horario_grupo"]!="")
|
|
|
|
|
+ echo "(".$reposicion["horario_grupo"].")";
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </small>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="text-center align-middle text-nowrap"><?php
|
|
|
|
|
+ if($reposicion["fecha_clase"]!=""){
|
|
|
|
|
+ $fechaI = date("d/m/Y", strtotime($reposicion["fecha_clase"]));
|
|
|
|
|
+ echo $fechaI."<br>".substr($reposicion["hora_original"],0, 5);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ echo " - ";
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="text-center align-middle text-nowrap"><?php
|
|
|
|
|
+ $fechaF = date("d/m/Y", strtotime($reposicion["fecha_nueva"]));
|
|
|
|
|
+ echo $fechaF."<br>".substr($reposicion["hora_nueva"],0, 5)." a ".substr($reposicion["hora_nueva_fin"],0, 5);
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="text-center align-middle"><?php
|
|
|
|
|
+ if($reposicion["salon_id"] != ""){
|
|
|
|
|
+ $salon_json = json_decode($reposicion["salon_array"], true);
|
|
|
|
|
+ echo $salon_json[count($salon_json)-1];
|
|
|
|
|
+ }else
|
|
|
|
|
+ echo "Pendiente";
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+
|
|
|
|
|
+ <?php if($write){ ?>
|
|
|
|
|
+ <td class="text-center align-middle icono-acciones text-nowrap">
|
|
|
|
|
+ <?php if (duracionMinutos($reposicion["fecha_nueva"], date("Y-m-d H:i:00")) < 0){ ?>
|
|
|
|
|
+ <?php //no se cumple la fecha de la reposicion, es jefe de carrera
|
|
|
|
|
+ if((!$user->jefe_carrera || $user->admin || !$coordinador) && $reposicion["estado_reposicion_id"] == 1){?>
|
|
|
|
|
+ <a href="#" data-toggle="modal" data-target="#modal_aprobar" data-estado="2" data-tipo="<?php echo $reposicion["solicitudtipo_id"];?>" title="Aprobar"><?php echo $ICO["ver"];?></a>
|
|
|
|
|
+ <?php } //no se cumple la fecha de la reposicion, no es jefe de carrera
|
|
|
|
|
+ else if(($supervisor || $user->admin) && $reposicion["estado_reposicion_id"] == 2){?>
|
|
|
|
|
+ <a href="#" data-toggle="modal" data-target="#modal_aprobar" data-estado="3" data-tipo="<?php echo $reposicion["solicitudtipo_id"];?>" title="Autorizar" ><?php echo $ICO["ver"];?></a>
|
|
|
|
|
+ <?php } else { ?>
|
|
|
|
|
+ <a href="#" data-toggle="modal" data-target="#modal_aprobar" data-estado="1" data-tipo="<?php echo $reposicion["solicitudtipo_id"];?>" title="Ver detalle"><?php echo $ICO["ver"];?></a>
|
|
|
|
|
+ <?php } ?>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }else{ //fecha ya pasó?>
|
|
|
|
|
+ <a href="#" data-toggle="modal" data-target="#modal_aprobar" data-estado="1" data-tipo="<?php echo $reposicion["solicitudtipo_id"];?>" title="Ver detalle"><span class="text-danger"><?php echo $ICO["ver"];?></span></a>
|
|
|
|
|
+ <?php } ?>
|
|
|
|
|
+
|
|
|
|
|
+ <?php
|
|
|
|
|
+ if($reposicion["estado_reposicion_id"]<4){
|
|
|
|
|
+ if(
|
|
|
|
|
+ (($user->jefe_carrera || $user->admin || $coordinador) && $reposicion["estado_reposicion_id"] == 1)/* nueva */
|
|
|
|
|
+ || (($user->admin || $coordinador || $supervisor) && $reposicion["estado_reposicion_id"] == 2)/* aprobado facultad */
|
|
|
|
|
+ ){
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <a href="#" data-toggle="modal" data-target="#modal_confirm" title="Cancelar"><span class="text-danger"><?php echo $ICO["cancelar"];?></span></a>
|
|
|
|
|
+ <?php }
|
|
|
|
|
+ } //estado
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <?php }//edición ?>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }//foreach
|
|
|
|
|
+ }//if ?>
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ $i++;
|
|
|
|
|
+ } ?>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <!-- Modal -->
|
|
|
|
|
+ <div class="modal fade" id="modal_aprobar" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
|
|
|
|
|
+ <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
|
|
|
|
+ <div class="modal-content">
|
|
|
|
|
+ <div class="modal-header">
|
|
|
|
|
+ <h4 class="col-12 modal-title text-center"><span id="modalLabel">Aprobar Reposición</span>
|
|
|
|
|
+ <button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
|
|
|
|
+ <span aria-hidden="true">×</span>
|
|
|
|
|
+ </button></h4>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="modal-body">
|
|
|
|
|
+ <form action="./action/reposicion_autoriza.php" method="post" id="formaModal">
|
|
|
|
|
+ <input type="hidden" name="id" id="id">
|
|
|
|
|
+ <input type="hidden" name="edo" id="edo" value="">
|
|
|
|
|
+ <input type="hidden" name="tipo" id="tipo" value="">
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Profesor</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <p class="rep-prof"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Dependencia</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <p class="rep-fac"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Carrera</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <p class="rep-carr"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Materia</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <p class="rep-mat"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Grupo</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <p class="rep-gpo"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Ciclo y bloque</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-3">
|
|
|
|
|
+ <p><strong>Ciclo:</strong><span class="rep-ciclo ml-3"></span></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-3">
|
|
|
|
|
+ <p><strong>Bloque:</strong><span class="rep-bloque ml-3"></span></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Tipo</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <p class="rep-tipo"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Fecha de falta</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <p class="rep-falta"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Fecha de reposición</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <p class="rep-fecha"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Alumnos aproximados</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <p class="rep-alumnos"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Tipo de aula</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <p class="rep-aula"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row" id="salon-ver">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Salón</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <p class="rep-salon"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row" id="salon-editar" style="display: none;">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Salón *</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <input list="lista_salones" name="dlSalon" id="dlSalon" class="form-control" placeholder="Salón">
|
|
|
|
|
+ <div class="valid-feedback">
|
|
|
|
|
+ Salón encontrado
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="invalid-feedback">
|
|
|
|
|
+ Salón no encontrado
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <datalist id="lista_salones">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ foreach ($salones_rs as $salon) {
|
|
|
|
|
+ extract($salon);
|
|
|
|
|
+ $salon_json = json_decode($salon_array, true);
|
|
|
|
|
+ if($salon_json[0]== "UNIVERSIDAD LA SALLE"){
|
|
|
|
|
+ unset($salon_json[0]);
|
|
|
|
|
+ }
|
|
|
|
|
+ $salon_nombre = join(" / ",$salon_json);
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <option data-id="<?= $salon_id ?>" data-nombre="<?= $salon_nombre ?>" value="<?= $salon_nombre ?>"></option>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </datalist>
|
|
|
|
|
+ <!-- <ul class="list-group" id="salones"></ul> -->
|
|
|
|
|
+ <input type="hidden" id="salon" name="salon" value="">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row" id="supervisor" style="display: none;">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Supervisor</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <p class="rep-sup"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row mt-4">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Comentarios</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6 bg-light">
|
|
|
|
|
+ <p class="rep-comentarios"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row mt-4" id="cancelada-block">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold text-danger">Motivo de cancelación</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6 bg-light">
|
|
|
|
|
+ <p class="rep-motivo"></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group row mt-3" id="submitGroup">
|
|
|
|
|
+ <div class="col-12 text-center">
|
|
|
|
|
+
|
|
|
|
|
+ <p class="aprobar-block">Una vez realizada la acción no se puede deshacer.</p>
|
|
|
|
|
+ <p>
|
|
|
|
|
+ <button type="button" class="btn btn-primary btn-enviar aprobar-block" id="submitBtn" ><?php echo $ICO["aceptar"];?> Aprobar</button>
|
|
|
|
|
+ <button type="button" class="btn btn-outline-secondary" data-dismiss="modal" aria-label="Close">Cerrar</button>
|
|
|
|
|
+ </p>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group row mt-3" id="loadingGroup" style="display:none">
|
|
|
|
|
+ <div class="col-12 text-center">
|
|
|
|
|
+ <div class="spinner-border text-primary" role="status">
|
|
|
|
|
+ <span class="sr-only">Loading...</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </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">
|
|
|
|
|
+ <div class="modal-body">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col">
|
|
|
|
|
+ <p class="font-weight-bold">¿Estás seguro de que quieres declinar la reposición?</p>
|
|
|
|
|
+ <p>Esta acción no se puede deshacer.</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <form action="./action/reposicion_autoriza.php" method="post">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-6 col-sm-4 barra-right text-right">
|
|
|
|
|
+ <p class="font-weight-bold">Motivo</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-6 col-sm-8">
|
|
|
|
|
+ <textarea name="motivo" id="motivo" rows="3" class="form-control"></textarea>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-12 mt-4 text-center">
|
|
|
|
|
+ <input type="hidden" id="id_borrar" name="id" value="">
|
|
|
|
|
+ <input type="hidden" name="edo" value="4">
|
|
|
|
|
+ <button type="submit" class="btn btn-outline-primary btn-borrar"><?php echo $ICO["aceptar"];?> Declinar</button>
|
|
|
|
|
+ <button type="button" class="btn btn-outline-danger" data-dismiss="modal" aria-label="Close"><?php echo $ICO["cancelar"];?> Cerrar</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </main>
|
|
|
|
|
+ <? include "import/html_footer.php"; ?>
|
|
|
|
|
+</body>
|
|
|
|
|
+
|
|
|
|
|
+ <?php
|
|
|
|
|
+ //--Manejo de errores y mensajes de exito
|
|
|
|
|
+ if(isset($_GET["error"]) && is_numeric($_GET["error"])){
|
|
|
|
|
+ switch ($_GET["error"]){
|
|
|
|
|
+ case 0: $errorDesc = "No se reciberon los datos de la reposición."; break;
|
|
|
|
|
+ case 1: $errorDesc = "Ocurrió un error al insertar los datos de la reposición/cambio."; break;
|
|
|
|
|
+ case 2: $errorDesc = "Ocurrió un error al actualizar los datos de la reposición/cambio."; break;
|
|
|
|
|
+ case 3: $errorDesc = "No tienes permisos para realizar esa acción."; break;
|
|
|
|
|
+ case 4: $errorDesc = "Ocurrió un error al cargar los datos de la reposición/cambio."; break;
|
|
|
|
|
+ case 6: $errorDesc = "La reposición/cambio que buscas no existe. Consulta la lista de reopsiciones disponibles en esta sección."; break;
|
|
|
|
|
+ case 7: $errorDesc = "La reposición/cambio se empalma con el horario del grupo y no se puede guardar."; break;
|
|
|
|
|
+ case 8: $errorDesc = "El salón de la reposición está siendo utilizado ese día a esa hora y no se puede guardar."; break;
|
|
|
|
|
+ case 9: $errorDesc = "El profesor está asigndo a otra reposición/cambio el mismo día a la misma hora y no se puede guardar."; break;
|
|
|
|
|
+ case 10: $errorDesc = "El profesor está asigndo a una materia el mismo día a la misma hora y no se puede guardar."; break;
|
|
|
|
|
+ case 11: $errorDesc = "No hay clases asignadas para esa materia y grupo en la fecha de falta."; break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(isset($_GET["ok"]) && is_numeric($_GET["ok"])){
|
|
|
|
|
+ switch ($_GET["ok"]){
|
|
|
|
|
+ case 0: $successDesc = "La reposición se actualizó correctamente."; break;
|
|
|
|
|
+ case 1: $successDesc = "La reposición fue declinada."; break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ require_once 'js/messages.php';
|
|
|
|
|
+ ?>
|
|
|
|
|
+<script>
|
|
|
|
|
+ <?php if(isset($errorDesc)){ ?>
|
|
|
|
|
+ triggerMessage("<?php echo $errorDesc;?>", "Error");
|
|
|
|
|
+ <?php } else if(isset($successDesc)){ ?>
|
|
|
|
|
+ triggerMessage("<?php echo $successDesc;?>", "Éxito", "success");
|
|
|
|
|
+ <?php } ?>
|
|
|
|
|
+
|
|
|
|
|
+ var _periodo_fecha_inicial = "<?php echo date("d/m/Y", strtotime($periodo_rs["periodo_fecha_inicio"])); ?>";
|
|
|
|
|
+ var _periodo_fecha_final = "<?php echo date("d/m/Y", strtotime($periodo_rs["periodo_fecha_fin"])); ?>";
|
|
|
|
|
+ var datepickerOptions = { dateFormat: "dd/mm/yy", minDate:_periodo_fecha_inicial, maxDate:_periodo_fecha_final };
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ function valida(){
|
|
|
|
|
+ <?php
|
|
|
|
|
+ if(!$user->jefe_carrera || $user->admin){ ?>
|
|
|
|
|
+ $("#salon").removeClass("is-invalid");
|
|
|
|
|
+ if($("#salon").val() === undefined || $("#salon").val() == 0 || $("#salon").val() == ''){
|
|
|
|
|
+ $("#salon").addClass("is-invalid");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ <?php } ?>
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $(document).ready(function(){
|
|
|
|
|
+ $(".date-picker-filtro" ).datepicker(datepickerOptions);
|
|
|
|
|
+ $(".date-picker-filtro" ).datepicker( $.datepicker.regional[ "es" ] );
|
|
|
|
|
+ $('#tab<?php echo $tab_inicial;?>-tab').tab('show');
|
|
|
|
|
+
|
|
|
|
|
+ $('#modal_confirm').on('show.bs.modal', function (event) {
|
|
|
|
|
+ var button = $(event.relatedTarget); // Button that triggered the modal
|
|
|
|
|
+ var id = button.parents("tr").data("id");
|
|
|
|
|
+ $("#id_borrar").val(id);
|
|
|
|
|
+ $("#motivo").val("")
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $('#dlSalon').on('change', function() {
|
|
|
|
|
+ const selectedValue = $(this).val();
|
|
|
|
|
+ //console.log(selectedValue)
|
|
|
|
|
+ const selectedOption = $(`option[value="${selectedValue}"]`);
|
|
|
|
|
+ //console.log(selectedOption.length)
|
|
|
|
|
+
|
|
|
|
|
+ const salonesList = $('#salones');
|
|
|
|
|
+
|
|
|
|
|
+ if (selectedOption.length) {
|
|
|
|
|
+ const salonId = selectedOption.data('id');
|
|
|
|
|
+ $('#salon').val(salonId);
|
|
|
|
|
+ //const salonNombre = selectedOption.data('nombre');
|
|
|
|
|
+ //salonesList.html(`<li class="list-group-item">${salonNombre}</li>`);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('#salon').val('');
|
|
|
|
|
+ //salonesList.empty();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $('#modal_aprobar').on('show.bs.modal', function (event) {
|
|
|
|
|
+ var button = $(event.relatedTarget); // Button that triggered the modal
|
|
|
|
|
+ var id = button.parents("tr").data("id");
|
|
|
|
|
+ var edo = button.data('estado');
|
|
|
|
|
+ var tipo = button.data('tipo');
|
|
|
|
|
+ $("#loadingGroup").hide();
|
|
|
|
|
+ $("#submitGroup").show();
|
|
|
|
|
+
|
|
|
|
|
+ //1 ver, 2 aprobar, 3 autorizar
|
|
|
|
|
+ $("#edo").val(edo);
|
|
|
|
|
+ $("#id").val(id);
|
|
|
|
|
+ $("#tipo").val(tipo);
|
|
|
|
|
+
|
|
|
|
|
+ var action_pag;
|
|
|
|
|
+ if(tipo == 1 || tipo == 2){
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: './action/reposicion_select.php',
|
|
|
|
|
+ type: 'POST',
|
|
|
|
|
+ dataType: 'json',
|
|
|
|
|
+ data: { id: id},
|
|
|
|
|
+ success: function(result) {
|
|
|
|
|
+ if(result["error"]!= "" && result["error"] !== undefined){
|
|
|
|
|
+ triggerMessage(result["error"], "Error");
|
|
|
|
|
+ $('#modal_aprobar').modal("hide");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#dlSalon").val("");
|
|
|
|
|
+ $("#modal_aprobar .rep-prof").text(result["profesor_nombre"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-fac").text(result["facultad"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-carr").parents(".row").show();
|
|
|
|
|
+ $("#modal_aprobar .rep-carr").text(result["carrera"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-gpo").parents(".row").show();
|
|
|
|
|
+ $("#modal_aprobar .rep-gpo").text(result["grupo"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-mat").parents(".row").show();
|
|
|
|
|
+ $("#modal_aprobar .rep-mat").text(result["materia_desc"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-ciclo").parents(".row").show();
|
|
|
|
|
+ $("#modal_aprobar .rep-ciclo").text(result["ciclo"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-bloque").text(result["bloque"]);
|
|
|
|
|
+ if(result["tipo"])
|
|
|
|
|
+ $("#modal_aprobar .rep-tipo").text("Reposición");
|
|
|
|
|
+ else
|
|
|
|
|
+ $("#modal_aprobar .rep-tipo").text("Cambio");
|
|
|
|
|
+ $("#modal_aprobar .rep-aula").text(result["aula_desc"])
|
|
|
|
|
+ $("#modal_aprobar .rep-aula").data("aula",result["aula"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-falta").parents(".row").show();
|
|
|
|
|
+ $("#modal_aprobar .rep-falta").text(result["fecha_clase"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-fecha").text(result["fecha_nueva"]+" de "+result["hora_ini"]+":"+result["min_ini"]+" a "+result["hora_fin"]+":"+result["min_fin"]);
|
|
|
|
|
+ if(result["salon"] =="" || result["salon"] === undefined){
|
|
|
|
|
+ $('#salon').prop("selectedIndex", 0);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $('#salon').val(result["salon"]);
|
|
|
|
|
+ }
|
|
|
|
|
+ $("#modal_aprobar .rep-salon").text(result["salon_desc"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-comentarios").text(result["comentario"]);
|
|
|
|
|
+ $('#modal_aprobar .rep-alumnos').text(result["alumnos"]);
|
|
|
|
|
+
|
|
|
|
|
+ if(result["supervisor_nombre"]!=""){
|
|
|
|
|
+ $("#supervisor").show();
|
|
|
|
|
+ $("#modal_aprobar .rep-sup").text(result["supervisor_nombre"]);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#supervisor").hide();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(result["estado"] == 4){//cancelada
|
|
|
|
|
+ $('#modal_aprobar .rep-motivo').text(result["motivo_cancelacion"]);
|
|
|
|
|
+ $("#cancelada-block").show();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#cancelada-block").hide();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(edo == 1){// 1 ver
|
|
|
|
|
+ $("#modalLabel").text("Detalle de reposición");
|
|
|
|
|
+ $(".aprobar-block").hide();
|
|
|
|
|
+
|
|
|
|
|
+ /*if(parseInt($("#modal_aprobar .rep-aula").data("aula")) != 1){//tipo aula 1 (salon normal) - ver
|
|
|
|
|
+ $("#salon-ver").hide();
|
|
|
|
|
+ $("#salon-editar").show();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#salon-ver").show();
|
|
|
|
|
+ $("#salon-editar").hide();
|
|
|
|
|
+ }*/
|
|
|
|
|
+ $("#salon-ver").show();
|
|
|
|
|
+ $("#salon-editar").hide();
|
|
|
|
|
+
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#modalLabel").text("Aprobar reposición");
|
|
|
|
|
+ $(".aprobar-block").show();
|
|
|
|
|
+
|
|
|
|
|
+ if(edo == 2 && parseInt($("#modal_aprobar .rep-aula").data("aula")) == 1){//tipo aula 1 (salon normal) - ver
|
|
|
|
|
+ $("#salon-ver").show();
|
|
|
|
|
+ $("#salon-editar").hide();
|
|
|
|
|
+ }else if(edo == 3 && parseInt($("#modal_aprobar .rep-aula").data("aula")) != 1){//aprobar (con salón especial)
|
|
|
|
|
+ $("#salon-ver").show();
|
|
|
|
|
+ $("#salon-editar").hide();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#salon-ver").hide();
|
|
|
|
|
+ $("#salon-editar").show();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(result["aula_supervisor"]){//Solo supervisor
|
|
|
|
|
+ <?php if($supervisor){ ?>
|
|
|
|
|
+ $("#salon-editar").attr("disabled", false);
|
|
|
|
|
+ <?php }else{?>
|
|
|
|
|
+ $("#salon-editar").attr("disabled", true);
|
|
|
|
|
+ <?php } ?>
|
|
|
|
|
+ }else{// Facultad
|
|
|
|
|
+ <?php if(!$supervisor){ ?>
|
|
|
|
|
+ $("#salon-editar").attr("disabled", false);
|
|
|
|
|
+ <?php }else{?>
|
|
|
|
|
+ $("#salon-editar").attr("disabled", true);
|
|
|
|
|
+ <?php } ?>
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ error: function(jqXHR, textStatus, errorThrown ){
|
|
|
|
|
+ triggerMessage(errorThrown, "Error");
|
|
|
|
|
+ }
|
|
|
|
|
+ });//ajax
|
|
|
|
|
+ }else{
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: './action/asignacion_select.php',
|
|
|
|
|
+ type: 'POST',
|
|
|
|
|
+ dataType: 'json',
|
|
|
|
|
+ data: { id: id},
|
|
|
|
|
+ success: function(result) {
|
|
|
|
|
+ if(result["error"]!= "" && result["error"] !== undefined){
|
|
|
|
|
+ triggerMessage(result["error"], "Error");
|
|
|
|
|
+ $('#modal_aprobar').modal("hide");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#dlSalon").val("");
|
|
|
|
|
+ $("#modal_aprobar .rep-prof").text(result["profesor_nombre"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-fac").text(result["facultad"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-carr").parents(".row").hide();
|
|
|
|
|
+ $("#modal_aprobar .rep-gpo").parents(".row").hide();
|
|
|
|
|
+ $("#modal_aprobar .rep-mat").parents(".row").hide();
|
|
|
|
|
+ $("#modal_aprobar .rep-ciclo").parents(".row").hide();
|
|
|
|
|
+
|
|
|
|
|
+ $("#modal_aprobar .rep-tipo").text("Asignación");
|
|
|
|
|
+
|
|
|
|
|
+ $("#modal_aprobar .rep-aula").text(result["aula_desc"])
|
|
|
|
|
+ $("#modal_aprobar .rep-aula").data("aula",result["aula"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-falta").parents(".row").hide();
|
|
|
|
|
+ $("#modal_aprobar .rep-fecha").text(result["fecha_nueva"]+" de "+result["hora_ini"]+":"+result["min_ini"]+" a "+result["hora_fin"]+":"+result["min_fin"]);
|
|
|
|
|
+ if(result["salon"] =="" || result["salon"] === undefined){
|
|
|
|
|
+ $('#salon').prop("selectedIndex", 0);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $('#salon').val(result["salon"]);
|
|
|
|
|
+ }
|
|
|
|
|
+ $("#modal_aprobar .rep-salon").text(result["salon_desc"]);
|
|
|
|
|
+ $("#modal_aprobar .rep-comentarios").text(result["comentario"]);
|
|
|
|
|
+ $('#modal_aprobar .rep-alumnos').text(result["alumnos"]);
|
|
|
|
|
+
|
|
|
|
|
+ if(result["supervisor_nombre"]!=""){
|
|
|
|
|
+ $("#supervisor").show();
|
|
|
|
|
+ $("#modal_aprobar .rep-sup").text(result["supervisor_nombre"]);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#supervisor").hide();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(result["estado"] == 4){//cancelada
|
|
|
|
|
+ $('#modal_aprobar .rep-motivo').text(result["motivo_cancelacion"]);
|
|
|
|
|
+ $("#cancelada-block").show();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#cancelada-block").hide();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(edo == 1){// 1 ver
|
|
|
|
|
+ $("#modalLabel").text("Detalle de reposición");
|
|
|
|
|
+ $(".aprobar-block").hide();
|
|
|
|
|
+
|
|
|
|
|
+ /*if(parseInt($("#modal_aprobar .rep-aula").data("aula")) != 1){//tipo aula 1 (salon normal) - ver
|
|
|
|
|
+ $("#salon-ver").hide();
|
|
|
|
|
+ $("#salon-editar").show();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#salon-ver").show();
|
|
|
|
|
+ $("#salon-editar").hide();
|
|
|
|
|
+ }*/
|
|
|
|
|
+ $("#salon-ver").show();
|
|
|
|
|
+ $("#salon-editar").hide();
|
|
|
|
|
+
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#modalLabel").text("Aprobar reposición");
|
|
|
|
|
+ $(".aprobar-block").show();
|
|
|
|
|
+
|
|
|
|
|
+ if(edo == 2 && parseInt($("#modal_aprobar .rep-aula").data("aula")) == 1){//tipo aula 1 (salon normal) - ver
|
|
|
|
|
+ $("#salon-ver").show();
|
|
|
|
|
+ $("#salon-editar").hide();
|
|
|
|
|
+ }else if(edo == 3 && parseInt($("#modal_aprobar .rep-aula").data("aula")) != 1){//aprobar (con salón especial)
|
|
|
|
|
+ $("#salon-ver").show();
|
|
|
|
|
+ $("#salon-editar").hide();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#salon-ver").hide();
|
|
|
|
|
+ $("#salon-editar").show();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(result["aula_supervisor"]){//Solo supervisor
|
|
|
|
|
+ <?php if($supervisor){ ?>
|
|
|
|
|
+ $("#salon-editar").attr("disabled", false);
|
|
|
|
|
+ <?php }else{?>
|
|
|
|
|
+ $("#salon-editar").attr("disabled", true);
|
|
|
|
|
+ <?php } ?>
|
|
|
|
|
+ }else{// Facultad
|
|
|
|
|
+ <?php if(!$supervisor){ ?>
|
|
|
|
|
+ $("#salon-editar").attr("disabled", false);
|
|
|
|
|
+ <?php }else{?>
|
|
|
|
|
+ $("#salon-editar").attr("disabled", true);
|
|
|
|
|
+ <?php } ?>
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ error: function(jqXHR, textStatus, errorThrown ){
|
|
|
|
|
+ triggerMessage(errorThrown, "Error");
|
|
|
|
|
+ }
|
|
|
|
|
+ });//ajax
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ /*
|
|
|
|
|
+ $(".btn-borrar").click(function(){
|
|
|
|
|
+ var cid = $("#id_borrar").val();
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: './action/reposicion_autoriza.php',
|
|
|
|
|
+ type: 'POST',
|
|
|
|
|
+ dataType: 'json',
|
|
|
|
|
+ data: { id: cid, edo: 4},
|
|
|
|
|
+ success: function(result) {
|
|
|
|
|
+ if(result["error"]!= "" && result["error"] !== undefined){
|
|
|
|
|
+ $("#errorBox").collapse('show');
|
|
|
|
|
+ $("#errorBox_text").html(result["error"]);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $("#successBox").collapse('show');
|
|
|
|
|
+ $("#successBox_text").html(result["ok"]);
|
|
|
|
|
+ $("#id"+cid).remove();
|
|
|
|
|
+ }
|
|
|
|
|
+ $('#messageBox')[0].scrollIntoView({ block: "end" });
|
|
|
|
|
+ },
|
|
|
|
|
+ error: function(jqXHR, textStatus, errorThrown ){
|
|
|
|
|
+ $("#errorBox").collapse('show');
|
|
|
|
|
+ $("#errorBox_text").html(errorThrown);
|
|
|
|
|
+ $('#messageBox')[0].scrollIntoView({ block: "end" });
|
|
|
|
|
+ }
|
|
|
|
|
+ });//ajax
|
|
|
|
|
+ $('#modal_confirm').modal("hide");
|
|
|
|
|
+ });*/
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ $("#submitBtn").click(function(){
|
|
|
|
|
+ var edo = parseInt($("#edo").val());
|
|
|
|
|
+ console.log(edo)
|
|
|
|
|
+ if((edo == 3 && valida()) || edo == 2){
|
|
|
|
|
+ $("#loadingGroup").show();
|
|
|
|
|
+ $("#submitGroup").hide();
|
|
|
|
|
+ $("#formaModal").submit();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ function validaFiltro(){
|
|
|
|
|
+ if($('#filter_fecha_ini').val() != "" && !validaFecha($('#filter_fecha_ini').val()) ){
|
|
|
|
|
+ $('#filter_fecha_ini').addClass("is-invalid");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if($('#filter_fecha_fin').val() != "" && !validaFecha($('#filter_fecha_fin').val())){
|
|
|
|
|
+ $('#filter_fecha_fin').addClass("is-invalid");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if($('#filter_fecha_ini').val() != "" && $('#filter_fecha_fin').val() != "" && fechaMayor($('#filter_fecha_ini').val(), $('#filter_fecha_fin').val()) >= 0){
|
|
|
|
|
+ $('#filter_fecha_fin').addClass("is-invalid");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $(function() {
|
|
|
|
|
+ $('[data-toggle="tooltip"]').tooltip()
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ /**@Auxiliary functions */
|
|
|
|
|
+ function listProfesor({
|
|
|
|
|
+ id,
|
|
|
|
|
+ grado,
|
|
|
|
|
+ profesor,
|
|
|
|
|
+ clave
|
|
|
|
|
+ }) {
|
|
|
|
|
+ const lista = document.getElementById("dlProfesor");
|
|
|
|
|
+ lista.innerHTML = "";
|
|
|
|
|
+ lista.classList.remove("is-invalid");
|
|
|
|
|
+ const li = document.createElement('li');
|
|
|
|
|
+ li.setAttribute('data-id', id);
|
|
|
|
|
+ li.classList.add('list-group-item', 'd-flex', 'justify-content-between', 'align-items-center');
|
|
|
|
|
+ li.innerHTML = `${clave} | ${grado ?? ''} ${profesor}`
|
|
|
|
|
+
|
|
|
|
|
+ const btn = document.createElement('button');
|
|
|
|
|
+ btn.setAttribute('type', 'button');
|
|
|
|
|
+ btn.classList.add('badge', 'badge-danger', 'badge-pill', 'border-0');
|
|
|
|
|
+ btn.onclick = _ => li.remove();
|
|
|
|
|
+
|
|
|
|
|
+ const i = document.createElement('i');
|
|
|
|
|
+ i.classList.add('ing-cancelar');
|
|
|
|
|
+ btn.appendChild(i);
|
|
|
|
|
+ li.appendChild(btn);
|
|
|
|
|
+
|
|
|
|
|
+ document.getElementById("profesores").appendChild(li);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function listSalon({
|
|
|
|
|
+ id,
|
|
|
|
|
+ nombre
|
|
|
|
|
+ }) {
|
|
|
|
|
+ const lista = document.getElementById("dlSalon");
|
|
|
|
|
+ lista.innerHTML = "";
|
|
|
|
|
+ lista.classList.remove("is-invalid");
|
|
|
|
|
+ const li = document.createElement('li');
|
|
|
|
|
+ li.setAttribute('data-id', id);
|
|
|
|
|
+ li.classList.add('list-group-item', 'd-flex', 'justify-content-between', 'align-items-center');
|
|
|
|
|
+ li.innerHTML = `${nombre}`
|
|
|
|
|
+
|
|
|
|
|
+ const btn = document.createElement('button');
|
|
|
|
|
+ btn.setAttribute('type', 'button');
|
|
|
|
|
+ btn.classList.add('badge', 'badge-danger', 'badge-pill', 'border-0');
|
|
|
|
|
+ btn.onclick = _ => li.remove();
|
|
|
|
|
+
|
|
|
|
|
+ const i = document.createElement('i');
|
|
|
|
|
+ i.classList.add('ing-cancelar');
|
|
|
|
|
+ btn.appendChild(i);
|
|
|
|
|
+ li.appendChild(btn);
|
|
|
|
|
+
|
|
|
|
|
+ document.getElementById("salones").appendChild(li);
|
|
|
|
|
+ }
|
|
|
|
|
+</script>
|
|
|
|
|
+</html>
|