Commit 16a6a227 by Roman Luque

[EDIT] Areglo de errores generales en diversos módulos

parent 12cea38a
...@@ -998,17 +998,17 @@ exists or setup the property manually. For example like this: ...@@ -998,17 +998,17 @@ exists or setup the property manually. For example like this:
<target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/> <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
<target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest"> <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
<copyfiles files="${file.reference.activation.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> <copyfiles files="${file.reference.activation.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.mysql-connector-java-3.1.14-bin.jar-1}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.json-20171018.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> <copyfiles files="${file.reference.json-20171018.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.dotenv-0.1.1.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> <copyfiles files="${file.reference.dotenv-0.1.1.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.mysql-connector-java-5.1.23-bin.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<mkdir dir="${build.web.dir}/META-INF"/> <mkdir dir="${build.web.dir}/META-INF"/>
<manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/> <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
</target> </target>
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir"> <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
<copyfiles files="${file.reference.activation.jar}" todir="${build.web.dir}/WEB-INF/lib"/> <copyfiles files="${file.reference.activation.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.mysql-connector-java-3.1.14-bin.jar-1}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.json-20171018.jar}" todir="${build.web.dir}/WEB-INF/lib"/> <copyfiles files="${file.reference.json-20171018.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.dotenv-0.1.1.jar}" todir="${build.web.dir}/WEB-INF/lib"/> <copyfiles files="${file.reference.dotenv-0.1.1.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.mysql-connector-java-5.1.23-bin.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
</target> </target>
<target depends="init" if="dist.ear.dir" name="-clean-webinf-lib"> <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
<delete dir="${build.web.dir}/WEB-INF/lib"/> <delete dir="${build.web.dir}/WEB-INF/lib"/>
......
build.xml.data.CRC32=22d59e15 build.xml.data.CRC32=0cf8cf75
build.xml.script.CRC32=5a966c0c build.xml.script.CRC32=5a966c0c
build.xml.stylesheet.CRC32=651128d4@1.77.1.1 build.xml.stylesheet.CRC32=651128d4@1.77.1.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=22d59e15 nbproject/build-impl.xml.data.CRC32=0cf8cf75
nbproject/build-impl.xml.script.CRC32=a9c734cb nbproject/build-impl.xml.script.CRC32=050b490e
nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1
...@@ -31,7 +31,7 @@ excludes= ...@@ -31,7 +31,7 @@ excludes=
file.reference.activation.jar=D:\\LIBRERIAS\\activation.jar file.reference.activation.jar=D:\\LIBRERIAS\\activation.jar
file.reference.dotenv-0.1.1.jar=C:\\Users\\sistem17user\\Desktop\\Juan Carlos Yupanqui Lozano\\Libreria\\LIBRERIAS 2\\DotEnv\\dotenv-0.1.1.jar file.reference.dotenv-0.1.1.jar=C:\\Users\\sistem17user\\Desktop\\Juan Carlos Yupanqui Lozano\\Libreria\\LIBRERIAS 2\\DotEnv\\dotenv-0.1.1.jar
file.reference.json-20171018.jar=D:\\LIBRERIAS\\json-20171018.jar file.reference.json-20171018.jar=D:\\LIBRERIAS\\json-20171018.jar
file.reference.mysql-connector-java-3.1.14-bin.jar-1=D:\\LIBRERIAS\\mysql-connector-java-3.1.14-bin.jar file.reference.mysql-connector-java-5.1.23-bin.jar=C:\\Users\\sistem17user\\Desktop\\Juan Carlos Yupanqui Lozano\\Libreria\\LIBRERIAS 2\\mysql-connector-java-5.1.23-bin.jar
includes=** includes=**
j2ee.compile.on.save=true j2ee.compile.on.save=true
j2ee.copy.static.files.on.save=true j2ee.copy.static.files.on.save=true
...@@ -47,9 +47,9 @@ j2ee.server.type=gfv3ee6 ...@@ -47,9 +47,9 @@ j2ee.server.type=gfv3ee6
jar.compress=false jar.compress=false
javac.classpath=\ javac.classpath=\
${file.reference.activation.jar}:\ ${file.reference.activation.jar}:\
${file.reference.mysql-connector-java-3.1.14-bin.jar-1}:\
${file.reference.json-20171018.jar}:\ ${file.reference.json-20171018.jar}:\
${file.reference.dotenv-0.1.1.jar} ${file.reference.dotenv-0.1.1.jar}:\
${file.reference.mysql-connector-java-5.1.23-bin.jar}
# Space-separated list of extra javac options # Space-separated list of extra javac options
javac.compilerargs= javac.compilerargs=
javac.debug=true javac.debug=true
......
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
<path-in-war>WEB-INF/lib</path-in-war> <path-in-war>WEB-INF/lib</path-in-war>
</library> </library>
<library dirs="200"> <library dirs="200">
<file>${file.reference.mysql-connector-java-3.1.14-bin.jar-1}</file> <file>${file.reference.json-20171018.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war> <path-in-war>WEB-INF/lib</path-in-war>
</library> </library>
<library dirs="200"> <library dirs="200">
<file>${file.reference.json-20171018.jar}</file> <file>${file.reference.dotenv-0.1.1.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war> <path-in-war>WEB-INF/lib</path-in-war>
</library> </library>
<library dirs="200"> <library dirs="200">
<file>${file.reference.dotenv-0.1.1.jar}</file> <file>${file.reference.mysql-connector-java-5.1.23-bin.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war> <path-in-war>WEB-INF/lib</path-in-war>
</library> </library>
</web-module-libraries> </web-module-libraries>
......
...@@ -1914,6 +1914,7 @@ public class MySqlAulaDAO implements AulaDAO { ...@@ -1914,6 +1914,7 @@ public class MySqlAulaDAO implements AulaDAO {
+ " ORDER BY h.cod_gru_aul,s.des_loc,tg.destipogrado,g.desgrado,t.desturno,h.codGru,\n" + " ORDER BY h.cod_gru_aul,s.des_loc,tg.destipogrado,g.desgrado,t.desturno,h.codGru,\n"
+ "tc.destipocentro,h.codGru,c.descentro,n.desnivel,h.codAula,sc.desseccion "; + "tc.destipocentro,h.codGru,c.descentro,n.desnivel,h.codAula,sc.desseccion ";
System.out.println("QUERYYY ---> " + query);
ResultSet rs = st.executeQuery(query); ResultSet rs = st.executeQuery(query);
while (rs.next()) { while (rs.next()) {
Aula aula = new Aula(); Aula aula = new Aula();
......
...@@ -68,7 +68,7 @@ public class MySqlDAOFactory extends DAOFactory { ...@@ -68,7 +68,7 @@ public class MySqlDAOFactory extends DAOFactory {
System.out.println("ERROR AL OBTENER EL ARCHIVO DOTENV --->> " + e.getMessage()); System.out.println("ERROR AL OBTENER EL ARCHIVO DOTENV --->> " + e.getMessage());
} }
System.out.println("PAATH =>> " + path); // System.out.println("PAATH =>> " + path);
String host = dotenv.get("MYSQL_HOST_SERVIDOR_HORARIO"); String host = dotenv.get("MYSQL_HOST_SERVIDOR_HORARIO");
String port = dotenv.get("MYSQL_PORT_SERVIDOR_HORARIO"); String port = dotenv.get("MYSQL_PORT_SERVIDOR_HORARIO");
......
...@@ -1801,7 +1801,7 @@ public class MySqlHorarioDAO implements HorarioDAO { ...@@ -1801,7 +1801,7 @@ public class MySqlHorarioDAO implements HorarioDAO {
// + " INNER JOIN turno on turno.codturno=aula.codturno " // + " INNER JOIN turno on turno.codturno=aula.codturno "
// + " WHERE horario_curso_docente.cod_doc='" + codDocente + "' and horario_curso_docente.cod_per='" + periodo + "' and horario_curso_docente.est_hcd='1' " // + " WHERE horario_curso_docente.cod_doc='" + codDocente + "' and horario_curso_docente.cod_per='" + periodo + "' and horario_curso_docente.est_hcd='1' "
// + " ORDER BY horario_curso_docente.dia, horario_curso_docente.hor_ini"; // + " ORDER BY horario_curso_docente.dia, horario_curso_docente.hor_ini";
String query = "SELECT\n" String query = "SELECT DISTINCT\n"
+ "tb_curso.cod_pla,\n" + "tb_curso.cod_pla,\n"
+ "tb_detalle.cod_tur,\n" + "tb_detalle.cod_tur,\n"
+ "tb_detalle.codAula,\n" + "tb_detalle.codAula,\n"
...@@ -2980,7 +2980,7 @@ public class MySqlHorarioDAO implements HorarioDAO { ...@@ -2980,7 +2980,7 @@ public class MySqlHorarioDAO implements HorarioDAO {
pst.setString(1, json.getString("codigoPeriodo")); pst.setString(1, json.getString("codigoPeriodo"));
pst.setInt(2, docente.getInt("codDocente")); pst.setInt(2, docente.getInt("codDocente"));
// pst.setString(3, String.join(",", arrayDias)); // pst.setString(3, String.join(",", arrayDias));
System.out.println(pst);
rs = pst.executeQuery(); rs = pst.executeQuery();
JSONArray arrayAulas = new JSONArray(); JSONArray arrayAulas = new JSONArray();
...@@ -3042,40 +3042,28 @@ public class MySqlHorarioDAO implements HorarioDAO { ...@@ -3042,40 +3042,28 @@ public class MySqlHorarioDAO implements HorarioDAO {
try { try {
cn = MySqlDAOFactory.obtenerConexion("horario"); cn = MySqlDAOFactory.obtenerConexion("horario");
String sql = "" String sql = ""
+ "select " + " SELECT pr.codprofesor,\n"
+ "pr.codprofesor, " + " CONCAT(pr.apellido,', ',pr.nombre) nombreDoc,\n"
+ "CONCAT(pr.apellido,', ',pr.nombre) nombreDoc, " + " COALESCE(dat.cel_dat_per, 'No registrado') AS cel_dat_per,\n"
+ "dat.cel_dat_per, " + " COALESCE(dat.nom_dir, 'No registrado') AS nom_dir,\n"
+ "dat.nom_dir, " + " COALESCE(dat.cor_dat_per, 'No registrado') AS cor_dat_per,\n"
+ "dat.cor_dat_per, " + " COALESCE(u.nom_dis_ubi, 'No registrado') AS nom_dis_ubi,\n"
+ "u.nom_dis_ubi, " + " dd.diaDis\n"
+ "dd.diaDis " + " from sacoolive3.profesor pr\n"
+ "from sacoolive3.profesor pr " + " INNER join (select codDoc,diaDis from disponibilidad_docente where estDis = 1 and cod_per = ? ) dd on dd.codDoc = pr.codprofesor\n"
+ "left join ( " + " left join datos_docente dat on dat.cod_doc = pr.codprofesor\n"
+ " select codDoc,diaDis from disponibilidad_docente " + " left join ubigeo u on u.cod_dep_ubi = dat.cod_dep and u.cod_pro_ubi = dat.cod_prov and u.cod_dis_ubi = dat.cod_dis\n"
+ " where estDis = 1 " + " where pr.estadoprofe = 'Y'\n"
+ " and cod_per = ? " + " and pr.codprofesor = ?\n"
+ ") dd on dd.codDoc = pr.codprofesor " + " group by pr.codprofesor, CONCAT(pr.apellido,', ',pr.nombre), dd.diaDis, dat.cel_dat_per, dat.nom_dir, dat.cor_dat_per, u.nom_dis_ubi\n"
+ "left join datos_docente dat on dat.cod_doc = pr.codprofesor " + " order by nombreDoc ASC;";
+ "left join ubigeo u on u.cod_dep_ubi = dat.cod_dep and u.cod_pro_ubi = dat.cod_prov and u.cod_dis_ubi = dat.cod_dis "
+ "where pr.estadoprofe = 'Y' "
+ "and pr.codprofesor = ? "
+ "group by "
+ "pr.codprofesor, "
+ "CONCAT(pr.apellido,', ',pr.nombre), "
+ "dd.diaDis, "
+ "dat.cel_dat_per, "
+ "dat.nom_dir, "
+ "dat.cor_dat_per, "
+ "u.nom_dis_ubi "
+ "order by nombreDoc ASC ";
pst = cn.prepareStatement(sql); pst = cn.prepareStatement(sql);
System.out.println("" + sql);
pst.setString(1, json.getString("codigoPeriodo")); pst.setString(1, json.getString("codigoPeriodo"));
pst.setString(2, json.getString("codigoProfesor")); pst.setString(2, json.getString("codigoProfesor"));
System.out.println("QUERY DATOS DEL DOCENTE ---->> \n" + pst);
rs = pst.executeQuery(); rs = pst.executeQuery();
JSONArray arrayDocente = new JSONArray(); JSONArray arrayDocente = new JSONArray();
...@@ -3162,7 +3150,7 @@ public class MySqlHorarioDAO implements HorarioDAO { ...@@ -3162,7 +3150,7 @@ public class MySqlHorarioDAO implements HorarioDAO {
Logger.getLogger(MySqlHorarioDAO.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(MySqlHorarioDAO.class.getName()).log(Level.SEVERE, null, ex);
} }
} }
System.out.println("RESPUESTAAA -->> \n" + jReturn);
return jReturn; return jReturn;
} }
...@@ -3319,9 +3307,9 @@ public class MySqlHorarioDAO implements HorarioDAO { ...@@ -3319,9 +3307,9 @@ public class MySqlHorarioDAO implements HorarioDAO {
+ "INNER JOIN sacoolive3.profesor p ON hc.cod_doc=p.codprofesor " + "INNER JOIN sacoolive3.profesor p ON hc.cod_doc=p.codprofesor "
+ "INNER JOIN periodo_academico pa ON hc.cod_per=pa.cod_per " + "INNER JOIN periodo_academico pa ON hc.cod_per=pa.cod_per "
+ "WHERE p.codprofesor=? and hc.est_hcd=1 " + "WHERE p.codprofesor=? and hc.est_hcd=1 "
+ "AND pa.nom_per != 'REGULAR 2020 I' OR hc.cod_per != 24 " // + "AND pa.nom_per != 'REGULAR 2020 I' OR hc.cod_per != 24 "
+ "GROUP BY hc.cod_per,pa.nom_per ORDER BY hc.cod_per DESC "; + "GROUP BY hc.cod_per,pa.nom_per ORDER BY hc.cod_per DESC ";
System.out.println("QUERY DE LISTA DE PERIODOOO -->> \n" + sql);
pst = cn.prepareStatement(sql); pst = cn.prepareStatement(sql);
pst.setString(1, codigoDocente); pst.setString(1, codigoDocente);
rs = pst.executeQuery(); rs = pst.executeQuery();
......
...@@ -22,11 +22,13 @@ class MySqlPeriodoAcademicoDAO implements PeriodoAcademicoDAO { ...@@ -22,11 +22,13 @@ class MySqlPeriodoAcademicoDAO implements PeriodoAcademicoDAO {
public ArrayList<PeriodoAcademico> listarPeriodoAcademico() throws Exception { public ArrayList<PeriodoAcademico> listarPeriodoAcademico() throws Exception {
ArrayList<PeriodoAcademico> lista = new ArrayList<PeriodoAcademico>(); ArrayList<PeriodoAcademico> lista = new ArrayList<PeriodoAcademico>();
String base = "horario"; String base = "horario";
System.out.println("ANTES DE CONECTAR...");
try (Connection cnx = MySqlDAOFactory.obtenerConexion(base);) { try (Connection cnx = MySqlDAOFactory.obtenerConexion(base);) {
System.out.println("CONECTADO...");
Statement st = cnx.createStatement(); Statement st = cnx.createStatement();
String query = "SELECT cod_per,nom_per,fec_ini_per,fec_fin_per,est_per FROM periodo_academico Order by cod_per desc"; String query = "SELECT cod_per,nom_per,fec_ini_per,fec_fin_per,est_per FROM periodo_academico Order by cod_per desc";
System.out.println("ANTES DE EJECTUAR EL QUERY...");
ResultSet rs = st.executeQuery(query); ResultSet rs = st.executeQuery(query);
while (rs.next()) { while (rs.next()) {
......
...@@ -21,280 +21,282 @@ import pe.siso.horario.Services.PeriodoAcademicoServices; ...@@ -21,280 +21,282 @@ import pe.siso.horario.Services.PeriodoAcademicoServices;
*/ */
public class ServletPeriodoAcademico extends HttpServlet { public class ServletPeriodoAcademico extends HttpServlet {
@Override @Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String param = request.getParameter("Accion"); String param = request.getParameter("Accion");
if ("listadoPeriodoAcademico".equals(param)) { if ("listadoPeriodoAcademico".equals(param)) {
listadoPeriodoAcademico(request, response); listadoPeriodoAcademico(request, response);
} else if ("registarPeriodoAcademico".equals(param)) { } else if ("registarPeriodoAcademico".equals(param)) {
registarPeriodoAcademico(request, response); registarPeriodoAcademico(request, response);
} else if ("cambiarEstado".equals(param)) { } else if ("cambiarEstado".equals(param)) {
cambiarEstado(request, response); cambiarEstado(request, response);
} else if ("armarEdicion".equals(param)) { } else if ("armarEdicion".equals(param)) {
armarEdicion(request, response); armarEdicion(request, response);
} else if ("actualizarPeriodoAcademico".equals(param)) { } else if ("actualizarPeriodoAcademico".equals(param)) {
actualizarPeriodoAcademico(request, response); actualizarPeriodoAcademico(request, response);
} else if ("listarAnio".equals(param)) { } else if ("listarAnio".equals(param)) {
listarAnio(request, response); listarAnio(request, response);
} else if ("listarPeriodoAcademico".equals(param)) { } else if ("listarPeriodoAcademico".equals(param)) {
listarPeriodoAcademico(request, response); listarPeriodoAcademico(request, response);
} }
} }
private void listadoPeriodoAcademico(HttpServletRequest request, HttpServletResponse response) throws IOException { private void listadoPeriodoAcademico(HttpServletRequest request, HttpServletResponse response) throws IOException {
PeriodoAcademicoServices servicios = new PeriodoAcademicoServices(); PeriodoAcademicoServices servicios = new PeriodoAcademicoServices();
ArrayList<PeriodoAcademico> lista = new ArrayList<PeriodoAcademico>(); ArrayList<PeriodoAcademico> lista = new ArrayList<PeriodoAcademico>();
lista = servicios.listarPeriodoAcademico(); lista = servicios.listarPeriodoAcademico();
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
pw.println("<div style=\"border: 1px solid #CCCCCC;\">\n" pw.println("<div style=\"border: 1px solid #CCCCCC;\">\n"
+ " <div class=\"table-header\">\n" + " <div class=\"table-header\">\n"
+ " Listado de Periodo Académico\n" + " Listado de Periodo Académico\n"
+ " </div>\n" + " </div>\n"
+ " <div>\n" + " <div>\n"
+ " <div class=\"dataTables_wrapper form-inline no-footer\" id=\"sample-table-2_wrapper\">\n" + " <div class=\"dataTables_wrapper form-inline no-footer\" id=\"sample-table-2_wrapper\">\n"
+ " <table class=\"table table-striped table-bordered table-hover dataTable no-footer\" id=\"sample-table-2\" role=\"grid\" aria-describedby=\"sample-table-2_info\" >\n" + " <table class=\"table table-striped table-bordered table-hover dataTable no-footer\" id=\"sample-table-2\" role=\"grid\" aria-describedby=\"sample-table-2_info\" >\n"
+ " <thead>\n" + " <thead>\n"
+ " <tr role=\"row\">\n" + " <tr role=\"row\">\n"
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\" >N°</th>\n" + " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\" >N°</th>\n"
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">PERIODO ACADÉMICO</th>\n" + " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">PERIODO ACADÉMICO</th>\n"
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">FECHA INICIO</th>\n" + " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">FECHA INICIO</th>\n"
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">FECHA TERMINO</th>\n" + " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">FECHA TERMINO</th>\n"
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">EDICIÓN</th>\n" + " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">EDICIÓN</th>\n"
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">ESTADO</th>\n" + " <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">ESTADO</th>\n"
+ " </tr>\n" + " </tr>\n"
+ " </thead>\n" + " </thead>\n"
+ " <tbody>"); + " <tbody>");
int cont = 1; int cont = 1;
for (int i = 0; i < lista.size(); i++) { for (int i = 0; i < lista.size(); i++) {
String estado = ""; String estado = "";
if (lista.get(i).getEstadoPeriodo() == 1) { if (lista.get(i).getEstadoPeriodo() == 1) {
estado = "<a href=\"javascript:validar_estado(0," + lista.get(i).getCodigoPeriodo() + ");\" class=\"regular\" >\n" estado = "<a href=\"javascript:validar_estado(0," + lista.get(i).getCodigoPeriodo() + ");\" class=\"regular\" >\n"
+ "<img src=\"imagenes/icons/lightbulb.png\" />\n" + "<img src=\"imagenes/icons/lightbulb.png\" />\n"
+ "</a>"; + "</a>";
} else { } else {
estado = "<a href=\"javascript:validar_estado(1," + lista.get(i).getCodigoPeriodo() + ");\" class=\"regular\" >\n" estado = "<a href=\"javascript:validar_estado(1," + lista.get(i).getCodigoPeriodo() + ");\" class=\"regular\" >\n"
+ "<img src=\"imagenes/icons/lightbulb_off.png\" />\n" + "<img src=\"imagenes/icons/lightbulb_off.png\" />\n"
+ "</a>"; + "</a>";
} }
String iniAc = lista.get(i).getFechaInicioPeriodo(); String iniAc = lista.get(i).getFechaInicioPeriodo();
String finAc = lista.get(i).getFechaFinalPeriodo(); String finAc = lista.get(i).getFechaFinalPeriodo();
String[] iniA = iniAc.split("-"); String[] iniA = iniAc.split("-");
String[] finA = finAc.split("-"); String[] finA = finAc.split("-");
String iniDia = iniA[2]; String iniDia = iniA[2];
String iniMes = iniA[1]; String iniMes = iniA[1];
String iniAnio = iniA[0]; String iniAnio = iniA[0];
String finDia = finA[2]; String finDia = finA[2];
String finMes = finA[1]; String finMes = finA[1];
String finAnio = finA[0]; String finAnio = finA[0];
String ini = iniDia + "/" + iniMes + "/" + iniAnio; String ini = iniDia + "/" + iniMes + "/" + iniAnio;
String fin = finDia + "/" + finMes + "/" + finAnio; String fin = finDia + "/" + finMes + "/" + finAnio;
pw.println(" <td align='center' width='20'>" + cont + "</td>" pw.println(" <td align='center' width='20'>" + cont + "</td>"
+ " <td>" + lista.get(i).getNombrePeriodo() + "</td>" + " <td>" + lista.get(i).getNombrePeriodo() + "</td>"
+ " <td align='center' >" + ini + "</td>" + " <td align='center' >" + ini + "</td>"
+ " <td align='center' >" + fin + "</td>" + " <td align='center' >" + fin + "</td>"
+ " <td align='center' width='50'><a href=\"javascript:armarEdicion(" + lista.get(i).getCodigoPeriodo() + ");\" class=\"regular\" >\n" + " <td align='center' width='50'><a href=\"javascript:armarEdicion(" + lista.get(i).getCodigoPeriodo() + ");\" class=\"regular\" >\n"
+ " <img src=\"imagenes/icons/page_edit.png\" />\n" + " <img src=\"imagenes/icons/page_edit.png\" />\n"
+ " </a>" + " </a>"
+ " </td>" + " </td>"
+ " <td align='center' valign='middle' width='50'>" + estado + "</td>" + " <td align='center' valign='middle' width='50'>" + estado + "</td>"
+ " </tr>"); + " </tr>");
cont++; cont++;
} }
if (cont == 1) { if (cont == 1) {
pw.println("<tr><td colspan='6' align='center'>No hay registro</td></tr>"); pw.println("<tr><td colspan='6' align='center'>No hay registro</td></tr>");
} }
pw.println(" </tbody>\n" pw.println(" </tbody>\n"
+ " </table>\n" + " </table>\n"
+ " </div>" + " </div>"
+ " </div>" + " </div>"
+ "</div>" + "</div>"
+ "<input type='hidden' id='cant_est' value='" + lista.size() + "'>"); + "<input type='hidden' id='cant_est' value='" + lista.size() + "'>");
} }
private void registarPeriodoAcademico(HttpServletRequest request, HttpServletResponse response) throws IOException { private void registarPeriodoAcademico(HttpServletRequest request, HttpServletResponse response) throws IOException {
String nombre = request.getParameter("nombre"); String nombre = request.getParameter("nombre");
String iniAc = request.getParameter("ini"); String iniAc = request.getParameter("ini");
String finAc = request.getParameter("fin"); String finAc = request.getParameter("fin");
String[] iniA = iniAc.split("/"); String[] iniA = iniAc.split("/");
String[] finA = finAc.split("/"); String[] finA = finAc.split("/");
String iniDia = iniA[0]; String iniDia = iniA[0];
String iniMes = iniA[1]; String iniMes = iniA[1];
String iniAnio = iniA[2]; String iniAnio = iniA[2];
String finDia = finA[0]; String finDia = finA[0];
String finMes = finA[1]; String finMes = finA[1];
String finAnio = finA[2]; String finAnio = finA[2];
String ini = iniAnio + "-" + iniMes + "-" + iniDia; String ini = iniAnio + "-" + iniMes + "-" + iniDia;
String fin = finAnio + "-" + finMes + "-" + finDia; String fin = finAnio + "-" + finMes + "-" + finDia;
PeriodoAcademicoServices servicios = new PeriodoAcademicoServices(); PeriodoAcademicoServices servicios = new PeriodoAcademicoServices();
int dato = servicios.registrarPeriodoAcademico(nombre, ini, fin); int dato = servicios.registrarPeriodoAcademico(nombre, ini, fin);
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
pw.println(dato); pw.println(dato);
} }
private void cambiarEstado(HttpServletRequest request, HttpServletResponse response) throws IOException { private void cambiarEstado(HttpServletRequest request, HttpServletResponse response) throws IOException {
PeriodoAcademicoServices servicios = new PeriodoAcademicoServices(); PeriodoAcademicoServices servicios = new PeriodoAcademicoServices();
String salida = ""; String salida = "";
String dato = request.getParameter("dato"); String dato = request.getParameter("dato");
String codigo = request.getParameter("codigo"); String codigo = request.getParameter("codigo");
if (dato.equals("1")) { if (dato.equals("1")) {
servicios.cambiarEstado(dato, codigo); servicios.cambiarEstado(dato, codigo);
salida = "1"; salida = "1";
} else { } else {
salida = "0"; salida = "0";
} }
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
pw.println(salida); pw.println(salida);
} }
private void armarEdicion(HttpServletRequest request, HttpServletResponse response) throws IOException { private void armarEdicion(HttpServletRequest request, HttpServletResponse response) throws IOException {
PeriodoAcademicoServices servicios = new PeriodoAcademicoServices(); PeriodoAcademicoServices servicios = new PeriodoAcademicoServices();
String codigo = request.getParameter("codigo"); String codigo = request.getParameter("codigo");
PeriodoAcademico periodo = new PeriodoAcademico(); PeriodoAcademico periodo = new PeriodoAcademico();
periodo = servicios.armarEdicion(codigo); periodo = servicios.armarEdicion(codigo);
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
String iniAc = periodo.getFechaInicioPeriodo(); String iniAc = periodo.getFechaInicioPeriodo();
String finAc = periodo.getFechaFinalPeriodo(); String finAc = periodo.getFechaFinalPeriodo();
String[] iniA = iniAc.split("-"); String[] iniA = iniAc.split("-");
String[] finA = finAc.split("-"); String[] finA = finAc.split("-");
String iniDia = iniA[2]; String iniDia = iniA[2];
String iniMes = iniA[1]; String iniMes = iniA[1];
String iniAnio = iniA[0]; String iniAnio = iniA[0];
String finDia = finA[2]; String finDia = finA[2];
String finMes = finA[1]; String finMes = finA[1];
String finAnio = finA[0]; String finAnio = finA[0];
String ini = iniDia + "/" + iniMes + "/" + iniAnio; String ini = iniDia + "/" + iniMes + "/" + iniAnio;
String fin = finDia + "/" + finMes + "/" + finAnio; String fin = finDia + "/" + finMes + "/" + finAnio;
pw.println("<center>" pw.println("<center>"
+ " <table>" + " <table>"
+ " <tr>" + " <tr>"
+ " <td height='20' colspan='3'></td>" + " <td height='20' colspan='3'></td>"
+ " </tr>" + " </tr>"
+ " <tr>" + " <tr>"
+ " <td>Periodo Académico: <span style='color:red;'>*</span></td>" + " <td>Periodo Académico: <span style='color:red;'>*</span></td>"
+ " <td width='10'></td>" + " <td width='10'></td>"
+ " <td><input class='form-control validate[required]' type='text' id='txt_new_nom' value='" + periodo.getNombrePeriodo() + "'></td>" + " <td><input class='form-control validate[required]' type='text' id='txt_new_nom' value='" + periodo.getNombrePeriodo() + "'></td>"
+ " </tr>" + " </tr>"
+ " <tr>" + " <tr>"
+ " <td height='15' colspan='3'></td>" + " <td height='15' colspan='3'></td>"
+ " </tr>" + " </tr>"
+ " <tr>" + " <tr>"
+ " <td>Fecha inicio: <span style='color:red;'>*</span></td>" + " <td>Fecha inicio: <span style='color:red;'>*</span></td>"
+ " <td width='10'></td>" + " <td width='10'></td>"
+ " <td>" + " <td>"
+ " <div class=' input-group'>" + " <div class=' input-group'>"
+ " <input class=' form-control validate[required] input-mask-date' id='txt_new_ini' style='text-align: center;' onblur='validaFecha(this.value);' type='text' placeholder=' dd/mm/yyyy' value='" + ini + "'><!-- input-sm -->" + " <input class=' form-control validate[required] input-mask-date' id='txt_new_ini' style='text-align: center;' onblur='validaFecha(this.value);' type='text' placeholder=' dd/mm/yyyy' value='" + ini + "'><!-- input-sm -->"
+ " <span class='input-group-addon'><i class='fa fa-calendar'></i></span>" + " <span class='input-group-addon'><i class='fa fa-calendar'></i></span>"
+ " </div>" + " </div>"
+ " </td>" + " </td>"
+ " </tr>" + " </tr>"
+ " <tr>" + " <tr>"
+ " <td height='15' colspan='3'></td>" + " <td height='15' colspan='3'></td>"
+ " </tr>" + " </tr>"
+ " <tr>" + " <tr>"
+ " <td>Fecha termino: <span style='color:red;'>*</span></td>" + " <td>Fecha termino: <span style='color:red;'>*</span></td>"
+ " <td width='10'></td>" + " <td width='10'></td>"
+ " <td>" + " <td>"
+ " <div class=' input-group'>" + " <div class=' input-group'>"
+ " <input class=' form-control validate[required] input-mask-date' id='txt_new_fin' style='text-align: center;' onblur='validaFecha(this.value);' type='text' placeholder=' dd/mm/yyyy' value='" + fin + "'><!-- input-sm -->" + " <input class=' form-control validate[required] input-mask-date' id='txt_new_fin' style='text-align: center;' onblur='validaFecha(this.value);' type='text' placeholder=' dd/mm/yyyy' value='" + fin + "'><!-- input-sm -->"
+ " <span class='input-group-addon'><i class='fa fa-calendar'></i></span>" + " <span class='input-group-addon'><i class='fa fa-calendar'></i></span>"
+ " </div>" + " </div>"
+ " </td>" + " </td>"
+ " </tr>" + " </tr>"
+ " </table>" + " </table>"
+ "</center>"); + "</center>");
} }
private void actualizarPeriodoAcademico(HttpServletRequest request, HttpServletResponse response) throws IOException { private void actualizarPeriodoAcademico(HttpServletRequest request, HttpServletResponse response) throws IOException {
PeriodoAcademicoServices servicios = new PeriodoAcademicoServices(); PeriodoAcademicoServices servicios = new PeriodoAcademicoServices();
String codigo = request.getParameter("codigo"); String codigo = request.getParameter("codigo");
String nombre = request.getParameter("nombre"); String nombre = request.getParameter("nombre");
String iniAc = request.getParameter("ini"); String iniAc = request.getParameter("ini");
String finAc = request.getParameter("fin"); String finAc = request.getParameter("fin");
String[] iniA = iniAc.split("/"); String[] iniA = iniAc.split("/");
String[] finA = finAc.split("/"); String[] finA = finAc.split("/");
String iniDia = iniA[0]; String iniDia = iniA[0];
String iniMes = iniA[1]; String iniMes = iniA[1];
String iniAnio = iniA[2]; String iniAnio = iniA[2];
String finDia = finA[0]; String finDia = finA[0];
String finMes = finA[1]; String finMes = finA[1];
String finAnio = finA[2]; String finAnio = finA[2];
String ini = iniAnio + "-" + iniMes + "-" + iniDia; String ini = iniAnio + "-" + iniMes + "-" + iniDia;
String fin = finAnio + "-" + finMes + "-" + finDia; String fin = finAnio + "-" + finMes + "-" + finDia;
int dato = servicios.actualizarPeriodoAcademico(nombre, ini, fin, codigo); int dato = servicios.actualizarPeriodoAcademico(nombre, ini, fin, codigo);
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
pw.println(dato); pw.println(dato);
} }
private void listarAnio(HttpServletRequest request, HttpServletResponse response) throws IOException { private void listarAnio(HttpServletRequest request, HttpServletResponse response) throws IOException {
PeriodoAcademicoServices servicios = new PeriodoAcademicoServices(); PeriodoAcademicoServices servicios = new PeriodoAcademicoServices();
ArrayList<PeriodoAcademico> lista = new ArrayList<PeriodoAcademico>(); ArrayList<PeriodoAcademico> lista = new ArrayList<PeriodoAcademico>();
String accion = request.getParameter("accion"); String accion = request.getParameter("accion");
String nombre = request.getParameter("nombre"); String nombre = request.getParameter("nombre");
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
lista = servicios.listarAnio(); lista = servicios.listarAnio();
pw.println("<select id='" + nombre + "' class='form-control validate[required]' onChange='" + accion + "'>"); pw.println("<select id='" + nombre + "' class='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 selected value='" + lista.get(i).getCodigoPeriodo() + "'>" + lista.get(i).getAnio() + " (Activo)</option>"); pw.println("<option selected value='" + lista.get(i).getCodigoPeriodo() + "'>" + lista.get(i).getAnio() + " (Activo)</option>");
} }
pw.println("</select>"); pw.println("</select>");
} }
private void listarPeriodoAcademico(HttpServletRequest request, HttpServletResponse response) throws IOException { private void listarPeriodoAcademico(HttpServletRequest request, HttpServletResponse response) throws IOException {
PeriodoAcademicoServices servicios = new PeriodoAcademicoServices(); System.out.println("LLEGA AL BACKEND...");
ArrayList<PeriodoAcademico> lista = new ArrayList<PeriodoAcademico>(); PeriodoAcademicoServices servicios = new PeriodoAcademicoServices();
ArrayList<PeriodoAcademico> lista = new ArrayList<PeriodoAcademico>();
lista = servicios.listarPeriodoAcademico();
String id = request.getParameter("nombre"); lista = servicios.listarPeriodoAcademico();
String accion = request.getParameter("accion"); String id = request.getParameter("nombre");
String accion = request.getParameter("accion");
response.setContentType("text/html");
PrintWriter pw = response.getWriter(); response.setContentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("<select class='form-control validate[required]' id='" + id + "' onchange='"+accion+"'>");
pw.println("<option value=\"\">[SELECCIONE PERIODO]</option>"); pw.println("<select class='form-control validate[required]' id='" + id + "' onchange='" + accion + "'>");
for (int i = 0; i < lista.size(); i++) { pw.println("<option value=\"\">[SELECCIONE PERIODO]</option>");
if(lista.get(i).getEstadoPeriodo() == 1){ for (int i = 0; i < lista.size(); i++) {
pw.println("<option value='"+lista.get(i).getCodigoPeriodo()+"' selected>"+lista.get(i).getNombrePeriodo()+" - ACTIVO</option>"); if (lista.get(i).getEstadoPeriodo() == 1) {
}else{ pw.println("<option value='" + lista.get(i).getCodigoPeriodo() + "' selected>" + lista.get(i).getNombrePeriodo() + " - ACTIVO</option>");
pw.println("<option value='"+lista.get(i).getCodigoPeriodo()+"'>"+lista.get(i).getNombrePeriodo()+"</option>"); } else {
} pw.println("<option value='" + lista.get(i).getCodigoPeriodo() + "'>" + lista.get(i).getNombrePeriodo() + "</option>");
}
}
pw.println("</select>"); }
System.out.println("REGRESA DEL BACKEND...");
} pw.println("</select>");
}
} }
...@@ -12,322 +12,322 @@ ...@@ -12,322 +12,322 @@
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<!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>JSP Page</title> <title>JSP Page</title>
<style> <style>
td,th { td,th {
padding: 10px padding: 10px
} }
</style> </style>
</head> </head>
<body> <body>
<strong>Leyenda</strong> <strong>Leyenda</strong>
<p>Color Gris: Sin Disponibilidad</p> <p>Color Gris: Sin Disponibilidad</p>
<% <%
// DNI EN FUTURO // DNI EN FUTURO
String codDocente = request.getParameter("codDocente"); String codDocente = request.getParameter("codDocente");
String periodo = request.getParameter("periodo"); String periodo = request.getParameter("periodo");
HorarioServices servicios = new HorarioServices(); HorarioServices servicios = new HorarioServices();
JSONObject jparam=new JSONObject(); JSONObject jparam=new JSONObject();
jparam.put("codigoPeriodo",periodo); jparam.put("codigoPeriodo",periodo);
jparam.put("codigoProfesor",codDocente); jparam.put("codigoProfesor",codDocente);
JSONObject objeto=servicios.listarVistaHorarioDisponibilidad(jparam); JSONObject objeto=servicios.listarVistaHorarioDisponibilidad(jparam);
JSONObject dataPersona = objeto.getJSONArray("data").getJSONObject(0); JSONObject dataPersona = objeto.getJSONArray("data").getJSONObject(0);
if(!dataPersona.isNull("disponibilidad")){ if(!dataPersona.isNull("disponibilidad")){
//cabecera //cabecera
String nombreDocente=dataPersona.getString("nombre"); String nombreDocente=dataPersona.getString("nombre");
String correoDocente=dataPersona.getString("correo"); String correoDocente=dataPersona.getString("correo");
String direccionDocente=dataPersona.getString("direccion"); String direccionDocente=dataPersona.getString("direccion");
String celularDocente=dataPersona.getString("celular"); String celularDocente=dataPersona.getString("celular");
String distrito=dataPersona.getString("distrito"); String distrito=dataPersona.getString("distrito");
String[] disponibilidad = dataPersona.getString("disponibilidad").split("-"); String[] disponibilidad = dataPersona.getString("disponibilidad").split("-");
ArrayList<String> diaM = new ArrayList<String>(); ArrayList<String> diaM = new ArrayList<String>();
ArrayList<String> diaT = new ArrayList<String>(); ArrayList<String> diaT = new ArrayList<String>();
ArrayList<Object> aulaM = new ArrayList<Object>(); ArrayList<Object> aulaM = new ArrayList<Object>();
ArrayList<Object> aulaT = new ArrayList<Object>(); ArrayList<Object> aulaT = new ArrayList<Object>();
for(int i= 0; i < disponibilidad.length; i++){ for(int i= 0; i < disponibilidad.length; i++){
String turno = disponibilidad[i].split("#")[0]; String turno = disponibilidad[i].split("#")[0];
String dia = disponibilidad[i].split("#")[1]; String dia = disponibilidad[i].split("#")[1];
if(turno.equals("1")){ if(turno.equals("1")){
diaM.add(dia); diaM.add(dia);
} else if(turno.equals("2")){ } else if(turno.equals("2")){
diaT.add(dia); diaT.add(dia);
} }
} }
if(!dataPersona.isNull("arrayAulas")){ if(!dataPersona.isNull("arrayAulas")){
JSONArray array = dataPersona.getJSONArray("arrayAulas"); JSONArray array = dataPersona.getJSONArray("arrayAulas");
for(Object obj : array){ for(Object obj : array){
JSONObject aula = (JSONObject) obj; JSONObject aula = (JSONObject) obj;
if(aula.getString("turno").equals("1")){ if(aula.getString("turno").equals("1")){
aulaM.add(aula); aulaM.add(aula);
}else if(aula.getString("turno").equals("2")){ }else if(aula.getString("turno").equals("2")){
aulaT.add(aula); aulaT.add(aula);
} }
} }
} }
response.setContentType("application/vnd.ms-excel; "); response.setContentType("application/vnd.ms-excel; ");
response.setHeader("Content-Disposition","attachment; filename=UsuarioDocente.xls"); response.setHeader("Content-Disposition","attachment; filename=UsuarioDocente.xls");
String borderT="style='border:solid 0.5pt #000000;vertical-align:middle; background-color:#2F75B5;color:white;' "; String borderT="style='border:solid 0.5pt #000000;vertical-align:middle; background-color:#2F75B5;color:white;' ";
String borderTD="style='border:solid 0.5pt #000000;vertical-align:middle; background-color:#D9D9D9;' "; String borderTD="style='border:solid 0.5pt #000000;vertical-align:middle; background-color:#D9D9D9;' ";
String border="style='border:solid 0.5pt #000000;vertical-align:middle;'"; String border="style='border:solid 0.5pt #000000;vertical-align:middle;'";
%> %>
<table border="2"> <table border="2">
<tr> <tr>
<td colspan="7" height='10'> </td> <td colspan="7" height='10'> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" <%=borderT%> ><b>DOCENTE:</b></td> <td colspan="2" <%=borderT%> ><b>DOCENTE:</b></td>
<td colspan="2" <%=border%>><font><b><%=nombreDocente%></b></font></td> <td colspan="2" <%=border%>><font><b><%=nombreDocente%></b></font></td>
<td colspan="1" <%=borderT%> ><b>CORREO:</b></td> <td colspan="1" <%=borderT%> ><b>CORREO:</b></td>
<td colspan="2" <%=border%> ><font><b><%=correoDocente%></b></font></td> <td colspan="2" <%=border%> ><font><b><%=correoDocente%></b></font></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" <%=borderT%> ><b>CELULAR:</b></td> <td colspan="2" <%=borderT%> ><b>CELULAR:</b></td>
<td colspan="2" <%=border%> align='left'><font><b><%=celularDocente%></b></font></td> <td colspan="2" <%=border%> align='left'><font><b><%=celularDocente%></b></font></td>
<td colspan="1" <%=borderT%> ><b>DISTRITO:</b></td> <td colspan="1" <%=borderT%> ><b>DISTRITO:</b></td>
<td colspan="2" <%=border%> ><font><b><%=distrito%></b></font></td> <td colspan="2" <%=border%> ><font><b><%=distrito%></b></font></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" <%=borderT%> height='70' ><b>DIRECCIÓN:</b></td> <td colspan="2" <%=borderT%> height='70' ><b>DIRECCIÓN:</b></td>
<td colspan="5" <%=border%> ><font><b><%=direccionDocente%></b></font></td> <td colspan="5" <%=border%> ><font><b><%=direccionDocente%></b></font></td>
</tr> </tr>
<tr> <tr>
<td height='10' colspan="7" ></td> <td height='10' colspan="7" ></td>
</tr> </tr>
<thead> <thead>
<tr> <tr>
<th <%=borderT%>>TURNO</th> <th <%=borderT%>>TURNO</th>
<th <%=borderT%>>LUNES</th> <th <%=borderT%>>LUNES</th>
<th <%=borderT%>>MARTES</th> <th <%=borderT%>>MARTES</th>
<th <%=borderT%>>MIERCOLES</th> <th <%=borderT%>>MIERCOLES</th>
<th <%=borderT%>>JUEVES</th> <th <%=borderT%>>JUEVES</th>
<th <%=borderT%>>VIERNES</th> <th <%=borderT%>>VIERNES</th>
<th <%=borderT%>>SABADO</th> <th <%=borderT%>>SABADO</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td <%=borderTD%>>M</td> <td <%=borderTD%>>M</td>
<% <%
for(int i=0;i<6;i++){ for(int i=0;i<6;i++){
String x="background-color: #585858;"; String x="background-color: #585858;";
if(diaM.contains(String.valueOf(i+1))){ if(diaM.contains(String.valueOf(i+1))){
x=""; x="";
} }
String horario = ""; String horario = "";
for(Object obj:aulaM){ for(Object obj:aulaM){
JSONObject hr=(JSONObject)obj; JSONObject hr=(JSONObject)obj;
if(hr.getString("dia").equals(String.valueOf(i+1))){ if(hr.getString("dia").equals(String.valueOf(i+1))){
horario += hr.getString("sede") + " | " + hr.getString("aulas") + " \n"; horario += hr.getString("sede") + " | " + hr.getString("aulas") + " \n";
} }
} }
%> %>
<td height='90' width='140' align='center' style="vertical-align:middle;<%=x%>"><font size="1"><b><%=horario%></b></font></td> <td height='90' width='140' align='center' style="vertical-align:middle;<%=x%>"><font size="1"><b><%=horario%></b></font></td>
<% <%
} }
%> %>
</tr> </tr>
<tr> <tr>
<td <%=borderTD%>>T</td> <td <%=borderTD%>>T</td>
<% <%
for(int i=0;i<6;i++){ for(int i=0;i<6;i++){
String x="background-color: #585858;"; String x="background-color: #585858;";
if(diaT.contains(String.valueOf(i+1))){ if(diaT.contains(String.valueOf(i+1))){
x=""; x="";
} }
String horario = ""; String horario = "";
for(Object obj:aulaT){ for(Object obj:aulaT){
JSONObject hr=(JSONObject)obj; JSONObject hr=(JSONObject)obj;
if(hr.getString("dia").equals(String.valueOf(i+1))){ if(hr.getString("dia").equals(String.valueOf(i+1))){
horario += hr.getString("sede") + " | " + hr.getString("aulas") + " \n"; horario += hr.getString("sede") + " | " + hr.getString("aulas") + " \n";
} }
} }
%> %>
<td height='50' width='140' align='center' style="vertical-align:middle;<%=x%>"><font size="1"><b><%=horario%></b></font></td> <td height='50' width='140' align='center' style="vertical-align:middle;<%=x%>"><font size="1"><b><%=horario%></b></font></td>
<% <%
} }
%> %>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<% <%
} else { } else {
%> %>
<h1>No hay disponibilidad.</h1> <h1>No hay disponibilidad.</h1>
<% <%
} }
%> %>
<!-- HORARIO CONFIRMADO--> <!-- HORARIO CONFIRMADO-->
<hr> <hr>
<p style="font-size: 30px;font-weight: bold;" id='tituloConformidad'>Sede y Aulas con Horario Confirmadas</p> <p style="font-size: 30px;font-weight: bold;" id='tituloConformidad'>Sede y Aulas con Horario Confirmadas</p>
<% <%
String codDocente2 = request.getParameter("codDocente"); String codDocente2 = request.getParameter("codDocente");
String periodo2 = request.getParameter("periodo"); String periodo2 = request.getParameter("periodo");
HorarioServices serviciosDos = new HorarioServices(); HorarioServices serviciosDos = new HorarioServices();
JSONObject jparam2=new JSONObject(); JSONObject jparam2=new JSONObject();
jparam2.put("codigoPeriodo",periodo2); jparam2.put("codigoPeriodo",periodo2);
jparam2.put("codigoProfesor",codDocente2); jparam2.put("codigoProfesor",codDocente2);
JSONObject objeto2=serviciosDos.listarVistaHorarioConformidad(jparam2); JSONObject objeto2=serviciosDos.listarVistaHorarioConformidad(jparam2);
JSONObject dataPersona2 = objeto2.getJSONArray("data").getJSONObject(0); JSONObject dataPersona2 = objeto2.getJSONArray("data").getJSONObject(0);
if(!dataPersona2.isNull("disponibilidad")){ if(!dataPersona2.isNull("disponibilidad")){
//cabecera //cabecera
String nombreDocente2=dataPersona2.getString("nombre"); String nombreDocente2=dataPersona2.getString("nombre");
String correoDocente2=dataPersona2.getString("correo"); String correoDocente2=dataPersona2.getString("correo");
String direccionDocente2=dataPersona2.getString("direccion"); String direccionDocente2=dataPersona2.getString("direccion");
String celularDocente2=dataPersona2.getString("celular"); String celularDocente2=dataPersona2.getString("celular");
String distrito2=dataPersona2.getString("distrito"); String distrito2=dataPersona2.getString("distrito");
String[] disponibilidad2 = dataPersona2.getString("disponibilidad").split("-"); String[] disponibilidad2 = dataPersona2.getString("disponibilidad").split("-");
ArrayList<String> diaM2 = new ArrayList<String>(); ArrayList<String> diaM2 = new ArrayList<String>();
ArrayList<String> diaT2 = new ArrayList<String>(); ArrayList<String> diaT2 = new ArrayList<String>();
ArrayList<Object> aulaM2 = new ArrayList<Object>(); ArrayList<Object> aulaM2 = new ArrayList<Object>();
ArrayList<Object> aulaT2 = new ArrayList<Object>(); ArrayList<Object> aulaT2 = new ArrayList<Object>();
for(int i= 0; i < disponibilidad2.length; i++){ for(int i= 0; i < disponibilidad2.length; i++){
String turno2 = disponibilidad2[i].split("#")[0]; String turno2 = disponibilidad2[i].split("#")[0];
String dia2= disponibilidad2[i].split("#")[1]; String dia2= disponibilidad2[i].split("#")[1];
if(turno2.equals("1")){ if(turno2.equals("1")){
diaM2.add(dia2); diaM2.add(dia2);
} else if(turno2.equals("2")){ } else if(turno2.equals("2")){
diaT2.add(dia2); diaT2.add(dia2);
} }
} }
if(!dataPersona2.isNull("arrayAulas")){ if(!dataPersona2.isNull("arrayAulas")){
JSONArray array = dataPersona2.getJSONArray("arrayAulas"); JSONArray array = dataPersona2.getJSONArray("arrayAulas");
for(Object obj : array){ for(Object obj : array){
JSONObject aula2 = (JSONObject) obj; JSONObject aula2 = (JSONObject) obj;
if(aula2.getString("turno").equals("1")){ if(aula2.getString("turno").equals("1")){
aulaM2.add(aula2); aulaM2.add(aula2);
}else if(aula2.getString("turno").equals("2")){ }else if(aula2.getString("turno").equals("2")){
aulaT2.add(aula2); aulaT2.add(aula2);
} }
} }
} }
response.setContentType("application/vnd.ms-excel; "); response.setContentType("application/vnd.ms-excel; ");
response.setHeader("Content-Disposition","attachment; filename=UsuarioDocente.xls"); response.setHeader("Content-Disposition","attachment; filename=UsuarioDocente.xls");
String borderT="style='border:solid 0.5pt #000000;vertical-align:middle; background-color:#A9F5F2;' "; String borderT="style='border:solid 0.5pt #000000;vertical-align:middle; background-color:#A9F5F2;' ";
String borderTD="style='border:solid 0.5pt #000000;vertical-align:middle; background-color:#A9F5D0;' "; String borderTD="style='border:solid 0.5pt #000000;vertical-align:middle; background-color:#A9F5D0;' ";
String border="style='border:solid 0.5pt #000000;vertical-align:middle;background-color:#D9D9D9'"; String border="style='border:solid 0.5pt #000000;vertical-align:middle;background-color:#D9D9D9'";
%> %>
<table border="2"> <table border="2">
<thead> <thead>
<tr> <tr>
<th style="background-color:#F1F1F1;">TURNO</th> <th style="background-color:#F1F1F1;">TURNO</th>
<th style="background-color:#F1F1F1;" >LUNES</th> <th style="background-color:#F1F1F1;" >LUNES</th>
<th style="background-color:#F1F1F1;">MARTES</th> <th style="background-color:#F1F1F1;">MARTES</th>
<th style="background-color:#F1F1F1;">MIERCOLES</th> <th style="background-color:#F1F1F1;">MIERCOLES</th>
<th style="background-color:#F1F1F1;">JUEVES</th> <th style="background-color:#F1F1F1;">JUEVES</th>
<th style="background-color:#F1F1F1;" >VIERNES</th> <th style="background-color:#F1F1F1;" >VIERNES</th>
<th style="background-color:#F1F1F1;">SABADO</th> <th style="background-color:#F1F1F1;">SABADO</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td <%=border%>>M</td> <td <%=border%>>M</td>
<% <%
for(int i=0;i<6;i++){ for(int i=0;i<6;i++){
String x="background-color: #585858;"; String x="background-color: #585858;";
if(diaM2.contains(String.valueOf(i+1))){ if(diaM2.contains(String.valueOf(i+1))){
x="background-color: #DDE3B6;"; x="background-color: #DDE3B6;";
} }
String horario = ""; String horario = "";
for(Object obj:aulaM2){ for(Object obj:aulaM2){
JSONObject hr=(JSONObject)obj; JSONObject hr=(JSONObject)obj;
if(hr.getString("dia").equals(String.valueOf(i+1))){ if(hr.getString("dia").equals(String.valueOf(i+1))){
horario += hr.getString("sede") + " | " + hr.getString("aulas") + " \n"; horario += hr.getString("sede") + " | " + hr.getString("aulas") + " \n";
} }
} }
%> %>
<td height='90' width='140' align='center' style="vertical-align:middle;<%=x%>"><font size="1"><b><%=horario%></b></font></td> <td height='90' width='140' align='center' style="vertical-align:middle;<%=x%>"><font size="1"><b><%=horario%></b></font></td>
<% <%
} }
%> %>
</tr> </tr>
<tr> <tr>
<td <%=border%>>T</td> <td <%=border%>>T</td>
<% <%
for(int i=0;i<6;i++){ for(int i=0;i<6;i++){
String x="background-color: #585858;"; String x="background-color: #585858;";
if(diaT2.contains(String.valueOf(i+1))){ if(diaT2.contains(String.valueOf(i+1))){
x="background-color: #DDE3B6;"; x="background-color: #DDE3B6;";
} }
String horario = ""; String horario = "";
for(Object obj:aulaT2){ for(Object obj:aulaT2){
JSONObject hr=(JSONObject)obj; JSONObject hr=(JSONObject)obj;
if(hr.getString("dia").equals(String.valueOf(i+1))){ if(hr.getString("dia").equals(String.valueOf(i+1))){
horario += hr.getString("sede") + " | " + hr.getString("aulas") + " \n"; horario += hr.getString("sede") + " | " + hr.getString("aulas") + " \n";
} }
} }
%> %>
<td height='50' width='140' align='center' style="vertical-align:middle;<%=x%>"><font size="1"><b><%=horario%></b></font></td> <td height='50' width='140' align='center' style="vertical-align:middle;<%=x%>"><font size="1"><b><%=horario%></b></font></td>
<% <%
} }
%> %>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<% <%
} else { } else {
%> %>
<% <%
} }
%> %>
</body> </body>
</html> </html>
<%@page import="pe.siso.horario.Beans.Aula"%> <%@page import="pe.siso.horario.Beans.Aula"%>
<%@page import="pe.siso.horario.Beans.PeriodoAcademico"%> <%@page import="pe.siso.horario.Beans.PeriodoAcademico"%>
<%-- <%--
Document : exportarHorario Document : exportarHorario
...@@ -25,349 +25,343 @@ ...@@ -25,349 +25,343 @@
<!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>VER HORARIOS </title> <title>VER HORARIOS </title>
</head> </head>
<body> <body>
<% <%
HttpSession session_actual = request.getSession(true); HttpSession session_actual = request.getSession(true);
Usuario usuario=(Usuario)session_actual.getAttribute("usuario"); Usuario usuario=(Usuario)session_actual.getAttribute("usuario");
response.setContentType("application/vnd.ms-excel; "); response.setContentType("application/vnd.ms-excel; ");
response.setHeader("Content-Disposition","attachment; filename=HorarioAula.xls"); response.setHeader("Content-Disposition","attachment; filename=HorarioAula.xls");
String border="style='border:solid 0.5pt #000000;vertical-align:middle;'"; String border="style='border:solid 0.5pt #000000;vertical-align:middle;'";
String centrado="style='vertical-align:middle;' "; String centrado="style='vertical-align:middle;' ";
String borderColor="style='border:solid 0.5pt #000000; vertical-align:middle; background-color:#B5E0F5;'"; String borderColor="style='border:solid 0.5pt #000000; vertical-align:middle; background-color:#B5E0F5;'";
String borderColorTitulo="style='border:solid 0.5pt #000000; vertical-align:middle; background-color:#006699; color:#FFFFFF;'"; String borderColorTitulo="style='border:solid 0.5pt #000000; vertical-align:middle; background-color:#006699; color:#FFFFFF;'";
String estilo = "style='background-color:#B5E0F5; border:solid 0.5pt;'"; String estilo = "style='background-color:#B5E0F5; border:solid 0.5pt;'";
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd/MM/yyyy"); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd/MM/yyyy");
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
Calendar cal1 = Calendar.getInstance(); Calendar cal1 = Calendar.getInstance();
int diaA = cal1.get(Calendar.DATE); int diaA = cal1.get(Calendar.DATE);
int mes = cal1.get(Calendar.MONTH); int mes = cal1.get(Calendar.MONTH);
int hora = cal1.get(Calendar.HOUR); int hora = cal1.get(Calendar.HOUR);
int minuto = cal1.get(Calendar.MINUTE); int minuto = cal1.get(Calendar.MINUTE);
int segundo = cal1.get(Calendar.SECOND); int segundo = cal1.get(Calendar.SECOND);
String diaAc = ""; String diaAc = "";
String mesAc = ""; String mesAc = "";
String hrAc = ""; String hrAc = "";
String minAc = ""; String minAc = "";
String secAc = ""; String secAc = "";
String perDia = ""; String perDia = "";
int horaAc=0; int horaAc=0;
if(diaA<10){ diaAc = "0"+diaA; }else{ diaAc = ""+diaA;} if(diaA<10){ diaAc = "0"+diaA; }else{ diaAc = ""+diaA;}
if(mes<10){ mesAc = "0"+mes; }else{ mesAc = ""+mes; } if(mes<10){ mesAc = "0"+mes; }else{ mesAc = ""+mes; }
//if(hora<10){ if(hora==0){ hrAc = "12"; }else{ hrAc = "0"+hora; } perDia="am."; }else{ hrAc = ""+hora; perDia="pm."; } //if(hora<10){ if(hora==0){ hrAc = "12"; }else{ hrAc = "0"+hora; } perDia="am."; }else{ hrAc = ""+hora; perDia="pm."; }
if(hora<12){ if(hora<12){
perDia="am."; perDia="am.";
if(hora<10 && hora>0){ if(hora<10 && hora>0){
hrAc="0"+hora; hrAc="0"+hora;
}else if(hora==0){ }else if(hora==0){
hrAc="12"; hrAc="12";
}else{ }else{
hrAc=""+hora; hrAc=""+hora;
} }
}else{ }else{
if(hora==12){ if(hora==12){
hrAc="12"; hrAc="12";
}else{ }else{
horaAc=hora-12; horaAc=hora-12;
if(horaAc<10){ if(horaAc<10){
hrAc="0"+horaAc; hrAc="0"+horaAc;
}else{ }else{
hrAc = ""+horaAc; hrAc = ""+horaAc;
} }
} }
perDia="pm."; perDia="pm.";
} }
if(minuto<10){ minAc = "0"+minuto; }else{ minAc = ""+minuto; } if(minuto<10){ minAc = "0"+minuto; }else{ minAc = ""+minuto; }
if(segundo<10){ secAc = "0"+segundo; }else{ secAc = ""+segundo; } if(segundo<10){ secAc = "0"+segundo; }else{ secAc = ""+segundo; }
%> %>
<table align='center' border='0' cellpadding= '0' cellspacing= '0'> <table align='center' border='0' cellpadding= '0' cellspacing= '0'>
<tr> <tr>
<td align='center' colspan='12' ><h3>HORARIO DEL AULA</h3></td> <td align='center' colspan='12' ><h3>HORARIO DEL AULA</h3></td>
</tr> </tr>
<tr> <tr>
<td colspan="6">FUENTE: SISTEMA DE HORARIOS</td> <td colspan="6">FUENTE: SISTEMA DE HORARIOS</td>
<td colspan="6" align="right">SACO OLIVEROS - SISTEMAS</td> <td colspan="6" align="right">SACO OLIVEROS - SISTEMAS</td>
</tr> </tr>
<tr> <tr>
<td colspan="6" >RESPONSABLE: <%=usuario!=null?usuario.getUsuarioUsuario():""%></td> <td colspan="6" >RESPONSABLE: <%=usuario!=null?usuario.getUsuarioUsuario():""%></td>
<td colspan="6" align="right">ACTUALIZACIÓN: <%=dtf.format(now)%></td> <td colspan="6" align="right">ACTUALIZACIÓN: <%=dtf.format(now)%></td>
</tr> </tr>
<% <%
String codSede = request.getParameter("codSede"); String codSede = request.getParameter("codSede");
String periodo = request.getParameter("periodo"); String periodo = request.getParameter("periodo");
int codPeriodo = Integer.parseInt(periodo); int codPeriodo = Integer.parseInt(periodo);
AulaServices serviciosAula = new AulaServices();
ArrayList<Aula> listaDatos = null;
listaDatos = serviciosAula.listarDatosHorairo(codSede,periodo);
//cipreces
String nombreSede=listaDatos.get(0).getNombreLocal();
for(int z=0;z<listaDatos.size();z++){
AulaServices serviciosAula = new AulaServices();
ArrayList<Aula> listaDatos = null;
String codAulas = ""+listaDatos.get(z).getCodigoAula(); listaDatos = serviciosAula.listarDatosHorairo(codSede,periodo);
String codigo = listaDatos.get(z).getCodigoGrupo(); //cipreces
String nombreSede=listaDatos.get(0).getNombreLocal();
for(int z=0;z<listaDatos.size();z++){
String codAulas = ""+listaDatos.get(z).getCodigoAula();
String codigo = listaDatos.get(z).getCodigoGrupo();
int cantidad = 1; int cantidad = 1;
System.out.println("nombre Sede "+nombreSede); System.out.println("nombre Sede "+nombreSede);
AulaServices servicios = new AulaServices();
BloqueServices serviciosBlo = new BloqueServices();
AulaServices servicios = new AulaServices(); HorarioServices serviciosHor = new HorarioServices();
BloqueServices serviciosBlo = new BloqueServices();
HorarioServices serviciosHor = new HorarioServices();
String cadena = listaDatos.get(z).getCadena(); String cadena = listaDatos.get(z).getCadena();
int maxGru = listaDatos.get(z).getMaxGrupo(); int maxGru = listaDatos.get(z).getMaxGrupo();
/* /*
Horario horarioCadenaGrupo = new Horario(); Horario horarioCadenaGrupo = new Horario();
horarioCadenaGrupo = serviciosHor.consultarCadenaGH(codigo); horarioCadenaGrupo = serviciosHor.consultarCadenaGH(codigo);
String cadena = horarioCadenaGrupo.getCadena(); String cadena = horarioCadenaGrupo.getCadena();
int maxGru = horarioCadenaGrupo.getMaxGrupo(); int maxGru = horarioCadenaGrupo.getMaxGrupo();
*/ */
String datoTD = ""; String datoTD = "";
String[] aulas = codAulas.split("#"); String[] aulas = codAulas.split("#");
//REGISTRAR GRUPO AULAS //REGISTRAR GRUPO AULAS
String cadenaAulas = codAulas.replace("#", ","); String cadenaAulas = codAulas.replace("#", ",");
// GUARDAR MAXIMOS Y MINIMOS HORARIOS POR DIA // GUARDAR MAXIMOS Y MINIMOS HORARIOS POR DIA
// GUARDAR CADENA DE HORARIOS INICIALES Y FINALES POR DIA // GUARDAR CADENA DE HORARIOS INICIALES Y FINALES POR DIA
String min_ini_1=""; String min_ini_2=""; String min_ini_3=""; String min_ini_4=""; String min_ini_5=""; String min_ini_6=""; String min_ini_1=""; String min_ini_2=""; String min_ini_3=""; String min_ini_4=""; String min_ini_5=""; String min_ini_6="";
String max_fin_1=""; String max_fin_2=""; String max_fin_3=""; String max_fin_4=""; String max_fin_5=""; String max_fin_6=""; String max_fin_1=""; String max_fin_2=""; String max_fin_3=""; String max_fin_4=""; String max_fin_5=""; String max_fin_6="";
String horas_ini_1=""; String horas_ini_2=""; String horas_ini_3=""; String horas_ini_4=""; String horas_ini_5=""; String horas_ini_6=""; String horas_ini_1=""; String horas_ini_2=""; String horas_ini_3=""; String horas_ini_4=""; String horas_ini_5=""; String horas_ini_6="";
String horas_fin_1=""; String horas_fin_2=""; String horas_fin_3=""; String horas_fin_4=""; String horas_fin_5=""; String horas_fin_6=""; String horas_fin_1=""; String horas_fin_2=""; String horas_fin_3=""; String horas_fin_4=""; String horas_fin_5=""; String horas_fin_6="";
int contGenral = 1; int contGenral = 1;
// ---- CADENA -------------------------// // ---- CADENA -------------------------//
String[] array1 = cadena.split("!"); String[] array1 = cadena.split("!");
int x =0; int x =0;
for(int i=0; i<array1.length;i++){ for(int i=0; i<array1.length;i++){
String[] array2 = array1[i].split("#"); String[] array2 = array1[i].split("#");
if(x<Integer.parseInt(array2[0])){ if(x<Integer.parseInt(array2[0])){
x=Integer.parseInt(array2[0]); x=Integer.parseInt(array2[0]);
} }
} }
// ---- CADENA ------------------------// // ---- CADENA ------------------------//
for(int i=0; i<cantidad;i++){ for(int i=0; i<cantidad;i++){
//cipreces //cipreces
String nomAula = servicios.consultarAula(aulas[i]); String nomAula = servicios.consultarAula(aulas[i]);
String nomAulaSede = servicios.consultarAulaSede(aulas[i]); String nomAulaSede = servicios.consultarAulaSede(aulas[i]);
if(nombreSede.equals(nomAulaSede)){ if(nombreSede.equals(nomAulaSede)){
%> %>
<tr>
<tr>
<td height='20' colspan='12' align='center' ><H3><font color='#006090'><b>SEDE:</b> <%=nomAula%></font> </H3></td>
<%
}else{
%>
<td height='20' colspan='12' align='center' style="background-color:#FFFF00;"><H3><font color='#006090'><b>SEDE:</b> <%=nomAula%></font> </H3></td>
<%
}
%>
</tr>
<tr>
<td height='15' width='35' ></td>
<td height='15' width='130' ></td>
<td height='15' width='35' ></td>
<td height='15' width='130' ></td>
<td height='15' width='35' ></td>
<td height='15' width='130' ></td>
<td height='15' width='35' ></td>
<td height='15' width='130' ></td>
<td height='15' width='35' ></td>
<td height='15' width='130' ></td>
<td height='15' width='35' ></td>
<td height='15' width='130' ></td>
</tr>
<tr>
<td width='140' <%=borderColorTitulo%> align='center' colspan='2'>LUNES</td>
<td width='140' <%=borderColorTitulo%> align='center' colspan='2'>MARTES</td>
<td width='140' <%=borderColorTitulo%> align='center' colspan='2'>MIÉRCOLES</td>
<td width='140' <%=borderColorTitulo%> align='center' colspan='2'>JUEVES</td>
<td width='140' <%=borderColorTitulo%> align='center' colspan='2'>VIERNES</td>
<td width='140' <%=borderColorTitulo%> align='center' colspan='2'>SÁBADO</td>
</tr>
<td height='20' colspan='12' align='center' ><H3><font color='#006090'><b>SEDE:</b> <%=nomAula%></font> </H3></td>
<% <%
String codPeriodo2 = ""+codPeriodo; }else{
String HorIni="";
String HorFin="";
int dia1=0; int dia2=0; int dia3=0; int dia4=0; int dia5=0; int dia6=0;
int cont_dia1=1; int cont_dia2=1; int cont_dia3=1; int cont_dia4=1; int cont_dia5=1; int cont_dia6=1;
int diaPos = 0;
int diaGen = 0;
int contenido = 0;
for(int t=1; t<=x;t++){
%> %>
<tr> <td height='20' colspan='12' align='center' style="background-color:#FFFF00;"><H3><font color='#006090'><b>SEDE:</b> <%=nomAula%></font> </H3></td>
<% <%
}
%>
String bloqueGrupoDia=""; </tr>
for(int f=1; f<=6;f++){ <tr>
for(int j=0; j<array1.length;j++){ <td height='15' width='35' ></td>
String[] array2 = array1[j].split("#"); <td height='15' width='130' ></td>
<td height='15' width='35' ></td>
if(array2[2].equals(""+f)){ <td height='15' width='130' ></td>
if(Integer.parseInt(array2[0])>=t){ <td height='15' width='35' ></td>
String[] horas = array2[3].split("¡"); <td height='15' width='130' ></td>
int h = t-1; <td height='15' width='35' ></td>
String[] hora1 = horas[h].split("-"); <td height='15' width='130' ></td>
HorIni=hora1[0]; <td height='15' width='35' ></td>
HorFin=hora1[1]; <td height='15' width='130' ></td>
bloqueGrupoDia = array2[0]; <td height='15' width='35' ></td>
<td height='15' width='130' ></td>
</tr>
<tr>
<td width='140' <%=borderColorTitulo%> align='center' colspan='2'>LUNES</td>
<td width='140' <%=borderColorTitulo%> align='center' colspan='2'>MARTES</td>
<td width='140' <%=borderColorTitulo%> align='center' colspan='2'>MIÉRCOLES</td>
<td width='140' <%=borderColorTitulo%> align='center' colspan='2'>JUEVES</td>
<td width='140' <%=borderColorTitulo%> align='center' colspan='2'>VIERNES</td>
<td width='140' <%=borderColorTitulo%> align='center' colspan='2'>SÁBADO</td>
</tr>
<%
String codPeriodo2 = ""+codPeriodo;
String HorIni="";
String HorFin="";
int dia1=0; int dia2=0; int dia3=0; int dia4=0; int dia5=0; int dia6=0;
int cont_dia1=1; int cont_dia2=1; int cont_dia3=1; int cont_dia4=1; int cont_dia5=1; int cont_dia6=1;
int diaPos = 0;
int diaGen = 0;
int contenido = 0;
for(int t=1; t<=x;t++){
%>
<tr>
<%
String bloqueGrupoDia="";
for(int f=1; f<=6;f++){
for(int j=0; j<array1.length;j++){
String[] array2 = array1[j].split("#");
if(array2[2].equals(""+f)){
if(Integer.parseInt(array2[0])>=t){
String[] horas = array2[3].split("¡");
int h = t-1;
String[] hora1 = horas[h].split("-");
HorIni=hora1[0];
HorFin=hora1[1];
bloqueGrupoDia = array2[0];
if(f==1){ dia1++; diaPos=dia1; diaGen=f;} if(f==1){ dia1++; diaPos=dia1; diaGen=f;}
else if(f==2){ dia2++; diaPos=dia2; diaGen=f;} else if(f==2){ dia2++; diaPos=dia2; diaGen=f;}
else if(f==3){ dia3++; diaPos=dia3; diaGen=f;} else if(f==3){ dia3++; diaPos=dia3; diaGen=f;}
else if(f==4){ dia4++; diaPos=dia4; diaGen=f;} else if(f==4){ dia4++; diaPos=dia4; diaGen=f;}
else if(f==5){ dia5++; diaPos=dia5; diaGen=f;} else if(f==5){ dia5++; diaPos=dia5; diaGen=f;}
else if(f==6){ dia6++; diaPos=dia6; diaGen=f;} else if(f==6){ dia6++; diaPos=dia6; diaGen=f;}
contenido=1; contenido=1;
}
} }
} }
String dia = ""+f; }
String posicion = ""+diaPos; String dia = ""+f;
String posicion = ""+diaPos;
if(contenido==1){
if(contenido==1){
Horario DatosHorario = new Horario();
DatosHorario = serviciosHor.consultarDatosHorarioAulaPorPosicionDiaria(aulas[i],codPeriodo2,dia,posicion); Horario DatosHorario = new Horario();
DatosHorario = serviciosHor.consultarDatosHorarioAulaPorPosicionDiaria(aulas[i],codPeriodo2,dia,posicion);
%>
<td <%=border%> align='center' width='35' style='color:white; background-color:#62A8D1; vertical-align:middle; font-size: 10px;'> %>
<%=HorIni%> <td <%=border%> align='center' width='35' style='color:white; background-color:#62A8D1; vertical-align:middle; font-size: 10px;'>
<br> <%=HorIni%>
<%=HorFin%> <br>
</td> <%=HorFin%>
<% </td>
if(i==0){ <%
if(dia.equals("1")){ if(i==0){
if(cont_dia1==1){ min_ini_1=HorIni; cont_dia1++;} if(dia.equals("1")){
max_fin_1=HorFin; if(cont_dia1==1){ min_ini_1=HorIni; cont_dia1++;}
if(horas_ini_1.equals("")){ horas_ini_1 = HorIni; horas_fin_1 = HorFin;} max_fin_1=HorFin;
else{ horas_ini_1 += "#"+HorIni; horas_fin_1 += "#"+HorFin;} if(horas_ini_1.equals("")){ horas_ini_1 = HorIni; horas_fin_1 = HorFin;}
}else if(dia.equals("2")){ else{ horas_ini_1 += "#"+HorIni; horas_fin_1 += "#"+HorFin;}
if(cont_dia2==1){ min_ini_2=HorIni; cont_dia2++;} }else if(dia.equals("2")){
max_fin_2=HorFin; if(cont_dia2==1){ min_ini_2=HorIni; cont_dia2++;}
if(horas_ini_2.equals("")){ horas_ini_2 = HorIni; horas_fin_2 = HorFin;} max_fin_2=HorFin;
else{ horas_ini_2 += "#"+HorIni; horas_fin_2 += "#"+HorFin;} if(horas_ini_2.equals("")){ horas_ini_2 = HorIni; horas_fin_2 = HorFin;}
}else if(dia.equals("3")){ else{ horas_ini_2 += "#"+HorIni; horas_fin_2 += "#"+HorFin;}
if(cont_dia3==1){ min_ini_3=HorIni; cont_dia3++;} }else if(dia.equals("3")){
max_fin_3=HorFin; if(cont_dia3==1){ min_ini_3=HorIni; cont_dia3++;}
if(horas_ini_3.equals("")){ horas_ini_3 = HorIni; horas_fin_3 = HorFin;} max_fin_3=HorFin;
else{ horas_ini_3 += "#"+HorIni; horas_fin_3 += "#"+HorFin;} if(horas_ini_3.equals("")){ horas_ini_3 = HorIni; horas_fin_3 = HorFin;}
}else if(dia.equals("4")){ else{ horas_ini_3 += "#"+HorIni; horas_fin_3 += "#"+HorFin;}
if(cont_dia4==1){ min_ini_4=HorIni; cont_dia4++;} }else if(dia.equals("4")){
max_fin_4=HorFin; if(cont_dia4==1){ min_ini_4=HorIni; cont_dia4++;}
if(horas_ini_4.equals("")){ horas_ini_4 = HorIni; horas_fin_4 = HorFin;} max_fin_4=HorFin;
else{ horas_ini_4 += "#"+HorIni; horas_fin_4 += "#"+HorFin;} if(horas_ini_4.equals("")){ horas_ini_4 = HorIni; horas_fin_4 = HorFin;}
}else if(dia.equals("5")){ else{ horas_ini_4 += "#"+HorIni; horas_fin_4 += "#"+HorFin;}
if(cont_dia5==1){ min_ini_5=HorIni; cont_dia5++;} }else if(dia.equals("5")){
max_fin_5=HorFin; if(cont_dia5==1){ min_ini_5=HorIni; cont_dia5++;}
if(horas_ini_5.equals("")){ horas_ini_5 = HorIni; horas_fin_5 = HorFin;} max_fin_5=HorFin;
else{ horas_ini_5 += "#"+HorIni; horas_fin_5 += "#"+HorFin;} if(horas_ini_5.equals("")){ horas_ini_5 = HorIni; horas_fin_5 = HorFin;}
}else if(dia.equals("6")){ else{ horas_ini_5 += "#"+HorIni; horas_fin_5 += "#"+HorFin;}
if(cont_dia6==1){ min_ini_6=HorIni; cont_dia6++;} }else if(dia.equals("6")){
max_fin_6=HorFin; if(cont_dia6==1){ min_ini_6=HorIni; cont_dia6++;}
if(horas_ini_6.equals("")){ horas_ini_6 = HorIni; horas_fin_6 = HorFin;} max_fin_6=HorFin;
else{ horas_ini_6 += "#"+HorIni; horas_fin_6 += "#"+HorFin;} if(horas_ini_6.equals("")){ horas_ini_6 = HorIni; horas_fin_6 = HorFin;}
} else{ horas_ini_6 += "#"+HorIni; horas_fin_6 += "#"+HorFin;}
}
if(DatosHorario.getH_estado()==null){
%>
<td <%=border%> width='130' align='center' style=' color: red; vertical-align:middle; font-size: 10px; ' >SIN CURSO</td>
<%
}else{
%>
<td <%=border%> width='130' align='center' style=' font-size: 10px;'>
<b><%=DatosHorario.getH_nombreCurso()%></b><br>
<%=DatosHorario.getH_apellidosDocente()%>, <%=DatosHorario.getH_nombreDocente()%>
</td>
<%
}
}else{
%>
<!-- <td colspan='2' width='140' align='center' ></td>-->
<td <%=border%> colspan='2' width='140' align='center' style='background-color: #FF7C80; color: white; vertical-align:middle; font-size: 10px; ' >SIN HORARIO</td>
<%
}
contenido=0;
} }
%>
</tr>
<%
} }
contGenral++;
} if(DatosHorario.getH_estado()==null){
%>
<td <%=border%> width='130' align='center' style=' color: red; vertical-align:middle; font-size: 10px; ' >SIN CURSO</td>
<%
}else{
%>
<td <%=border%> width='130' align='center' style=' font-size: 10px;'>
<b><%=DatosHorario.getH_nombreCurso()%></b><br>
<%=DatosHorario.getH_apellidosDocente()%>, <%=DatosHorario.getH_nombreDocente()%>
</td>
<%
} }
%>
}else{
%>
<!-- <td colspan='2' width='140' align='center' ></td>-->
<td <%=border%> colspan='2' width='140' align='center' style='background-color: #FF7C80; color: white; vertical-align:middle; font-size: 10px; ' >SIN HORARIO</td>
<%
}
contenido=0;
}
%>
</tr>
<%
}
contGenral++;
}
}
%>
</table> </table>
</body> </body>
</html> </html>
...@@ -553,9 +553,9 @@ ...@@ -553,9 +553,9 @@
var target = $(this).find('input[type=radio]'); var target = $(this).find('input[type=radio]');
var which = parseInt(target.val()); var which = parseInt(target.val());
if (which == 2) if (which == 2)
$('.select2').addClass('tag-input-style'); $('.select2').addClass('tag-input-style');
else else
$('.select2').removeClass('tag-input-style'); $('.select2').removeClass('tag-input-style');
}); });
...@@ -1100,9 +1100,10 @@ ...@@ -1100,9 +1100,10 @@
cargando(); cargando();
}, success: function (resultado) { }, success: function (resultado) {
close_carga(); close_carga();
// debugger debugger
$('#aula').html(resultado); $('#aula').html(resultado);
let op = $("#cmbSede").val(); let op = $("#cmbSede").val();
debugger
name = $("#lblUsuario").text(); name = $("#lblUsuario").text();
if (name === "6" || name === "5") { if (name === "6" || name === "5") {
$("#aula #btnAgregar").hide(); $("#aula #btnAgregar").hide();
...@@ -1118,7 +1119,9 @@ ...@@ -1118,7 +1119,9 @@
}, complete: function () { }, complete: function () {
$('#aula').fadeIn(); $('#aula').fadeIn();
$("#cmbSede").val(codAulaSession) console.log(`revisar...`)
debugger;
// $("#cmbSede").val(codAulaSession)
// $("body").animate({ scrollTop: $(document).height()}, 1000); // $("body").animate({ scrollTop: $(document).height()}, 1000);
} }
......
...@@ -792,7 +792,8 @@ ...@@ -792,7 +792,8 @@
html += '<tr>' html += '<tr>'
html += '<td id="turno">M</td>' html += '<td id="turno">M</td>'
console.log('Prueba.....................................................');
debugger;
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) {
......
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