Commit f5fb679a by Luis Gangas

[ADD] exportar cambios fijos, dias

parent f75ff048
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
* To change this template file, choose Tools | Templates * To change this template file, choose Tools | Templates
* and open the template in the editor. * and open the template in the editor.
*/ */
package pe.siso.horario.Beans; package pe.siso.horario.Beans;
/** /**
...@@ -11,12 +10,12 @@ package pe.siso.horario.Beans; ...@@ -11,12 +10,12 @@ package pe.siso.horario.Beans;
* @author fcelestino * @author fcelestino
*/ */
public class Horario { public class Horario {
private String codigoHorarioGrupo; private String codigoHorarioGrupo;
private String codigoGrupo; private String codigoGrupo;
private String estadoHorarioGrupo; private String estadoHorarioGrupo;
//--------------------------------- //---------------------------------
private String codHorarioCursoDoc; private String codHorarioCursoDoc;
private String codAula_HorarioCursoDoc; private String codAula_HorarioCursoDoc;
private String dia_HorarioCursoDoc; private String dia_HorarioCursoDoc;
...@@ -55,7 +54,6 @@ public class Horario { ...@@ -55,7 +54,6 @@ public class Horario {
private String ArmarHoraio_cadenaAulas; private String ArmarHoraio_cadenaAulas;
//------------------------------------- //-------------------------------------
private String h_codigoHorarioCursoDocente; private String h_codigoHorarioCursoDocente;
private String h_codigoAula; private String h_codigoAula;
private String h_dia; private String h_dia;
...@@ -78,6 +76,24 @@ public class Horario { ...@@ -78,6 +76,24 @@ public class Horario {
private String h_hora; private String h_hora;
private String h_accion; private String h_accion;
private String h_clase; private String h_clase;
private String h_codigo_doc_reemp;
private String h_codigo_cur_reemp;
private String h_nombre_cur_reemp;
private String h_observacion;
private String h_motivoCambio;
private String h_condicionTrabajador;
private String h_horaAviso;
private String h_fechaIngreso;
public String getH_fechaIngreso() {
return h_fechaIngreso;
}
public void setH_fechaIngreso(String h_fechaIngreso) {
this.h_fechaIngreso = h_fechaIngreso;
}
private String anio; private String anio;
private String GA_codigoGrupoAula; private String GA_codigoGrupoAula;
...@@ -85,12 +101,10 @@ public class Horario { ...@@ -85,12 +101,10 @@ public class Horario {
private String GA_cantidad; private String GA_cantidad;
//----------------------------------- //-----------------------------------
private String cadena; private String cadena;
private int maxGrupo; private int maxGrupo;
//----------------------------------- //-----------------------------------
private String GTS; private String GTS;
//----------------------------------- //-----------------------------------
...@@ -114,6 +128,61 @@ public class Horario { ...@@ -114,6 +128,61 @@ public class Horario {
return codigoSede; return codigoSede;
} }
public String getH_codigo_cur_reemp() {
return h_codigo_cur_reemp;
}
public void setH_codigo_cur_reemp(String h_codigo_cur_reemp) {
this.h_codigo_cur_reemp = h_codigo_cur_reemp;
}
public String getH_nombre_cur_reemp() {
return h_nombre_cur_reemp;
}
public void setH_nombre_cur_reemp(String h_nombre_cur_reemp) {
this.h_nombre_cur_reemp = h_nombre_cur_reemp;
}
public String getH_observacion() {
return h_observacion;
}
public void setH_observacion(String h_observacion) {
this.h_observacion = h_observacion;
}
public String getH_motivoCambio() {
return h_motivoCambio;
}
public void setH_motivoCambio(String h_motivoCambio) {
this.h_motivoCambio = h_motivoCambio;
}
public String getH_condicionTrabajador() {
return h_condicionTrabajador;
}
public void setH_condicionTrabajador(String h_condicionTrabajador) {
this.h_condicionTrabajador = h_condicionTrabajador;
}
public String getH_horaAviso() {
return h_horaAviso;
}
public void setH_horaAviso(String h_horaAviso) {
this.h_horaAviso = h_horaAviso;
}
public String getH_codigo_doc_reemp() {
return h_codigo_doc_reemp;
}
public void setH_codigo_doc_reemp(String h_codigo_doc_reemp) {
this.h_codigo_doc_reemp = h_codigo_doc_reemp;
}
public void setCodigoSede(String codigoSede) { public void setCodigoSede(String codigoSede) {
this.codigoSede = codigoSede; this.codigoSede = codigoSede;
...@@ -175,7 +244,6 @@ public class Horario { ...@@ -175,7 +244,6 @@ public class Horario {
this.cadena = cadena; this.cadena = cadena;
} }
private String codigoPlana; private String codigoPlana;
public String getArmarHoraio_codigo() { public String getArmarHoraio_codigo() {
...@@ -234,7 +302,6 @@ public class Horario { ...@@ -234,7 +302,6 @@ public class Horario {
this.h_hora = h_hora; this.h_hora = h_hora;
} }
public String getH_periodo() { public String getH_periodo() {
return h_periodo; return h_periodo;
} }
...@@ -251,7 +318,6 @@ public class Horario { ...@@ -251,7 +318,6 @@ public class Horario {
this.h_nombreUsuario = h_nombreUsuario; this.h_nombreUsuario = h_nombreUsuario;
} }
public String getH_codigoUsuario() { public String getH_codigoUsuario() {
return h_codigoUsuario; return h_codigoUsuario;
} }
...@@ -269,7 +335,6 @@ public class Horario { ...@@ -269,7 +335,6 @@ public class Horario {
this.h_nombreGrupo = h_nombreGrupo; this.h_nombreGrupo = h_nombreGrupo;
} }
public String getH_codigoHorarioCursoDocente() { public String getH_codigoHorarioCursoDocente() {
return h_codigoHorarioCursoDocente; return h_codigoHorarioCursoDocente;
} }
...@@ -382,9 +447,7 @@ public class Horario { ...@@ -382,9 +447,7 @@ public class Horario {
this.h_nombreDocente = h_nombreDocente; this.h_nombreDocente = h_nombreDocente;
} }
//------------------------------------- //-------------------------------------
public int getArmarHoraio_cantidad() { public int getArmarHoraio_cantidad() {
return ArmarHoraio_cantidad; return ArmarHoraio_cantidad;
} }
...@@ -417,7 +480,6 @@ public class Horario { ...@@ -417,7 +480,6 @@ public class Horario {
this.ArmarHoraio_codGru = ArmarHoraio_codGru; this.ArmarHoraio_codGru = ArmarHoraio_codGru;
} }
public String getNombreNivel() { public String getNombreNivel() {
return nombreNivel; return nombreNivel;
} }
...@@ -458,7 +520,6 @@ public class Horario { ...@@ -458,7 +520,6 @@ public class Horario {
this.nombreTurno = nombreTurno; this.nombreTurno = nombreTurno;
} }
public String getNombreCurso() { public String getNombreCurso() {
return nombreCurso; return nombreCurso;
} }
...@@ -475,7 +536,6 @@ public class Horario { ...@@ -475,7 +536,6 @@ public class Horario {
this.nombreSede = nombreSede; this.nombreSede = nombreSede;
} }
public int getCantidad() { public int getCantidad() {
return cantidad; return cantidad;
} }
...@@ -572,10 +632,6 @@ public class Horario { ...@@ -572,10 +632,6 @@ public class Horario {
this.estado_HorarioCursoDoc = estado_HorarioCursoDoc; this.estado_HorarioCursoDoc = estado_HorarioCursoDoc;
} }
public String getCodigoHorarioGrupo() { public String getCodigoHorarioGrupo() {
return codigoHorarioGrupo; return codigoHorarioGrupo;
} }
......
...@@ -22,6 +22,7 @@ public interface AulaDAO { ...@@ -22,6 +22,7 @@ public interface AulaDAO {
public int registrarAula(String codSede,String codTipoCentro,String codCentro,String codNivel,String codTipoGrado,String codGrado,String codSeccion,String codTurno) throws Exception; public int registrarAula(String codSede,String codTipoCentro,String codCentro,String codNivel,String codTipoGrado,String codGrado,String codSeccion,String codTurno) throws Exception;
public int consultarAula(String codSede,String codTipoCentro,String codCentro,String codNivel,String codTipoGrado,String codGrado,String codSeccion,String codTurno) throws Exception; public int consultarAula(String codSede,String codTipoCentro,String codCentro,String codNivel,String codTipoGrado,String codGrado,String codSeccion,String codTurno) throws Exception;
public String consultarAula(String codigoAula) throws Exception; public String consultarAula(String codigoAula) throws Exception;
public Aula getAula(String codigoAula) throws Exception;
public ArrayList<Aula> listaAulasEncuestadas(String codigoSede, String codigoEncuesta) throws Exception; public ArrayList<Aula> listaAulasEncuestadas(String codigoSede, String codigoEncuesta) throws Exception;
public String cantidadUsuariosAula() throws Exception; public String cantidadUsuariosAula() throws Exception;
public void crearUsuarioEncuestador(String codigoSede,String codigoAula, String nombreUsuario,String usuario, String clave,String cantidad) throws Exception; public void crearUsuarioEncuestador(String codigoSede,String codigoAula, String nombreUsuario,String usuario, String clave,String cantidad) throws Exception;
......
...@@ -7,6 +7,7 @@ package pe.siso.horario.DAO; ...@@ -7,6 +7,7 @@ package pe.siso.horario.DAO;
import java.util.ArrayList; import java.util.ArrayList;
import pe.siso.horario.Beans.Docente; import pe.siso.horario.Beans.Docente;
import pe.siso.horario.Beans.Horario;
/** /**
* *
...@@ -14,8 +15,14 @@ import pe.siso.horario.Beans.Docente; ...@@ -14,8 +15,14 @@ import pe.siso.horario.Beans.Docente;
*/ */
public interface DocenteDAO { public interface DocenteDAO {
public String darDeBaja(String codigo, String periodo, int usuario) throws Exception;
public ArrayList<Docente> listaDocentes() throws Exception; public ArrayList<Docente> listaDocentes() throws Exception;
public ArrayList<Horario> listarCambiosFijo(String fechaDesde,String fechaHasta) throws Exception;
public ArrayList<Horario> listarCambiosDia(String fechaDesde,String fechaHasta) throws Exception;
public ArrayList<Horario> listarBajasDocente(String fechaDesde,String fechaHasta) throws Exception;
public ArrayList<Docente> listaDocentes(String apellido) throws Exception; public ArrayList<Docente> listaDocentes(String apellido) throws Exception;
public ArrayList<Docente> listarDocenteScundaria() throws Exception; public ArrayList<Docente> listarDocenteScundaria() throws Exception;
...@@ -60,6 +67,7 @@ public interface DocenteDAO { ...@@ -60,6 +67,7 @@ public interface DocenteDAO {
public int registrarDatosEdit(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir) throws Exception; public int registrarDatosEdit(String codDocente, String telefono, String mail, int cod_dep, int cod_pro, int cod_dis, String cel, String dir) throws Exception;
public ArrayList<Docente> cargarDocentePrimaria(String codcurso) throws Exception; public ArrayList<Docente> cargarDocentePrimaria(String codcurso) throws Exception;
public ArrayList<Docente> cargarDocentePrimaria2(String codcurso, String apellido, int inicio, int cantidad) throws Exception;
public Docente listarDocenteSede(String local) throws Exception; public Docente listarDocenteSede(String local) throws Exception;
......
...@@ -23,7 +23,7 @@ public interface HorarioDAO{ ...@@ -23,7 +23,7 @@ public interface HorarioDAO{
public Bloque consultarCodigoGrupoTurno(String codAula) throws Exception; public Bloque consultarCodigoGrupoTurno(String codAula) throws Exception;
public Bloque consultarCodigoGrupoTurno() throws Exception; public Bloque consultarCodigoGrupoTurno() throws Exception;
public int registrarAsigCurDoceHorario(String codigoAula,String dia,String Posicionbloque,String Hini,String Hfin,String codigoTurno,String codigoCurso,String codigoDocente) throws Exception; public int registrarAsigCurDoceHorario(String codigoAula,String dia,String Posicionbloque,String Hini,String Hfin,String codigoTurno,String codigoCurso,String codigoDocente) throws Exception;
public int registrarAsigCurDoceHorario(String codigoAula,String dia,String Posicionbloque,String Hini,String Hfin,String codigoTurno,String codigoCurso,String codigoDocente,String periodo, String codigoGrupo,int codUsuario, int clase,String grupoAulas) throws Exception; public int registrarAsigCurDoceHorario(String codigoAula,String dia,String Posicionbloque,String Hini,String Hfin,String codigoTurno,String codigoCurso,String codigoDocente,String periodo, String codigoGrupo,int codUsuario, int clase,String grupoAulas,String historial,String motivoCambio, String observacion, String condicionTrabajador, String horaAviso) throws Exception;
public int registrarAsigCurDoceHorarioMasivo(String cadenaTotal,String hora_inicio,String hora_termino,String dia,String codigoTurno,String codigoCurso,String codigoDocente,String periodo, String codigoGrupo,int codUsuario, int clase) throws Exception; public int registrarAsigCurDoceHorarioMasivo(String cadenaTotal,String hora_inicio,String hora_termino,String dia,String codigoTurno,String codigoCurso,String codigoDocente,String periodo, String codigoGrupo,int codUsuario, int clase) throws Exception;
public int cantidadAsignado(String codAula,String dia,String posicionBloque) throws Exception; public int cantidadAsignado(String codAula,String dia,String posicionBloque) throws Exception;
......
...@@ -204,6 +204,49 @@ public class MySqlAulaDAO implements AulaDAO { ...@@ -204,6 +204,49 @@ public class MySqlAulaDAO implements AulaDAO {
} }
@Override @Override
public Aula getAula(String codigoAula) throws Exception {
Aula aula = new Aula();
String base = "horario";
Connection cnx = null;
try {
cnx = MySqlDAOFactory.obtenerConexion(base);
Statement st = cnx.createStatement();
String query = "SELECT aula.codaula,aula.codlocal,aula.codtipocentro,aula.cocentro,aula.codnivel,aula.codtipogrado,"
+ "aula.codgrado,aula.codseccion,aula.codturno,sede.des_loc,tipo_centro.destipocentro,centro.descentro,"
+ "nivel.desnivel,tipo_grado.destipogrado,grado.desgrado,seccion.desseccion,turno.desturno,aula.estado,aula.nombre FROM aula "
+ "INNER JOIN sede on sede.cod_loc=aula.codlocal "
+ "INNER JOIN tipo_centro on tipo_centro.codtipocentro=aula.codtipocentro "
+ "INNER JOIN centro on centro.codcentro=aula.cocentro "
+ "INNER JOIN nivel on nivel.codnivel=aula.codnivel "
+ "INNER JOIN tipo_grado on tipo_grado.codtipogrado=aula.codtipogrado "
+ "INNER JOIN grado on grado.codgrado=aula.codgrado "
+ "INNER JOIN seccion on seccion.codseccion=aula.codseccion "
+ "INNER JOIN turno on turno.codturno=aula.codturno "
+ "WHERE aula.codaula='" + codigoAula + "' and aula.anno=YEAR(CURDATE()) "
+ "ORDER BY sede.des_loc,tipo_centro.destipocentro,centro.descentro, "
+ "nivel.desnivel,tipo_grado.destipogrado,grado.desgrado,seccion.desseccion,turno.desturno";
ResultSet rs = st.executeQuery(query);
if (rs.next()) {
aula.setNombreLocal(rs.getString("des_loc"));
aula.setNombreTipoCentro(rs.getString("destipocentro"));
aula.setNombreNivel(rs.getString("desnivel"));
aula.setNombreTipoGrado(rs.getString("destipogrado"));
aula.setNombreGrado(rs.getString("desgrado"));
aula.setNombre(rs.getString("nombre"));
aula.setNombreTurno(rs.getString("desturno"));
}
} catch (Exception e) {
e.printStackTrace();
} finally {
cnx.close();
}
return aula;
}
@Override
public ArrayList<Aula> listaAulasEncuestadas(String codigoSede, String codigoEncuesta) throws Exception { public ArrayList<Aula> listaAulasEncuestadas(String codigoSede, String codigoEncuesta) throws Exception {
ArrayList<Aula> lista = new ArrayList<Aula>(); ArrayList<Aula> lista = new ArrayList<Aula>();
String base = "horario"; String base = "horario";
......
...@@ -6,10 +6,18 @@ ...@@ -6,10 +6,18 @@
package pe.siso.horario.MySqlDAO; package pe.siso.horario.MySqlDAO;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Statement; import java.sql.Statement;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.stream.Collectors;
import pe.siso.horario.Beans.Docente; import pe.siso.horario.Beans.Docente;
import pe.siso.horario.Beans.Horario;
import pe.siso.horario.DAO.DocenteDAO; import pe.siso.horario.DAO.DocenteDAO;
/** /**
...@@ -148,12 +156,13 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -148,12 +156,13 @@ public class MySqlDocenteDAO implements DocenteDAO {
cnx2 = MySqlDAOFactory.obtenerConexion(base2); cnx2 = MySqlDAOFactory.obtenerConexion(base2);
Statement st2 = cnx2.createStatement(); Statement st2 = cnx2.createStatement();
String query2 = "SELECT apellido,nombre,dni FROM personal WHERE codper = '" + codDOcenteP + "'"; String query2 = "SELECT apellido,nombre,dni,telefono FROM personal WHERE codper = '" + codDOcenteP + "'";
ResultSet rs3 = st2.executeQuery(query2); ResultSet rs3 = st2.executeQuery(query2);
if (rs3.next()) { if (rs3.next()) {
docente.setApe_pro(rs3.getString("apellido")); docente.setApe_pro(rs3.getString("apellido"));
docente.setNom_pro(rs3.getString("nombre")); docente.setNom_pro(rs3.getString("nombre"));
docente.setDni("dni"); docente.setDni("dni");
// docente.setTelefono("telefono");
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -195,7 +204,7 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -195,7 +204,7 @@ public class MySqlDocenteDAO implements DocenteDAO {
} }
@Override @Override
public ArrayList<Docente> buscarUsuarioDocente(String apellido, int inicio, int cantidad) throws Exception { public ArrayList<Docente> buscarUsuarioDocente(String apellido, int inicio, int cantidad) throws Exception { //checkpoint
ArrayList<Docente> lista = new ArrayList<Docente>(); ArrayList<Docente> lista = new ArrayList<Docente>();
String base = "sacoolive3"; String base = "sacoolive3";
Connection cnx = null; Connection cnx = null;
...@@ -748,7 +757,7 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -748,7 +757,7 @@ public class MySqlDocenteDAO implements DocenteDAO {
} }
@Override @Override
public ArrayList<Docente> cargarDocentePrimaria(String codcurso) throws Exception { public ArrayList<Docente> cargarDocentePrimaria(String codcurso) throws Exception { //checkpoint
ArrayList<Docente> lista = new ArrayList<Docente>(); ArrayList<Docente> lista = new ArrayList<Docente>();
String base = "nuevo"; String base = "nuevo";
Connection cnx = null; Connection cnx = null;
...@@ -781,6 +790,40 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -781,6 +790,40 @@ public class MySqlDocenteDAO implements DocenteDAO {
} }
@Override @Override
public ArrayList<Docente> cargarDocentePrimaria2(String codcurso, String apellido, int inicio, int cantidad) throws Exception { //checkpoint
ArrayList<Docente> lista = new ArrayList<Docente>();
String base = "nuevo";
Connection cnx = null;
try {
cnx = MySqlDAOFactory.obtenerConexion(base);
Statement st = cnx.createStatement();
String query = "";
if (codcurso.equals("30")) {
query = "SELECT codper,apellido,nombre,codcargo,dni FROM personal WHERE codcargo in (" + codcurso + ") AND retirado= '0' AND codlocal='L067' ORDER BY apellido,nombre LIMIT " + inicio + ", " + cantidad + " ";
} else {
query = "SELECT codper,apellido,nombre,codcargo,dni FROM personal WHERE codcargo in (" + codcurso + ") AND retirado= '0' and apellido LIKE '" + apellido + "%' ORDER BY apellido,nombre LIMIT " + inicio + ", " + cantidad + " ";
}
ResultSet rs = st.executeQuery(query);
System.out.println("cargarDocentePrimaria " + query);
while (rs.next()) {
Docente docente = new Docente();
docente.setCodDocenteId("P" + rs.getString("codper"));
docente.setApe_pro(rs.getString("apellido"));
docente.setNom_pro(rs.getString("nombre"));
docente.setCodigoCargo(rs.getString("codcargo"));
docente.setDni(rs.getString("codcargo"));
lista.add(docente);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
cnx.close();
}
return lista;
}
@Override
public Docente listarDocenteSede(String local) throws Exception { public Docente listarDocenteSede(String local) throws Exception {
ArrayList<Docente> lista = new ArrayList<Docente>(); ArrayList<Docente> lista = new ArrayList<Docente>();
Docente doc = new Docente(); Docente doc = new Docente();
...@@ -2150,4 +2193,259 @@ public class MySqlDocenteDAO implements DocenteDAO { ...@@ -2150,4 +2193,259 @@ public class MySqlDocenteDAO implements DocenteDAO {
return lista; return lista;
} }
@Override
public String darDeBaja(String codigo, String periodo, int usuario) throws Exception {
String respuesta = "";
int dato = 0;
String base = "horario";
Connection cnx = null;
ResultSet rs = null;
PreparedStatement pst = null;
Statement st = null;
try {
cnx = MySqlDAOFactory.obtenerConexion(base);
cnx.setAutoCommit(false);
st = cnx.createStatement();
String query = "SELECT cod_hcd,codAula,dia,pos_blo,hor_ini,hor_fin,cod_cur,cod_doc,cod_tur,cod_per,codGru FROM horario_curso_docente WHERE cod_doc = ? and cod_per= ? ";
pst = cnx.prepareStatement(query);
pst.setString(1, codigo);
pst.setString(2, periodo);
rs = pst.executeQuery();
while (rs.next()) {
String codHorarioDoc = rs.getString("cod_hcd");
String codAula = rs.getString("codAula");
String dia = rs.getString("dia");
String Posicionbloque = rs.getString("pos_blo");
String Hini = rs.getString("hor_ini");
String Hfin = rs.getString("hor_fin");
String codigoTurno = rs.getString("cod_tur");
String codigoCurso = rs.getString("cod_cur");
String codigoDocente = rs.getString("cod_doc");
String codPeriodo = rs.getString("cod_per");
String codigoGrupo = rs.getString("codGru");
String queryHistorial = "INSERT INTO historial_horario (codAula,dia,pos_blo,hor_ini,hor_fin,cod_tur,cod_cur,cod_doc,est_hcd,cod_per,codGru,fecha,hora,accion,cod_usu) "
+ "VALUES ('" + codAula + "','" + dia + "','" + Posicionbloque + "','" + Hini + "','" + Hfin + "','" + codigoTurno + "','" + codigoCurso + "','" + codigoDocente + "','1','" + codPeriodo + "','" + codigoGrupo + "',CURDATE(),CURTIME(),'DADO DE BAJA'," + usuario + ")";
st.executeUpdate(queryHistorial);
String queryDelete = "DELETE FROM horario_curso_docente WHERE cod_hcd='" + codHorarioDoc + "' ";
st.executeUpdate(queryDelete);
}
cnx.commit();
respuesta = "exito";
// System.out.println("asignarCoordinadorPlana=> "+query);
// dato = st.executeUpdate(query);
} catch (Exception e) {
e.printStackTrace();
respuesta = e.getMessage();
cnx.rollback();
} finally {
cnx.close();
}
return respuesta;
}
@Override
public ArrayList<Horario> listarCambiosFijo(String fechaDesde, String fechaHasta) throws Exception {
ArrayList<Horario> lista = new ArrayList<Horario>();
String base = "horario";
Connection cnx = null;
try {
cnx = MySqlDAOFactory.obtenerConexion(base);
String query = ""
+ "select "
+ "cod_usu, "
+ "codAula, "
+ "dia, "
+ "hor_ini, "
+ "hor_fin, "
+ "c1.nom_cur curso, "
+ "c2.nom_cur curso_reemp, "
+ "cod_doc, "
+ "date_format(fecha, '%d/%m/%Y') fecha, "
+ "date_format(adddate(fecha,7), '%d/%m/%Y') fechaIngreso, "
+ "hora, "
+ "cod_doc_reemp, "
+ "motivoCambio, "
+ "observacion, "
+ "condicionTrabajador "
+ "from historial_horario hh "
+ "inner join curso c1 "
+ "on c1.cod_cur = hh.cod_cur "
+ "inner join curso c2 "
+ "on c2.cod_cur = hh.cod_cur_reemp "
+ "where accion = 'CAMBIO FIJO' "
+ "and est_hcd = 1 "
// + "and date_format(fecha, '%d/%m/%Y') between ? and ? ";
+ "and fecha between ? and ? ";
PreparedStatement st = cnx.prepareStatement(query);
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date fechaInicio = dateFormat.parse(fechaDesde);
Date fechaFin = dateFormat.parse(fechaHasta);
st.setTimestamp(1, new Timestamp(fechaInicio.getTime()));
st.setTimestamp(2, new Timestamp(fechaFin.getTime()));
ResultSet rs = st.executeQuery();
while (rs.next()) {
Horario h = new Horario();
h.setH_codigoUsuario(rs.getString("cod_usu"));
h.setH_codigoAula(rs.getString("codAula"));
h.setH_dia(rs.getString("dia"));
h.setH_horarioInicio(rs.getString("hor_ini"));
h.setH_horarioFinal(rs.getString("hor_fin"));
h.setH_nombreCurso(rs.getString("curso"));
h.setH_nombre_cur_reemp(rs.getString("curso_reemp"));
h.setH_codigoDocente(rs.getString("cod_doc"));
h.setH_fecha(rs.getString("fecha"));
h.setH_hora(rs.getString("hora"));
h.setH_codigo_doc_reemp(rs.getString("cod_doc_reemp"));
h.setH_motivoCambio(rs.getString("motivoCambio"));
h.setH_condicionTrabajador(rs.getString("condicionTrabajador"));
h.setH_observacion(rs.getString("observacion"));
h.setH_fechaIngreso(rs.getString("fechaIngreso"));
lista.add(h);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
cnx.close();
}
return lista;
}
@Override
public ArrayList<Horario> listarCambiosDia(String fechaDesde, String fechaHasta) throws Exception {
ArrayList<Horario> lista = new ArrayList<Horario>();
String base = "horario";
Connection cnx = null;
try {
cnx = MySqlDAOFactory.obtenerConexion(base);
String query = ""
+ "select "
+ "cod_usu, "
+ "codAula, "
+ "dia, "
+ "hor_ini, "
+ "hor_fin, "
+ "c1.nom_cur curso, "
+ "c2.nom_cur curso_reemp, "
+ "cod_doc, "
+ "date_format(fecha, '%d/%m/%Y') fecha, "
+ "hora, "
+ "cod_doc_reemp, "
+ "motivoCambio, "
+ "observacion, "
+ "horaAviso "
+ "from historial_horario hh "
+ "inner join curso c1 "
+ "on c1.cod_cur = hh.cod_cur "
+ "inner join curso c2 "
+ "on c2.cod_cur = hh.cod_cur_reemp "
+ "where accion = 'CAMBIO DIA' "
+ "and est_hcd = 1 "
// + "and date_format(fecha, '%d/%m/%Y') between ? and ? ";
+ "and fecha between ? and ? ";
PreparedStatement st = cnx.prepareStatement(query);
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date fechaInicio = dateFormat.parse(fechaDesde);
Date fechaFin = dateFormat.parse(fechaHasta);
st.setTimestamp(1, new Timestamp(fechaInicio.getTime()));
st.setTimestamp(2, new Timestamp(fechaFin.getTime()));
ResultSet rs = st.executeQuery();
while (rs.next()) {
Horario h = new Horario();
h.setH_codigoUsuario(rs.getString("cod_usu"));
h.setH_codigoAula(rs.getString("codAula"));
h.setH_dia(rs.getString("dia"));
h.setH_horarioInicio(rs.getString("hor_ini"));
h.setH_horarioFinal(rs.getString("hor_fin"));
h.setH_nombreCurso(rs.getString("curso"));
h.setH_nombre_cur_reemp(rs.getString("curso_reemp"));
h.setH_codigoDocente(rs.getString("cod_doc"));
h.setH_fecha(rs.getString("fecha"));
h.setH_hora(rs.getString("hora"));
h.setH_codigo_doc_reemp(rs.getString("cod_doc_reemp"));
h.setH_observacion(rs.getString("observacion"));
h.setH_motivoCambio(rs.getString("motivoCambio"));
h.setH_horaAviso(rs.getString("horaAviso"));
lista.add(h);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
cnx.close();
}
return lista;
}
@Override
public ArrayList<Horario> listarBajasDocente(String fechaDesde, String fechaHasta) throws Exception {
ArrayList<Horario> lista = new ArrayList<Horario>();
String base = "horario";
Connection cnx = null;
try {
cnx = MySqlDAOFactory.obtenerConexion(base);
String query = ""
+ "select "
+ "cod_doc, "
+ "s.des_loc, "
+ "GROUP_CONCAT(DISTINCT p.nom_pla) curso, "
+ "date_format(fecha, '%d/%m/%Y') fecha "
+ "from historial_horario hh "
+ "inner join aula a "
+ "on hh.codAula = a.codaula "
+ "inner join sede s "
+ "on s.cod_loc = a.codlocal "
+ "inner join curso c "
+ "on c.cod_cur = hh.cod_cur "
+ "inner join plana p "
+ "on p.cod_pla = c.cod_pla "
+ "where accion = 'DADO DE BAJA' "
+ "and est_hcd = 1 "
+ "and fecha between ? and ? "
+ "GROUP BY "
+ "cod_doc, "
+ "s.cod_loc ";
PreparedStatement st = cnx.prepareStatement(query);
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date fechaInicio = dateFormat.parse(fechaDesde);
Date fechaFin = dateFormat.parse(fechaHasta);
st.setTimestamp(1, new Timestamp(fechaInicio.getTime()));
st.setTimestamp(2, new Timestamp(fechaFin.getTime()));
ResultSet rs = st.executeQuery();
while (rs.next()) {
Horario h = new Horario();
h.setH_codigoDocente(rs.getString("cod_doc"));
h.setNombreSede(rs.getString("des_loc"));
h.setNombreCurso(rs.getString("curso"));
h.setH_fecha(rs.getString("fecha"));
lista.add(h);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
cnx.close();
}
return lista;
}
} }
...@@ -734,9 +734,11 @@ public class MySqlHorarioDAO implements HorarioDAO { ...@@ -734,9 +734,11 @@ public class MySqlHorarioDAO implements HorarioDAO {
} }
@Override @Override
public int registrarAsigCurDoceHorario(String codigoAula, String dia, String Posicionbloque, String Hini, String Hfin, String codigoTurno, String codigoCurso, String codigoDocente, String periodo, String codigoGrupo, int codUsuario, int clase, String grupoAulas) throws Exception { public int registrarAsigCurDoceHorario(String codigoAula, String dia, String Posicionbloque, String Hini, String Hfin, String codigoTurno, String codigoCurso, String codigoDocente, String periodo, String codigoGrupo, int codUsuario, int clase, String grupoAulas, String historial,String motivoCambio, String observacion, String condicionTrabajador, String horaAviso) throws Exception {
int dato = 0; int dato = 0;
int codHorario = 0; int codHorario = 0;
String codDocReemp = "";
String codCurReemp = "";
int cantCruce = 0; int cantCruce = 0;
int libre = 0; int libre = 0;
String base = "horario"; String base = "horario";
...@@ -753,11 +755,13 @@ public class MySqlHorarioDAO implements HorarioDAO { ...@@ -753,11 +755,13 @@ public class MySqlHorarioDAO implements HorarioDAO {
libre = libreRS.getInt("cant"); libre = libreRS.getInt("cant");
} }
String queryCant = "SELECT cod_hcd FROM horario_curso_docente WHERE codAula='" + codigoAula + "' and dia='" + dia + "' and pos_blo='" + Posicionbloque + "' and cod_per='" + periodo + "'"; String queryCant = "SELECT cod_hcd,cod_doc,cod_cur FROM horario_curso_docente WHERE codAula='" + codigoAula + "' and dia='" + dia + "' and pos_blo='" + Posicionbloque + "' and cod_per='" + periodo + "'";
System.out.println(">>>>-(1) codHorario-> " + queryCant); System.out.println(">>>>-(1) codHorario-> " + queryCant);
ResultSet rsCant = st.executeQuery(queryCant); ResultSet rsCant = st.executeQuery(queryCant);
if (rsCant.next()) { if (rsCant.next()) {
codHorario = rsCant.getInt("cod_hcd"); codHorario = rsCant.getInt("cod_hcd");
codDocReemp = rsCant.getString("cod_doc");
codCurReemp = rsCant.getString("cod_cur");
} }
System.out.println("kokoko " + codHorario); System.out.println("kokoko " + codHorario);
...@@ -826,8 +830,27 @@ public class MySqlHorarioDAO implements HorarioDAO { ...@@ -826,8 +830,27 @@ public class MySqlHorarioDAO implements HorarioDAO {
System.out.println("UPDATE -->> " + queryUpdate); System.out.println("UPDATE -->> " + queryUpdate);
dato = st.executeUpdate(queryUpdate); dato = st.executeUpdate(queryUpdate);
String queryHH1 = "INSERT INTO historial_horario (codAula,dia,pos_blo,hor_ini,hor_fin,cod_tur,cod_cur,cod_doc,est_hcd,cod_per,codGru,fecha,hora,accion,cod_usu) " String estado = "";
+ "VALUES ('" + codigoAula + "','" + dia + "','" + Posicionbloque + "','" + Hini + "','" + Hfin + "','" + codigoTurno + "','" + codigoCurso + "','" + codigoDocente + "','1','" + periodo + "','" + codigoGrupo + "',CURDATE(),CURTIME(),'ACTUALIZADO'," + codUsuario + ")"; String queryHH1 = "";
switch (historial) {
case "editar":
estado = "ACTUALIZADO";
queryHH1 = "INSERT INTO historial_horario (codAula,dia,pos_blo,hor_ini,hor_fin,cod_tur,cod_cur,cod_doc,est_hcd,cod_per,codGru,fecha,hora,accion,cod_usu,cod_doc_reemp,cod_cur_reemp) "
+ "VALUES ('" + codigoAula + "','" + dia + "','" + Posicionbloque + "','" + Hini + "','" + Hfin + "','" + codigoTurno + "','" + codigoCurso + "','" + codigoDocente + "','1','" + periodo + "','" + codigoGrupo + "',CURDATE(),CURTIME(),'" + estado + "'," + codUsuario + ",'" + codDocReemp + "','" + codCurReemp + "')";
break;
case "cambioFijo":
estado = "CAMBIO FIJO";
queryHH1 = "INSERT INTO historial_horario (codAula,dia,pos_blo,hor_ini,hor_fin,cod_tur,cod_cur,cod_doc,est_hcd,cod_per,codGru,fecha,hora,accion,cod_usu,cod_doc_reemp,motivoCambio,observacion,condicionTrabajador,cod_cur_reemp) "
+ "VALUES ('" + codigoAula + "','" + dia + "','" + Posicionbloque + "','" + Hini + "','" + Hfin + "','" + codigoTurno + "','" + codigoCurso + "','" + codigoDocente + "','1','" + periodo + "','" + codigoGrupo + "',CURDATE(),CURTIME(),'" + estado + "'," + codUsuario + ",'" + codDocReemp + "','" + motivoCambio + "','" + observacion + "','" + condicionTrabajador + "','" + codCurReemp +"')";
break;
case "cambioDia":
estado = "CAMBIO DIA";
queryHH1 = "INSERT INTO historial_horario (codAula,dia,pos_blo,hor_ini,hor_fin,cod_tur,cod_cur,cod_doc,est_hcd,cod_per,codGru,fecha,hora,accion,cod_usu,cod_doc_reemp,motivoCambio,observacion,horaAviso,cod_cur_reemp) "
+ "VALUES ('" + codigoAula + "','" + dia + "','" + Posicionbloque + "','" + Hini + "','" + Hfin + "','" + codigoTurno + "','" + codigoCurso + "','" + codigoDocente + "','1','" + periodo + "','" + codigoGrupo + "',CURDATE(),CURTIME(),'" + estado + "'," + codUsuario + ",'" + codDocReemp + "','" + motivoCambio + "','" + observacion + "','" + horaAviso +"','" + codCurReemp + "')";
break;
default:
}
dato = st.executeUpdate(queryHH1); dato = st.executeUpdate(queryHH1);
} }
......
...@@ -73,6 +73,16 @@ public class AulaServices { ...@@ -73,6 +73,16 @@ public class AulaServices {
} }
return aula; return aula;
} }
public Aula getAula(String codigoAula){
Aula aula= new Aula();
try {
aula=objAulaDAO.getAula(codigoAula);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return aula;
}
public ArrayList<Aula> listaAulasEncuestadas(String codigoSede, String codigoEncuesta){ public ArrayList<Aula> listaAulasEncuestadas(String codigoSede, String codigoEncuesta){
ArrayList<Aula> lista=null; ArrayList<Aula> lista=null;
......
...@@ -7,6 +7,7 @@ package pe.siso.horario.Services; ...@@ -7,6 +7,7 @@ package pe.siso.horario.Services;
import java.util.ArrayList; import java.util.ArrayList;
import pe.siso.horario.Beans.Docente; import pe.siso.horario.Beans.Docente;
import pe.siso.horario.Beans.Horario;
import pe.siso.horario.DAO.DAOFactory; import pe.siso.horario.DAO.DAOFactory;
import pe.siso.horario.DAO.DocenteDAO; import pe.siso.horario.DAO.DocenteDAO;
...@@ -19,6 +20,39 @@ public class DocenteServices { ...@@ -19,6 +20,39 @@ public class DocenteServices {
DAOFactory fabrica = DAOFactory.getDAOFactory(DAOFactory.MYSQL); DAOFactory fabrica = DAOFactory.getDAOFactory(DAOFactory.MYSQL);
DocenteDAO objDocenteDAO = fabrica.getDocenteDAO(); DocenteDAO objDocenteDAO = fabrica.getDocenteDAO();
public ArrayList<Horario> listarCambiosFijo(String fechaDesde, String fechaHasta){
ArrayList<Horario> lista = null;
try {
lista = objDocenteDAO.listarCambiosFijo(fechaDesde, fechaHasta);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return lista;
}
public ArrayList<Horario> listarCambiosDia(String fechaDesde, String fechaHasta){
ArrayList<Horario> lista = null;
try {
lista = objDocenteDAO.listarCambiosDia(fechaDesde, fechaHasta);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return lista;
}
public ArrayList<Horario> listarBajasDocente(String fechaDesde, String fechaHasta){
ArrayList<Horario> lista = null;
try {
lista = objDocenteDAO.listarBajasDocente(fechaDesde, fechaHasta);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return lista;
}
public ArrayList<Docente> listaDocentes() { public ArrayList<Docente> listaDocentes() {
ArrayList<Docente> lista = null; ArrayList<Docente> lista = null;
try { try {
...@@ -30,6 +64,17 @@ public class DocenteServices { ...@@ -30,6 +64,17 @@ public class DocenteServices {
return lista; return lista;
} }
public String darDeBaja(String codigo, String periodo, int usuario) {
String respuesta = "";
try {
respuesta = objDocenteDAO.darDeBaja(codigo,periodo,usuario);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return respuesta;
}
public ArrayList<Docente> listaDocentes(String apellido) { public ArrayList<Docente> listaDocentes(String apellido) {
ArrayList<Docente> lista = null; ArrayList<Docente> lista = null;
try { try {
...@@ -272,6 +317,16 @@ public class DocenteServices { ...@@ -272,6 +317,16 @@ public class DocenteServices {
} }
return lista; return lista;
} }
public ArrayList<Docente> cargarDocentePrimaria2(String codcurso,String apellido,int inicio,int cantidad) {
ArrayList<Docente> lista = null;
try {
lista = objDocenteDAO.cargarDocentePrimaria2(codcurso,apellido,inicio, cantidad);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return lista;
}
public Docente listarDocenteSede(String local) { public Docente listarDocenteSede(String local) {
Docente docente = new Docente(); Docente docente = new Docente();
......
...@@ -290,10 +290,10 @@ public class HorarioServices { ...@@ -290,10 +290,10 @@ public class HorarioServices {
} }
public int registrarAsigCurDoceHorario(String codigoAula, String dia, String Posicionbloque, String Hini, String Hfin, String codigoTurno, String codigoCurso, String codigoDocente, String periodo, String codigoGrupo,int codUsuario,int clase,String grupoAulas){ public int registrarAsigCurDoceHorario(String codigoAula, String dia, String Posicionbloque, String Hini, String Hfin, String codigoTurno, String codigoCurso, String codigoDocente, String periodo, String codigoGrupo,int codUsuario,int clase,String grupoAulas,String historial,String motivoCambio, String observacion, String condicionTrabajador, String horaAviso){
int dato=0; int dato=0;
try { try {
dato=objHorarioDAO.registrarAsigCurDoceHorario(codigoAula, dia, Posicionbloque, Hini, Hfin, codigoTurno, codigoCurso, codigoDocente, periodo, codigoGrupo, codUsuario,clase,grupoAulas); dato=objHorarioDAO.registrarAsigCurDoceHorario(codigoAula, dia, Posicionbloque, Hini, Hfin, codigoTurno, codigoCurso, codigoDocente, periodo, codigoGrupo, codUsuario,clase,grupoAulas,historial,motivoCambio, observacion, condicionTrabajador, horaAviso);
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
......
...@@ -24,6 +24,7 @@ import pe.siso.horario.Beans.PeriodoAcademico; ...@@ -24,6 +24,7 @@ import pe.siso.horario.Beans.PeriodoAcademico;
import pe.siso.horario.Beans.Plana; import pe.siso.horario.Beans.Plana;
import pe.siso.horario.Beans.PlanaDocente; import pe.siso.horario.Beans.PlanaDocente;
import pe.siso.horario.Beans.UbigeoDocente; import pe.siso.horario.Beans.UbigeoDocente;
import pe.siso.horario.Beans.Usuario;
import pe.siso.horario.Services.AreaDocenteServices; import pe.siso.horario.Services.AreaDocenteServices;
import pe.siso.horario.Services.AreaServices; import pe.siso.horario.Services.AreaServices;
import pe.siso.horario.Services.DisponibilidadServices; import pe.siso.horario.Services.DisponibilidadServices;
...@@ -91,6 +92,8 @@ public class ServletDocente extends HttpServlet { ...@@ -91,6 +92,8 @@ public class ServletDocente extends HttpServlet {
actualizarDatos(request, response); actualizarDatos(request, response);
} else if ("registraDatosDocenteEdit".equals(param)) { } else if ("registraDatosDocenteEdit".equals(param)) {
registraDatosDocenteEdit(request, response); registraDatosDocenteEdit(request, response);
} else if ("darDeBaja".equals(param)) {
darDeBaja(request, response);
} else if ("buscarDocenteHorario".equals(param)) { } else if ("buscarDocenteHorario".equals(param)) {
buscarDocenteHorario(request, response); buscarDocenteHorario(request, response);
} else if ("armarDocenteHorario".equals(param)) { } else if ("armarDocenteHorario".equals(param)) {
...@@ -2147,7 +2150,7 @@ public class ServletDocente extends HttpServlet { ...@@ -2147,7 +2150,7 @@ public class ServletDocente extends HttpServlet {
+ " <td align='center'>" + nombres + "</td>" + " <td align='center'>" + nombres + "</td>"
+ " <td align='center'>" + lista.get(i).getTelefono() + "</td>" + " <td align='center'>" + lista.get(i).getTelefono() + "</td>"
+ " <td align='center'>" + lista.get(i).getCell() + "</td>" + " <td align='center'>" + lista.get(i).getCell() + "</td>"
+ " <td align='center'>" + lista.get(i).getCorreo() + "<input type='hidden' value='"+lista.get(i).getCorreo()+"' id='correo' ></td>" + " <td align='center'>" + lista.get(i).getCorreo() + "<input type='hidden' value='" + lista.get(i).getCorreo() + "' id='correo' ></td>"
+ " <td align='center'>" + lista.get(i).getNombreDep() + "</td>" + " <td align='center'>" + lista.get(i).getNombreDep() + "</td>"
+ " <td align='center'>" + lista.get(i).getNombrePro() + "</td>" + " <td align='center'>" + lista.get(i).getNombrePro() + "</td>"
+ " <td align='center'>" + lista.get(i).getNombreDDis() + "</td>" + " <td align='center'>" + lista.get(i).getNombreDDis() + "</td>"
...@@ -2420,7 +2423,7 @@ public class ServletDocente extends HttpServlet { ...@@ -2420,7 +2423,7 @@ public class ServletDocente extends HttpServlet {
pw.println(dato); pw.println(dato);
} }
private void buscarDocenteHorario(HttpServletRequest request, HttpServletResponse response) throws IOException { private void buscarDocenteHorario(HttpServletRequest request, HttpServletResponse response) throws IOException { //checkpoint
DocenteServices servicios = new DocenteServices(); DocenteServices servicios = new DocenteServices();
HorarioServices servicios2 = new HorarioServices(); HorarioServices servicios2 = new HorarioServices();
...@@ -2435,6 +2438,18 @@ public class ServletDocente extends HttpServlet { ...@@ -2435,6 +2438,18 @@ public class ServletDocente extends HttpServlet {
int inicio = (pagina - 1) * cantidad; int inicio = (pagina - 1) * cantidad;
int cantRegistro = 0; int cantRegistro = 0;
lista = servicios.buscarUsuarioDocente(apellido, inicio, cantidad); lista = servicios.buscarUsuarioDocente(apellido, inicio, cantidad);
String cargos = "41,57,102,95,11,51,30,33,19";
ArrayList<Docente> lista2 = servicios.cargarDocentePrimaria2(cargos, apellido, inicio, cantidad - lista.size());
for (Docente docente : lista2) {
Docente docente1 = lista.stream()
.filter(docente2 -> docente2.getDni().equals(docente.getDni()))
.findAny()
.orElse(null);
if (docente1 == null) {
lista.add(docente);
}
}
cantRegistro = servicios.cantListaDocente(apellido); cantRegistro = servicios.cantListaDocente(apellido);
//=============CALCULO DE PAGINADO============= //=============CALCULO DE PAGINADO=============
...@@ -2483,6 +2498,7 @@ public class ServletDocente extends HttpServlet { ...@@ -2483,6 +2498,7 @@ public class ServletDocente extends HttpServlet {
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"2\" colspan=\"1\">NOMBRES</th>" + " <th tabindex=\"0\" class=\"center\" rowspan=\"2\" colspan=\"1\">NOMBRES</th>"
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"2\" colspan=\"1\">VER HORARIO</th>" + " <th tabindex=\"0\" class=\"center\" rowspan=\"2\" colspan=\"1\">VER HORARIO</th>"
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"2\" colspan=\"1\">EXPORTAR</th>" + " <th tabindex=\"0\" class=\"center\" rowspan=\"2\" colspan=\"1\">EXPORTAR</th>"
+ " <th tabindex=\"0\" class=\"center\" rowspan=\"2\" colspan=\"1\">BAJA</th>"
+ " </tr>" + " </tr>"
+ " </thead>" + " </thead>"
+ " <tbody>"); + " <tbody>");
...@@ -2495,7 +2511,7 @@ public class ServletDocente extends HttpServlet { ...@@ -2495,7 +2511,7 @@ public class ServletDocente extends HttpServlet {
cont_ini = cont; cont_ini = cont;
} }
//int cDoc = lista.get(i).getCod_pro(); //int cDoc = lista.get(i).getCod_pro();
String codDocente = lista.get(i).getCod_pro(); String codDocente = lista.get(i).getCod_pro() == null ? lista.get(i).getCodDocenteId() : lista.get(i).getCod_pro();
cant = servicios2.cantidadAsignadoCursosDoc(codDocente, periodo); cant = servicios2.cantidadAsignadoCursosDoc(codDocente, periodo);
String nombre = lista.get(i).getApe_pro() + ", " + lista.get(i).getNom_pro(); String nombre = lista.get(i).getApe_pro() + ", " + lista.get(i).getNom_pro();
if (cont % 2 == 0) { if (cont % 2 == 0) {
...@@ -2511,29 +2527,36 @@ public class ServletDocente extends HttpServlet { ...@@ -2511,29 +2527,36 @@ public class ServletDocente extends HttpServlet {
if (cant > 0) { if (cant > 0) {
pw.println(" " pw.println(" "
+ " <td align='center'>" + " <td align='center'>"
+ " <a title='Horario detallado' href=\"javascript:armarHorarioDocente2(" + lista.get(i).getCod_pro() + ",'" + nombre + "');\" class=\"regular\" >" + " <a title='Horario detallado' href=\"javascript:armarHorarioDocente2('" + codDocente + "','" + nombre + "');\" class=\"regular\" >"
+ " <img src=\"imagenes/icons/zoom.png\" />" + " <img src=\"imagenes/icons/zoom.png\" />"
+ " </a>" + " </a>"
+ " | <a title='Horario corto' href=\"javascript:armarHorarioDocente(" + lista.get(i).getCod_pro() + ",'" + nombre + "');\" class=\"regular\" >" + " | <a title='Horario corto' href=\"javascript:armarHorarioDocente('" + codDocente + "','" + nombre + "');\" class=\"regular\" >"
+ " <img src=\"imagenes/icons/zoom.png\" />" + " <img src=\"imagenes/icons/zoom.png\" />"
+ " </a>" + " </a>"
+ " </td>" + " </td>"
);//tiene cursos asignados );//tiene cursos asignados
pw.println("<!--<td align='center'>" pw.println("<!--<td align='center'>"
+ " <a href=\"javascript:exportar(" + lista.get(i).getCod_pro() + ");\" class=\"regular\" >" + " <a href=\"javascript:exportar('" + codDocente + "');\" class=\"regular\" >"
+ " <img src=\"imagenes/icons/export_excel.png\" />" + " <img src=\"imagenes/icons/export_excel.png\" />"
+ " </a>" + " </a>"
+ "</td>-->" + "</td>-->"
+ "<td align='center'>" + "<td align='center'>"
+ " <a title='Horario corto' href=\"javascript:exportarCompletoReducido(" + lista.get(i).getCod_pro() + ");\" class=\"regular\" >" + " <a title='Horario corto' href=\"javascript:exportarCompletoReducido('" + codDocente + "');\" class=\"regular\" >"
+ " <img src=\"imagenes/icons/export_excel.png\" />" + " <img src=\"imagenes/icons/export_excel.png\" />"
+ " </a>" + " </a>"
+ " | " + " | "
+ " <a title='Horario detallado' href=\"javascript:exportarCompleto(" + lista.get(i).getCod_pro() + ");\" class=\"regular\" >" + " <a title='Horario detallado' href=\"javascript:exportarCompleto('" + codDocente + "');\" class=\"regular\" >"
+ " <img src=\"imagenes/icons/export_excel.png\" />" + " <img src=\"imagenes/icons/export_excel.png\" />"
+ " </a>" + " </a>"
+ "</td>" + "</td>"
); );
pw.println("<td align='center'>"
+ " <a title='Dar de baja' href=\"javascript:darDeBaja('" + codDocente + "');\" class=\"regular\" >"
+ " <i class='ace-icon fa fa-user-times red'></i>"
+ " </a>"
+ "</td>"
);
} else { } else {
pw.println(" <td align='center'><font color='red'><b>No tiene cursos</b></font></td>" pw.println(" <td align='center'><font color='red'><b>No tiene cursos</b></font></td>"
);//no tiene cursos );//no tiene cursos
...@@ -2541,9 +2564,11 @@ public class ServletDocente extends HttpServlet { ...@@ -2541,9 +2564,11 @@ public class ServletDocente extends HttpServlet {
+ " </td>-->" + " </td>-->"
+ " <td align='center'> <font color='red'><b>No tiene cursos</b></font>" + " <td align='center'> <font color='red'><b>No tiene cursos</b></font>"
+ " </td>" + " </td>"
+ "<td></td>"
); );
} }
pw.println("</tr>"); pw.println("</tr>");
cont++; cont++;
} }
...@@ -2551,7 +2576,7 @@ public class ServletDocente extends HttpServlet { ...@@ -2551,7 +2576,7 @@ public class ServletDocente extends HttpServlet {
cont_fin = cont - 1; cont_fin = cont - 1;
if (cont == 1) { if (cont == 1) {
pw.println("<tr><td colspan='5' align='center'>No hay resultados de búsqueda</td></tr>"); pw.println("<tr><td colspan='6' align='center'>No hay resultados de búsqueda</td></tr>");
} }
pw.println(" </tbody>" pw.println(" </tbody>"
...@@ -5920,5 +5945,16 @@ public class ServletDocente extends HttpServlet { ...@@ -5920,5 +5945,16 @@ public class ServletDocente extends HttpServlet {
pw.println("</div>"); pw.println("</div>");
} }
private void darDeBaja(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
HttpSession session_actual = request.getSession(true);
Usuario usuario = (Usuario) session_actual.getAttribute("usuario");
String codigo = request.getParameter("codigo");
String periodo = request.getParameter("periodo");
DocenteServices service = new DocenteServices();
String respuesta = service.darDeBaja(codigo, periodo, usuario.getCodigoUsuario());
pw.print(respuesta);
}
} }
...@@ -2910,7 +2910,7 @@ public class ServletHorario extends HttpServlet { ...@@ -2910,7 +2910,7 @@ public class ServletHorario extends HttpServlet {
+ " </p>\n" + " </p>\n"
+ " <ul class=\"dropdown-menu dropdown-only-icon dropdown-yellow dropdown-caret dropdown-close dropdown-menu-right\">\n" + " <ul class=\"dropdown-menu dropdown-only-icon dropdown-yellow dropdown-caret dropdown-close dropdown-menu-right\">\n"
+ " <li>\n" + " <li>\n"
+ " <a title=\"Editar\" class=\"tooltip-success\" href=\"javascript:editar('" + DatosHorario.getH_codigoAula() + "','" + diaPos + "','" + diaGen + "','" + HorIni + "','" + HorFin + "','" + codigo + "','" + contGenral + "','" + DatosHorario.getH_codigoDocente() + "','" + DatosHorario.getH_codigoCurso() + "','" + DatosHorario.getH_clase() + "' );\" data-original-title=\"Mark&nbsp;as&nbsp;done\" data-rel=\"tooltip\">\n" + " <a title=\"Editar\" class=\"tooltip-success\" href=\"javascript:editar('" + DatosHorario.getH_codigoAula() + "','" + diaPos + "','" + diaGen + "','" + HorIni + "','" + HorFin + "','" + codigo + "','" + contGenral + "','" + DatosHorario.getH_codigoDocente() + "','" + DatosHorario.getH_codigoCurso() + "','" + DatosHorario.getH_clase() + "','editar' );\" data-original-title=\"Mark&nbsp;as&nbsp;done\" data-rel=\"tooltip\">\n"
+ " <span class=\"green\">\n" + " <span class=\"green\">\n"
+ " <i class=\"ace-icon fa fa-pencil bigger-110\"></i>\n" + " <i class=\"ace-icon fa fa-pencil bigger-110\"></i>\n"
+ " Editar" + " Editar"
...@@ -2918,7 +2918,7 @@ public class ServletHorario extends HttpServlet { ...@@ -2918,7 +2918,7 @@ public class ServletHorario extends HttpServlet {
+ " </a>\n" + " </a>\n"
+ " </li>\n" + " </li>\n"
+ " <li>\n" + " <li>\n"
+ " <a title=\"Editar\" class=\"tooltip-success\" href=\"javascript:cambioFijo('" + DatosHorario.getH_codigoAula() + "','" + diaPos + "','" + diaGen + "','" + HorIni + "','" + HorFin + "','" + codigo + "','" + contGenral + "','" + DatosHorario.getH_codigoDocente() + "','" + DatosHorario.getH_codigoCurso() + "','" + DatosHorario.getH_clase() + "' );\" data-original-title=\"Mark&nbsp;as&nbsp;done\" data-rel=\"tooltip\">\n" + " <a title=\"Editar\" class=\"tooltip-success\" href=\"javascript:cambioFijo('" + DatosHorario.getH_codigoAula() + "','" + diaPos + "','" + diaGen + "','" + HorIni + "','" + HorFin + "','" + codigo + "','" + contGenral + "','" + DatosHorario.getH_codigoDocente() + "','" + DatosHorario.getH_codigoCurso() + "','" + DatosHorario.getH_clase() + "','cambioFijo' );\" data-original-title=\"Mark&nbsp;as&nbsp;done\" data-rel=\"tooltip\">\n"
+ " <span class=\"green\">\n" + " <span class=\"green\">\n"
+ " <i class=\"ace-icon fa fa-pencil bigger-110\"></i>\n" + " <i class=\"ace-icon fa fa-pencil bigger-110\"></i>\n"
+ " Cambio fijo" + " Cambio fijo"
...@@ -2926,7 +2926,7 @@ public class ServletHorario extends HttpServlet { ...@@ -2926,7 +2926,7 @@ public class ServletHorario extends HttpServlet {
+ " </a>\n" + " </a>\n"
+ " </li>\n" + " </li>\n"
+ " <li>\n" + " <li>\n"
+ " <a title=\"Editar\" class=\"tooltip-success\" href=\"javascript:cambioDia('" + DatosHorario.getH_codigoAula() + "','" + diaPos + "','" + diaGen + "','" + HorIni + "','" + HorFin + "','" + codigo + "','" + contGenral + "','" + DatosHorario.getH_codigoDocente() + "','" + DatosHorario.getH_codigoCurso() + "','" + DatosHorario.getH_clase() + "' );\" data-original-title=\"Mark&nbsp;as&nbsp;done\" data-rel=\"tooltip\">\n" + " <a title=\"Editar\" class=\"tooltip-success\" href=\"javascript:cambioDia('" + DatosHorario.getH_codigoAula() + "','" + diaPos + "','" + diaGen + "','" + HorIni + "','" + HorFin + "','" + codigo + "','" + contGenral + "','" + DatosHorario.getH_codigoDocente() + "','" + DatosHorario.getH_codigoCurso() + "','" + DatosHorario.getH_clase() + "','cambioDia' );\" data-original-title=\"Mark&nbsp;as&nbsp;done\" data-rel=\"tooltip\">\n"
+ " <span class=\"green\">\n" + " <span class=\"green\">\n"
+ " <i class=\"ace-icon fa fa-pencil bigger-110\"></i>\n" + " <i class=\"ace-icon fa fa-pencil bigger-110\"></i>\n"
+ " Cambio dia" + " Cambio dia"
...@@ -3242,9 +3242,14 @@ public class ServletHorario extends HttpServlet { ...@@ -3242,9 +3242,14 @@ public class ServletHorario extends HttpServlet {
String periodo = request.getParameter("periodo"); String periodo = request.getParameter("periodo");
String codGru = request.getParameter("codGru"); String codGru = request.getParameter("codGru");
String grupoAulas = request.getParameter("grupoAulas"); String grupoAulas = request.getParameter("grupoAulas");
String historial = request.getParameter("historial");
String motivoCambio = request.getParameter("motivoCambio");
String observacion = request.getParameter("observacion");
String condicionTrabajador = request.getParameter("condicionTrabajador");
String horaAviso = request.getParameter("horaAviso");
int codClase = Integer.parseInt(request.getParameter("codClase")); int codClase = Integer.parseInt(request.getParameter("codClase"));
System.out.println("akiiiiiiiiiiiiiiiiiiiiiiiii el que lee esto tiene una hermosa sonrisa."); System.out.println("akiiiiiiiiiiiiiiiiiiiiiiiii el que lee esto tiene una hermosa sonrisa.");
int dato = servicios.registrarAsigCurDoceHorario(codAula, dia, bloq, Hini, Hfin, codTurno, codCurso, codDocente, periodo, codGru, codUsuario, codClase, grupoAulas); int dato = servicios.registrarAsigCurDoceHorario(codAula, dia, bloq, Hini, Hfin, codTurno, codCurso, codDocente, periodo, codGru, codUsuario, codClase, grupoAulas,historial,motivoCambio, observacion, condicionTrabajador, horaAviso);
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
pw.println(dato); pw.println(dato);
......
...@@ -264,6 +264,10 @@ ...@@ -264,6 +264,10 @@
<br> <br>
<div id="listadoCruce" style="display: none;"> <div id="listadoCruce" style="display: none;">
</div> </div>
<br>
<div class="col-sm-12" id="divFormularioCambio">
</div>
</form> </form>
<br><br> <br><br>
</div> </div>
...@@ -326,6 +330,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -326,6 +330,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
<script src="../assets/js/flot/jquery.flot.js"></script> <script src="../assets/js/flot/jquery.flot.js"></script>
<script src="../assets/js/flot/jquery.flot.pie.js"></script> <script src="../assets/js/flot/jquery.flot.pie.js"></script>
<script src="../assets/js/flot/jquery.flot.resize.js"></script> <script src="../assets/js/flot/jquery.flot.resize.js"></script>
<script src="../assets/js/jquery.maskedinput.js"></script>
<!-- ace scripts --> <!-- ace scripts -->
<script src="../assets/js/ace/elements.scroller.js"></script> <script src="../assets/js/ace/elements.scroller.js"></script>
...@@ -1039,7 +1044,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1039,7 +1044,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
$("#listadoCruce").html(""); $("#listadoCruce").html("");
} }
function alerta2(bloq, dia, Hini, Hfin, Turno, codigaGrupoHorario, codaula, contGeneral, opcion, editar) { function alerta2(bloq, dia, Hini, Hfin, Turno, codigaGrupoHorario, codaula, contGeneral, opcion, editar, historial) {
$("#dialog-armar2").removeClass('hide').dialog({ $("#dialog-armar2").removeClass('hide').dialog({
resizable: false, resizable: false,
width: 800, width: 800,
...@@ -1051,7 +1056,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1051,7 +1056,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; ASIGNAR", html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; ASIGNAR",
"class": "btn btn-primary btn-xs", "class": "btn btn-primary btn-xs",
click: function () { click: function () {
verCursosIguales(codigaGrupoHorario, Turno, bloq, dia, Hini, Hfin, codaula, contGeneral, opcion, editar); verCursosIguales(codigaGrupoHorario, Turno, bloq, dia, Hini, Hfin, codaula, contGeneral, opcion, editar, historial);
} }
}, { }, {
html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; CANCELAR", html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; CANCELAR",
...@@ -1064,7 +1069,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1064,7 +1069,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
}); });
} }
function verCursosIguales(codigaGrupoHorario, Turno, bloq, dia, Hini, Hfin, codaula, contGeneral, opcion, editar) { function verCursosIguales(codigaGrupoHorario, Turno, bloq, dia, Hini, Hfin, codaula, contGeneral, opcion, editar, historial) {
//alert("verificar "+editar); //alert("verificar "+editar);
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
var codAulas = "<%=armandoHorario!=null?armandoHorario.getArmarHoraio_codAulas():""%>"; var codAulas = "<%=armandoHorario!=null?armandoHorario.getArmarHoraio_codAulas():""%>";
...@@ -1076,7 +1081,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1076,7 +1081,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
success: function (resultado) { success: function (resultado) {
//alert("rsultado "+resultado); //alert("rsultado "+resultado);
if (resultado == 0) { if (resultado == 0) {
validar_RegistroAsigCurDoc(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral); validar_RegistroAsigCurDoc(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral, historial);
} else { } else {
advertencia1(); advertencia1();
} }
...@@ -1125,7 +1130,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1125,7 +1130,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
}); });
} }
function validar_RegistroAsigCurDoc(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral) { function validar_RegistroAsigCurDoc(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral, historial) {
var estado = jQuery('#RegistroAsigCurDoc').validationEngine('validate'); var estado = jQuery('#RegistroAsigCurDoc').validationEngine('validate');
if (estado) { if (estado) {
var cantidad = $("#cantidad").val(); var cantidad = $("#cantidad").val();
...@@ -1141,11 +1146,23 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1141,11 +1146,23 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
} }
} }
if (codigoDocente != "") { if (codigoDocente != "") {
popup_confimacion(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral, codigoDocente);
var json = {}
if (historial == 'cambioFijo') {
json.motivoCambio = $('#txtMotivoCambio').val() || ''
json.observacion = $('#txtObservacion').val() || ''
json.condicionTrabajador = $('#cbCondicionTrabajador').val() || ''
} else if (historial == 'cambioDia') {
json.motivoCambio = $('#txtMotivoCambio').val() || ''
json.observacion = $('#txtObservacion').val() || ''
json.horaAviso = $('#txtHoraAviso').val() || ''
}
popup_confimacion(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral, codigoDocente, historial, json);
} else { } else {
alertaVacios(); alertaVacios();
} }
} }
} }
...@@ -1167,7 +1184,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1167,7 +1184,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
] ]
}); });
} }
function popup_confimacion(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral, codigoDocente) { function popup_confimacion(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral, codigoDocente, historial, json) {
$("#dialog-confor2").removeClass('hide').dialog({ $("#dialog-confor2").removeClass('hide').dialog({
resizable: false, resizable: false,
modal: true, modal: true,
...@@ -1180,9 +1197,9 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1180,9 +1197,9 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
click: function () { click: function () {
// alert(codigoDocente); // alert(codigoDocente);
if (opcion == "1") { if (opcion == "1") {
registrarAsigCurDoceHorarioMasivo(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral, codigoDocente); registrarAsigCurDoceHorarioMasivo(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral, codigoDocente, historial);
} else { } else {
registrarAsigCurDoceHorario(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral, codigoDocente); registrarAsigCurDoceHorario(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral, codigoDocente, historial, json);
} }
$(this).dialog("close"); $(this).dialog("close");
} }
...@@ -1359,6 +1376,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1359,6 +1376,7 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
type: 'POST', type: 'POST',
url: '../ServletHorario?Accion=registrarAsigCurDoceHorarioGeneralMasivo2', url: '../ServletHorario?Accion=registrarAsigCurDoceHorarioGeneralMasivo2',
data: "cadenaTotal=" + cadenaTotal + "&hora_inicio=" + hora_inicio + "&hora_termino=" + hora_termino + "&dia=" + dia + "&codTurno=" + codTurno + "&codCurso=" + codCurso + "&codDocente=" + codigoDocente + '&periodo=' + periodo + '&codGru=' + codigaGrupoHorario + '&codClase=' + codClase + '&grupoAulas=' + grupoAulas, data: "cadenaTotal=" + cadenaTotal + "&hora_inicio=" + hora_inicio + "&hora_termino=" + hora_termino + "&dia=" + dia + "&codTurno=" + codTurno + "&codCurso=" + codCurso + "&codDocente=" + codigoDocente + '&periodo=' + periodo + '&codGru=' + codigaGrupoHorario + '&codClase=' + codClase + '&grupoAulas=' + grupoAulas,
success: function (resultado) { success: function (resultado) {
//alert("res "+resultado); //alert("res "+resultado);
if (resultado == 1) { if (resultado == 1) {
...@@ -1379,21 +1397,36 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1379,21 +1397,36 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
} }
function registrarAsigCurDoceHorario(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral, codigoDocente) { function registrarAsigCurDoceHorario(codigaGrupoHorario, bloq, dia, Hini, Hfin, codaula, opcion, Turno, contGeneral, codigoDocente, historial, json) {
//alert("registrarAsigCurDoceHorario"); //alert("registrarAsigCurDoceHorario");
var codTurno = Turno; var codTurno = Turno;
var codCurso = $("#cmbCurso").val(); var codCurso = $("#cmbCurso").val();
var codClase = $("#idClase").val(); var codClase = $("#idClase").val();
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
var grupoAulas = $("#grupoAulas").val(); var grupoAulas = $("#grupoAulas").val();
historial = historial || 0
//alert("codAula="+codaula+"&bloq="+bloq+"&dia="+dia+"&Hini="+Hini+"&Hfin="+Hfin+"&codTurno="+codTurno+"&codCurso="+codCurso+"&codDocente="+codDocente+'&periodo='+periodo+'&codGru='+codigaGrupoHorario+'&codClase='+codClase); //alert("codAula="+codaula+"&bloq="+bloq+"&dia="+dia+"&Hini="+Hini+"&Hfin="+Hfin+"&codTurno="+codTurno+"&codCurso="+codCurso+"&codDocente="+codDocente+'&periodo='+periodo+'&codGru='+codigaGrupoHorario+'&codClase='+codClase);
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '../ServletHorario?Accion=registrarAsigCurDoceHorarioGeneral2', url: '../ServletHorario?Accion=registrarAsigCurDoceHorarioGeneral2',
data: "codAula=" + codaula + "&bloq=" + bloq + "&dia=" + dia + "&Hini=" + Hini + "&Hfin=" + Hfin + "&codTurno=" + codTurno + "&codCurso=" + codCurso + "&codDocente=" + codigoDocente + '&periodo=' + periodo + '&codGru=' + codigaGrupoHorario + '&codClase=' + codClase + '&grupoAulas=' + grupoAulas, data: "codAula=" + codaula +
"&bloq=" + bloq +
"&dia=" + dia +
"&Hini=" + Hini +
"&Hfin=" + Hfin +
"&codTurno=" + codTurno +
"&codCurso=" + codCurso +
"&codDocente=" + codigoDocente +
'&periodo=' + periodo +
'&codGru=' + codigaGrupoHorario +
'&codClase=' + codClase +
'&grupoAulas=' + grupoAulas +
'&historial=' + historial +
'&motivoCambio=' + (json.motivoCambio || '') +
'&observacion=' + (json.observacion || '') +
'&condicionTrabajador=' + (json.condicionTrabajador || '') +
'&horaAviso=' + (json.horaAviso || ''),
success: function (resultado) { success: function (resultado) {
//alert("res1 "+resultado);
if (resultado == 1) { if (resultado == 1) {
popup_exito(codigaGrupoHorario, codaula, bloq, dia, Hini, Hfin, Turno, contGeneral); popup_exito(codigaGrupoHorario, codaula, bloq, dia, Hini, Hfin, Turno, contGeneral);
} else if (resultado == 3) { } else if (resultado == 3) {
...@@ -1670,13 +1703,25 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1670,13 +1703,25 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
} }
function editar(codaula, posBlo, dia, Hor_ini, Hor_fin, codigo, contGeneral, codigoDocente, codigoCurso, clase) { function editar(codaula, posBlo, dia, Hor_ini, Hor_fin, codigo, contGeneral, codigoDocente, codigoCurso, clase, historial) {
// function editar(codaula,posBlo,dia,Hor_ini,Hor_fin,turno,contGeneral,codigoDocente,codigoCurso,clase){ // function editar(codaula,posBlo,dia,Hor_ini,Hor_fin,turno,contGeneral,codigoDocente,codigoCurso,clase){
// armarAsignacionCursoEdit(0,posBlo,dia,Hor_ini,Hor_fin,codigo,codaula,contGeneral,codigoDocente,codigoCurso,clase); // armarAsignacionCursoEdit(0,posBlo,dia,Hor_ini,Hor_fin,codigo,codaula,contGeneral,codigoDocente,codigoCurso,clase);
cargarDocentesDisponiblesGeneral3TablaTemporal(0, codaula, posBlo, dia, Hor_ini, Hor_fin, codigo, contGeneral, codigoDocente, codigoCurso, clase); cargarDocentesDisponiblesGeneral3TablaTemporal(0, codaula, posBlo, dia, Hor_ini, Hor_fin, codigo, contGeneral, codigoDocente, codigoCurso, clase, historial);
} }
function cargarDocentesDisponiblesGeneral3TablaTemporal(opcion, codaula, posBlo, dia, Hor_ini, Hor_fin, codigo, contGeneral, codigoDocente, codigoCurso, clase) { function cambioDia(codaula, posBlo, dia, Hor_ini, Hor_fin, codigo, contGeneral, codigoDocente, codigoCurso, clase, historial) {
// function editar(codaula,posBlo,dia,Hor_ini,Hor_fin,turno,contGeneral,codigoDocente,codigoCurso,clase){
// armarAsignacionCursoEdit(0,posBlo,dia,Hor_ini,Hor_fin,codigo,codaula,contGeneral,codigoDocente,codigoCurso,clase);
cargarDocentesDisponiblesGeneral3TablaTemporal(0, codaula, posBlo, dia, Hor_ini, Hor_fin, codigo, contGeneral, codigoDocente, codigoCurso, clase, historial);
}
function cambioFijo(codaula, posBlo, dia, Hor_ini, Hor_fin, codigo, contGeneral, codigoDocente, codigoCurso, clase, historial) {
// function editar(codaula,posBlo,dia,Hor_ini,Hor_fin,turno,contGeneral,codigoDocente,codigoCurso,clase){
// armarAsignacionCursoEdit(0,posBlo,dia,Hor_ini,Hor_fin,codigo,codaula,contGeneral,codigoDocente,codigoCurso,clase);
cargarDocentesDisponiblesGeneral3TablaTemporal(0, codaula, posBlo, dia, Hor_ini, Hor_fin, codigo, contGeneral, codigoDocente, codigoCurso, clase, historial);
}
function cargarDocentesDisponiblesGeneral3TablaTemporal(opcion, codaula, posBlo, dia, Hor_ini, Hor_fin, codigo, contGeneral, codigoDocente, codigoCurso, clase, historial) {
var dato = verificarTurno(Hor_ini, Hor_fin); var dato = verificarTurno(Hor_ini, Hor_fin);
var Turno = dato; var Turno = dato;
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
...@@ -1686,14 +1731,14 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1686,14 +1731,14 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
url: '../ServletDocente?Accion=cargarDocentesDisponiblesGeneral3', url: '../ServletDocente?Accion=cargarDocentesDisponiblesGeneral3',
data: 'codTurno=' + Turno + '&dia=' + dia + '&codCurso=' + codigoCurso + '&periodo=' + periodo + '&opcion=' + opcion + '&codaula=' + codaula, data: 'codTurno=' + Turno + '&dia=' + dia + '&codCurso=' + codigoCurso + '&periodo=' + periodo + '&opcion=' + opcion + '&codaula=' + codaula,
success: function (resultado) { success: function (resultado) {
armarAsignacionCursoEdit(0, posBlo, dia, Hor_ini, Hor_fin, codigo, codaula, contGeneral, codigoDocente, codigoCurso, clase); armarAsignacionCursoEdit(0, posBlo, dia, Hor_ini, Hor_fin, codigo, codaula, contGeneral, codigoDocente, codigoCurso, clase, historial);
}, complete: function () { }, complete: function () {
// $("#formulario1").dialog( "close" ); // $("#formulario1").dialog( "close" );
} }
}); });
} }
function armarAsignacionCursoEdit(opcion, bloq, dia, Hini, Hfin, codigo, codaula, contGeneral, codigoDocente, codigoCurso, clase) { function armarAsignacionCursoEdit(opcion, bloq, dia, Hini, Hfin, codigo, codaula, contGeneral, codigoDocente, codigoCurso, clase, historial) {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
var codigo = "<%=armandoHorario!=null?armandoHorario.getArmarHoraio_codigo():""%>"; var codigo = "<%=armandoHorario!=null?armandoHorario.getArmarHoraio_codigo():""%>";
var dato = verificarTurno(Hini, Hfin); var dato = verificarTurno(Hini, Hfin);
...@@ -1708,10 +1753,56 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/ ...@@ -1708,10 +1753,56 @@ window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/
data: 'bloq=' + bloq + '&dia=' + dia + '&Turno=' + Turno + '&Hini=' + Hini + '&Hfin=' + Hfin + '&opcion=' + opcion + '&codigoDocente=' + codigoDocente + '&codigoCurso=' + codigoCurso + '&periodo=' + periodo + '&clase=' + clase + '&cadenaAulas=' + cadenaAulas, data: 'bloq=' + bloq + '&dia=' + dia + '&Turno=' + Turno + '&Hini=' + Hini + '&Hfin=' + Hfin + '&opcion=' + opcion + '&codigoDocente=' + codigoDocente + '&codigoCurso=' + codigoCurso + '&periodo=' + periodo + '&clase=' + clase + '&cadenaAulas=' + cadenaAulas,
success: function (resultado) { success: function (resultado) {
$('#divRegistroCursoDocente').html(resultado); $('#divRegistroCursoDocente').html(resultado);
let formCambio = ''
if (historial == 'cambioFijo') {
formCambio = `<div class="col-sm-4">
<div class="form-group">
<b>Motivo del cambio:</b>
<textarea class="form-control" id="txtMotivoCambio"></textarea>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<b>Observacion:</b>
<textarea class="form-control" id="txtObservacion"></textarea>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<b>Condicion del trabajador:</b>
<select class="form-control" id="cbCondicionTrabajador">
<option>Por horas</option>
<option>Por contrato</option>
</select>
</div>
</div> `
} else if (historial == 'cambioDia') {
formCambio = `<div class="col-sm-4">
<div class="form-group">
<b>Motivo del cambio:</b>
<textarea class="form-control" id="txtMotivoCambio"></textarea>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<b>Observacion:</b>
<textarea class="form-control" id="txtObservacion"></textarea>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<b>Hora a la que avisa:</b>
<input class="form-control input-mask-time center" id="txtHoraAviso">
</div>
</div> `
}
$('#divFormularioCambio').html(formCambio)
$.mask.definitions['~'] = '[+-]';
$('.input-mask-time').mask('99:99');
}, complete: function () { }, complete: function () {
$("#listadoCruce").fadeOut(); $("#listadoCruce").fadeOut();
//cargarCursoArea(opcion,bloq,dia); //cargarCursoArea(opcion,bloq,dia);
alerta2(bloq, dia, Hini, Hfin, Turno, codigo, codaula, contGeneral, opcion, editar); alerta2(bloq, dia, Hini, Hfin, Turno, codigo, codaula, contGeneral, opcion, editar, historial);
} }
}); });
} }
......
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="validar.jsp" %>
<!DOCTYPE html>
<html lang="es">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>:::SISTEMA DE HORARIOS:::</title>
<meta name="description" content="overview &amp; stats" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<link rel="stylesheet" href="../assets/css/bootstrap.css" />
<link rel="stylesheet" href="../assets/css/font-awesome.css" />
<link rel="stylesheet" href="../assets/css/jquery-ui.css" />
<link rel="stylesheet" href="../assets/css/ace-fonts.css" />
<link rel="stylesheet" href="../assets/css/ace.css" class="ace-main-stylesheet" id="main-ace-style" />
<script src="../assets/js/ace-extra.js"></script>
<!-- inline scripts related to this page -->
<script type="text/javascript" language="javascript">
/*$(document).ready( function() {
jQuery("#registroEncuesta").validationEngine();
});*/
</script>
</head>
<body class="no-skin" onLoad="cargar();">
<!-- #section:basics/navbar.layout -->
<div id="navbar" class="navbar navbar-default">
<script type="text/javascript">
try {
ace.settings.check('navbar', 'fixed')
} catch (e) {
}
</script>
<div class="navbar-container" id="navbar-container">
<%@ include file="banner.jsp" %>
</div><!-- /.navbar-container -->
</div>
<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
<script type="text/javascript">
try {
ace.settings.check('main-container', 'fixed')
} catch (e) {
}
</script>
<!-- #section:basics/sidebar -->
<div id="sidebar" class="sidebar responsive">
<script type="text/javascript">
try {
ace.settings.check('sidebar', 'fixed')
} catch (e) {
}
</script>
<input id="codModulo" type="hidden" value="<%=menu!=null?menu.getCodModulo():""%>">
<input id="codCategoria" type="hidden" value="<%=menu!=null?menu.getCodCategoria():""%>">
<%@ include file="menu.jsp" %>
<!-- #section:basics/sidebar.layout.minimize -->
<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
<i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
</div>
<!-- /section:basics/sidebar.layout.minimize -->
<script type="text/javascript">
try {
ace.settings.check('sidebar', 'collapsed')
} catch (e) {
}
</script>
</div>
<!-- /section:basics/sidebar -->
<div class="main-content">
<div class="main-content-inner">
<!-- #section:basics/content.breadcrumbs -->
<div class="breadcrumbs" id="breadcrumbs">
<script type="text/javascript">
try {
ace.settings.check('breadcrumbs', 'fixed')
} catch (e) {
}
</script>
<ul class="breadcrumb">
<li>
<i class="ace-icon fa fa-home home-icon"></i>
<a href="principal.jsp">INICIO</a>
</li>
<li class="active">REPORTE</li>
</ul><!-- /.breadcrumb -->
</div>
<!-- /section:basics/content.breadcrumbs -->
<div class="page-content">
<div class="page-header">
<h1>
Reporte
<small>
<i class="ace-icon fa fa-angle-double-right"></i>
Cambios y reemplazos
</small>
</h1>
</div><!-- /.page-header -->
<div class="row">
<!-- ----------- CONTENEDOR DE FORMULARIOS--------INI----- -->
<div class="col-sm-12" style="width:100%;">
<div class="col-sm-4"></div>
<div class="col-sm-4">
<div class="widget-box widget-color-blue">
<div class="widget-header">
<h4 class="widget-title">Generar reporte</h4>
</div>
<div class="widget-body">
<div class="widget-main no-padding">
<form id="registroEncuesta" method="post">
<fieldset>
<div class="row">
<div class="col-sm-6 form-group">
<label>Fecha desde: <span style='color:red;'>*</span></label>
<div>
<input type="text" id="txt_fecha_desde" size="80" class='form-control validate[required] input-mask-date' placeholder=" dd/mm/yyyy" style="text-align: center;" onblur="validaFecha(this.value);" >
</div>
</div>
<div class="col-sm-6 form-group">
<label>Fecha hasta: <span style='color:red;'>*</span></label>
<div>
<input type="text" id="txt_fecha_hasta" size="80" class='form-control validate[required]] input-mask-date' placeholder=" dd/mm/yyyy" style="text-align: center;" onblur="validaFecha(this.value);" >
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 form-group">
<label>Fecha desde: <span style='color:red;'>*</span></label>
<div>
<select id="txt_tipo_reporte" class='form-control validate[required]'>
<option value="1">Cambio fijo</option>
<option value="2">Reemplazo por dia</option>
<option value="3">Baja</option>
</select>
</div>
</div>
</div>
</fieldset>
<div class="form-actions center">
<button class="btn btn-sm btn-info" type="button" onclick="validar_busqueda();">
<i class="ace-icon fa fa-search icon-on-right bigger-110"></i>
Buscar
</button>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="col-sm-4"></div>
</div>
<div class="col-sm-12" style="width:100%; height: 40px;"></div>
<div class="col-sm-12" style="width:100%;">
<div class="col-sm-1" ></div>
<div class="col-sm-10">
<!-- -------------TABLA---INI------------ -->
<div id="listaDocenteBusqueda" style='display: none;'>
<div id='divListadoDoc'></div>
</div>
<!-- -------------TABLA---FIN------------ -->
</div>
<div class="col-sm-1"></div>
</div>
<!-- ----------- CONTENEDOR DE FORMULARIOS--------FIN----- -->
<!-- ::::::::::-ALERTAS-::::::::::::::: -->
<input type="hidden" id="ape">
<div id="dialog-noti1" class="hide">
<br>
-----------------------
<br><br>
</div>
<div id="dialog-confor1" class="hide">
<br>
--------------------
<br><br>
</div>
<div id="dialog-advertencia1" class="hide">
<br>
-----------------------
<br><br>
</div>
<div id="dialog-Alerta2" class="hide">
</div>
<div id="dialog-armar" class="hide">
<br>
<form id="verHorario" class="formular" method="post">
<div class="sttxt2" id="divFormulario"></div>
</form>
<br><br>
</div>
<div id="dialog-cargando" class="hide">
<table cellpadding="0" cellspacing="0" width="100%">
<tr><td align="center"><img src="imagenes/cargando.gif" border=0></td></tr>
</table>
</div>
<!-- ::::::::::-ALERTAS-::::::::::::::: -->
</div><!-- /.row -->
</div><!-- /.page-content -->
</div>
</div><!-- /.main-content -->
<div class="footer">
<%@ include file="footer.jsp" %>
</div>
<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
</a>
</div><!-- /.main-container -->
<!-- basic scripts -->
<!--[if !IE]> -->
<script type="text/javascript">
window.jQuery || document.write("<script src='../assets/js/jquery.js'>" + "<" + "/script>");
</script>
<!-- <![endif]-->
<!--[if IE]>
<script type="text/javascript">
window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script type="text/javascript">
if ('ontouchstart' in document.documentElement)
document.write("<script src='../assets/js/jquery.mobile.custom.js'>" + "<" + "/script>");
</script>
<script src="../assets/js/bootstrap.js"></script>
<!-- page specific plugin scripts -->
<script src="../assets/js/jquery-ui.js"></script>
<script src="../assets/js/jquery.ui.touch-punch.js"></script>
<!--[if lte IE 8]>
<script src="../assets/js/excanvas.js"></script>
<![endif]-->
<script src="../assets/js/jquery-ui.custom.js"></script>
<script src="../assets/js/jquery.ui.touch-punch.js"></script>
<script src="../assets/js/jquery.easypiechart.js"></script>
<script src="../assets/js/jquery.sparkline.js"></script>
<script src="../assets/js/flot/jquery.flot.js"></script>
<script src="../assets/js/flot/jquery.flot.pie.js"></script>
<script src="../assets/js/flot/jquery.flot.resize.js"></script>
<script src="../assets/js/jquery.maskedinput.js"></script>
<!-- ace scripts -->
<script src="../assets/js/ace/elements.scroller.js"></script>
<script src="../assets/js/ace/elements.colorpicker.js"></script>
<script src="../assets/js/ace/elements.fileinput.js"></script>
<script src="../assets/js/ace/elements.typeahead.js"></script>
<script src="../assets/js/ace/elements.wysiwyg.js"></script>
<script src="../assets/js/ace/elements.spinner.js"></script>
<script src="../assets/js/ace/elements.treeview.js"></script>
<script src="../assets/js/ace/elements.wizard.js"></script>
<script src="../assets/js/ace/elements.aside.js"></script>
<script src="../assets/js/ace/ace.js"></script>
<script src="../assets/js/ace/ace.ajax-content.js"></script>
<script src="../assets/js/ace/ace.touch-drag.js"></script>
<script src="../assets/js/ace/ace.sidebar.js"></script>
<script src="../assets/js/ace/ace.sidebar-scroll-1.js"></script>
<script src="../assets/js/ace/ace.submenu-hover.js"></script>
<script src="../assets/js/ace/ace.widget-box.js"></script>
<script src="../assets/js/ace/ace.settings.js"></script>
<script src="../assets/js/ace/ace.settings-rtl.js"></script>
<script src="../assets/js/ace/ace.settings-skin.js"></script>
<script src="../assets/js/ace/ace.widget-on-reload.js"></script>
<script src="../assets/js/ace/ace.searchbox-autocomplete.js"></script>
<script src="../assets/js/ace/ace.searchbox-autocomplete.js"></script>
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>
<!--<link rel="stylesheet" href="css/template.css" type="text/css"/>-->
<!-- inline scripts related to this page -->
<script type="text/javascript">
jQuery(function ($) {
//override dialog's title function to allow for HTML titles
$.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
_title: function (title) {
var $title = this.options.title || '&nbsp;'
if (("title_html" in this.options) && this.options.title_html == true)
title.html($title);
else
title.text($title);
}
}));
$.mask.definitions['~'] = '[+-]';
$('.input-mask-date').mask('99/99/9999');
$("#id-btn-dialog2").on('click', function (e) {//--
e.preventDefault();
$("#dialog-confirm").removeClass('hide').dialog({
resizable: false,
modal: true,
title: "<div class='widget-header'><h4 class='smaller'><i class='ace-icon fa fa-exclamation-triangle red'></i> Empty the recycle bin?</h4></div>",
title_html: true,
buttons: [
{
html: "<i class='ace-icon fa fa-trash-o bigger-110'></i>&nbsp; Delete all items",
"class": "btn btn-danger btn-xs",
click: function () {
$(this).dialog("close");
}
}
,
{
html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; Cancel",
"class": "btn btn-xs",
click: function () {
$(this).dialog("close");
}
}
]
});
});
$('.easy-pie-chart.percentage').each(function () {
var $box = $(this).closest('.infobox');
var barColor = $(this).data('color') || (!$box.hasClass('infobox-dark') ? $box.css('color') : 'rgba(255,255,255,0.95)');
var trackColor = barColor == 'rgba(255,255,255,0.95)' ? 'rgba(255,255,255,0.25)' : '#E2E2E2';
var size = parseInt($(this).data('size')) || 50;
$(this).easyPieChart({
barColor: barColor,
trackColor: trackColor,
scaleColor: false,
lineCap: 'butt',
lineWidth: parseInt(size / 10),
animate: /msie\s*(8|7|6)/.test(navigator.userAgent.toLowerCase()) ? false : 1000,
size: size
});
})
$('.sparkline').each(function () {
var $box = $(this).closest('.infobox');
var barColor = !$box.hasClass('infobox-dark') ? $box.css('color') : '#FFF';
$(this).sparkline('html',
{
tagValuesAttribute: 'data-values',
type: 'bar',
barColor: barColor,
chartRangeMin: $(this).data('min') || 0
});
});
//flot chart resize plugin, somehow manipulates default browser resize event to optimize it!
//but sometimes it brings up errors with normal resize event handlers
$.resize.throttleWindow = false;
var placeholder = $('#piechart-placeholder').css({'width': '90%', 'min-height': '150px'});
var data = [
{label: "social networks", data: 38.7, color: "#68BC31"},
{label: "search engines", data: 24.5, color: "#2091CF"},
{label: "ad campaigns", data: 8.2, color: "#AF4E96"},
{label: "direct traffic", data: 18.6, color: "#DA5430"},
{label: "other", data: 10, color: "#FEE074"}
]
function drawPieChart(placeholder, data, position) {
$.plot(placeholder, data, {
series: {
pie: {
show: true,
tilt: 0.8,
highlight: {
opacity: 0.25
},
stroke: {
color: '#fff',
width: 2
},
startAngle: 2
}
},
legend: {
show: true,
position: position || "ne",
labelBoxBorderColor: null,
margin: [-30, 15]
}
,
grid: {
hoverable: true,
clickable: true
}
})
}
drawPieChart(placeholder, data);
/**
we saved the drawing function and the data to redraw with different position later when switching to RTL mode dynamically
so that's not needed actually.
*/
placeholder.data('chart', data);
placeholder.data('draw', drawPieChart);
//pie chart tooltip example
var $tooltip = $("<div class='tooltip top in'><div class='tooltip-inner'></div></div>").hide().appendTo('body');
var previousPoint = null;
placeholder.on('plothover', function (event, pos, item) {
if (item) {
if (previousPoint != item.seriesIndex) {
previousPoint = item.seriesIndex;
var tip = item.series['label'] + " : " + item.series['percent'] + '%';
$tooltip.show().children(0).text(tip);
}
$tooltip.css({top: pos.pageY + 10, left: pos.pageX + 10});
} else {
$tooltip.hide();
previousPoint = null;
}
});
/////////////////////////////////////
$(document).one('ajaxloadstart.page', function (e) {
$tooltip.remove();
});
var d1 = [];
for (var i = 0; i < Math.PI * 2; i += 0.5) {
d1.push([i, Math.sin(i)]);
}
var d2 = [];
for (var i = 0; i < Math.PI * 2; i += 0.5) {
d2.push([i, Math.cos(i)]);
}
var d3 = [];
for (var i = 0; i < Math.PI * 2; i += 0.2) {
d3.push([i, Math.tan(i)]);
}
var sales_charts = $('#sales-charts').css({'width': '100%', 'height': '220px'});
$.plot("#sales-charts", [
{label: "Domains", data: d1},
{label: "Hosting", data: d2},
{label: "Services", data: d3}
], {
hoverable: true,
shadowSize: 0,
series: {
lines: {show: true},
points: {show: true}
},
xaxis: {
tickLength: 0
},
yaxis: {
ticks: 10,
min: -2,
max: 2,
tickDecimals: 3
},
grid: {
backgroundColor: {colors: ["#fff", "#fff"]},
borderWidth: 1,
borderColor: '#555'
}
});
$('#recent-box [data-rel="tooltip"]').tooltip({placement: tooltip_placement});
function tooltip_placement(context, source) {
var $source = $(source);
var $parent = $source.closest('.tab-content')
var off1 = $parent.offset();
var w1 = $parent.width();
var off2 = $source.offset();
//var w2 = $source.width();
if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2))
return 'right';
return 'left';
}
$('.dialogs,.comments').ace_scroll({
size: 300
});
//Android's default browser somehow is confused when tapping on label which will lead to dragging the task
//so disable dragging when clicking on label
var agent = navigator.userAgent.toLowerCase();
if ("ontouchstart" in document && /applewebkit/.test(agent) && /android/.test(agent))
$('#tasks').on('touchstart', function (e) {
var li = $(e.target).closest('#tasks li');
if (li.length == 0)
return;
var label = li.find('label.inline').get(0);
if (label == e.target || $.contains(label, e.target))
e.stopImmediatePropagation();
});
$('#tasks').sortable({
opacity: 0.8,
revert: true,
forceHelperSize: true,
placeholder: 'draggable-placeholder',
forcePlaceholderSize: true,
tolerance: 'pointer',
stop: function (event, ui) {
//just for Chrome!!!! so that dropdowns on items don't appear below other items after being moved
$(ui.item).css('z-index', 'auto');
}
}
);
$('#tasks').disableSelection();
$('#tasks input:checkbox').removeAttr('checked').on('click', function () {
if (this.checked)
$(this).closest('li').addClass('selected');
else
$(this).closest('li').removeClass('selected');
});
//show the dropdowns on top or bottom depending on window height and menu position
$('#task-tab .dropdown-hover').on('mouseenter', function (e) {
var offset = $(this).offset();
var $w = $(window)
if (offset.top > $w.scrollTop() + $w.innerHeight() - 100)
$(this).addClass('dropup');
else
$(this).removeClass('dropup');
});
});
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
$(document).ready(function () {
jQuery("#registroEncuesta").validationEngine();
});
function cargando() {
$("#dialog-cargando").removeClass('hide').dialog({
resizable: false,
modal: true,
title: "<div class='widget-header' ><h4 class='smaller'><i class='fa fa-spinner'></i> Cargando...</h4></div>",
title_html: true
});
}
function close_carga() {
$("#dialog-cargando").dialog("close");
}
function validar_busqueda() {
var estado = $('#registroEncuesta').validationEngine('validate');
if (estado) {
let reporte = $('#txt_tipo_reporte').val()
let fechaDesde = $('#txt_fecha_desde').val()
let fechaHasta = $('#txt_fecha_hasta').val()
let href = ''
switch (reporte) {
case '1':
href = 'exportar_cambios_fijos'
break;
case '2':
href = 'exportar_reemplazo_dia'
break;
case '3':
href = 'exportar_bajas'
break;
default:
}
location.href = href + ".jsp?fechaDesde=" + fechaDesde + "&fechaHasta=" + fechaHasta
}
}
function alerta_darBaja(opcion) {
$("#dialog-Alerta2").removeClass('hide').dialog({
resizable: false,
modal: true,
title: "<div class='widget-color-blue' ><div class='widget-header white' ><h4 class='smaller' ><i class='ace-icon fa fa-check-circle white'></i> <span class='white'>Conformidad</span></h4></div></div>",
title_html: true,
buttons: [
{
html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; SI",
"class": "btn btn-primary btn-xs",
click: function () {
$(this).dialog("close");
return opcion(true)
}
}, {
html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; NO",
"class": "btn btn-danger btn-xs",
click: function () {
$(this).dialog("close");
}
}
]
});
}
function darDeBaja(codigo) {
alerta_darBaja(opcion => {
if (opcion) {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
if (codigo != null) {
$.ajax({
type: 'POST',
url: '../ServletDocente?Accion=darDeBaja',
data: 'codigo=' + codigo + '&periodo=' + periodo,
beforeSend: function () {
cargando();
}, success: function (resultado) {
close_carga();
validar_busqueda()
}
});
}
}
})
}
function BuscarDocente(pagina) {
var accion = "";
var cantidad = 15;
var apellido = $("#txt_bus_doc").val();
$("#ape").val(apellido);
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
$.ajax({
type: 'POST',
url: '../ServletDocente?Accion=buscarDocenteHorario',
data: 'accion=' + accion + '&apellido=' + apellido + '&pagina=' + pagina + '&cantidad=' + cantidad + '&periodo=' + periodo,
beforeSend: function () {
cargando();
}, success: function (resultado) {
close_carga();
$("#divListadoDoc").html(resultado);
}, complete: function () {
if (apellido == "") {
$("#listaDocenteBusqueda").fadeOut();
} else {
$("#listaDocenteBusqueda").fadeIn();
}
}
});
}
function exportarUsuario() {
var apellido = $("#ape").val();
window.location = "exportarUsuarioDocente.jsp?apellido=" + apellido;
}
function exportarTodoUsuario() {
// var apellido = $("#txt_bus_doc").val();
window.location = "exportarTodoUsuDocente.jsp";
}
function armarHorarioDocente(codDocente, nombre) {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
$.ajax({
type: 'POST',
url: '../ServletHorario?Accion=verHorarioDocente',
data: 'codDocente=' + codDocente + '&nombre=' + nombre + '&periodo=' + periodo,
success: function (resultado) {
$("#divFormulario").html(resultado);
}, complete: function () {
verHorarioDocente(codDocente, nombre);
}
});
}
function armarHorarioDocente2(codDocente, nombre) {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
$.ajax({
type: 'POST',
url: '../ServletHorario?Accion=verHorarioDocente2',
data: 'codDocente=' + codDocente + '&nombre=' + nombre + '&periodo=' + periodo,
success: function (resultado) {
$("#divFormulario").html(resultado);
}, complete: function () {
verHorarioDocente(codDocente, nombre);
}
});
}
function verHorarioDocente(codDocente, nombre) {
$("#dialog-armar").removeClass('hide').dialog({
resizable: false,
width: 900,
modal: true,
title: "<div class='widget-color-blue' ><div class='widget-header white' ><h4 class='smaller' ><i class='ace-icon fa fa-check-circle white'></i> <span class='white'>Horario del docente</span></h4></div></div>",
title_html: true,
buttons: [
{
html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; ACEPTAR",
"class": "btn btn-primary btn-xs",
click: function () {
$(this).dialog("close");
}
}
]
});
}
function validaFecha(fecha) {
if (fecha != "__/__/____") {
var fechaArr = fecha.split('/');
var aho = fechaArr[2];
var mes = fechaArr[1];
var dia = fechaArr[0];
var plantilla = new Date(aho, mes - 1, dia);//mes empieza de cero Enero = 0
if (!plantilla || plantilla.getFullYear() == aho && plantilla.getMonth() == mes - 1 && plantilla.getDate() == dia) {
} else {
alertaFecha(fecha);
}
}
}
function alertaFecha(fecha) {
$("#dialog-advertencia").removeClass('hide').dialog({
resizable: false,
width: 400,
modal: true,
title: "<div class='widget-color-orange' ><div class='widget-header white' ><h4 class='smaller' ><i class='ace-icon fa fa-exclamation-triangle white'></i> <span class='white'>Advertencia</span></h4></div></div>",
title_html: true,
buttons: [
{
html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; OK",
"class": "btn btn-warning btn-xs",
click: function () {
$(this).dialog("close");
var ini = $('#txt_fec_ini').val();
var fin = $('#txt_fec_fin').val();
var iniEdit = $('#txt_new_ini').val();
var finEdit = $('#txt_new_fin').val();
if (ini == fecha) {
$('#txt_fec_ini').val("");
$('#txt_fec_ini').focus();
} else if (fin == fecha) {
$('#txt_fec_fin').val("");
$('#txt_fec_fin').focus();
} else if (iniEdit == fecha) {
$('#txt_new_ini').val("");
$('#txt_new_ini').focus();
} else if (finEdit == fecha) {
$('#txt_new_fin').val("");
$('#txt_new_fin').focus();
}
//$('#txt_fecnac').focus();
}
}
]
});
}
function exportar(codDocente) {
window.location = "exportarHorarioDocente.jsp?codDocente=" + codDocente;
}
function exportarCompleto(codDocente) {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
window.location = "exportarHorarioDocenteCompletoPeriodo.jsp?codDocente=" + codDocente + '&periodo=' + periodo;
}
function exportarCompletoReducido(codDocente) {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
window.location = "exportarHorarioDocenteCompletoReducidoPeriodo.jsp?codDocente=" + codDocente + '&periodo=' + periodo;
}
function exportarTodo() {
window.location = "exportarHorarioDocenteTodo.jsp";
}
function exportarTodoCompleto() {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
window.location = "exportarHorarioDocenteTodoCompletoPeriodo.jsp?periodo=" + periodo;
}
function exportarTodoCompletoReducido() {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
window.location = "exportarHorarioDocenteTodoCompletoPeriodoReducido.jsp?periodo=" + periodo;
}
function enter(e) {
tecla = (document.all) ? e.keyCode : e.which;
if (tecla == 13)
validar_busqueda();
}
$('input').keypress(function (e) {
if (e.which == 13) {
return false;
}
});
</script>
<!-- the following scripts are used in demo only for onpage help and you don't need them -->
<link rel="stylesheet" href="../assets/css/ace.onpage-help.css" />
<link rel="stylesheet" href="../docs/assets/js/themes/sunburst.css" />
<script type="text/javascript"> ace.vars['base'] = '..';</script>
<script src="../assets/js/ace/elements.onpage-help.js"></script>
<script src="../assets/js/ace/ace.onpage-help.js"></script>
<script src="../docs/assets/js/rainbow.js"></script>
<script src="../docs/assets/js/language/generic.js"></script>
<script src="../docs/assets/js/language/html.js"></script>
<script src="../docs/assets/js/language/css.js"></script>
<script src="../docs/assets/js/language/javascript.js"></script>
<script src="js/languages/jquery.validationEngine-es.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
</html>
<%--
Document : exportar_cambios_fijos
Created on : 31-oct-2018, 17:01:58
Author : sistem20user
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="pe.siso.horario.Beans.Horario"%>
<%@page import="pe.siso.horario.Beans.Aula"%>
<%@page import="pe.siso.horario.Beans.Docente"%>
<%@page import="pe.siso.horario.Services.DocenteServices"%>
<%@page import="pe.siso.horario.Services.AulaServices"%>
<%@page import="java.util.ArrayList"%>
<%@page import="pe.siso.horario.Beans.Usuario"%>
<%@page import="java.time.format.DateTimeFormatter"%>
<%@page import="java.time.LocalDateTime"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
// response.setContentType("application/vnd.ms-excel; ");
// response.setHeader("Content-Disposition","attachment; filename=cambio-dia.xls");
HttpSession session_actual = request.getSession(true);
Usuario usuario=(Usuario)session_actual.getAttribute("usuario");
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd/MM/yyyy");
LocalDateTime now = LocalDateTime.now();
String fechaDesde = request.getParameter("fechaDesde");
String fechaHasta = request.getParameter("fechaHasta");
String[] dias = {"Lunes","Martes","Miercoles","Jueves","Viernes","Sabado","Domingo"};
// String centrado="style='vertical-align:middle;' ";
String centrado=" align='center' ";
AulaServices serviceAula = new AulaServices();
DocenteServices serviceDocente = new DocenteServices();
ArrayList<Horario> lista = serviceDocente.listarBajasDocente(fechaDesde,fechaHasta);
%>
<table cellpadding= '0' cellspacing= '0'>
<tr>
<td <%=centrado%> colspan='5' align='center'><h3>LISTADO CAMBIOS DIARIOS DE DOCENTES</h3></td>
</tr>
<tr>
<td colspan='5' height='10'></td>
</tr>
<tr>
<td colspan='3' >FUENTE: SISTEMA DE HORARIOS</td>
<td colspan='2' align='right'>SACO OLIVEROS - SISTEMAS</td>
</tr>
<tr>
<td colspan='3' >RESPONSABLE: <%=usuario!=null?usuario.getNombreTipoUsuario():""%></td>
<td colspan='2' align='right'></td>
</tr>
<tr>
<td colspan='5' height='20'>FECHA: <%=dtf.format(now)%></td>
</tr>
<tr>
<td colspan='5' height='20'></td>
</tr>
</table>
<table border="2">
<tr bgcolor="lightyellow">
<td <%=centrado%> colspan="5">DATOS GENERALES</td>
</tr>
<tr bgcolor="lightgreen">
<td <%=centrado%> style="padding: 10px">APELLIDOS Y NOMBRES</td>
<td <%=centrado%> style="padding: 10px">SEDE</td>
<td <%=centrado%> style="padding: 10px">CURSO</td>
<td <%=centrado%> style="padding: 10px">DNI</td>
<td <%=centrado%> style="padding: 10px">FECHA</td>
<!--<td style="padding: 10px">MOTIVO</td>-->
</tr>
<%
for(Horario horario : lista){
Docente docente1 = serviceDocente.NombreDocente(horario.getH_codigoDocente());
%>
<tr>
<td style="padding : 10px"><%=docente1.getApe_pro() + ", " + docente1.getNom_pro()%></td>
<td style="padding : 10px"><%=horario.getNombreSede()%></td>
<td style="padding : 10px"><%=horario.getNombreCurso()%></td>
<td style="padding : 10px"><%=docente1.getDni()%></td>
<td style="padding : 10px"><%=horario.getH_fecha()%></td>
</tr>
<%
}
%>
</table>
</body>
</html>
<%--
Document : exportar_cambios_fijos
Created on : 31-oct-2018, 17:01:58
Author : sistem20user
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="pe.siso.horario.Beans.Horario"%>
<%@page import="pe.siso.horario.Beans.Aula"%>
<%@page import="pe.siso.horario.Beans.Docente"%>
<%@page import="pe.siso.horario.Services.DocenteServices"%>
<%@page import="pe.siso.horario.Services.AulaServices"%>
<%@page import="java.util.ArrayList"%>
<%@page import="pe.siso.horario.Beans.Usuario"%>
<%@page import="java.time.format.DateTimeFormatter"%>
<%@page import="java.time.LocalDateTime"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
// response.setContentType("application/vnd.ms-excel; ");
// response.setHeader("Content-Disposition","attachment; filename=cambio-fijo.xls");
HttpSession session_actual = request.getSession(true);
Usuario usuario=(Usuario)session_actual.getAttribute("usuario");
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd/MM/yyyy");
LocalDateTime now = LocalDateTime.now();
String fechaDesde = request.getParameter("fechaDesde");
String fechaHasta = request.getParameter("fechaHasta");
String[] dias = {"Lunes","Martes","Miercoles","Jueves","Viernes","Sabado","Domingo"};
// String centrado="style='vertical-align:middle;' ";
String centrado=" align='center' ";
AulaServices serviceAula = new AulaServices();
DocenteServices serviceDocente = new DocenteServices();
ArrayList<Horario> lista = serviceDocente.listarCambiosFijo(fechaDesde,fechaHasta);
%>
<table cellpadding= '0' cellspacing= '0'>
<tr>
<td <%=centrado%> colspan='5' align='center'><h3>LISTADO CAMBIOS FIJOS DE DOCENTES</h3></td>
</tr>
<tr>
<td colspan='5' height='10'></td>
</tr>
<tr>
<td colspan='3' >FUENTE: SISTEMA DE HORARIOS</td>
<td colspan='2' align='right'>SACO OLIVEROS - SISTEMAS</td>
</tr>
<tr>
<td colspan='3' >RESPONSABLE: <%=usuario!=null?usuario.getNombreTipoUsuario():""%></td>
<td colspan='2' align='right'></td>
</tr>
<tr>
<td colspan='5' height='20'>FECHA: <%=dtf.format(now)%></td>
</tr>
<tr>
<td colspan='5' height='20'></td>
</tr>
</table>
<table border="2">
<tr bgcolor="lightyellow">
<td <%=centrado%> colspan="5">DATOS GENERALES</td>
<td <%=centrado%> colspan="3">DOCENTE QUE SALE</td>
<td <%=centrado%> colspan="4">DOCENTE QUE INGRESA</td>
</tr>
<tr bgcolor="lightgreen">
<td <%=centrado%> style="padding: 10px">SEDE</td>
<td <%=centrado%> style="padding: 10px">DIA</td>
<td <%=centrado%> style="padding: 10px">HORARIO</td>
<td <%=centrado%> style="padding: 10px">AULA</td>
<td <%=centrado%> style="padding: 10px">CURSO</td>
<td <%=centrado%> style="padding: 10px">FECHA</td>
<td <%=centrado%> style="padding: 10px">APELLIDOS Y NOMBRES</td>
<td <%=centrado%> style="padding: 10px">MOTIVO</td>
<td <%=centrado%> style="padding: 10px">APELLIDOS Y NOMBRES</td>
<td <%=centrado%> style="padding: 10px">FECHA INICIO</td>
<td <%=centrado%> style="padding: 10px">CONDICION</td>
<td <%=centrado%> style="padding: 10px">OBSERVACION</td>
</tr>
<%
for(Horario horario : lista){
Aula aula = serviceAula.getAula(horario.getH_codigoAula());
Docente docente1 = serviceDocente.NombreDocente(horario.getH_codigoDocente());
Docente docente2 = serviceDocente.NombreDocente(horario.getH_codigo_doc_reemp());
%>
<tr>
<td style="padding : 10px"><%=aula.getNombreLocal()%></td>
<td style="padding : 10px"><%=dias[Integer.parseInt(horario.getH_dia()) - 1]%></td>
<td style="padding : 10px"><%=horario.getH_horarioInicio()%> - <%=horario.getH_horarioFinal()%></td>
<td style="padding : 10px"><%=aula.getNombreGrado() + "-" + aula.getNombre()%></td>
<td style="padding : 10px"><%=horario.getH_nombre_cur_reemp()%></td>
<td style="padding : 10px"><%=horario.getH_fecha()%></td>
<td style="padding : 10px"><%=docente1.getApe_pro() + ", " + docente1.getNom_pro()%></td>
<td style="padding : 10px"><%=horario.getH_motivoCambio()%></td>
<td style="padding : 10px"><%=docente2.getApe_pro() + ", " + docente2.getNom_pro()%></td>
<td style="padding : 10px"><%=horario.getH_fechaIngreso()%></td>
<td style="padding : 10px"><%=horario.getH_condicionTrabajador()%></td>
<td style="padding : 10px"><%=horario.getH_observacion()%></td>
</tr>
<%
}
%>
</table>
</body>
</html>
<%--
Document : exportar_cambios_fijos
Created on : 31-oct-2018, 17:01:58
Author : sistem20user
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="pe.siso.horario.Beans.Horario"%>
<%@page import="pe.siso.horario.Beans.Aula"%>
<%@page import="pe.siso.horario.Beans.Docente"%>
<%@page import="pe.siso.horario.Services.DocenteServices"%>
<%@page import="pe.siso.horario.Services.AulaServices"%>
<%@page import="java.util.ArrayList"%>
<%@page import="pe.siso.horario.Beans.Usuario"%>
<%@page import="java.time.format.DateTimeFormatter"%>
<%@page import="java.time.LocalDateTime"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
// response.setContentType("application/vnd.ms-excel; ");
// response.setHeader("Content-Disposition","attachment; filename=cambio-dia.xls");
HttpSession session_actual = request.getSession(true);
Usuario usuario=(Usuario)session_actual.getAttribute("usuario");
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd/MM/yyyy");
LocalDateTime now = LocalDateTime.now();
String fechaDesde = request.getParameter("fechaDesde");
String fechaHasta = request.getParameter("fechaHasta");
String[] dias = {"Lunes","Martes","Miercoles","Jueves","Viernes","Sabado","Domingo"};
// String centrado="style='vertical-align:middle;' ";
String centrado=" align='center' ";
AulaServices serviceAula = new AulaServices();
DocenteServices serviceDocente = new DocenteServices();
ArrayList<Horario> lista = serviceDocente.listarCambiosDia(fechaDesde,fechaHasta);
%>
<table cellpadding= '0' cellspacing= '0'>
<tr>
<td <%=centrado%> colspan='5' align='center'><h3>LISTADO CAMBIOS DIARIOS DE DOCENTES</h3></td>
</tr>
<tr>
<td colspan='5' height='10'></td>
</tr>
<tr>
<td colspan='3' >FUENTE: SISTEMA DE HORARIOS</td>
<td colspan='2' align='right'>SACO OLIVEROS - SISTEMAS</td>
</tr>
<tr>
<td colspan='3' >RESPONSABLE: <%=usuario!=null?usuario.getNombreTipoUsuario():""%></td>
<td colspan='2' align='right'></td>
</tr>
<tr>
<td colspan='5' height='20'>FECHA: <%=dtf.format(now)%></td>
</tr>
<tr>
<td colspan='5' height='20'></td>
</tr>
</table>
<table border="2">
<tr bgcolor="lightyellow">
<td <%=centrado%> colspan="5">DATOS GENERALES</td>
<td <%=centrado%> colspan="4">DOCENTE QUE FALTA</td>
<td <%=centrado%> colspan="3">DOCENTE QUE REEMPLAZA</td>
</tr>
<tr bgcolor="lightgreen">
<td <%=centrado%> style="padding: 10px">SEDE</td>
<td <%=centrado%> style="padding: 10px">DIA</td>
<td <%=centrado%> style="padding: 10px">HORARIO</td>
<td <%=centrado%> style="padding: 10px">AULA</td>
<td <%=centrado%> style="padding: 10px">CURSO</td>
<td <%=centrado%> style="padding: 10px">FECHA</td>
<td <%=centrado%> style="padding: 10px">APELLIDOS Y NOMBRES</td>
<td <%=centrado%> style="padding: 10px">MOTIVO</td>
<td <%=centrado%> style="padding: 10px">HORA AVISO</td>
<td <%=centrado%> style="padding: 10px">APELLIDOS Y NOMBRES</td>
<td <%=centrado%> style="padding: 10px">CURSO</td>
<td <%=centrado%> style="padding: 10px">OBSERVACION</td>
</tr>
<%
for(Horario horario : lista){
Aula aula = serviceAula.getAula(horario.getH_codigoAula());
Docente docente1 = serviceDocente.NombreDocente(horario.getH_codigoDocente());
Docente docente2 = serviceDocente.NombreDocente(horario.getH_codigo_doc_reemp());
%>
<tr>
<td style="padding : 10px"><%=aula.getNombreLocal()%></td>
<td style="padding : 10px"><%=dias[Integer.parseInt(horario.getH_dia()) - 1]%></td>
<td style="padding : 10px"><%=horario.getH_horarioInicio()%> - <%=horario.getH_horarioFinal()%></td>
<td style="padding : 10px"><%=aula.getNombreGrado() + "-" + aula.getNombre()%></td>
<td style="padding : 10px"><%=horario.getH_nombreCurso()%></td>
<td style="padding : 10px"><%=horario.getH_fecha()%></td>
<td style="padding : 10px"><%=docente1.getApe_pro() + ", " + docente1.getNom_pro()%></td>
<td style="padding : 10px"><%=horario.getH_motivoCambio()%></td>
<td style="padding : 10px"><%=horario.getH_horaAviso()%></td>
<td style="padding : 10px"><%=docente2.getApe_pro() + ", " + docente2.getNom_pro()%></td>
<td style="padding : 10px"><%=horario.getH_nombre_cur_reemp()%></td>
<td style="padding : 10px"><%=horario.getH_observacion()%></td>
</tr>
<%
}
%>
</table>
</body>
</html>
...@@ -35,7 +35,10 @@ ...@@ -35,7 +35,10 @@
<!-- #section:basics/navbar.layout --> <!-- #section:basics/navbar.layout -->
<div id="navbar" class="navbar navbar-default"> <div id="navbar" class="navbar navbar-default">
<script type="text/javascript"> <script type="text/javascript">
try{ace.settings.check('navbar' , 'fixed')}catch(e){} try {
ace.settings.check('navbar', 'fixed')
} catch (e) {
}
</script> </script>
<div class="navbar-container" id="navbar-container"> <div class="navbar-container" id="navbar-container">
...@@ -46,13 +49,19 @@ ...@@ -46,13 +49,19 @@
<!-- /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">
try{ace.settings.check('main-container' , 'fixed')}catch(e){} try {
ace.settings.check('main-container', 'fixed')
} catch (e) {
}
</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{ace.settings.check('sidebar' , 'fixed')}catch(e){} try {
ace.settings.check('sidebar', 'fixed')
} catch (e) {
}
</script> </script>
<input id="codModulo" type="hidden" value="<%=menu!=null?menu.getCodModulo():""%>"> <input id="codModulo" type="hidden" value="<%=menu!=null?menu.getCodModulo():""%>">
<input id="codCategoria" type="hidden" value="<%=menu!=null?menu.getCodCategoria():""%>"> <input id="codCategoria" type="hidden" value="<%=menu!=null?menu.getCodCategoria():""%>">
...@@ -63,7 +72,10 @@ ...@@ -63,7 +72,10 @@
</div> </div>
<!-- /section:basics/sidebar.layout.minimize --> <!-- /section:basics/sidebar.layout.minimize -->
<script type="text/javascript"> <script type="text/javascript">
try{ace.settings.check('sidebar' , 'collapsed')}catch(e){} try {
ace.settings.check('sidebar', 'collapsed')
} catch (e) {
}
</script> </script>
</div> </div>
...@@ -73,7 +85,10 @@ ...@@ -73,7 +85,10 @@
<!-- #section:basics/content.breadcrumbs --> <!-- #section:basics/content.breadcrumbs -->
<div class="breadcrumbs" id="breadcrumbs"> <div class="breadcrumbs" id="breadcrumbs">
<script type="text/javascript"> <script type="text/javascript">
try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){} try {
ace.settings.check('breadcrumbs', 'fixed')
} catch (e) {
}
</script> </script>
<ul class="breadcrumb"> <ul class="breadcrumb">
...@@ -179,7 +194,8 @@ ...@@ -179,7 +194,8 @@
<div id="dialog-Alerta2" class="hide"> <div id="dialog-Alerta2" class="hide">
<br> <br>
--------------------------------- ¿Desea dar de baja a este personal?<br>
Se deshabilitará toda su carga horaria.
<br><br> <br><br>
</div> </div>
...@@ -220,18 +236,19 @@ ...@@ -220,18 +236,19 @@
<!--[if !IE]> --> <!--[if !IE]> -->
<script type="text/javascript"> <script type="text/javascript">
window.jQuery || document.write("<script src='../assets/js/jquery.js'>"+"<"+"/script>"); window.jQuery || document.write("<script src='../assets/js/jquery.js'>" + "<" + "/script>");
</script> </script>
<!-- <![endif]--> <!-- <![endif]-->
<!--[if IE]> <!--[if IE]>
<script type="text/javascript"> <script type="text/javascript">
window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/script>"); window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/script>");
</script> </script>
<![endif]--> <![endif]-->
<script type="text/javascript"> <script type="text/javascript">
if('ontouchstart' in document.documentElement) document.write("<script src='../assets/js/jquery.mobile.custom.js'>"+"<"+"/script>"); if ('ontouchstart' in document.documentElement)
document.write("<script src='../assets/js/jquery.mobile.custom.js'>" + "<" + "/script>");
</script> </script>
<script src="../assets/js/bootstrap.js"></script> <script src="../assets/js/bootstrap.js"></script>
...@@ -282,24 +299,25 @@ ...@@ -282,24 +299,25 @@
<!-- inline scripts related to this page --> <!-- inline scripts related to this page -->
<script type="text/javascript"> <script type="text/javascript">
jQuery(function($) { jQuery(function ($) {
//override dialog's title function to allow for HTML titles //override dialog's title function to allow for HTML titles
$.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, { $.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
_title: function(title) { _title: function (title) {
var $title = this.options.title || '&nbsp;' var $title = this.options.title || '&nbsp;'
if( ("title_html" in this.options) && this.options.title_html == true ) if (("title_html" in this.options) && this.options.title_html == true)
title.html($title); title.html($title);
else title.text($title); else
title.text($title);
} }
})); }));
$( "#id-btn-dialog2" ).on('click', function(e) {//-- $("#id-btn-dialog2").on('click', function (e) {//--
e.preventDefault(); e.preventDefault();
$( "#dialog-confirm" ).removeClass('hide').dialog({ $("#dialog-confirm").removeClass('hide').dialog({
resizable: false, resizable: false,
modal: true, modal: true,
title: "<div class='widget-header'><h4 class='smaller'><i class='ace-icon fa fa-exclamation-triangle red'></i> Empty the recycle bin?</h4></div>", title: "<div class='widget-header'><h4 class='smaller'><i class='ace-icon fa fa-exclamation-triangle red'></i> Empty the recycle bin?</h4></div>",
...@@ -307,24 +325,24 @@ ...@@ -307,24 +325,24 @@
buttons: [ buttons: [
{ {
html: "<i class='ace-icon fa fa-trash-o bigger-110'></i>&nbsp; Delete all items", html: "<i class='ace-icon fa fa-trash-o bigger-110'></i>&nbsp; Delete all items",
"class" : "btn btn-danger btn-xs", "class": "btn btn-danger btn-xs",
click: function() { click: function () {
$( this ).dialog( "close" ); $(this).dialog("close");
} }
} }
, ,
{ {
html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; Cancel", html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; Cancel",
"class" : "btn btn-xs", "class": "btn btn-xs",
click: function() { click: function () {
$( this ).dialog( "close" ); $(this).dialog("close");
} }
} }
] ]
}); });
}); });
$('.easy-pie-chart.percentage').each(function(){ $('.easy-pie-chart.percentage').each(function () {
var $box = $(this).closest('.infobox'); var $box = $(this).closest('.infobox');
var barColor = $(this).data('color') || (!$box.hasClass('infobox-dark') ? $box.css('color') : 'rgba(255,255,255,0.95)'); var barColor = $(this).data('color') || (!$box.hasClass('infobox-dark') ? $box.css('color') : 'rgba(255,255,255,0.95)');
var trackColor = barColor == 'rgba(255,255,255,0.95)' ? 'rgba(255,255,255,0.25)' : '#E2E2E2'; var trackColor = barColor == 'rgba(255,255,255,0.95)' ? 'rgba(255,255,255,0.25)' : '#E2E2E2';
...@@ -334,21 +352,21 @@ ...@@ -334,21 +352,21 @@
trackColor: trackColor, trackColor: trackColor,
scaleColor: false, scaleColor: false,
lineCap: 'butt', lineCap: 'butt',
lineWidth: parseInt(size/10), lineWidth: parseInt(size / 10),
animate: /msie\s*(8|7|6)/.test(navigator.userAgent.toLowerCase()) ? false : 1000, animate: /msie\s*(8|7|6)/.test(navigator.userAgent.toLowerCase()) ? false : 1000,
size: size size: size
}); });
}) })
$('.sparkline').each(function(){ $('.sparkline').each(function () {
var $box = $(this).closest('.infobox'); var $box = $(this).closest('.infobox');
var barColor = !$box.hasClass('infobox-dark') ? $box.css('color') : '#FFF'; var barColor = !$box.hasClass('infobox-dark') ? $box.css('color') : '#FFF';
$(this).sparkline('html', $(this).sparkline('html',
{ {
tagValuesAttribute:'data-values', tagValuesAttribute: 'data-values',
type: 'bar', type: 'bar',
barColor: barColor , barColor: barColor,
chartRangeMin:$(this).data('min') || 0 chartRangeMin: $(this).data('min') || 0
}); });
}); });
...@@ -357,20 +375,20 @@ ...@@ -357,20 +375,20 @@
//but sometimes it brings up errors with normal resize event handlers //but sometimes it brings up errors with normal resize event handlers
$.resize.throttleWindow = false; $.resize.throttleWindow = false;
var placeholder = $('#piechart-placeholder').css({'width':'90%' , 'min-height':'150px'}); var placeholder = $('#piechart-placeholder').css({'width': '90%', 'min-height': '150px'});
var data = [ var data = [
{ label: "social networks", data: 38.7, color: "#68BC31"}, {label: "social networks", data: 38.7, color: "#68BC31"},
{ label: "search engines", data: 24.5, color: "#2091CF"}, {label: "search engines", data: 24.5, color: "#2091CF"},
{ label: "ad campaigns", data: 8.2, color: "#AF4E96"}, {label: "ad campaigns", data: 8.2, color: "#AF4E96"},
{ label: "direct traffic", data: 18.6, color: "#DA5430"}, {label: "direct traffic", data: 18.6, color: "#DA5430"},
{ label: "other", data: 10, color: "#FEE074"} {label: "other", data: 10, color: "#FEE074"}
] ]
function drawPieChart(placeholder, data, position) { function drawPieChart(placeholder, data, position) {
$.plot(placeholder, data, { $.plot(placeholder, data, {
series: { series: {
pie: { pie: {
show: true, show: true,
tilt:0.8, tilt: 0.8,
highlight: { highlight: {
opacity: 0.25 opacity: 0.25
}, },
...@@ -385,7 +403,7 @@ ...@@ -385,7 +403,7 @@
show: true, show: true,
position: position || "ne", position: position || "ne",
labelBoxBorderColor: null, labelBoxBorderColor: null,
margin:[-30,15] margin: [-30, 15]
} }
, ,
grid: { grid: {
...@@ -409,13 +427,13 @@ ...@@ -409,13 +427,13 @@
var previousPoint = null; var previousPoint = null;
placeholder.on('plothover', function (event, pos, item) { placeholder.on('plothover', function (event, pos, item) {
if(item) { if (item) {
if (previousPoint != item.seriesIndex) { if (previousPoint != item.seriesIndex) {
previousPoint = item.seriesIndex; previousPoint = item.seriesIndex;
var tip = item.series['label'] + " : " + item.series['percent']+'%'; var tip = item.series['label'] + " : " + item.series['percent'] + '%';
$tooltip.show().children(0).text(tip); $tooltip.show().children(0).text(tip);
} }
$tooltip.css({top:pos.pageY + 10, left:pos.pageX + 10}); $tooltip.css({top: pos.pageY + 10, left: pos.pageX + 10});
} else { } else {
$tooltip.hide(); $tooltip.hide();
previousPoint = null; previousPoint = null;
...@@ -424,7 +442,7 @@ ...@@ -424,7 +442,7 @@
}); });
///////////////////////////////////// /////////////////////////////////////
$(document).one('ajaxloadstart.page', function(e) { $(document).one('ajaxloadstart.page', function (e) {
$tooltip.remove(); $tooltip.remove();
}); });
...@@ -447,17 +465,17 @@ ...@@ -447,17 +465,17 @@
} }
var sales_charts = $('#sales-charts').css({'width':'100%' , 'height':'220px'}); var sales_charts = $('#sales-charts').css({'width': '100%', 'height': '220px'});
$.plot("#sales-charts", [ $.plot("#sales-charts", [
{ label: "Domains", data: d1 }, {label: "Domains", data: d1},
{ label: "Hosting", data: d2 }, {label: "Hosting", data: d2},
{ label: "Services", data: d3 } {label: "Services", data: d3}
], { ], {
hoverable: true, hoverable: true,
shadowSize: 0, shadowSize: 0,
series: { series: {
lines: { show: true }, lines: {show: true},
points: { show: true } points: {show: true}
}, },
xaxis: { xaxis: {
tickLength: 0 tickLength: 0
...@@ -469,9 +487,9 @@ ...@@ -469,9 +487,9 @@
tickDecimals: 3 tickDecimals: 3
}, },
grid: { grid: {
backgroundColor: { colors: [ "#fff", "#fff" ] }, backgroundColor: {colors: ["#fff", "#fff"]},
borderWidth: 1, borderWidth: 1,
borderColor:'#555' borderColor: '#555'
} }
}); });
...@@ -486,7 +504,8 @@ ...@@ -486,7 +504,8 @@
var off2 = $source.offset(); var off2 = $source.offset();
//var w2 = $source.width(); //var w2 = $source.width();
if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right'; if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2))
return 'right';
return 'left'; return 'left';
} }
...@@ -499,42 +518,47 @@ ...@@ -499,42 +518,47 @@
//Android's default browser somehow is confused when tapping on label which will lead to dragging the task //Android's default browser somehow is confused when tapping on label which will lead to dragging the task
//so disable dragging when clicking on label //so disable dragging when clicking on label
var agent = navigator.userAgent.toLowerCase(); var agent = navigator.userAgent.toLowerCase();
if("ontouchstart" in document && /applewebkit/.test(agent) && /android/.test(agent)) if ("ontouchstart" in document && /applewebkit/.test(agent) && /android/.test(agent))
$('#tasks').on('touchstart', function(e){ $('#tasks').on('touchstart', function (e) {
var li = $(e.target).closest('#tasks li'); var li = $(e.target).closest('#tasks li');
if(li.length == 0)return; if (li.length == 0)
return;
var label = li.find('label.inline').get(0); var label = li.find('label.inline').get(0);
if(label == e.target || $.contains(label, e.target)) e.stopImmediatePropagation() ; if (label == e.target || $.contains(label, e.target))
e.stopImmediatePropagation();
}); });
$('#tasks').sortable({ $('#tasks').sortable({
opacity:0.8, opacity: 0.8,
revert:true, revert: true,
forceHelperSize:true, forceHelperSize: true,
placeholder: 'draggable-placeholder', placeholder: 'draggable-placeholder',
forcePlaceholderSize:true, forcePlaceholderSize: true,
tolerance:'pointer', tolerance: 'pointer',
stop: function( event, ui ) { stop: function (event, ui) {
//just for Chrome!!!! so that dropdowns on items don't appear below other items after being moved //just for Chrome!!!! so that dropdowns on items don't appear below other items after being moved
$(ui.item).css('z-index', 'auto'); $(ui.item).css('z-index', 'auto');
} }
} }
); );
$('#tasks').disableSelection(); $('#tasks').disableSelection();
$('#tasks input:checkbox').removeAttr('checked').on('click', function(){ $('#tasks input:checkbox').removeAttr('checked').on('click', function () {
if(this.checked) $(this).closest('li').addClass('selected'); if (this.checked)
else $(this).closest('li').removeClass('selected'); $(this).closest('li').addClass('selected');
else
$(this).closest('li').removeClass('selected');
}); });
//show the dropdowns on top or bottom depending on window height and menu position //show the dropdowns on top or bottom depending on window height and menu position
$('#task-tab .dropdown-hover').on('mouseenter', function(e) { $('#task-tab .dropdown-hover').on('mouseenter', function (e) {
var offset = $(this).offset(); var offset = $(this).offset();
var $w = $(window) var $w = $(window)
if (offset.top > $w.scrollTop() + $w.innerHeight() - 100) if (offset.top > $w.scrollTop() + $w.innerHeight() - 100)
$(this).addClass('dropup'); $(this).addClass('dropup');
else $(this).removeClass('dropup'); else
$(this).removeClass('dropup');
}); });
...@@ -543,13 +567,13 @@ ...@@ -543,13 +567,13 @@
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
$(document).ready( function() { $(document).ready(function () {
jQuery("#registroEncuesta").validationEngine(); jQuery("#registroEncuesta").validationEngine();
}); });
function cargando(){ function cargando() {
$( "#dialog-cargando" ).removeClass('hide').dialog({ $("#dialog-cargando").removeClass('hide').dialog({
resizable: false, resizable: false,
modal: true, modal: true,
title: "<div class='widget-header' ><h4 class='smaller'><i class='fa fa-spinner'></i> Cargando...</h4></div>", title: "<div class='widget-header' ><h4 class='smaller'><i class='fa fa-spinner'></i> Cargando...</h4></div>",
...@@ -557,89 +581,154 @@ ...@@ -557,89 +581,154 @@
}); });
} }
function close_carga(){ function close_carga() {
$( "#dialog-cargando" ).dialog( "close" ); $("#dialog-cargando").dialog("close");
} }
function validar_busqueda(){ function validar_busqueda() {
var estado=$('#registroEncuesta').validationEngine('validate'); var estado = $('#registroEncuesta').validationEngine('validate');
if(estado){ if (estado) {
//si esta vacio //si esta vacio
var pagina=1; var pagina = 1;
BuscarDocente(pagina); BuscarDocente(pagina);
}else{ } else {
$("#txt_bus_doc").val(""); $("#txt_bus_doc").val("");
$("#listaDocenteBusqueda").fadeOut(); $("#listaDocenteBusqueda").fadeOut();
} }
} }
function alerta_darBaja(opcion){
$("#dialog-Alerta2").removeClass('hide').dialog({
resizable: false,
modal: true,
title: "<div class='widget-color-blue' ><div class='widget-header white' ><h4 class='smaller' ><i class='ace-icon fa fa-check-circle white'></i> <span class='white'>Conformidad</span></h4></div></div>",
title_html: true,
buttons: [
{
html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; SI",
"class": "btn btn-primary btn-xs",
click: function () {
$(this).dialog("close");
return opcion(true)
}
}, {
html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; NO",
"class": "btn btn-danger btn-xs",
click: function () {
$(this).dialog("close");
}
}
]
});
}
function BuscarDocente(pagina){ function darDeBaja(codigo) {
alerta_darBaja(opcion => {
if(opcion) {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
if (codigo != null) {
$.ajax({
type: 'POST',
url: '../ServletDocente?Accion=darDeBaja',
data: 'codigo=' + codigo + '&periodo=' + periodo,
beforeSend: function () {
cargando();
}, success: function (resultado) {
close_carga();
popup_exito()
validar_busqueda()
}
});
}
}
})
}
function popup_exito() {
$("#dialog-noti2").removeClass('hide').dialog({
resizable: false,
modal: true,
title: "<div class='widget-color-green' ><div class='widget-header white' ><h4 class='smaller' ><i class='ace-icon fa fa-tags white'></i> <span class='white'>Notificación</span></h4></div></div>",
title_html: true,
buttons: [
{
html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; ACEPTAR",
"class": "btn btn-success btn-xs",
click: function () {
$(this).dialog("close");
}
}
]
});
}
function BuscarDocente(pagina) {
var accion = ""; var accion = "";
var cantidad=15; var cantidad = 15;
var apellido = $("#txt_bus_doc").val(); var apellido = $("#txt_bus_doc").val();
$("#ape").val(apellido); $("#ape").val(apellido);
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
$.ajax({ $.ajax({
type:'POST', type: 'POST',
url:'../ServletDocente?Accion=buscarDocenteHorario', url: '../ServletDocente?Accion=buscarDocenteHorario',
data: 'accion='+accion+'&apellido='+apellido+'&pagina='+pagina+'&cantidad='+cantidad+'&periodo='+periodo, data: 'accion=' + accion + '&apellido=' + apellido + '&pagina=' + pagina + '&cantidad=' + cantidad + '&periodo=' + periodo,
beforeSend: function() { beforeSend: function () {
cargando(); cargando();
},success:function(resultado){ }, success: function (resultado) {
close_carga(); close_carga();
$("#divListadoDoc").html(resultado); $("#divListadoDoc").html(resultado);
},complete:function(){ }, complete: function () {
if(apellido==""){ if (apellido == "") {
$("#listaDocenteBusqueda").fadeOut(); $("#listaDocenteBusqueda").fadeOut();
}else{ } else {
$("#listaDocenteBusqueda").fadeIn(); $("#listaDocenteBusqueda").fadeIn();
} }
} }
}); });
} }
function exportarUsuario(){ function exportarUsuario() {
var apellido = $("#ape").val(); var apellido = $("#ape").val();
window.location="exportarUsuarioDocente.jsp?apellido="+apellido; window.location = "exportarUsuarioDocente.jsp?apellido=" + apellido;
} }
function exportarTodoUsuario(){ function exportarTodoUsuario() {
// var apellido = $("#txt_bus_doc").val(); // var apellido = $("#txt_bus_doc").val();
window.location="exportarTodoUsuDocente.jsp"; window.location = "exportarTodoUsuDocente.jsp";
} }
function armarHorarioDocente(codDocente,nombre){ function armarHorarioDocente(codDocente, nombre) {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
$.ajax({ $.ajax({
type:'POST', type: 'POST',
url:'../ServletHorario?Accion=verHorarioDocente', url: '../ServletHorario?Accion=verHorarioDocente',
data: 'codDocente='+codDocente+'&nombre='+nombre+'&periodo='+periodo, data: 'codDocente=' + codDocente + '&nombre=' + nombre + '&periodo=' + periodo,
success:function(resultado){ success: function (resultado) {
$("#divFormulario").html(resultado); $("#divFormulario").html(resultado);
},complete:function(){ }, complete: function () {
verHorarioDocente(codDocente,nombre); verHorarioDocente(codDocente, nombre);
} }
}); });
} }
function armarHorarioDocente2(codDocente,nombre){ function armarHorarioDocente2(codDocente, nombre) {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
$.ajax({ $.ajax({
type:'POST', type: 'POST',
url:'../ServletHorario?Accion=verHorarioDocente2', url: '../ServletHorario?Accion=verHorarioDocente2',
data: 'codDocente='+codDocente+'&nombre='+nombre+'&periodo='+periodo, data: 'codDocente=' + codDocente + '&nombre=' + nombre + '&periodo=' + periodo,
success:function(resultado){ success: function (resultado) {
$("#divFormulario").html(resultado); $("#divFormulario").html(resultado);
},complete:function(){ }, complete: function () {
verHorarioDocente(codDocente,nombre); verHorarioDocente(codDocente, nombre);
} }
}); });
} }
function verHorarioDocente(codDocente,nombre){ function verHorarioDocente(codDocente, nombre) {
$( "#dialog-armar" ).removeClass('hide').dialog({ $("#dialog-armar").removeClass('hide').dialog({
resizable: false, resizable: false,
width: 900, width: 900,
modal: true, modal: true,
...@@ -648,9 +737,9 @@ ...@@ -648,9 +737,9 @@
buttons: [ buttons: [
{ {
html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; ACEPTAR", html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; ACEPTAR",
"class" : "btn btn-primary btn-xs", "class": "btn btn-primary btn-xs",
click: function() { click: function () {
$( this ).dialog( "close" ); $(this).dialog("close");
} }
} }
] ]
...@@ -659,41 +748,42 @@ ...@@ -659,41 +748,42 @@
} }
function exportar(codDocente){ function exportar(codDocente) {
window.location="exportarHorarioDocente.jsp?codDocente="+codDocente; window.location = "exportarHorarioDocente.jsp?codDocente=" + codDocente;
} }
function exportarCompleto(codDocente){ function exportarCompleto(codDocente) {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
window.location="exportarHorarioDocenteCompletoPeriodo.jsp?codDocente="+codDocente+'&periodo='+periodo; window.location = "exportarHorarioDocenteCompletoPeriodo.jsp?codDocente=" + codDocente + '&periodo=' + periodo;
} }
function exportarCompletoReducido(codDocente){ function exportarCompletoReducido(codDocente) {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
window.location="exportarHorarioDocenteCompletoReducidoPeriodo.jsp?codDocente="+codDocente+'&periodo='+periodo; window.location = "exportarHorarioDocenteCompletoReducidoPeriodo.jsp?codDocente=" + codDocente + '&periodo=' + periodo;
} }
function exportarTodo(){ function exportarTodo() {
window.location="exportarHorarioDocenteTodo.jsp"; window.location = "exportarHorarioDocenteTodo.jsp";
} }
function exportarTodoCompleto(){ function exportarTodoCompleto() {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
window.location="exportarHorarioDocenteTodoCompletoPeriodo.jsp?periodo="+periodo; window.location = "exportarHorarioDocenteTodoCompletoPeriodo.jsp?periodo=" + periodo;
} }
function exportarTodoCompletoReducido(){ function exportarTodoCompletoReducido() {
var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>"; var periodo = "<%=periodo!=null?periodo.getCodigoPeriodo():""%>";
window.location="exportarHorarioDocenteTodoCompletoPeriodoReducido.jsp?periodo="+periodo; window.location = "exportarHorarioDocenteTodoCompletoPeriodoReducido.jsp?periodo=" + periodo;
} }
function enter(e) { function enter(e) {
tecla = (document.all) ? e.keyCode : e.which; tecla = (document.all) ? e.keyCode : e.which;
if (tecla==13) validar_busqueda(); if (tecla == 13)
validar_busqueda();
} }
$('input').keypress(function(e){ $('input').keypress(function (e) {
if(e.which == 13){ if (e.which == 13) {
return false; return false;
} }
}); });
...@@ -707,7 +797,7 @@ ...@@ -707,7 +797,7 @@
<link rel="stylesheet" href="../assets/css/ace.onpage-help.css" /> <link rel="stylesheet" href="../assets/css/ace.onpage-help.css" />
<link rel="stylesheet" href="../docs/assets/js/themes/sunburst.css" /> <link rel="stylesheet" href="../docs/assets/js/themes/sunburst.css" />
<script type="text/javascript"> ace.vars['base'] = '..'; </script> <script type="text/javascript"> ace.vars['base'] = '..';</script>
<script src="../assets/js/ace/elements.onpage-help.js"></script> <script src="../assets/js/ace/elements.onpage-help.js"></script>
<script src="../assets/js/ace/ace.onpage-help.js"></script> <script src="../assets/js/ace/ace.onpage-help.js"></script>
<script src="../docs/assets/js/rainbow.js"></script> <script src="../docs/assets/js/rainbow.js"></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