Commit 3c757138 by sistem26user

Merge branches 'canchivilca' and 'tonyid' of…

Merge branches 'canchivilca' and 'tonyid' of http://version.sacooliveros.edu.pe/jguevara/horario into canchivilca

 Conflicts:
	src/java/pe/siso/horario/MySqlDAO/MySqlDocenteDAO.java
	src/java/pe/siso/horario/Servlets/ServletDocente.java
	web/vista/registroTablaEvaluacionDocente.jsp
parents b22a6525 82e939a4
...@@ -10,5 +10,6 @@ nbdist/ ...@@ -10,5 +10,6 @@ nbdist/
.nb-gradle/ .nb-gradle/
web/assets/ web/assets/
web/html/ web/html/
.idea/
# End of https://www.gitignore.io/api/netbeans # End of https://www.gitignore.io/api/netbeans
\ No newline at end of file
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
package pe.siso.horario.Beans; package pe.siso.horario.Beans;
public class Area { public class Area {
private int codigoArea; private int codigoArea;
private String nombreArea; private String nombreArea;
......
...@@ -13,6 +13,7 @@ import java.io.Serializable; ...@@ -13,6 +13,7 @@ import java.io.Serializable;
* @author fcelestino * @author fcelestino
*/ */
public class Usuario implements Serializable{ public class Usuario implements Serializable{
private int codarea;
private int codigoUsuario; private int codigoUsuario;
private int codigoTipoUsuario; private int codigoTipoUsuario;
private int codigoSede; private int codigoSede;
...@@ -34,6 +35,14 @@ public class Usuario implements Serializable{ ...@@ -34,6 +35,14 @@ public class Usuario implements Serializable{
this.dni = dni; this.dni = dni;
} }
public int getCodarea() {
return codarea;
}
public void setCodarea(int codarea) {
this.codarea = codarea;
}
public String getNombreTipoUsuario() { public String getNombreTipoUsuario() {
return nombreTipoUsuario; return nombreTipoUsuario;
} }
......
...@@ -20,7 +20,7 @@ public interface AreaDAO { ...@@ -20,7 +20,7 @@ public interface AreaDAO {
public void Actualizar(String codigo,String nombreArea) throws Exception; public void Actualizar(String codigo,String nombreArea) throws Exception;
public int registrarAreas(String nombreArea) throws Exception; public int registrarAreas(String nombreArea) throws Exception;
public void cambiarEstado(String dato, String codigoArea) throws Exception; public void cambiarEstado(String dato, String codigoArea) throws Exception;
public ArrayList<Area> cargarArea() throws Exception; public ArrayList<Area> cargarArea(int cod) throws Exception;
public int cantidadAreaUso(String codigoArea) throws Exception; public int cantidadAreaUso(String codigoArea) throws Exception;
public Area datosArea(String codDocente) throws Exception; public Area datosArea(String codDocente) throws Exception;
public int registrarAreaDocente(String codigoArea, String codigoDocente) throws Exception; public int registrarAreaDocente(String codigoArea, String codigoDocente) throws Exception;
......
...@@ -94,15 +94,19 @@ public class MySqlAreaDAO implements AreaDAO { ...@@ -94,15 +94,19 @@ public class MySqlAreaDAO implements AreaDAO {
} }
@Override @Override
public ArrayList<Area> cargarArea() throws Exception { public ArrayList<Area> cargarArea(int cod) throws Exception {
ArrayList<Area> lista = new ArrayList<Area>(); ArrayList<Area> lista = new ArrayList<Area>();
Connection cnx = null; Connection cnx = null;
try { try {
String base = "horario"; String base = "horario";
cnx = MySqlDAOFactory.obtenerConexion(base); String codarea="";
cnx = MySqlDAOFactory.obtenerConexion(base);
Statement st = cnx.createStatement(); Statement st = cnx.createStatement();
if(cod!=0){
String query = "SELECT cod_are,nom_are,est_are from area WHERE est_are = '1'"; codarea=" and cod_are ="+cod;
}
String query = "SELECT cod_are,nom_are,est_are from area WHERE est_are = '1'"+codarea;
ResultSet rs = st.executeQuery(query); ResultSet rs = st.executeQuery(query);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -52,15 +52,17 @@ public class MySqlUsuarioDAO implements UsuarioDAO { ...@@ -52,15 +52,17 @@ public class MySqlUsuarioDAO implements UsuarioDAO {
cnx = MySqlDAOFactory.obtenerConexion(base); cnx = MySqlDAOFactory.obtenerConexion(base);
Statement st = cnx.createStatement(); Statement st = cnx.createStatement();
String query = "SELECT usuario.cod_usu,usuario.cod_tip_usu, usuario.ani_usu, usuario.usu_usu, usuario.cla_usu, usuario.cod_loc, usuario.est_usu, tipo_usuario.nom_tip_usu, sede.des_loc " String query = "SELECT area.cod_are,usuario.cod_usu,usuario.cod_tip_usu,usuario.ani_usu, usuario.usu_usu, usuario.cla_usu, usuario.cod_loc, usuario.est_usu, tipo_usuario.nom_tip_usu, sede.des_loc "
+ "FROM usuario " + "FROM usuario "
+ "LEFT JOIN sede ON sede.cod_loc = usuario.cod_loc " + "LEFT JOIN sede ON sede.cod_loc = usuario.cod_loc "
+ "LEFT JOIN area ON usuario.cod_usu=area.cod_usuario "
+ "INNER JOIN tipo_usuario ON tipo_usuario.cod_tip_usu = usuario.cod_tip_usu " + "INNER JOIN tipo_usuario ON tipo_usuario.cod_tip_usu = usuario.cod_tip_usu "
+ "WHERE usuario.usu_usu='" + usuario + "' and usuario.cla_usu='" + clave + "' and usuario.est_usu='1'"; + "WHERE usuario.usu_usu='" + usuario + "' and usuario.cla_usu='" + clave + "' and usuario.est_usu='1'";
ResultSet rs = st.executeQuery(query); ResultSet rs = st.executeQuery(query);
while (rs.next()) { while (rs.next()) {
usuario1.setCodarea(rs.getInt("cod_are"));
usuario1.setCodigoUsuario(rs.getInt("cod_usu")); usuario1.setCodigoUsuario(rs.getInt("cod_usu"));
usuario1.setCodigoTipoUsuario(rs.getInt("cod_tip_usu")); usuario1.setCodigoTipoUsuario(rs.getInt("cod_tip_usu"));
usuario1.setCodigoSede(rs.getInt("cod_loc")); usuario1.setCodigoSede(rs.getInt("cod_loc"));
......
...@@ -62,10 +62,10 @@ public class AreaServices { ...@@ -62,10 +62,10 @@ public class AreaServices {
} }
public ArrayList<Area> cargarArea() { public ArrayList<Area> cargarArea(int cod) {
ArrayList<Area> lista = null; ArrayList<Area> lista = null;
try { try {
lista = objAreaDAO.cargarArea(); lista = objAreaDAO.cargarArea(cod);
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
......
...@@ -12,8 +12,10 @@ import javax.servlet.ServletException; ...@@ -12,8 +12,10 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.JSONArray; import org.json.JSONArray;
import pe.siso.horario.Beans.Area; import pe.siso.horario.Beans.Area;
import pe.siso.horario.Beans.Usuario;
import pe.siso.horario.Services.AreaServices; import pe.siso.horario.Services.AreaServices;
/** /**
...@@ -22,346 +24,350 @@ import pe.siso.horario.Services.AreaServices; ...@@ -22,346 +24,350 @@ import pe.siso.horario.Services.AreaServices;
*/ */
public class ServletArea extends HttpServlet { public class ServletArea extends HttpServlet {
protected void service(HttpServletRequest request, HttpServletResponse response) protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { throws ServletException, IOException {
String param = request.getParameter("Accion"); String param = request.getParameter("Accion");
if ("listarAreas".equals(param)) { if ("listarAreas".equals(param)) {
listarAreas(request, response); listarAreas(request, response);
} else if ("cambiarEstado".equals(param)) { } else if ("cambiarEstado".equals(param)) {
cambiarEstado(request, response); cambiarEstado(request, response);
} else if ("registrarAreas".equals(param)) { } else if ("registrarAreas".equals(param)) {
registrarAreas(request, response); registrarAreas(request, response);
} else if ("armarEdicion".equals(param)) { } else if ("armarEdicion".equals(param)) {
armarEdicion(request, response); armarEdicion(request, response);
} else if ("cargarArea".equals(param)) { } else if ("cargarArea".equals(param)) {
cargarArea(request, response); cargarArea(request, response);
} else if ("Actualizar".equals(param)) { } else if ("Actualizar".equals(param)) {
Actualizar(request, response); Actualizar(request, response);
} else if ("cantidadUsoArea".equals(param)) { } else if ("cantidadUsoArea".equals(param)) {
cantidadUsoArea(request, response); cantidadUsoArea(request, response);
} else if ("consultarAreas".equals(param)) { } else if ("consultarAreas".equals(param)) {
consultarAreas(request, response); consultarAreas(request, response);
} else if ("registraAreaDocente".equals(param)) { } else if ("registraAreaDocente".equals(param)) {
registraAreaDocente(request, response); registraAreaDocente(request, response);
} else if ("cargarAreaJson".equals(param)) { } else if ("cargarAreaJson".equals(param)) {
cargarAreaJson(request, response); cargarAreaJson(request, response);
}else if("cargarAreaEditar".equals(param)){ } else if ("cargarAreaEditar".equals(param)) {
cargarAreaEditar(request,response); cargarAreaEditar(request, response);
} }
} }
private void listarAreas(HttpServletRequest request, HttpServletResponse response) throws IOException { private void listarAreas(HttpServletRequest request, HttpServletResponse response) throws IOException {
AreaServices servicios = new AreaServices(); AreaServices servicios = new AreaServices();
ArrayList<Area> lista = null; ArrayList<Area> lista = null;
lista = servicios.listarAreas(); lista = servicios.listarAreas();
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
pw.println("<div style=\"border: 1px solid #CCCCCC;\"> " pw.println("<div style=\"border: 1px solid #CCCCCC;\"> "
+ " <div class=\"table-header\"> " + " <div class=\"table-header\"> "
+ " Listado de Áreas " + " Listado de Áreas "
+ " </div> " + " </div> "
+ " <div> " + " <div> "
+ " <div class=\"dataTables_wrapper form-inline no-footer\" id=\"sample-table-2_wrapper\"> " + " <div class=\"dataTables_wrapper form-inline no-footer\" id=\"sample-table-2_wrapper\"> "
+ " <table class=\"table table-striped table-bordered table-hover dataTable no-footer\" id=\"sample-table-2\" role=\"grid\" aria-describedby=\"sample-table-2_info\" > " + " <table class=\"table table-striped table-bordered table-hover dataTable no-footer\" id=\"sample-table-2\" role=\"grid\" aria-describedby=\"sample-table-2_info\" > "
+ " <thead> " + " <thead> "
+ " <tr role=\"row\"> " + " <tr role=\"row\"> "
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\" >N°</th> " + " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\" >N°</th> "
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">ÁREA</th> " + " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">ÁREA</th> "
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">EDICIÓN</th> " + " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">EDICIÓN</th> "
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">ESTADO</th> " + " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">ESTADO</th> "
+ " </tr> " + " </tr> "
+ " </thead> " + " </thead> "
+ " <tbody>"); + " <tbody>");
int cont = 1; int cont = 1;
for (int i = 0; i < lista.size(); i++) { for (int i = 0; i < lista.size(); i++) {
if (cont % 2 == 0) { if (cont % 2 == 0) {
pw.println("<tr class=\"alt\" >"); pw.println("<tr class=\"alt\" >");
} else { } else {
pw.println("<tr >"); pw.println("<tr >");
} }
String estado = ""; String estado = "";
if (lista.get(i).getEstaArea() == 1) { if (lista.get(i).getEstaArea() == 1) {
estado = "<a id='btnValidarEstado' href=\"javascript:validar_estado(0," + lista.get(i).getCodigoArea() + ");\" class=\"regular\" > " estado = "<a id='btnValidarEstado' href=\"javascript:validar_estado(0," + lista.get(i).getCodigoArea() + ");\" class=\"regular\" > "
+ "<img src=\"imagenes/icons/lightbulb.png\" /> " + "<img src=\"imagenes/icons/lightbulb.png\" /> "
+ "</a>"; + "</a>";
} else { } else {
estado = "<a id='btnValidarEstado2' href=\"javascript:validar_estado(1," + lista.get(i).getCodigoArea() + ");\" class=\"regular\" > " estado = "<a id='btnValidarEstado2' href=\"javascript:validar_estado(1," + lista.get(i).getCodigoArea() + ");\" class=\"regular\" > "
+ "<img src=\"imagenes/icons/lightbulb_off.png\" /> " + "<img src=\"imagenes/icons/lightbulb_off.png\" /> "
+ "</a>"; + "</a>";
} }
pw.println(" <td align='center'>" + cont + "</td>" pw.println(" <td align='center'>" + cont + "</td>"
+ " <td>" + lista.get(i).getNombreArea() + "</td>" + " <td>" + lista.get(i).getNombreArea() + "</td>"
+ " <td align='center'><a id='btnEditar' href=\"javascript:armarEdicion(" + lista.get(i).getCodigoArea() + ");\" class=\"regular\" > " + " <td align='center'><a id='btnEditar' href=\"javascript:armarEdicion(" + lista.get(i).getCodigoArea() + ");\" class=\"regular\" > "
+ " <img src=\"imagenes/icons/page_edit.png\" /> " + " <img src=\"imagenes/icons/page_edit.png\" /> "
+ " </a>" + " </a>"
+ " </td>" + " </td>"
+ " <td align='center' valign='middle'>" + estado + "</td>" + " <td align='center' valign='middle'>" + estado + "</td>"
+ " </tr>"); + " </tr>");
cont++; cont++;
} }
if (cont == 1) { if (cont == 1) {
pw.println("<tr><td colspan='4' align='center'>No hay Áreas registradas</td></tr>"); pw.println("<tr><td colspan='4' align='center'>No hay Áreas registradas</td></tr>");
} }
pw.println(" </tbody> " pw.println(" </tbody> "
+ " </table> " + " </table> "
+ " </div>" + " </div>"
+ " </div>" + " </div>"
+ " </div>"); + " </div>");
} }
private void cambiarEstado(HttpServletRequest request, HttpServletResponse response) throws IOException { private void cambiarEstado(HttpServletRequest request, HttpServletResponse response) throws IOException {
//String codArea=request.getParameter("codArea"); //String codArea=request.getParameter("codArea");
String cod_area = request.getParameter("cod_area"); String cod_area = request.getParameter("cod_area");
AreaServices servicios = new AreaServices(); AreaServices servicios = new AreaServices();
int cantidad = servicios.cantidadAreaUso(cod_area); int cantidad = servicios.cantidadAreaUso(cod_area);
String dato = request.getParameter("dato"); String dato = request.getParameter("dato");
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
if (cantidad == 0) { if (cantidad == 0) {
servicios.cambiarEstado(dato, cod_area); servicios.cambiarEstado(dato, cod_area);
pw.println("0"); pw.println("0");
} else { } else {
pw.println("1"); pw.println("1");
} }
} }
private void registrarAreas(HttpServletRequest request, HttpServletResponse response) throws IOException { private void registrarAreas(HttpServletRequest request, HttpServletResponse response) throws IOException {
AreaServices servicios = new AreaServices(); AreaServices servicios = new AreaServices();
String nombreArea = request.getParameter("Tcentro"); String nombreArea = request.getParameter("Tcentro");
int dato = servicios.registrarAreas(nombreArea); int dato = servicios.registrarAreas(nombreArea);
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
if (dato == 0) { if (dato == 0) {
pw.println("1"); pw.println("1");
} else if (dato > 0) { } else if (dato > 0) {
pw.println("0"); pw.println("0");
} else { } else {
pw.println("2"); pw.println("2");
} }
} }
private void armarEdicion(HttpServletRequest request, HttpServletResponse response) throws IOException { private void armarEdicion(HttpServletRequest request, HttpServletResponse response) throws IOException {
AreaServices servicios = new AreaServices(); AreaServices servicios = new AreaServices();
Area area = new Area(); Area area = new Area();
String cod_area = request.getParameter("codarea"); String cod_area = request.getParameter("codarea");
area = servicios.NombreAreas(cod_area); area = servicios.NombreAreas(cod_area);
//String dato = request.getParameter("dato"); //String dato = request.getParameter("dato");
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
pw.println("<center>" pw.println("<center>"
+ " <table border='0'>" + " <table border='0'>"
+ " <tr>" + " <tr>"
+ " <td colspan='4' height='30'></td>" + " <td colspan='4' height='30'></td>"
+ " </tr>" + " </tr>"
+ " <tr>" + " <tr>"
+ " <td><b>Nombre de Área: </b> <font color=\"#FF0000\">*</font></td>" + " <td><b>Nombre de Área: </b> <font color=\"#FF0000\">*</font></td>"
+ " <td width='10'></td>" + " <td width='10'></td>"
+ " <td><input id='txt_nom' type='text' class='form-control validate[required,custom[onlyLetterSp]]' value='" + area.getNombreArea() + "' onChange='conMayusculas(this);' > </td>" + " <td><input id='txt_nom' type='text' class='form-control validate[required,custom[onlyLetterSp]]' value='" + area.getNombreArea() + "' onChange='conMayusculas(this);' > </td>"
+ " <td width='20'></td>" + " <td width='20'></td>"
+ " </tr>" + " </tr>"
+ " </table>" + " </table>"
+ "</center>"); + "</center>");
} }
private void cargarArea(HttpServletRequest request, HttpServletResponse response) throws IOException { private void cargarArea(HttpServletRequest request, HttpServletResponse response) throws IOException {
AreaServices servicios = new AreaServices(); AreaServices servicios = new AreaServices();
ArrayList<Area> lista = null; ArrayList<Area> lista = null;
String accion = request.getParameter("accion"); String accion = request.getParameter("accion");
String nombreId = request.getParameter("nombre"); String nombreId = request.getParameter("nombre");
lista = servicios.cargarArea(); lista = servicios.cargarArea(0);
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
pw.println("<select id='"+nombreId+"' class='chosen-select form-control validate[required]' onChange='" + accion + "'>"); pw.println("<select id='" + nombreId + "' class='chosen-select form-control validate[required]' onChange='" + accion + "'>");
pw.println("<option value=''>[Seleccione]</option>"); pw.println("<option value=''>[Seleccione]</option>");
for (int i = 0; i < lista.size(); i++) { for (int i = 0; i < lista.size(); i++) {
pw.println("<option value='" + lista.get(i).getCodigoArea() + "'>" + lista.get(i).getNombreArea() + "</option>"); pw.println("<option value='" + lista.get(i).getCodigoArea() + "'>" + lista.get(i).getNombreArea() + "</option>");
} }
pw.println("</select>"); pw.println("</select>");
} }
private void cargarAreaEditar(HttpServletRequest request, HttpServletResponse response) throws IOException {
AreaServices servicios = new AreaServices(); private void cargarAreaEditar(HttpServletRequest request, HttpServletResponse response) throws IOException {
ArrayList<Area> lista = null; AreaServices servicios = new AreaServices();
String accion = request.getParameter("accion"); ArrayList<Area> lista = null;
String nombreId = request.getParameter("nombre"); String accion = request.getParameter("accion");
String nombreId = request.getParameter("nombre");
String codDocente = request.getParameter("codDocente");
String codDocente = request.getParameter("codDocente");
lista = servicios.listarAreasDocente(codDocente);
lista = servicios.listarAreasDocente(codDocente);
response.setContentType("text/html");
PrintWriter pw = response.getWriter(); response.setContentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("<select id='"+nombreId+"' class='chosen-select form-control validate[required]' onChange='" + accion + "'>");
pw.println("<option value=''>[SELECCIONE]</option>"); pw.println("<select id='" + nombreId + "' class='chosen-select form-control validate[required]' onChange='" + accion + "'>");
for (int i = 0; i < lista.size(); i++) { pw.println("<option value=''>[SELECCIONE]</option>");
pw.println("<option value='" + lista.get(i).getCodigoArea() + "' selected>" + lista.get(i).getNombreArea() + "</option>"); for (int i = 0; i < lista.size(); i++) {
} pw.println("<option value='" + lista.get(i).getCodigoArea() + "' selected>" + lista.get(i).getNombreArea() + "</option>");
}
pw.println("</select>");
} pw.println("</select>");
}
private void Actualizar(HttpServletRequest request, HttpServletResponse response) {
AreaServices servicios = new AreaServices(); private void Actualizar(HttpServletRequest request, HttpServletResponse response) {
String nombre = request.getParameter("nombre"); AreaServices servicios = new AreaServices();
String cod_area = request.getParameter("cod_area"); String nombre = request.getParameter("nombre");
servicios.Actualizar(cod_area, nombre); String cod_area = request.getParameter("cod_area");
} servicios.Actualizar(cod_area, nombre);
}
private void cantidadUsoArea(HttpServletRequest request, HttpServletResponse response) throws IOException {
String cod_area = request.getParameter("cod_area"); private void cantidadUsoArea(HttpServletRequest request, HttpServletResponse response) throws IOException {
AreaServices servicios = new AreaServices(); String cod_area = request.getParameter("cod_area");
int cantidad = servicios.cantidadAreaUso(cod_area); AreaServices servicios = new AreaServices();
int cantidad = servicios.cantidadAreaUso(cod_area);
response.setContentType("text/html");
PrintWriter pw = response.getWriter(); response.setContentType("text/html");
if (cantidad == 0) { PrintWriter pw = response.getWriter();
pw.println("0"); if (cantidad == 0) {
} else { pw.println("0");
pw.println("1"); } else {
} pw.println("1");
} }
}
private void consultarAreas(HttpServletRequest request, HttpServletResponse response) throws IOException {
String codDoc = request.getParameter("codDoc"); private void consultarAreas(HttpServletRequest request, HttpServletResponse response) throws IOException {
AreaServices servicios = new AreaServices(); String codDoc = request.getParameter("codDoc");
Area area = new Area(); AreaServices servicios = new AreaServices();
area = servicios.datosArea(codDoc); Area area = new Area();
response.setContentType("text/html"); area = servicios.datosArea(codDoc);
PrintWriter pw = response.getWriter(); response.setContentType("text/html");
if (area.getCodigoArea() > 0) { PrintWriter pw = response.getWriter();
pw.println("<input id='idAreasDocente' type='hidden' value='1' >"); if (area.getCodigoArea() > 0) {
pw.println("<input id='idAreasSelect' type='hidden' value='" + area.getCodigoArea() + "' >"); pw.println("<input id='idAreasDocente' type='hidden' value='1' >");
pw.println("<div class='widget-box widget-color-dark'> " pw.println("<input id='idAreasSelect' type='hidden' value='" + area.getCodigoArea() + "' >");
+ " <div class='widget-header'> " pw.println("<div class='widget-box widget-color-dark'> "
+ " <h4 class='widget-title'>ÁREA</h4> " + " <div class='widget-header'> "
+ " </div> " + " <h4 class='widget-title'>ÁREA</h4> "
+ " <div class='widget-body'> " + " </div> "
+ " <div class='widget-main no-padding'> " + " <div class='widget-body'> "
+ " <form id='registroAreaFormulario' class='formular' method='post'> " + " <div class='widget-main no-padding'> "
+ " <fieldset> " + " <form id='registroAreaFormulario' class='formular' method='post'> "
+ " <div class='col-sm-6'> " + " <fieldset> "
+ " <br> " + " <div class='col-sm-6'> "
+ " <div class='alert alert-block alert-success'> " + " <br> "
+ " <button type='button' class='close' data-dismiss='alert'> " + " <div class='alert alert-block alert-success'> "
+ " <i class='ace-icon fa fa-times'></i> " + " <button type='button' class='close' data-dismiss='alert'> "
+ " </button> " + " <i class='ace-icon fa fa-times'></i> "
+ " <strong>ÁREA!</strong> <br> " + " </button> "
+ " " + area.getNombreArea() + " " + " <strong>ÁREA!</strong> <br> "
+ " <br> " + " " + area.getNombreArea() + " "
+ " </div> " + " <br> "
+ " </div> " + " </div> "
+ " <div class='col-sm-6'> " + " </div> "
+ " <br> " + " <div class='col-sm-6'> "
+ " <div class='alert alert-warning'> " + " <br> "
+ " <button type='button' class='close' data-dismiss='alert'> " + " <div class='alert alert-warning'> "
+ " <i class='ace-icon fa fa-times'></i> " + " <button type='button' class='close' data-dismiss='alert'> "
+ " </button> " + " <i class='ace-icon fa fa-times'></i> "
+ " <strong>NOTA!</strong> " + " </button> "
+ " Seleccione su area perteneciente para poder registrar su disponibilidad horaria. " + " <strong>NOTA!</strong> "
+ " <br> " + " Seleccione su area perteneciente para poder registrar su disponibilidad horaria. "
+ " </div> " + " <br> "
+ " </div> " + " </div> "
+ " </fieldset> " + " </div> "
+ " " + " </fieldset> "
+ " </form> " + " "
+ " </div> " + " </form> "
+ " </div> " + " </div> "
+ " </div>"); + " </div> "
} else { + " </div>");
pw.println("<input id='idAreasDocente' type='hidden' value='0' >"); } else {
pw.println("<input id='idAreasSelect' type='hidden' value='0' >"); pw.println("<input id='idAreasDocente' type='hidden' value='0' >");
pw.println("<div class='widget-box widget-color-dark'> " pw.println("<input id='idAreasSelect' type='hidden' value='0' >");
+ " <div class='widget-header'> " pw.println("<div class='widget-box widget-color-dark'> "
+ " <h4 class='widget-title'>ÁREA</h4> " + " <div class='widget-header'> "
+ " </div> " + " <h4 class='widget-title'>ÁREA</h4> "
+ " <div class='widget-body'> " + " </div> "
+ " <div class='widget-main no-padding'> " + " <div class='widget-body'> "
+ " <form id='registroAreaFormulario' class='formular' method='post'> " + " <div class='widget-main no-padding'> "
+ " <fieldset> " + " <form id='registroAreaFormulario' class='formular' method='post'> "
+ " <div class='col-sm-6'> " + " <fieldset> "
+ " <label for='form-field-select-3'>¿A qué área asiste? <span style='color: red;'>(*)</span></label> " + " <div class='col-sm-6'> "
+ " <br> " + " <label for='form-field-select-3'>¿A qué área asiste? <span style='color: red;'>(*)</span></label> "
+ " <span > " + " <br> "
+ " <select id='cmbAreaSelect' class='form-control validate[required]'> " + " <span > "
+ " <option value=''>[Seleccione]</option> "); + " <select id='cmbAreaSelect' class='form-control validate[required]'> "
+ " <option value=''>[Seleccione]</option> ");
pw.println("<option value='1'>MATEMÁTICA</option>");
pw.println("<option value='2'>COMUNICACIÓN</option>"); pw.println("<option value='1'>MATEMÁTICA</option>");
pw.println("<option value='3'>CIENCIAS SOCIALES</option>"); pw.println("<option value='2'>COMUNICACIÓN</option>");
pw.println("<option value='4'>C.T.A.</option>"); pw.println("<option value='3'>CIENCIAS SOCIALES</option>");
pw.println("<option value='5'>C.E.F.</option>"); pw.println("<option value='4'>C.T.A.</option>");
pw.println("<option value='5'>C.E.F.</option>");
pw.println(" </select> " pw.println(" </select> "
+ " </span> " + " </span> "
+ " <br> " + " <br> "
+ " </div> " + " </div> "
+ " <div class='col-sm-6'> " + " <div class='col-sm-6'> "
+ " <br> " + " <br> "
+ " <div class='alert alert-warning'> " + " <div class='alert alert-warning'> "
+ " <button type='button' class='close' data-dismiss='alert'> " + " <button type='button' class='close' data-dismiss='alert'> "
+ " <i class='ace-icon fa fa-times'></i> " + " <i class='ace-icon fa fa-times'></i> "
+ " </button> " + " </button> "
+ " <strong>NOTA!</strong> " + " <strong>NOTA!</strong> "
+ " Seleccione su area perteneciente para poder registrar su disponibilidad horaria. " + " Seleccione su area perteneciente para poder registrar su disponibilidad horaria. "
+ " <br> " + " <br> "
+ " </div> " + " </div> "
+ " </div> " + " </div> "
+ " </fieldset> " + " </fieldset> "
+ " <div class='form-actions center'> " + " <div class='form-actions center'> "
+ " <button class='btn btn-sm btn-primary' type='button' onclick='validar_seleccion();'> " + " <button class='btn btn-sm btn-primary' type='button' onclick='validar_seleccion();'> "
+ " <i class='ace-icon fa fa-save icon-on-right bigger-110'></i> " + " <i class='ace-icon fa fa-save icon-on-right bigger-110'></i> "
+ " Seleccionar " + " Seleccionar "
+ " </button> " + " </button> "
+ " </div> " + " </div> "
+ " " + " "
+ " </form> " + " </form> "
+ " </div> " + " </div> "
+ " </div> " + " </div> "
+ " </div>"); + " </div>");
} }
} }
private void registraAreaDocente(HttpServletRequest request, HttpServletResponse response) { private void registraAreaDocente(HttpServletRequest request, HttpServletResponse response) {
String codArea = request.getParameter("cmbAreaSelect"); String codArea = request.getParameter("cmbAreaSelect");
String codDocente = request.getParameter("codDocente"); String codDocente = request.getParameter("codDocente");
AreaServices servicios = new AreaServices(); AreaServices servicios = new AreaServices();
int dato = 0; int dato = 0;
dato = servicios.registrarAreaDocente(codArea, codDocente); dato = servicios.registrarAreaDocente(codArea, codDocente);
} }
private void cargarAreaJson(HttpServletRequest request, HttpServletResponse response) throws IOException { private void cargarAreaJson(HttpServletRequest request, HttpServletResponse response) throws IOException {
AreaServices servicios = new AreaServices(); AreaServices servicios = new AreaServices();
ArrayList<Area> lista = null; ArrayList<Area> lista = null;
HttpSession session_actual = request.getSession(true);
lista = servicios.cargarArea(); Usuario usuario = (Usuario) session_actual.getAttribute("usuario");
int codarea=usuario.getCodarea();
response.setContentType("application/json"); System.out.println("***********************************");
PrintWriter pw = response.getWriter(); System.out.println(codarea);
lista = servicios.cargarArea(codarea);
JSONArray jArray = new JSONArray(lista);
pw.print(jArray); response.setContentType("application/json");
} PrintWriter pw = response.getWriter();
JSONArray jArray = new JSONArray(lista);
pw.print(jArray);
}
} }
...@@ -282,7 +282,7 @@ public class ServletCurso extends HttpServlet { ...@@ -282,7 +282,7 @@ public class ServletCurso extends HttpServlet {
ArrayList<Area> listaArea = null; ArrayList<Area> listaArea = null;
ArrayList<Plana> listaPlana = null; ArrayList<Plana> listaPlana = null;
ArrayList<Curso> listaCurso= null; ArrayList<Curso> listaCurso= null;
listaArea = serviciosArea.cargarArea(); listaArea = serviciosArea.cargarArea(0);
listaPlana=serviciosPlana.cargarPlana(codArea); listaPlana=serviciosPlana.cargarPlana(codArea);
listaCurso=servicios.cargarFamilia(); listaCurso=servicios.cargarFamilia();
//String dato = request.getParameter("dato"); //String dato = request.getParameter("dato");
...@@ -488,7 +488,7 @@ public class ServletCurso extends HttpServlet { ...@@ -488,7 +488,7 @@ public class ServletCurso extends HttpServlet {
ArrayList<Area> listaArea = null; ArrayList<Area> listaArea = null;
ArrayList<Plana> listaPlana = null; ArrayList<Plana> listaPlana = null;
ArrayList<Curso> listaCurso= null; ArrayList<Curso> listaCurso= null;
listaArea = serviciosArea.cargarArea(); listaArea = serviciosArea.cargarArea(0);
listaPlana=serviciosPlana.cargarPlana(codArea); listaPlana=serviciosPlana.cargarPlana(codArea);
listaCurso=servicios.cargarFamilia(); listaCurso=servicios.cargarFamilia();
//String dato = request.getParameter("dato"); //String dato = request.getParameter("dato");
......
...@@ -304,7 +304,7 @@ public class ServletPlana extends HttpServlet { ...@@ -304,7 +304,7 @@ public class ServletPlana extends HttpServlet {
ArrayList<Area> listaArea = null; ArrayList<Area> listaArea = null;
listaArea = serviciosArea.cargarArea(); listaArea = serviciosArea.cargarArea(0);
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
...@@ -399,7 +399,7 @@ public class ServletPlana extends HttpServlet { ...@@ -399,7 +399,7 @@ public class ServletPlana extends HttpServlet {
AreaServices serviciosArea = new AreaServices(); AreaServices serviciosArea = new AreaServices();
ArrayList<Area> listaArea = null; ArrayList<Area> listaArea = null;
int codigoArea = Integer.parseInt(request.getParameter("codigoArea")); int codigoArea = Integer.parseInt(request.getParameter("codigoArea"));
listaArea = serviciosArea.cargarArea(); listaArea = serviciosArea.cargarArea(0);
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
......
...@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServlet; ...@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import pe.siso.horario.Beans.Area;
import pe.siso.horario.Beans.PeriodoAcademico; import pe.siso.horario.Beans.PeriodoAcademico;
import pe.siso.horario.Beans.Usuario; import pe.siso.horario.Beans.Usuario;
import pe.siso.horario.Beans.UsuarioDocente; import pe.siso.horario.Beans.UsuarioDocente;
...@@ -111,7 +112,7 @@ public class ServletUsuario extends HttpServlet { ...@@ -111,7 +112,7 @@ public class ServletUsuario extends HttpServlet {
String SessionId = session_actual.getId(); String SessionId = session_actual.getId();
//System.out.println(SessionId); //System.out.println(SessionId);
usuarioConsul.setIdentificadorSesion(SessionId); usuarioConsul.setIdentificadorSesion(SessionId);
session_actual.setAttribute("usuario", usuarioConsul); session_actual.setAttribute("usuario", usuarioConsul);
periodo.setCodigoPeriodo(periodoAcademico); periodo.setCodigoPeriodo(periodoAcademico);
periodo.setNombrePeriodo(nombrePeriodo); periodo.setNombrePeriodo(nombrePeriodo);
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<link href="css/snackbar.css" rel="stylesheet" type="text/css"/> <link href="css/snackbar.css" rel="stylesheet" type="text/css"/>
<!-- inline scripts related to this page --> <!-- inline scripts related to this page -->
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
/*$(document).ready( function() { /*$(document).ready( function() {
jQuery("#registroEncuesta").validationEngine(); jQuery("#registroEncuesta").validationEngine();
});*/ });*/
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
<div class="navbar-container" id="navbar-container"> <div class="navbar-container" id="navbar-container">
<%@ include file="banner.jsp" %> <%@ include file="banner.jsp" %>
</div><!-- /.navbar-container --> </div><!-- /.navbar-container -->
<p id="lblUsuario"><%=usuario!=null?usuario.getCodigoTipoUsuario():""%></p> <p id="lblUsuario"><%=usuario!=null?usuario.getCodigoTipoUsuario():""%></p>
</div> </div>
<div id="snackbar">Se registro correctamente..</div> <div id="snackbar">Se registro correctamente..</div>
<!-- /section:basics/navbar.layout --> <!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container"> <div class="main-container" id="main-container">
<script type="text/javascript"> <script type="text/javascript">
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</script> </script>
<!-- #section:basics/sidebar --> <!-- #section:basics/sidebar -->
<div id="sidebar" class="sidebar responsive"> <div id="sidebar" class="sidebar responsive">
<script type="text/javascript"> <script type="text/javascript">
try { try {
ace.settings.check('sidebar', 'fixed') ace.settings.check('sidebar', 'fixed')
...@@ -326,24 +326,24 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -326,24 +326,24 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
<!-- inline scripts related to this page --> <!-- inline scripts related to this page -->
<script type="text/javascript"> <script type="text/javascript">
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
$(document).ready(function () { $(document).ready(function () {
jQuery("#formulario").validationEngine(); jQuery("#formulario").validationEngine();
jQuery("#listado").validationEngine(); jQuery("#listado").validationEngine();
}); });
function conMayuscula(field) { function conMayuscula(field) {
field.value = field.value.toUpperCase(); field.value = field.value.toUpperCase();
} }
function cargando() { function cargando() {
$.blockUI({ $.blockUI({
message: '<div class="thecube"> <div class="cube c1"></div> <div class="cube c2"></div> <div class="cube c4"></div> <div class="cube c3"></div> </div>', message: '<div class="thecube"> <div class="cube c1"></div> <div class="cube c2"></div> <div class="cube c4"></div> <div class="cube c3"></div> </div>',
// message: '<div class="loading" id="g-spinner" style="zoom: 1;"><div class="circle c1"></div><div class="circle c2"></div><div class="circle c3"></div><div class="circle c4"></div></div>', // message: '<div class="loading" id="g-spinner" style="zoom: 1;"><div class="circle c1"></div><div class="circle c2"></div><div class="circle c3"></div><div class="circle c4"></div></div>',
// message: '<div class="js-loading-indicator triple" style="width: 192px; height: 192px; top: 64px; left: 208px;"></div>', // message: '<div class="js-loading-indicator triple" style="width: 192px; height: 192px; top: 64px; left: 208px;"></div>',
baseZ: 9000, baseZ: 9000,
overlayCSS: { overlayCSS: {
backgroundColor: '#1b2024', backgroundColor: '#1b2024',
...@@ -359,22 +359,22 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -359,22 +359,22 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
} }
}); });
} }
function cerrar_cargando() { function cerrar_cargando() {
$.unblockUI(); $.unblockUI();
} }
function segundaCarga() { function segundaCarga() {
cargarArea(); cargarArea();
} }
function cargarArea() { function cargarArea() {
var accion = "cargarPlana();"; var accion = "cargarPlana();";
var nombre = "cmbArea"; var nombre = "cmbArea";
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '../ServletArea?Accion=cargarArea', url: '../ServletArea?Accion=cargarArea',
data: 'accion=' + accion+'&nombre='+nombre, data: 'accion=' + accion + '&nombre=' + nombre,
beforeSend: function () { beforeSend: function () {
cargando(); cargando();
}, success: function (resultado) { }, success: function (resultado) {
...@@ -384,12 +384,12 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -384,12 +384,12 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
} }
}); });
} }
function cargarPlana() { function cargarPlana() {
var codArea = $("#cmbArea").val(); var codArea = $("#cmbArea").val();
var accion = ""; var accion = "";
var nombre = "cmbPlana"; var nombre = "cmbPlana";
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '../ServletPlana?Accion=cargarPlana', url: '../ServletPlana?Accion=cargarPlana',
...@@ -402,18 +402,18 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -402,18 +402,18 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
}, complete: function () { }, complete: function () {
} }
}); });
} }
function validar() { function validar() {
var estado = $("#formulario").validationEngine(); var estado = $("#formulario").validationEngine();
if (estado) { if (estado) {
listarRegistros(); listarRegistros();
} }
} }
function listarRegistros() { function listarRegistros() {
let name='' let name = ''
var nombrePlana = $("#cmbPlana option:selected").text(); var nombrePlana = $("#cmbPlana option:selected").text();
var codigoPlana = $("#cmbPlana").val(); var codigoPlana = $("#cmbPlana").val();
var codigoPeriodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var codigoPeriodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
...@@ -426,46 +426,48 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -426,46 +426,48 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
}, success: function (resultado) { }, success: function (resultado) {
cerrar_cargando(); cerrar_cargando();
$("#divListado").html(resultado); $("#divListado").html(resultado);
name=$("#lblUsuario").text(); name = $("#lblUsuario").text();
if(name === "6"){ if (name === "6") {
$("#divListado #btnRegistrar").hide(); $("#divListado #btnRegistrar").hide();
} }
let periodoEnc=$("#divListado #codEnc").val(); let periodoEnc = $("#divListado #codEnc").val();
// $("#divListado #txtPuesto").keypress(function (e) { // $("#divListado #txtPuesto").keypress(function (e) {
// if (e.which == 13 || e.keyCode == 13) { // if (e.which == 13 || e.keyCode == 13) {
//// alert('enter key is pressed'); //// alert('enter key is pressed');
// registrarPuesto(periodoEnc); // registrarPuesto(periodoEnc);
// } // }
// }); // });
}, complete: function () { }, complete: function () {
} }
}); });
} }
function mostrarSnackBar() { function mostrarSnackBar() {
// Get the snackbar DIV // Get the snackbar DIV
var x = document.getElementById("snackbar"); var x = document.getElementById("snackbar");
// Add the "show" class to DIV // Add the "show" class to DIV
x.className = "show"; x.className = "show";
// After 3 seconds, remove the show class from DIV // After 3 seconds, remove the show class from DIV
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 2000); setTimeout(function () {
} x.className = x.className.replace("show", "");
}, 2000);
}
// $("#search").on('click',function(){ // $("#search").on('click',function(){
// alert('You press enter'); // alert('You press enter');
// }); // });
function conformidadRegistrarNota() { function conformidadRegistrarNota() {
bootbox.dialog({ bootbox.dialog({
headerClass: "modal-bg-primary", headerClass: "modal-bg-primary",
title: "<i class='ace-icon fa fa-check-circle white'></i> <span class='white'>Conformidad</span>", title: "<i class='ace-icon fa fa-check-circle white'></i> <span class='white'>Conformidad</span>",
...@@ -482,17 +484,17 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -482,17 +484,17 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
label: "<i class='fa fa-times bigger-110'></i>&nbsp; No", label: "<i class='fa fa-times bigger-110'></i>&nbsp; No",
className: "btn-danger btn-sm", className: "btn-danger btn-sm",
callback: function () { callback: function () {
} }
} }
} }
}); });
} }
function armarDatos() { function armarDatos() {
var cantidad = $("#cantidad").val(); var cantidad = $("#cantidad").val();
var datos = ""; let datos = "";
for (var i = 0; i < cantidad; i++) { for (var i = 0; i < cantidad; i++) {
var codigoDocente = $("#codDoc_" + i + "").val(); var codigoDocente = $("#codDoc_" + i + "").val();
var nombreDocente = $("#nomDoc_" + i + "").val(); var nombreDocente = $("#nomDoc_" + i + "").val();
...@@ -501,79 +503,90 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -501,79 +503,90 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
var notaEncuesta = $("#notaEncuesta_" + i + "").val(); var notaEncuesta = $("#notaEncuesta_" + i + "").val();
var txtPuesto = $("#txtPuesto_" + i + "").val(); var txtPuesto = $("#txtPuesto_" + i + "").val();
var txtObservacion = $("#txtObservacion_" + i + "").val(); var txtObservacion = $("#txtObservacion_" + i + "").val();
if (notaPlana != "" && notaExa != "" && txtPuesto !="" && txtObservacion != "") {
if (notaPlana != "" && notaExa != "" && txtPuesto != "" && txtObservacion != "") {
if (datos == "") { if (datos == "") {
datos = codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta+"#"+txtPuesto+"#"+txtObservacion; datos = codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta + "#" + txtPuesto + "#" + txtObservacion;
} else { } else {
datos += "!" + codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta+"#"+txtPuesto+"#"+txtObservacion; datos += "!" + codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta + "#" + txtPuesto + "#" + txtObservacion;
} }
} else if (notaPlana == "" && notaExa != "" && txtPuesto !="" && txtObservacion != "") { } else if (notaPlana == "" && notaExa != "" && txtPuesto != "" && txtObservacion != "") {
notaPlana = "vacio"; notaPlana = "vacio";
if (datos == "") { if (datos == "") {
datos = codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta+"#"+txtPuesto+"#"+txtObservacion; datos = codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta + "#" + txtPuesto + "#" + txtObservacion;
} else { } else {
datos += "!" + codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta+"#"+txtPuesto+"#"+txtObservacion; datos += "!" + codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta + "#" + txtPuesto + "#" + txtObservacion;
} }
} else if (notaExa == "" && notaPlana != "" && txtPuesto !="" && txtObservacion != "") { } else if (notaExa == "" && notaPlana != "" && txtPuesto != "" && txtObservacion != "") {
notaExa = "vacio"; notaExa = "vacio";
if (datos == "") { if (datos == "") {
datos = codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta+"#"+txtPuesto+"#"+txtObservacion; datos = codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta + "#" + txtPuesto + "#" + txtObservacion;
} else { } else {
datos += "!" + codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta+"#"+txtPuesto+"#"+txtObservacion; datos += "!" + codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta + "#" + txtPuesto + "#" + txtObservacion;
} }
} } else if (txtPuesto == "" && txtObservacion != "" && notaExa != "" && notaPlana != "") {
else if(txtPuesto == "" && txtObservacion != "" && notaExa != "" && notaPlana != ""){
txtPuesto = "vacio"; txtPuesto = "vacio";
if (datos == "") { if (datos == "") {
datos = codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta+"#"+txtPuesto+"#"+txtObservacion; datos = codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta + "#" + txtPuesto + "#" + txtObservacion;
} else { } else {
datos += "!" + codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta+"#"+txtPuesto+"#"+txtObservacion; datos += "!" + codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta + "#" + txtPuesto + "#" + txtObservacion;
} }
}else if(txtObservacion == "" && txtPuesto != "" && notaExa != "" && notaPlana != ""){ }else if (txtPuesto == "" && txtObservacion == "" && notaExa != "" && notaPlana != "") {
txtObservacion = "vacio"; txtPuesto = "vacio";
txtObservacion = "vacio";
if (datos == "") {
datos = codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta + "#" + txtPuesto + "#" + txtObservacion;
} else {
datos += "!" + codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta + "#" + txtPuesto + "#" + txtObservacion;
}
if (datos == "") { } else if (txtObservacion == "" && txtPuesto != "" && notaExa != "" && notaPlana != "") {
txtObservacion = "vacio";
datos = codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta+"#"+txtPuesto+"#"+txtObservacion;
if (datos == "") {
datos = codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta + "#" + txtPuesto + "#" + txtObservacion;
} else { } else {
datos += "!" + codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta+"#"+txtPuesto+"#"+txtObservacion; datos += "!" + codigoDocente + "#" + nombreDocente + "#" + notaPlana + "#" + notaExa + "#" + notaEncuesta + "#" + txtPuesto + "#" + txtObservacion;
} }
} }
} }
registrarMerito(datos); registrarMerito(datos);
} }
function registrarMerito(datos) { function registrarMerito(datos) {
var codigoPeriodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var codigoPeriodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
var codigoPlana = $("#cmbPlana").val(); var codigoPlana = $("#cmbPlana").val();
var codigoEncuesta = $("#codEnc").val(); var codigoEncuesta = $("#codEnc").val();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '../ServletTablaMerito?Accion=registrarNotaTablaEvaluacion', url: '../ServletTablaMerito?Accion=registrarNotaTablaEvaluacion',
...@@ -582,13 +595,13 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -582,13 +595,13 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
cargando(); cargando();
}, success: function (resultado) { }, success: function (resultado) {
cerrar_cargando(); cerrar_cargando();
}, complete: function () { }, complete: function () {
notificarRegistroNota(); notificarRegistroNota();
} }
}); });
} }
function notificarRegistroNota() { function notificarRegistroNota() {
bootbox.dialog({ bootbox.dialog({
headerClass: "modal-bg-success", headerClass: "modal-bg-success",
...@@ -609,31 +622,31 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -609,31 +622,31 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
function validaSoloNumericos(e) { function validaSoloNumericos(e) {
let tecla = (document.all) ? e.keyCode : e.which; let tecla = (document.all) ? e.keyCode : e.which;
//Tecla de retroceso para borrar, siempre la permite //Tecla de retroceso para borrar, siempre la permite
if (tecla == 8) { if (tecla == 8) {
return true; return true;
} }
patron = /[0-9]/; patron = /[0-9]/;
tecla_final = String.fromCharCode(tecla); tecla_final = String.fromCharCode(tecla);
return patron.test(tecla_final); return patron.test(tecla_final);
} }
// ----------------------------------------------------------------- // -----------------------------------------------------------------
function doSearch() { function doSearch() {
var tableReg = document.getElementById('datos'); var tableReg = document.getElementById('datos');
var searchText = document.getElementById('searchTerm').value.toLowerCase(); var searchText = document.getElementById('searchTerm').value.toLowerCase();
var cellsOfRow = ""; var cellsOfRow = "";
var found = false; var found = false;
var compareWith = ""; var compareWith = "";
// Recorremos todas las filas con contenido de la tabla // Recorremos todas las filas con contenido de la tabla
for (var i = 1; i < tableReg.rows.length; i++) { for (var i = 1; i < tableReg.rows.length; i++) {
cellsOfRow = tableReg.rows[i].getElementsByTagName('td'); cellsOfRow = tableReg.rows[i].getElementsByTagName('td');
found = false; found = false;
// Recorremos todas las celdas // Recorremos todas las celdas
for (var j = 0; j < cellsOfRow.length && !found; j++) { for (var j = 0; j < cellsOfRow.length && !found; j++) {
...@@ -652,27 +665,27 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -652,27 +665,27 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
tableReg.rows[i].style.display = 'none'; tableReg.rows[i].style.display = 'none';
} }
} }
} }
$('[data-rel=tooltip]').tooltip(); $('[data-rel=tooltip]').tooltip();
function conMayusculas(field) { function conMayusculas(field) {
field.value = field.value.toUpperCase(); field.value = field.value.toUpperCase();
} }
$('input').keypress(function (e) { $('input').keypress(function (e) {
if (e.which == 13) { if (e.which == 13) {
return false; return false;
} }
}); });
function validarIngreso(event, id, condicion) { function validarIngreso(event, id, condicion) {
$(id).mask('00.00', {reverse: true}); $(id).mask('00.00', {reverse: true});
} }
</script> </script>
<!-- the following scripts are used in demo only for onpage help and you don't need them --> <!-- the following scripts are used in demo only for onpage help and you don't need them -->
......
...@@ -19,7 +19,6 @@ Menu menu=(Menu)session_actual.getAttribute("menu"); ...@@ -19,7 +19,6 @@ Menu menu=(Menu)session_actual.getAttribute("menu");
Sede SedeCod=(Sede)session_actual.getAttribute("sedeSessionCod"); Sede SedeCod=(Sede)session_actual.getAttribute("sedeSessionCod");
PeriodoAcademico periodo=(PeriodoAcademico)session_actual.getAttribute("periodo"); PeriodoAcademico periodo=(PeriodoAcademico)session_actual.getAttribute("periodo");
Horario armandoHorario=(Horario)session_actual.getAttribute("armandoHorario"); Horario armandoHorario=(Horario)session_actual.getAttribute("armandoHorario");
Grupo CadenaGrupo=(Grupo)session_actual.getAttribute("sessionGrupoHorario"); Grupo CadenaGrupo=(Grupo)session_actual.getAttribute("sessionGrupoHorario");
if(usuario == null || periodo== null){ if(usuario == null || periodo== null){
......
<%-- <%@page import="pe.siso.horario.Beans.Usuario"%>
Document : vistaDobleDisponibilidad
Created on : 17-nov-2018, 8:48:37
Author : sistem20user
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="pe.siso.horario.Beans.PeriodoAcademico"%> <%@page import="pe.siso.horario.Beans.PeriodoAcademico"%>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>VISTA DOBLE DISPONIBILIDAD</title> <title>VISTA DOBLE DISPONIBILIDAD</title>
<link rel="stylesheet" href="../assets/css/jquery-ui.css" /> <link rel="stylesheet" href="../assets/css/jquery-ui.css" />
<!-- Compiled and minified CSS --> <!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="css/snackbar.css" rel="stylesheet" type="text/css"/> <link href="css/snackbar.css" rel="stylesheet" type="text/css"/>
<link href="css/alert.css" rel="stylesheet" type="text/css"/> <link href="css/alert.css" rel="stylesheet" type="text/css"/>
<!-- Compiled and minified JavaScript --> <!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<!--jquery--> <!--jquery-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!--axios--> <!--axios-->
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<% <%
HttpSession session_actual = request.getSession(true); HttpSession session_actual = request.getSession(true);
PeriodoAcademico periodo=(PeriodoAcademico)session_actual.getAttribute("periodo"); PeriodoAcademico periodo = (PeriodoAcademico) session_actual.getAttribute("periodo");
%> %>
<style type="text/css"> <style type="text/css">
@media print { @media print {
#divBusqueda {display:none} #divBusqueda {display:none}
#lblTitulo{text-align: center;font-size: 40px;font-weight: bold} #lblTitulo{text-align: center;font-size: 40px;font-weight: bold}
} }
td{ td{
border : 3px solid; border : 3px solid;
text-align : center; text-align : center;
} }
body{ body{
background-image: url(../assets/images/fondo-trismegisto.png); background-image: url(../assets/images/fondo-trismegisto.png);
height: 500px; height: 500px;
max-width: 100%; max-width: 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
background-attachment: fixed; background-attachment: fixed;
} }
body::after { body::after {
content: ""; content: "";
position: absolute; position: absolute;
top: 0%; top: 0%;
left: 0%; left: 0%;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: rgba(255, 255, 255, 0.9); background: rgba(255, 255, 255, 0.9);
z-index: -1; z-index: -1;
position: fixed; position: fixed;
} }
.colorVerde{ .colorVerde{
background-color: #96d089; background-color: #96d089;
} }
.colorRojo{ .colorRojo{
background-color: #d0766f; background-color: #d0766f;
} }
.colorAzul{ .colorAzul{
background-color: #59a1da; background-color: #59a1da;
} }
</style> </style>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
function alertDGC(mensaje) function alertDGC(mensaje)
{ {
var dgcTiempo = 500 var dgcTiempo = 500
var ventanaCS = '<div class="dgcAlert"><div class="dgcVentana"><div class="dgcCerrar"></div><div class="dgcMensaje">' + mensaje + '<br><div class="dgcAceptar">Aceptar</div></div></div></div>'; var ventanaCS = '<div class="dgcAlert"><div class="dgcVentana"><div class="dgcCerrar"></div><div class="dgcMensaje">' + mensaje + '<br><div class="dgcAceptar">Aceptar</div></div></div></div>';
// var bodyCS='<input type="text" value="prueba">'; // var bodyCS='<input type="text" value="prueba">';
$('body').append(ventanaCS); $('body').append(ventanaCS);
// $('body').append(bodyCS); // $('body').append(bodyCS);
var alVentana = $('.dgcVentana').height(); var alVentana = $('.dgcVentana').height();
var alNav = $(window).height(); var alNav = $(window).height();
var supNav = $(window).scrollTop(); var supNav = $(window).scrollTop();
$('.dgcAlert').css('height', $(document).height()); $('.dgcAlert').css('height', $(document).height());
$('.dgcVentana').css('top', ((alNav - alVentana) / 2 + supNav - 100) + 'px'); $('.dgcVentana').css('top', ((alNav - alVentana) / 2 + supNav - 100) + 'px');
$('.dgcAlert').css('display', 'block'); $('.dgcAlert').css('display', 'block');
$('.dgcAlert').animate({opacity: 1}, dgcTiempo); $('.dgcAlert').animate({opacity: 1}, dgcTiempo);
$('.dgcCerrar,.dgcAceptar').click(function (e) { $('.dgcCerrar,.dgcAceptar').click(function (e) {
$('.dgcAlert').animate({opacity: 0}, dgcTiempo); $('.dgcAlert').animate({opacity: 0}, dgcTiempo);
setTimeout("$('.dgcAlert').remove()", dgcTiempo); setTimeout("$('.dgcAlert').remove()", dgcTiempo);
}); });
} }
</script> </script>
</head> </head>
<body> <body>
<script> <script>
window.alert = function (message) { window.alert = function (message) {
alertDGC(message); alertDGC(message);
}; };
</script> </script>
<div class="container"> <div class="container">
<div class="row" id="divBusqueda"> <div class="row" id="divBusqueda">
<div class="col s8 offset-s2"> <div class="col s8 offset-s2">
<div class="card"> <div class="card">
<div class="card-content"> <div class="card-content">
<span class="card-title" style="font-weight: bold">Buscar disponibilidad</span> <span class="card-title" style="font-weight: bold">Buscar disponibilidad</span>
<div class="row"> <div class="row">
<div class="input-field col s6"> <div class="input-field col s6">
<select id="cbArea" onchange="listarPlana(this);desactivarBuscar();desactivarPrint();"> <select id="cbArea" onchange="listarPlana(this);desactivarBuscar();desactivarPrint();">
</select> </select>
<label>Area:</label> <label>Area:</label>
</div> </div>
<div class="input-field col s6"> <div class="input-field col s6">
<select id="cbPlana" onchange="activarBuscar();"> <select id="cbPlana" onchange="activarBuscar();">
</select> </select>
<label>Plana:</label> <label>Plana:</label>
</div> </div>
</div> </div>
</div> </div>
<div class="card-action center"> <div class="card-action center">
<a class="waves-effect waves-light btn blue" id="btnBuscar" onclick="activarPrint();"><i class="material-icons left">search</i>BUSCAR</a> <a class="waves-effect waves-light btn blue" id="btnBuscar" onclick="activarPrint();"><i class="material-icons left">search</i>BUSCAR</a>
<a class="waves-effect waves-light btn" id="btnImprimir" onclick="pintarTDRed();window.print();" style="background-color: #5478a2;"><i class="material-icons dp48 left">print</i>IMPRIMIR</a><br> <a class="waves-effect waves-light btn" id="btnImprimir" onclick="pintarTDRed();window.print();" style="background-color: #5478a2;"><i class="material-icons dp48 left">print</i>IMPRIMIR</a><br>
<!-- <a class="btn btn-app btn-light btn-xs align-left" onclick="window.print();" target="_blank" id="iconoImprimir"> <!-- <a class="btn btn-app btn-light btn-xs align-left" onclick="window.print();" target="_blank" id="iconoImprimir">
<i class="ace-icon fa fa-print bigger-160"></i>--> <i class="ace-icon fa fa-print bigger-160"></i>-->
<label>Zona:</label> <label>Zona:</label>
<select id="cmbZonas" onchange="listarDisponibilidad();activarPrint();"> <select id="cmbZonas" onchange="listarDisponibilidad();
</select> activarPrint();">
</select>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="row">
<div class="col s12"> <div class="row">
<div class="card"> <div class="col s12">
<div class="card-content"> <div class="card">
<span class="card-title" id="lblTitulo">Lista de docentes y disponibilidad</span> <div class="card-content">
<span class="card-title" id="lblTitulo">Lista de docentes y disponibilidad</span>
<div class="row">
<div id="divListaDisponibilidad"> <div class="row">
<div id="divListaDisponibilidad">
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Modal Structure --> </div>
<!-- Modal Structure -->
</div>
</div>
</div>
<!-- The actual snackbar --> </div>
<div id="snackbar">Se bloqueo el dia correctamente..</div> <!-- The actual snackbar -->
<div id="snackbar2">Desbloqueado.</div> <div id="snackbar">Se bloqueo el dia correctamente..</div>
<script> <div id="snackbar2">Desbloqueado.</div>
<script>
// $("#btnBuscar").attr('disabled','disabled'); // $("#btnBuscar").attr('disabled','disabled');
function desactivarBuscar() { function desactivarBuscar() {
$("#btnBuscar").attr('disabled', 'disabled'); $("#btnBuscar").attr('disabled', 'disabled');
} }
function activarBuscar() { function activarBuscar() {
$("#btnBuscar").attr('disabled', false); $("#btnBuscar").attr('disabled', false);
} }
var elems = document.querySelectorAll('select'); var elems = document.querySelectorAll('select');
var instances = M.FormSelect; var instances = M.FormSelect;
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
listarArea() listarArea()
listarZona() listarZona()
// setTimeout(function(){ alert("HOLA MASCOTA"); }, 5000); // setTimeout(function(){ alert("HOLA MASCOTA"); }, 5000);
document.querySelector('#btnBuscar').addEventListener('click', function () { document.querySelector('#btnBuscar').addEventListener('click', function () {
let cmbZonas = $("#cmbZonas option:selected").text(); let cmbZonas = $("#cmbZonas option:selected").text();
if (cmbZonas === "[SELECCIONE]") { if (cmbZonas === "[SELECCIONE]") {
listarDisponibilidad() listarDisponibilidad()
} else { } else {
listarDisponibilidad() listarDisponibilidad()
} }
}) })
}); });
function listarArea() { function listarArea() {
axios.get('../ServletArea?Accion=cargarAreaJson') axios.get('../ServletArea?Accion=cargarAreaJson')
.then(data => { .then(data => {
let option = '<option value="">[SELECCIONE]</option>' let option = '<option value="">[SELECCIONE]</option>'
data.data.forEach(v => { data.data.forEach(v => {
option += '<option value="' + v.codigoArea + '">' + v.nombreArea + '</option>' option += '<option value="' + v.codigoArea + '">' + v.nombreArea + '</option>'
}) })
document.querySelector('#cbArea').innerHTML = option document.querySelector('#cbArea').innerHTML = option
instances.init(elems) instances.init(elems)
}) })
} }
function listarZona() { function listarZona() {
axios.get('../ServletZona?Accion=cargarZonaJson') axios.get('../ServletZona?Accion=cargarZonaJson')
.then(data => { .then(data => {
let option = '<option value="">[SIN ZONA]</option><option value="T">TODAS LAS ZONAS</option>' let option = '<option value="">[SIN ZONA]</option><option value="T">TODAS LAS ZONAS</option>'
data.data.forEach(v => { data.data.forEach(v => {
option += '<option value="' + v.codigoZona + '">' + v.nombreZona + '</option>' option += '<option value="' + v.codigoZona + '">' + v.nombreZona + '</option>'
}) })
document.querySelector('#cmbZonas').innerHTML = option document.querySelector('#cmbZonas').innerHTML = option
instances.init(elems) instances.init(elems)
}) })
} }
function listarDisponibilidad() { function listarDisponibilidad() {
let codigoPlana = document.querySelector('#cbPlana').value let codigoPlana = document.querySelector('#cbPlana').value
let codigoPeriodo = '<%= periodo!=null?periodo.getCodigoPeriodo():""%>' let codigoPeriodo = '<%= periodo != null ? periodo.getCodigoPeriodo() : ""%>'
console.log(codigoPeriodo) console.log(codigoPeriodo)
let codigoZona = document.querySelector('#cmbZonas').value let codigoZona = document.querySelector('#cmbZonas').value
// let distritos=new ZonaDistritoServices(); // let distritos=new ZonaDistritoServices();
if (codigoPlana && codigoPeriodo && codigoZona) { if (codigoPlana && codigoPeriodo && codigoZona) {
let json = {
codigoPlana,
codigoPeriodo,
codigoZona
}
let json = { peticionWith3Parameters(json);
codigoPlana,
codigoPeriodo,
codigoZona
}
peticionWith3Parameters(json);
} else {
let codigoPeriodo2 = '<%= periodo!=null?periodo.getCodigoPeriodo():""%>' } else {
let codigoPeriodo2 = '<%= periodo != null ? periodo.getCodigoPeriodo() : ""%>'
// let codigoPlana2 = document.querySelector('#cbPlana').value // let codigoPlana2 = document.querySelector('#cbPlana').value
let json2 = { let json2 = {
codigoPlana, codigoPlana,
codigoPeriodo2 codigoPeriodo2
} }
peticionSimple(json2);
}
}
function peticionSimple(json) {
$.ajax({
url: '../ServletHorario?Accion=listarVistaDobleDisponibilidadSinZona',
type: 'POST',
dataType: 'json',
data: {
json: JSON.stringify(json)
},
success: function (data, textStatus, jqXHR) {
let html = ''
let nTurno = []
let nDia = []
let mensaje = 'No registrado'
data.data.forEach(function (docente) {
if (typeof (docente.celular && docente.distrito) == "undefined") {
html += '<table>'
html += '<div class="divider"></div>'
html += '<div class="section">'
html += '<h6 id="nombreDocente">' + docente.nombre + '<span></span><span></span><span style="margin-left:650px;font-size:20px;color:#6C7807"><i class="small material-icons" title="Puesto" style="color:black;">grade</i><strong>No registrado</strong></span></h6>'
html += '<label id="codDocente" style="visibility:hidden;">' + docente.codDocente + '</label>'
html += '<tr>'
html += '<p>Celular: No registrado</p>'
html += '<p>Distrito: No registrado</p>'
html += '<p>Direccion: No registrado</p>'
html += '<p>Correo: No registrado</p>'
html += '</tr>'
html += '<br>'
peticionSimple(json2);
}
}
function peticionSimple(json) { if (docente.disponibilidad) {
$.ajax({ let disponibilidad = docente.disponibilidad.split('-') || []
url: '../ServletHorario?Accion=listarVistaDobleDisponibilidadSinZona', let diasM = []
type: 'POST', let diasT = []
dataType: 'json', let aulasM = []
data: { let aulasT = []
json: JSON.stringify(json)
},
success: function (data, textStatus, jqXHR) {
if (docente.arrayAulas) {
docente.arrayAulas.forEach(v => {
if (v.turno == '1') {
aulasM.push(v)
} else if (v.turno == '2') {
aulasT.push(v)
}
})
}
let html = '' let diasin = docente.diasin.split('-') || []
let nTurno = [] let diasMS = []
let nDia = [] let diasTS = []
let mensaje = 'No registrado'
data.data.forEach(function (docente) {
if (typeof (docente.celular && docente.distrito) == "undefined") { diasin.forEach(function (b) {
let nTurnoS = b.split('#')[0]
let nDiaS = b.split('#')[1]
html += '<table>' if (nTurnoS == '1') {
html += '<div class="divider"></div>' diasMS.push(nDiaS)
html += '<div class="section">' } else if (nTurno == '2') {
diasTS.push(nDiaS)
}
html += '<h6 id="nombreDocente">' + docente.nombre + '<span></span><span></span><span style="margin-left:650px;font-size:20px;color:#6C7807"><i class="small material-icons" title="Puesto" style="color:black;">grade</i><strong>No registrado</strong></span></h6>' })
html += '<label id="codDocente" style="visibility:hidden;">' + docente.codDocente + '</label>'
html += '<tr>'
html += '<p>Celular: No registrado</p>'
html += '<p>Distrito: No registrado</p>'
html += '<p>Direccion: No registrado</p>'
html += '<p>Correo: No registrado</p>'
html += '</tr>' let bloqueo = docente.bloqueo.split('-') || []
let diasMB = []
let diasTB = []
let aulasMB = []
let aulasTB = []
html += '<br>' bloqueo.forEach(function (b) {
let nTurno = b.split('#')[0]
let nDia = b.split('#')[1]
if (nTurno == '1') {
diasMB.push(nDia)
} else if (nTurno == '2') {
diasTB.push(nDia)
}
})
if (docente.disponibilidad) { disponibilidad.forEach(function (d) {
let turno = d.split('#')[0]
let dia = d.split('#')[1]
let disponibilidad = docente.disponibilidad.split('-') || [] if (turno == '1') {
let diasM = [] diasM.push(dia)
let diasT = [] } else if (turno == '2') {
let aulasM = [] diasT.push(dia)
let aulasT = [] }
})
if (docente.arrayAulas) { html += '<p class="col s12">'
docente.arrayAulas.forEach(v => { html += '<table class="centered" id="tableDisponibilidad">'
if (v.turno == '1') { html += '<thead>'
aulasM.push(v) html += '<tr>'
} else if (v.turno == '2') { html += '<td>TURNO</td>'
aulasT.push(v) html += '<td id="dia">LUNES</td>'
} html += '<td id="dia">MARTES</td>'
}) html += '<td id="dia">MIERCOLES</td>'
} html += '<td id="dia">JUEVES</td>'
html += '<td id="dia">VIERNES</td>'
html += '<td id="dia">SABADO</td>'
html += '</tr>'
html += '</thead>'
html += '<tbody>'
let diasin = docente.diasin.split('-') || []
let diasMS = []
let diasTS = []
diasin.forEach(function (b) { html += '<tr>'
let nTurnoS = b.split('#')[0] html += '<td id="turno">M</td>'
let nDiaS = b.split('#')[1]
if (nTurnoS == '1') { for (let i = 0; i < 6; i++) {
diasMS.push(nDiaS) let aulas = aulasM.map(a => {
} else if (nTurno == '2') { if (a.dia == i + 1) {
diasTS.push(nDiaS) return a.sede + ' - ' + a.aulas
} }
})
}) if (diasM.some(d => d == (i + 1))) {
html += `<td class="colorVerde" onclick="colorChange(this);">` + aulas.join(' \n ') + `</td>`
let bloqueo = docente.bloqueo.split('-') || [] } else if (diasMB.some(t => t == (i + 1))) {
let diasMB = []
let diasTB = []
let aulasMB = []
let aulasTB = []
bloqueo.forEach(function (b) { html += `<td class="blue" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
let nTurno = b.split('#')[0]
let nDia = b.split('#')[1]
if (nTurno == '1') { } else if (diasMS.some(r => r == (i + 1))) {
diasMB.push(nDia)
} else if (nTurno == '2') {
diasTB.push(nDia)
}
}) html += `<td class="blue" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
} else {
disponibilidad.forEach(function (d) { html += `<td class="colorRojo" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
let turno = d.split('#')[0] }
let dia = d.split('#')[1] }
if (turno == '1') {
diasM.push(dia)
} else if (turno == '2') {
diasT.push(dia)
}
})
html += '<p class="col s12">' html += '</tr>'
html += '<table class="centered" id="tableDisponibilidad">'
html += '<thead>'
html += '<tr>'
html += '<td>TURNO</td>'
html += '<td id="dia">LUNES</td>'
html += '<td id="dia">MARTES</td>'
html += '<td id="dia">MIERCOLES</td>'
html += '<td id="dia">JUEVES</td>'
html += '<td id="dia">VIERNES</td>'
html += '<td id="dia">SABADO</td>'
html += '</tr>'
html += '</thead>'
html += '<tbody>'
html += '<tr>'
html += '<td id="turno">T</td>'
html += '<tr>' for (let i = 0; i < 6; i++) {
html += '<td id="turno">M</td>' let aulas = aulasT.map(a => {
for (let i = 0; i < 6; i++) { if (a.dia == i + 1) {
let aulas = aulasM.map(a => { return a.sede + ' - ' + a.aulas
if (a.dia == i + 1) { }
return a.sede + ' - ' + a.aulas })
} if (diasT.some(d => d == (i + 1))) {
})
if (diasM.some(d => d == (i + 1))) { html += `<td class="colorVerde" onclick="colorChange(this);">` + aulas.join(' \n ') + `</td>`
html += `<td class="colorVerde" onclick="colorChange(this);">` + aulas.join(' \n ') + `</td>` } else if (diasTB.some(t => t == (i + 1))) {
} else if (diasMB.some(t => t == (i + 1))) { html += `<td class="blue" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
html += `<td class="blue" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>` } else if (diasTS.some(q => q == (i + 1))) {
} else if (diasMS.some(r => r == (i + 1))) { html += `<td class="blue" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
html += `<td class="blue" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>` } else {
} else {
html += `<td class="colorRojo" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>` html += `<td class="colorRojo" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
}
}
}
}
html += '</tr>' html += '</tr>'
html += '<tr>' html += '</tbody>'
html += '<td id="turno">T</td>' html += '</table>'
html += '</p>'
for (let i = 0; i < 6; i++) {
let aulas = aulasT.map(a => {
if (a.dia == i + 1) { } else {
return a.sede + ' - ' + a.aulas html += '<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
} }
}) html += `</div>`
if (diasT.some(d => d == (i + 1))) {
html += `<td class="colorVerde" onclick="colorChange(this);">` + aulas.join(' \n ') + `</td>` } else {
} else if (diasTB.some(t => t == (i + 1))) { html += '<div class="divider"></div>'
html += '<div class="section">'
html += `<td class="blue" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>` html += '<h6 id="nombreDocente" style="font-weight:bold;">' + docente.nombre + '</h6>'
html += '<label id="codDocente" style="visibility:hidden;">' + docente.codDocente + '</label>'
} else if (diasTS.some(q => q == (i + 1))) {
html += `<td class="blue" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>` html += '<div class="form-control">'
html += '<div class="card grey lighten-2">'
html += '<div class="card-content black-text">'
//PRIMERA FILA
html += '<div class="row" style="margin-bottom:0px">'
html += '<div class="input-field col s3"><i class="material-icons dp48">local_phone</i> <strong>' + docente.celular + '</strong></div>'
html += '<div class="input-field col s3"><i class="material-icons dp48">school</i><strong> Puesto Nro: ' + docente.puesto + '</strong></div>'
html += '<div class="input-field col s6"><i class="material-icons dp48">hdr_weak</i> <strong>Exa. Encuesta: ' + docente.notaEncuesta + '</strong></div>'
html += '</div>'
} else { //SEGUNDA FILA
html += '<div class="row" style="margin-bottom:0px">'
html += '<div class="input-field col s3"><i class="material-icons dp48">room</i> <strong>' + docente.distrito + '</strong></div>'
html += '<div class="input-field col s6"><i class="material-icons dp48">hdr_strong</i> <strong> Exa. Academico: ' + docente.examenNota + '</strong></div>'
html += '</div>'
//TERCERA FILA
html += '<div class="row" style="margin-bottom:0px">'
html += '<div class="input-field col s3"><i class="material-icons dp48">email</i> <strong>' + docente.correo + '</strong></div>'
html += '<div class="input-field col s6"><i class="material-icons dp48">home</i> <strong>' + docente.direccion + '</strong></div>'
html += `<td class="colorRojo" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>` html += '</div>'
} html += '</div>'
} html += '</div>'
html += '</tr>' html += '</div>'
html += '</tbody>' html += '<p></p>'
html += '</table>'
html += '</p>'
html += '<br>'
} else {
html += '<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
}
html += `</div>`
}
else {
html += '<div class="divider"></div>'
html += '<div class="section">'
html += '<h6 id="nombreDocente" style="font-weight:bold;">' + docente.nombre + '</h6>' if (docente.disponibilidad) {
html += '<label id="codDocente" style="visibility:hidden;">' + docente.codDocente + '</label>'
html +='<div class="form-control">'
html +='<div class="card grey lighten-2">'
html += '<div class="card-content black-text">'
//PRIMERA FILA
html += '<div class="row" style="margin-bottom:0px">'
html += '<div class="input-field col s3"><i class="material-icons dp48">local_phone</i> <strong>' + docente.celular + '</strong></div>'
html += '<div class="input-field col s3"><i class="material-icons dp48">school</i><strong> Puesto Nro: '+docente.puesto+'</strong></div>'
html += '<div class="input-field col s6"><i class="material-icons dp48">hdr_weak</i> <strong>Exa. Encuesta: '+docente.notaEncuesta+'</strong></div>'
html += '</div>'
//SEGUNDA FILA let disponibilidad = docente.disponibilidad.split('-') || []
html += '<div class="row" style="margin-bottom:0px">' let diasM = []
html += '<div class="input-field col s3"><i class="material-icons dp48">room</i> <strong>' + docente.distrito + '</strong></div>' let diasT = []
html += '<div class="input-field col s6"><i class="material-icons dp48">hdr_strong</i> <strong> Exa. Academico: '+docente.examenNota+'</strong></div>' let aulasM = []
html += '</div>' let aulasT = []
//TERCERA FILA
html += '<div class="row" style="margin-bottom:0px">'
html += '<div class="input-field col s3"><i class="material-icons dp48">email</i> <strong>' + docente.correo + '</strong></div>'
html += '<div class="input-field col s6"><i class="material-icons dp48">home</i> <strong>' + docente.direccion + '</strong></div>'
html += '</div>'
html += '</div>'
html += '</div>'
html += '</div>'
html += '<p></p>'
html += '<br>'
if (docente.arrayAulas) {
docente.arrayAulas.forEach(v => {
if (v.turno == '1') {
aulasM.push(v)
} else if (v.turno == '2') {
aulasT.push(v)
}
})
}
let diasin = docente.diasin.split('-') || []
let diasMS = []
let diasTS = []
diasin.forEach(function (b) {
let nTurnoS = b.split('#')[0]
let nDiaS = b.split('#')[1]
if (docente.disponibilidad) { if (nTurnoS == '1') {
diasMS.push(nDiaS)
} else if (nTurno == '2') {
diasTS.push(nDiaS)
}
let disponibilidad = docente.disponibilidad.split('-') || [] })
let diasM = []
let diasT = []
let aulasM = []
let aulasT = []
if (docente.arrayAulas) {
docente.arrayAulas.forEach(v => {
if (v.turno == '1') {
aulasM.push(v)
} else if (v.turno == '2') {
aulasT.push(v)
}
})
}
let diasin = docente.diasin.split('-') || [] let bloqueo = docente.bloqueo.split('-') || []
let diasMS = [] let diasMB = []
let diasTS = [] let diasTB = []
let aulasMB = []
let aulasTB = []
diasin.forEach(function (b) { bloqueo.forEach(function (b) {
let nTurnoS = b.split('#')[0] let nTurno = b.split('#')[0]
let nDiaS = b.split('#')[1] let nDia = b.split('#')[1]
if (nTurnoS == '1') { if (nTurno == '1') {
diasMS.push(nDiaS) diasMB.push(nDia)
} else if (nTurno == '2') { } else if (nTurno == '2') {
diasTS.push(nDiaS) diasTB.push(nDia)
} }
}) })
let bloqueo = docente.bloqueo.split('-') || [] disponibilidad.forEach(function (d) {
let diasMB = [] let turno = d.split('#')[0]
let diasTB = [] let dia = d.split('#')[1]
let aulasMB = []
let aulasTB = []
bloqueo.forEach(function (b) { if (turno == '1') {
let nTurno = b.split('#')[0] diasM.push(dia)
let nDia = b.split('#')[1] } else if (turno == '2') {
diasT.push(dia)
}
})
if (nTurno == '1') { html += '<p class="col s12">'
diasMB.push(nDia) html += '<table class="centered">'
} else if (nTurno == '2') { html += '<thead>'
diasTB.push(nDia) html += '<tr>'
} html += '<td>TURNO</td>'
html += '<td id="dia">LUNES</td>'
html += '<td id="dia">MARTES</td>'
html += '<td id="dia">MIERCOLES</td>'
html += '<td id="dia">JUEVES</td>'
html += '<td id="dia">VIERNES</td>'
html += '<td id="dia">SABADO</td>'
html += '</tr>'
html += '</thead>'
html += '<tbody>'
})
html += '<tr>'
html += '<td id="turno">M</td>'
disponibilidad.forEach(function (d) { for (let i = 0; i < 6; i++) {
let turno = d.split('#')[0] let aulas = aulasM.map(a => {
let dia = d.split('#')[1] if (a.dia == i + 1) {
return a.sede + ' - ' + a.aulas
}
})
if (turno == '1') { if (diasM.some(d => d == (i + 1))) {
diasM.push(dia)
} else if (turno == '2') {
diasT.push(dia)
}
})
html += '<p class="col s12">' html += `<td class="colorVerde" onclick="colorChange(this);"> ` + aulas.join(' \n ') + `</td> `
html += '<table class="centered">'
html += '<thead>'
html += '<tr>'
html += '<td>TURNO</td>'
html += '<td id="dia">LUNES</td>'
html += '<td id="dia">MARTES</td>'
html += '<td id="dia">MIERCOLES</td>'
html += '<td id="dia">JUEVES</td>'
html += '<td id="dia">VIERNES</td>'
html += '<td id="dia">SABADO</td>'
html += '</tr>'
html += '</thead>'
html += '<tbody>'
} else if (diasMB.some(t => t == (i + 1))) {
html += '<tr>' html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> '
html += '<td id="turno">M</td>'
for (let i = 0; i < 6; i++) { } else if (diasMS.some(r => r == (i + 1))) {
let aulas = aulasM.map(a => {
if (a.dia == i + 1) {
return a.sede + ' - ' + a.aulas
}
})
if (diasM.some(d => d == (i + 1))) { html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> '
html += `<td class="colorVerde" onclick="colorChange(this);"> ` + aulas.join(' \n ') + `</td> ` } else {
} else if (diasMB.some(t => t == (i + 1))) { html += '<td class="colorRojo" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> '
}
}
html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> '
} else if (diasMS.some(r => r == (i + 1))) { html += '</tr>'
html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> ' html += '<tr>'
html += '<td id="turno">T</td>'
} else { for (let i = 0; i < 6; i++) {
let aulas = aulasT.map(a => {
html += '<td class="colorRojo" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> ' if (a.dia == i + 1) {
} return a.sede + ' - ' + a.aulas
} }
})
if (diasT.some(d => d == (i + 1))) {
html += `<td class="colorVerde" onclick="colorChange(this);"> ` + aulas.join(' \n ') + `</td> `
html += '</tr>'
html += '<tr>' } else if (diasTB.some(t => t == (i + 1))) {
html += '<td id="turno">T</td>'
for (let i = 0; i < 6; i++) { html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> '
let aulas = aulasT.map(a => {
if (a.dia == i + 1) { } else if (diasTS.some(q => q == (i + 1))) {
return a.sede + ' - ' + a.aulas
}
})
if (diasT.some(d => d == (i + 1))) {
html += `<td class="colorVerde" onclick="colorChange(this);"> ` + aulas.join(' \n ') + `</td> ` html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td>'
} else {
} else if (diasTB.some(t => t == (i + 1))) {
html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> ' html += '<td class="colorRojo" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> '
} else if (diasTS.some(q => q == (i + 1))) { }
}
html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td>' html += '</tr>'
} else { html += '</tbody>'
html += '</table>'
html += '</p>'
} else {
html += '<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
}
html += '<td class="colorRojo" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> ' html += `</div>`
}
})
document.querySelector('#divListaDisponibilidad').innerHTML = html
}
})
} }
}
html += '</tr>'
html += '</tbody>' function peticionWith3Parameters(json) {
html += '</table>'
html += '</p>'
} $.ajax({
else { url: '../ServletHorario?Accion=listarVistaDobleDisponibilidad',
html += '<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>' type: 'POST',
} dataType: 'json',
data: {
json: JSON.stringify(json)
},
success: function (data, textStatus, jqXHR) {
html += `</div>`
}
})
document.querySelector('#divListaDisponibilidad').innerHTML = html
}
})
} let html = ''
let nTurno = []
let nDia = []
let mensaje = 'No registrado'
data.data.forEach(function (docente) {
if (typeof (docente.celular && docente.distrito) == "undefined") {
html += '<table>'
html += '<div class="divider"></div>'
html += '<div class="section">'
function peticionWith3Parameters(json) { html += '<h6 id="nombreDocente">' + docente.nombre + '<span></span><span></span><span style="margin-left:650px;font-size:20px;color:#6C7807"><i class="small material-icons" title="Puesto" style="color:black;">grade</i><strong>No registrado</strong></span></h6>'
html += '<label id="codDocente" style="visibility:hidden;">' + docente.codDocente + '</label>'
$.ajax({ html += '<tr>'
url: '../ServletHorario?Accion=listarVistaDobleDisponibilidad', html += '<p>Celular: No registrado</p>'
type: 'POST', html += '<p>Distrito: No registrado</p>'
dataType: 'json', html += '<p>Direccion: No registrado</p>'
data: { html += '<p>Correo: No registrado</p>'
json: JSON.stringify(json) html += '<p>Zona: No registrado</p>'
}, html += '</tr>'
success: function (data, textStatus, jqXHR) {
html += '<br>'
let html = ''
let nTurno = []
let nDia = []
let mensaje = 'No registrado'
data.data.forEach(function (docente) {
if (typeof (docente.celular && docente.distrito) == "undefined") {
html += '<table>'
html += '<div class="divider"></div>'
html += '<div class="section">'
html += '<h6 id="nombreDocente">' + docente.nombre + '<span></span><span></span><span style="margin-left:650px;font-size:20px;color:#6C7807"><i class="small material-icons" title="Puesto" style="color:black;">grade</i><strong>No registrado</strong></span></h6>'
html += '<label id="codDocente" style="visibility:hidden;">' + docente.codDocente + '</label>'
html += '<tr>' if (docente.disponibilidad) {
html += '<p>Celular: No registrado</p>'
html += '<p>Distrito: No registrado</p>'
html += '<p>Direccion: No registrado</p>'
html += '<p>Correo: No registrado</p>'
html += '<p>Zona: No registrado</p>'
html += '</tr>'
html += '<br>' let disponibilidad = docente.disponibilidad.split('-') || []
let diasM = []
let diasT = []
let aulasM = []
let aulasT = []
if (docente.arrayAulas) {
docente.arrayAulas.forEach(v => {
if (v.turno == '1') {
aulasM.push(v)
} else if (v.turno == '2') {
aulasT.push(v)
}
})
}
let diasin = docente.diasin.split('-') || []
let diasMS = []
let diasTS = []
diasin.forEach(function (b) {
let nTurnoS = b.split('#')[0]
let nDiaS = b.split('#')[1]
if (docente.disponibilidad) { if (nTurnoS == '1') {
diasMS.push(nDiaS)
} else if (nTurno == '2') {
diasTS.push(nDiaS)
}
let disponibilidad = docente.disponibilidad.split('-') || [] })
let diasM = []
let diasT = []
let aulasM = []
let aulasT = []
if (docente.arrayAulas) {
docente.arrayAulas.forEach(v => {
if (v.turno == '1') {
aulasM.push(v)
} else if (v.turno == '2') {
aulasT.push(v)
}
})
}
let diasin = docente.diasin.split('-') || [] let bloqueo = docente.bloqueo.split('-') || []
let diasMS = [] let diasMB = []
let diasTS = [] let diasTB = []
let aulasMB = []
let aulasTB = []
diasin.forEach(function (b) { bloqueo.forEach(function (b) {
let nTurnoS = b.split('#')[0] let nTurno = b.split('#')[0]
let nDiaS = b.split('#')[1] let nDia = b.split('#')[1]
if (nTurnoS == '1') { if (nTurno == '1') {
diasMS.push(nDiaS) diasMB.push(nDia)
} else if (nTurno == '2') { } else if (nTurno == '2') {
diasTS.push(nDiaS) diasTB.push(nDia)
} }
}) })
let bloqueo = docente.bloqueo.split('-') || [] disponibilidad.forEach(function (d) {
let diasMB = [] let turno = d.split('#')[0]
let diasTB = [] let dia = d.split('#')[1]
let aulasMB = []
let aulasTB = []
bloqueo.forEach(function (b) { if (turno == '1') {
let nTurno = b.split('#')[0] diasM.push(dia)
let nDia = b.split('#')[1] } else if (turno == '2') {
diasT.push(dia)
}
})
if (nTurno == '1') { html += '<p class="col s12">'
diasMB.push(nDia) html += '<table class="centered" id="tableDisponibilidad">'
} else if (nTurno == '2') { html += '<thead>'
diasTB.push(nDia) html += '<tr>'
} html += '<td>TURNO</td>'
html += '<td id="dia">LUNES</td>'
html += '<td id="dia">MARTES</td>'
html += '<td id="dia">MIERCOLES</td>'
html += '<td id="dia">JUEVES</td>'
html += '<td id="dia">VIERNES</td>'
html += '<td id="dia">SABADO</td>'
html += '</tr>'
html += '</thead>'
html += '<tbody>'
})
html += '<tr>'
html += '<td id="turno">M</td>'
disponibilidad.forEach(function (d) { for (let i = 0; i < 6; i++) {
let turno = d.split('#')[0] let aulas = aulasM.map(a => {
let dia = d.split('#')[1] if (a.dia == i + 1) {
return a.sede + ' - ' + a.aulas
}
})
if (turno == '1') { if (diasM.some(d => d == (i + 1))) {
diasM.push(dia)
} else if (turno == '2') {
diasT.push(dia)
}
})
html += '<p class="col s12">' html += `<td class="colorVerde" onclick="colorChange(this);">` + aulas.join(' \n ') + `</td>`
html += '<table class="centered" id="tableDisponibilidad">'
html += '<thead>'
html += '<tr>'
html += '<td>TURNO</td>'
html += '<td id="dia">LUNES</td>'
html += '<td id="dia">MARTES</td>'
html += '<td id="dia">MIERCOLES</td>'
html += '<td id="dia">JUEVES</td>'
html += '<td id="dia">VIERNES</td>'
html += '<td id="dia">SABADO</td>'
html += '</tr>'
html += '</thead>'
html += '<tbody>'
} else if (diasMB.some(t => t == (i + 1))) {
html += '<tr>' html += `<td class="colorAzul" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
html += '<td id="turno">M</td>'
for (let i = 0; i < 6; i++) { } else if (diasMS.some(r => r == (i + 1))) {
let aulas = aulasM.map(a => {
if (a.dia == i + 1) {
return a.sede + ' - ' + a.aulas
}
})
if (diasM.some(d => d == (i + 1))) { html += `<td class="colorAzul" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
html += `<td class="colorVerde" onclick="colorChange(this);">` + aulas.join(' \n ') + `</td>` } else {
} else if (diasMB.some(t => t == (i + 1))) { html += `<td class="colorRojo" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
}
}
html += `<td class="colorAzul" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
} else if (diasMS.some(r => r == (i + 1))) { html += '</tr>'
html += `<td class="colorAzul" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>` html += '<tr>'
html += '<td id="turno">T</td>'
} else { for (let i = 0; i < 6; i++) {
let aulas = aulasT.map(a => {
html += `<td class="colorRojo" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>` if (a.dia == i + 1) {
} return a.sede + ' - ' + a.aulas
} }
})
if (diasT.some(d => d == (i + 1))) {
html += `<td class="colorVerde" onclick="colorChange(this);">` + aulas.join(' \n ') + `</td>`
html += '</tr>' } else if (diasTB.some(t => t == (i + 1))) {
html += '<tr>' html += `<td class="colorAzul" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
html += '<td id="turno">T</td>'
for (let i = 0; i < 6; i++) { } else if (diasTS.some(q => q == (i + 1))) {
let aulas = aulasT.map(a => {
if (a.dia == i + 1) { html += `<td class="colorAzul" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
return a.sede + ' - ' + a.aulas
}
})
if (diasT.some(d => d == (i + 1))) {
html += `<td class="colorVerde" onclick="colorChange(this);">` + aulas.join(' \n ') + `</td>` } else {
} else if (diasTB.some(t => t == (i + 1))) {
html += `<td class="colorAzul" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>` html += `<td class="colorRojo" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>`
} else if (diasTS.some(q => q == (i + 1))) { }
}
html += `<td class="colorAzul" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>` html += '</tr>'
html += '</tbody>'
html += '</table>'
html += '</p>'
} else {
} else {
html += '<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
}
html += `</div>`
html += `<td class="colorRojo" onclick="colorChange(this);" id="changed">` + aulas.join(' \n ') + `</td>` } else {
} html += '<div class="divider"></div>'
} html += '<div class="section">'
html += '</tr>' html += '<h6 id="nombreDocente" style="font-weight:bold;">' + docente.nombre + '<span></span><span></span> <span> </span>&nbsp;&nbsp; <a href="javascript:updateObservacion(this.value);" value=' + docente.observacion + '>' + docente.observacion + '</a></span></h6>'
html += '</tbody>' html += '<label id="codDocente" style="visibility:hidden;">' + docente.codDocente + '</label>'
html += '</table>'
html += '</p>'
html += '<div class="form-control">'
html += '<div class="card grey lighten-2">'
html += '<div class="card-content black-text">'
//PRIMERA FILA
html += '<div class="row" style="margin-bottom:0px">'
html += '<div class="input-field col s3"><i class="material-icons dp48">local_phone</i> <strong>' + docente.celular + '</strong></div>'
html += '<div class="input-field col s3"><i class="material-icons dp48">school</i><strong> Puesto Nro: ' + docente.puesto + '</strong></div>'
html += '<div class="input-field col s6"><i class="material-icons dp48">hdr_weak</i> <strong>Exa. Encuesta ' + docente.notaEncuesta + '</strong></div>'
html += '</div>'
} else { //SEGUNDA FILA
html += '<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>' html += '<div class="row" style="margin-bottom:0px">'
} html += '<div class="input-field col s3"><i class="material-icons dp48">room</i> <strong>' + docente.distrito + '</strong></div>'
html += `</div>` html += '<div class="input-field col s3"><i class="material-icons dp48">room</i> <strong>' + docente.zona + '</strong></div>'
html += '<div class="input-field col s6"><i class="material-icons dp48">hdr_strong</i> <strong> Exa. Academico ' + docente.examen + '</strong></div>'
html += '</div>'
//TERCERA FILA
} html += '<div class="row" style="margin-bottom:0px">'
html += '<div class="input-field col s3"><i class="material-icons dp48">email</i> <strong>' + docente.correo + '</strong></div>'
else { html += '<div class="input-field col s6"><i class="material-icons dp48">home</i> <strong>' + docente.direccion + '</strong></div>'
html += '<div class="divider"></div>' html += '</div>'
html += '<div class="section">' html += '</div>'
html += '</div>'
html += '</div>'
html += '<h6 id="nombreDocente" style="font-weight:bold;">' + docente.nombre + '<span></span><span></span> <span> </span>&nbsp;&nbsp; <a href="javascript:updateObservacion(this.value);" value=' + docente.observacion + '>' + docente.observacion + '</a></span></h6>'
html += '<label id="codDocente" style="visibility:hidden;">' + docente.codDocente + '</label>'
html +='<div class="form-control">'
html +='<div class="card grey lighten-2">'
html += '<div class="card-content black-text">'
//PRIMERA FILA
html += '<div class="row" style="margin-bottom:0px">'
html += '<div class="input-field col s3"><i class="material-icons dp48">local_phone</i> <strong>' + docente.celular + '</strong></div>'
html += '<div class="input-field col s3"><i class="material-icons dp48">school</i><strong> Puesto Nro: '+docente.puesto+'</strong></div>'
html += '<div class="input-field col s6"><i class="material-icons dp48">hdr_weak</i> <strong>Exa. Encuesta '+docente.notaEncuesta+'</strong></div>'
html += '</div>'
//SEGUNDA FILA html += '<p></p>'
html += '<div class="row" style="margin-bottom:0px">' html += '<br>'
html += '<div class="input-field col s3"><i class="material-icons dp48">room</i> <strong>' + docente.distrito + '</strong></div>'
html += '<div class="input-field col s3"><i class="material-icons dp48">room</i> <strong>' + docente.zona + '</strong></div>'
html += '<div class="input-field col s6"><i class="material-icons dp48">hdr_strong</i> <strong> Exa. Academico '+docente.examen+'</strong></div>'
html += '</div>'
//TERCERA FILA
html += '<div class="row" style="margin-bottom:0px">'
html += '<div class="input-field col s3"><i class="material-icons dp48">email</i> <strong>' + docente.correo + '</strong></div>'
html += '<div class="input-field col s6"><i class="material-icons dp48">home</i> <strong>' + docente.direccion + '</strong></div>'
html += '</div>'
html += '</div>'
html += '</div>'
html += '</div>'
html += '<p></p>'
html += '<br>'
if (docente.disponibilidad) { if (docente.disponibilidad) {
let disponibilidad = docente.disponibilidad.split('-') || [] let disponibilidad = docente.disponibilidad.split('-') || []
let diasM = [] let diasM = []
let diasT = [] let diasT = []
let aulasM = [] let aulasM = []
let aulasT = [] let aulasT = []
if (docente.arrayAulas) { if (docente.arrayAulas) {
docente.arrayAulas.forEach(v => { docente.arrayAulas.forEach(v => {
if (v.turno == '1') { if (v.turno == '1') {
aulasM.push(v) aulasM.push(v)
} else if (v.turno == '2') { } else if (v.turno == '2') {
aulasT.push(v) aulasT.push(v)
} }
}) })
} }
let diasin = docente.diasin.split('-') || [] let diasin = docente.diasin.split('-') || []
let diasMS = [] let diasMS = []
let diasTS = [] let diasTS = []
diasin.forEach(function (b) { diasin.forEach(function (b) {
let nTurnoS = b.split('#')[0] let nTurnoS = b.split('#')[0]
let nDiaS = b.split('#')[1] let nDiaS = b.split('#')[1]
if (nTurnoS == '1') { if (nTurnoS == '1') {
diasMS.push(nDiaS) diasMS.push(nDiaS)
} else if (nTurno == '2') { } else if (nTurno == '2') {
diasTS.push(nDiaS) diasTS.push(nDiaS)
} }
}) })
let bloqueo = docente.bloqueo.split('-') || [] let bloqueo = docente.bloqueo.split('-') || []
let diasMB = [] let diasMB = []
let diasTB = [] let diasTB = []
let aulasMB = [] let aulasMB = []
let aulasTB = [] let aulasTB = []
bloqueo.forEach(function (b) { bloqueo.forEach(function (b) {
let nTurno = b.split('#')[0] let nTurno = b.split('#')[0]
let nDia = b.split('#')[1] let nDia = b.split('#')[1]
if (nTurno == '1') { if (nTurno == '1') {
diasMB.push(nDia) diasMB.push(nDia)
} else if (nTurno == '2') { } else if (nTurno == '2') {
diasTB.push(nDia) diasTB.push(nDia)
} }
}) })
disponibilidad.forEach(function (d) { disponibilidad.forEach(function (d) {
let turno = d.split('#')[0] let turno = d.split('#')[0]
let dia = d.split('#')[1] let dia = d.split('#')[1]
if (turno == '1') { if (turno == '1') {
diasM.push(dia) diasM.push(dia)
} else if (turno == '2') { } else if (turno == '2') {
diasT.push(dia) diasT.push(dia)
} }
}) })
html += '<p class="col s12">' html += '<p class="col s12">'
html += '<table class="centered">' html += '<table class="centered">'
html += '<thead>' html += '<thead>'
html += '<tr>' html += '<tr>'
html += '<td>TURNO</td>' html += '<td>TURNO</td>'
html += '<td id="dia">LUNES</td>' html += '<td id="dia">LUNES</td>'
html += '<td id="dia">MARTES</td>' html += '<td id="dia">MARTES</td>'
html += '<td id="dia">MIERCOLES</td>' html += '<td id="dia">MIERCOLES</td>'
html += '<td id="dia">JUEVES</td>' html += '<td id="dia">JUEVES</td>'
html += '<td id="dia">VIERNES</td>' html += '<td id="dia">VIERNES</td>'
html += '<td id="dia">SABADO</td>' html += '<td id="dia">SABADO</td>'
html += '</tr>' html += '</tr>'
html += '</thead>' html += '</thead>'
html += '<tbody>' html += '<tbody>'
html += '<tr>' html += '<tr>'
html += '<td id="turno">M</td>' html += '<td id="turno">M</td>'
for (let i = 0; i < 6; i++) { for (let i = 0; i < 6; i++) {
let aulas = aulasM.map(a => { let aulas = aulasM.map(a => {
if (a.dia == i + 1) { if (a.dia == i + 1) {
return a.sede + ' - ' + a.aulas return a.sede + ' - ' + a.aulas
} }
}) })
if (diasM.some(d => d == (i + 1))) { if (diasM.some(d => d == (i + 1))) {
html += `<td class="colorVerde" onclick="colorChange(this);"> ` + aulas.join(' \n ') + `</td> ` html += `<td class="colorVerde" onclick="colorChange(this);"> ` + aulas.join(' \n ') + `</td> `
} else if (diasMB.some(t => t == (i + 1))) { } else if (diasMB.some(t => t == (i + 1))) {
html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> ' html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> '
} else if (diasMS.some(r => r == (i + 1))) { } else if (diasMS.some(r => r == (i + 1))) {
html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> ' html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> '
} else { } else {
html += '<td class="colorRojo" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> ' html += '<td class="colorRojo" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> '
} }
} }
html += '</tr>' html += '</tr>'
html += '<tr>' html += '<tr>'
html += '<td id="turno">T</td>' html += '<td id="turno">T</td>'
for (let i = 0; i < 6; i++) { for (let i = 0; i < 6; i++) {
let aulas = aulasT.map(a => { let aulas = aulasT.map(a => {
if (a.dia == i + 1) { if (a.dia == i + 1) {
return a.sede + ' - ' + a.aulas return a.sede + ' - ' + a.aulas
} }
}) })
if (diasT.some(d => d == (i + 1))) { if (diasT.some(d => d == (i + 1))) {
html += `<td class="colorVerde" onclick="colorChange(this);"> ` + aulas.join(' \n ') + `</td> ` html += `<td class="colorVerde" onclick="colorChange(this);"> ` + aulas.join(' \n ') + `</td> `
} else if (diasTB.some(t => t == (i + 1))) { } else if (diasTB.some(t => t == (i + 1))) {
html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> ' html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> '
} else if (diasTS.some(q => q == (i + 1))) { } else if (diasTS.some(q => q == (i + 1))) {
html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td>' html += '<td class="colorAzul" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td>'
} else { } else {
html += '<td class="colorRojo" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> ' html += '<td class="colorRojo" onclick="colorChange(this);" id="changed"> ' + aulas.join(' \n ') + '</td> '
} }
} }
html += '</tr>' html += '</tr>'
html += '</tbody>' html += '</tbody>'
html += '</table>' html += '</table>'
html += '</p>' html += '</p>'
} else { } else {
html += '<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>' html += '<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
} }
html += ` html += `
</div> </div>
` `
} }
}) })
document.querySelector('#divListaDisponibilidad').innerHTML = html document.querySelector('#divListaDisponibilidad').innerHTML = html
} }
}) })
} }
function btnDesactivarHorario(codDocente) { function btnDesactivarHorario(codDocente) {
let question = confirm("¿Esta seguro de eliminar su horario ?"); let question = confirm("¿Esta seguro de eliminar su horario ?");
if (question) { if (question) {
console.log(codDocente) console.log(codDocente)
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var periodo = "<%=periodo != null ? periodo.getCodigoPeriodo() : ""%>";
desactivarHorario(codDocente, periodo) desactivarHorario(codDocente, periodo)
} else { } else {
console.log("cancel") console.log("cancel")
} }
} }
function desactivarHorario() { function desactivarHorario() {
} }
function colorChange(obj){ function colorChange(obj) {
let periodo = '<%= periodo!=null?periodo.getCodigoPeriodo():""%>' let periodo = '<%= periodo != null ? periodo.getCodigoPeriodo() : ""%>'
let codigoDoc = $(obj).parents('div.section').find('#codDocente').text(); let codigoDoc = $(obj).parents('div.section').find('#codDocente').text();
let nombreDoc = $(obj).parents('div.section').find('#nombreDocente').text(); let nombreDoc = $(obj).parents('div.section').find('#nombreDocente').text();
let turno = $(obj).parents('tr').find('#turno').text(); let turno = $(obj).parents('tr').find('#turno').text();
let numeroTurno = 0; let numeroTurno = 0;
if (turno === "T") { if (turno === "T") {
numeroTurno = 2 numeroTurno = 2
} else if (turno === "M") { } else if (turno === "M") {
numeroTurno = 1 numeroTurno = 1
} }
let dia = $(obj).parent().children().index(obj); let dia = $(obj).parent().children().index(obj);
if ($(obj).hasClass('colorAzul')) { if ($(obj).hasClass('colorAzul')) {
let question = confirm("¿Esta seguro de querer desbloquear el dia " + convertirDia(dia) + " ?"); let question = confirm("¿Esta seguro de querer desbloquear el dia " + convertirDia(dia) + " ?");
if (question) { if (question) {
$.ajax({ $.ajax({
url: '../ServletHorario?Accion=rollbackDisponibilidad', url: '../ServletHorario?Accion=rollbackDisponibilidad',
type: 'POST', type: 'POST',
data: { data: {
codDocente: codigoDoc, codDocente: codigoDoc,
diaBloquear: dia, diaBloquear: dia,
periodo: periodo, periodo: periodo,
turno: numeroTurno turno: numeroTurno
}, },
success: function (data, textStatus, jqXHR) { success: function (data, textStatus, jqXHR) {
if (data.trim() == 2) { if (data.trim() == 2) {
if ($(obj).hasClass('colorAzul')) { if ($(obj).hasClass('colorAzul')) {
$(obj).removeClass('colorAzul'); $(obj).removeClass('colorAzul');
$(obj).addClass('colorRojo'); $(obj).addClass('colorRojo');
mostrarSnackBarDesbloqueo(); mostrarSnackBarDesbloqueo();
} }
} else if (data.trim() == 3) { } else if (data.trim() == 3) {
if ($(obj).hasClass('colorAzul')) { if ($(obj).hasClass('colorAzul')) {
$(obj).removeClass('colorAzul'); $(obj).removeClass('colorAzul');
$(obj).addClass('colorVerde'); $(obj).addClass('colorVerde');
mostrarSnackBarDesbloqueo(); mostrarSnackBarDesbloqueo();
} }
} }
} }
}) })
} }
} else { } else {
let question = confirm("¿Esta seguro de querer bloquear el dia " + convertirDia(dia) + " ?"); let question = confirm("¿Esta seguro de querer bloquear el dia " + convertirDia(dia) + " ?");
if (question) { if (question) {
//aqui realizar peticion AJAX //aqui realizar peticion AJAX
$.ajax({ $.ajax({
url: '../ServletHorario?Accion=updateDisponibilidad', url: '../ServletHorario?Accion=updateDisponibilidad',
type: 'POST', type: 'POST',
data: { data: {
codDocente: codigoDoc, codDocente: codigoDoc,
diaBloquear: dia, diaBloquear: dia,
periodo: periodo, periodo: periodo,
turno: numeroTurno turno: numeroTurno
}, },
success: function (data, textStatus, jqXHR) { success: function (data, textStatus, jqXHR) {
if (data.trim() == 1) { if (data.trim() == 1) {
if ($(obj).hasClass('colorVerde')) { if ($(obj).hasClass('colorVerde')) {
$(obj).removeClass('colorVerde'); $(obj).removeClass('colorVerde');
$(obj).addClass('colorAzul'); $(obj).addClass('colorAzul');
mostrarSnackBar(); mostrarSnackBar();
} else { } else {
$(obj).removeClass('colorRojo'); $(obj).removeClass('colorRojo');
$(obj).addClass('colorAzul'); $(obj).addClass('colorAzul');
mostrarSnackBar(); mostrarSnackBar();
} }
} else { } else {
console.log("error"); console.log("error");
} }
} }
}) })
} else { } else {
window.exit(); window.exit();
} }
} }
// $(obj).parents('tr').find('#changed').removeClass('red'); // $(obj).parents('tr').find('#changed').removeClass('red');
// $(obj).parents('tr').find('#changed').addClass('blue'); // $(obj).parents('tr').find('#changed').addClass('blue');
} }
function convertirDia(dia) { function convertirDia(dia) {
let diaLetras = ""; let diaLetras = "";
switch (dia) { switch (dia) {
case 1: case 1:
diaLetras = "Lunes"; diaLetras = "Lunes";
break; break;
case 2: case 2:
diaLetras = "Martes"; diaLetras = "Martes";
break; break;
case 3: case 3:
diaLetras = "Miercoles"; diaLetras = "Miercoles";
break; break;
case 4: case 4:
diaLetras = "Jueves"; diaLetras = "Jueves";
break; break;
case 5: case 5:
diaLetras = "Viernes"; diaLetras = "Viernes";
break; break;
case 6: case 6:
diaLetras = "Sabado"; diaLetras = "Sabado";
break; break;
default : default :
break; break;
} }
return diaLetras; return diaLetras;
} }
function mostrarSnackBar() { function mostrarSnackBar() {
// Get the snackbar DIV // Get the snackbar DIV
var x = document.getElementById("snackbar"); var x = document.getElementById("snackbar");
// Add the "show" class to DIV // Add the "show" class to DIV
x.className = "show"; x.className = "show";
// After 3 seconds, remove the show class from DIV // After 3 seconds, remove the show class from DIV
setTimeout(function () { setTimeout(function () {
x.className = x.className.replace("show", ""); x.className = x.className.replace("show", "");
}, 3000); }, 3000);
} }
function mostrarSnackBarDesbloqueo() { function mostrarSnackBarDesbloqueo() {
// Get the snackbar DIV // Get the snackbar DIV
var x = document.getElementById("snackbar2"); var x = document.getElementById("snackbar2");
// Add the "show" class to DIV // Add the "show" class to DIV
x.className = "show"; x.className = "show";
// After 3 seconds, remove the show class from DIV // After 3 seconds, remove the show class from DIV
setTimeout(function () { setTimeout(function () {
x.className = x.className.replace("show", ""); x.className = x.className.replace("show", "");
}, 3000); }, 3000);
} }
function listarPlana(select) { function listarPlana(select) {
let codigoArea = select.value let codigoArea = select.value
axios.get('../ServletPlana?Accion=cargarPlanaJson&codigoArea=' + codigoArea) axios.get('../ServletPlana?Accion=cargarPlanaJson&codigoArea=' + codigoArea)
.then(data => { .then(data => {
let option = '<option value="">[SELECCIONE]</option>' let option = '<option value="">[SELECCIONE]</option>'
data.data.forEach(v => { data.data.forEach(v => {
option += '<option value="' + v.cod_pla + '">' + v.nom_pla + '</option>' option += '<option value="' + v.cod_pla + '">' + v.nom_pla + '</option>'
}) })
document.querySelector('#cbPlana').innerHTML = option document.querySelector('#cbPlana').innerHTML = option
instances.init(elems) instances.init(elems)
$("#btnBuscar").attr('enabled', 'enabled'); $("#btnBuscar").attr('enabled', 'enabled');
}) })
} }
function pintarTDRed() { function pintarTDRed() {
//alert("holii"); //alert("holii");
$(".red").text("X"); $(".red").text("X");
} }
function desactivarPrint() { function desactivarPrint() {
$("#btnImprimir").attr('disabled', 'disabled'); $("#btnImprimir").attr('disabled', 'disabled');
} }
function activarPrint() { function activarPrint() {
$("#btnImprimir").attr('disabled', false); $("#btnImprimir").attr('disabled', false);
} }
function updateObservacion(obs) { function updateObservacion(obs) {
let textObs = prompt("Ingresar Observación"); let textObs = prompt("Ingresar Observación");
if (textObs != null) { if (textObs != null) {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '../ServletHorario?accion=updateObservacion', url: '../ServletHorario?accion=updateObservacion',
data: { data: {
observacion: textObs observacion: textObs
}, success: function (data, textStatus, jqXHR) { }, success: function (data, textStatus, jqXHR) {
alert("Actualizado exitosamente !") alert("Actualizado exitosamente !")
} }
}) })
} }
} }
</script> </script>
<script src="js/pages/webSocketHorario.js" type="text/javascript"></script> <script src="js/pages/webSocketHorario.js" type="text/javascript"></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment