diff --git a/action/solicitud_select.php b/action/solicitud_select.php index acce88c..f27446e 100644 --- a/action/solicitud_select.php +++ b/action/solicitud_select.php @@ -69,7 +69,6 @@ $user = unserialize($_SESSION['user']); $return["profesor_nombre"] = $rs["profesor_nombre"]; $return["comentario"] = $rs["descripcion"]; $return["alumnos"] = $rs["alumnos"]; - $return["tipo"] = $rs["solicitudtipo_id"]; $return["aula"] = $rs["tipoaula_id"]; $return["aula_desc"] = $rs["tipoaula_nombre"]; $return["aula_supervisor"] = $rs["tipoaula_supervisor"]; @@ -81,6 +80,7 @@ $user = unserialize($_SESSION['user']); $return["grupo"] = $rs["horario_grupo"]; $return["supervisor_nombre"] = $rs["supervisor_nombre"]; $return["solicitudtipo_id"] = $rs["solicitudtipo_id"]; + $return["solicitudtipo"] = $rs["solicitudtipo_nombre"]; } echo json_encode($return); ?> diff --git a/solicitudes_autorizar.php b/solicitudes_autorizar.php index 2ab559b..78da13a 100644 --- a/solicitudes_autorizar.php +++ b/solicitudes_autorizar.php @@ -294,7 +294,7 @@ if($user->periodo_id!= ""){ ".substr($reposicion["hora_original"],0, 5); + echo $fechaI."
".substr($reposicion["horario_hora"],0, 5); }else{ echo " - "; } @@ -381,7 +381,7 @@ if($user->periodo_id!= ""){

Profesor

-

+

@@ -389,7 +389,7 @@ if($user->periodo_id!= ""){

Dependencia

-

+

@@ -397,7 +397,7 @@ if($user->periodo_id!= ""){

Carrera

-

+

@@ -405,7 +405,7 @@ if($user->periodo_id!= ""){

Materia

-

+

@@ -413,7 +413,7 @@ if($user->periodo_id!= ""){

Grupo

-

+

@@ -421,10 +421,10 @@ if($user->periodo_id!= ""){

Ciclo y bloque

-

Ciclo:

+

Ciclo:

-

Bloque:

+

Bloque:

@@ -433,7 +433,7 @@ if($user->periodo_id!= ""){

Tipo

-

+

@@ -441,15 +441,15 @@ if($user->periodo_id!= ""){

Fecha de falta

-

+

-

Fecha de reposición

+

Fecha nueva

-

+

@@ -457,7 +457,7 @@ if($user->periodo_id!= ""){

Alumnos aproximados

-

+

@@ -466,7 +466,7 @@ if($user->periodo_id!= ""){

Tipo de aula

-

+

@@ -474,7 +474,7 @@ if($user->periodo_id!= ""){

Salón

-

+

@@ -515,7 +515,7 @@ if($user->periodo_id!= ""){

Supervisor

-

+

@@ -525,7 +525,7 @@ if($user->periodo_id!= ""){

Comentarios

-

+

@@ -534,7 +534,7 @@ if($user->periodo_id!= ""){

Motivo de cancelación

-

+

@@ -685,6 +685,52 @@ if($user->periodo_id!= ""){ } }); + function cambiaTipo(tipo){ + switch(tipo){ + case 1://reposición + $('#rep-falta').parents('.row').show(); + $('#rep-fecha').parents('.row').show(); + $("#rep-mat").parents('.row').show(); + $("#rep-carr").parents('.row').show(); + + $("#rep-ciclo").parents('.row').show(); + $("#rep-bloque").parents('.row').show(); + $("#rep-gpo").parents('.row').show(); + break; + case 2://cambio de salón + $('#rep-falta').parents('.row').show(); + $('#rep-fecha').parents('.row').hide(); + $("#rep-mat").parents('.row').show(); + $("#rep-carr").parents('.row').show(); + + $("#rep-ciclo").parents('.row').show(); + $("#rep-bloque").parents('.row').show(); + $("#rep-gpo").parents('.row').show(); + break; + case 3://asignación directa + $('#rep-falta').parents('.row').hide(); + $('#rep-fecha').parents('.row').show(); + $("#rep-mat").parents('.row').hide(); + $("#rep-carr").parents('.row').hide(); + + $("#rep-ciclo").parents('.row').hide(); + $("#rep-bloque").parents('.row').hide(); + $("#rep-gpo").parents('.row').hide(); + break; + gpo + case 4://cambio permanente + $('#rep-falta').parents('.row').show(); + $('#rep-fecha').parents('.row').show(); + $("#rep-mat").parents('.row').show(); + $("#rep-carr").parents('.row').show(); + + $("#rep-ciclo").parents('.row').show(); + $("#rep-bloque").parents('.row').show(); + $("#rep-gpo").parents('.row').show(); + break; + } + } + $('#modal_aprobar').on('show.bs.modal', function (event) { var button = $(event.relatedTarget); // Button that triggered the modal var id = button.parents("tr").data("id"); @@ -699,9 +745,10 @@ if($user->periodo_id!= ""){ $("#tipo").val(tipo); var action_pag; - if(tipo == 1 || tipo == 2){ + cambiaTipo(tipo); + //if(tipo == 1 || tipo == 2){ $.ajax({ - url: './action/reposicion_select.php', + url: './action/solicitud_select.php', type: 'POST', dataType: 'json', data: { id: id}, @@ -711,44 +758,42 @@ if($user->periodo_id!= ""){ $('#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"]); + $("#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"]); + $("#modal_aprobar #rep-tipo").text(result["solicitudtipo"]); + + $("#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"]); + $("#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"]); + $("#modal_aprobar #rep-sup").text(result["supervisor_nombre"]); }else{ $("#supervisor").hide(); } if(result["estado"] == 4){//cancelada - $('#modal_aprobar .rep-motivo').text(result["motivo_cancelacion"]); + $('#modal_aprobar #rep-motivo').text(result["motivo_cancelacion"]); $("#cancelada-block").show(); }else{ $("#cancelada-block").hide(); @@ -758,7 +803,7 @@ if($user->periodo_id!= ""){ $("#modalLabel").text("Detalle de reposición"); $(".aprobar-block").hide(); - /*if(parseInt($("#modal_aprobar .rep-aula").data("aula")) != 1){//tipo aula 1 (salon normal) - ver + /*if(parseInt($("#modal_aprobar #rep-aula").data("aula")) != 1){//tipo aula 1 (salon normal) - ver $("#salon-ver").hide(); $("#salon-editar").show(); }else{ @@ -772,10 +817,10 @@ if($user->periodo_id!= ""){ $("#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 + 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) + }else if(edo == 3 && parseInt($("#modal_aprobar #rep-aula").data("aula")) != 1){//aprobar (con salón especial) $("#salon-ver").show(); $("#salon-editar").hide(); }else{ @@ -804,7 +849,7 @@ if($user->periodo_id!= ""){ triggerMessage(errorThrown, "Error"); } });//ajax - }else{ + /*}else{ $.ajax({ url: './action/asignacion_select.php', @@ -857,13 +902,6 @@ if($user->periodo_id!= ""){ $("#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(); @@ -903,7 +941,7 @@ if($user->periodo_id!= ""){ triggerMessage(errorThrown, "Error"); } });//ajax - } + }*/ });