Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
horario
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Juan Guevara Mayta
horario
Commits
f3a10347
Commit
f3a10347
authored
Jan 14, 2020
by
sistem02 user
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] disponibilidad por area
parent
5e1db259
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1054 additions
and
1046 deletions
+1054
-1046
Usuario.java
src/java/pe/siso/horario/Beans/Usuario.java
+9
-0
MySqlDAOFactory.java
src/java/pe/siso/horario/MySqlDAO/MySqlDAOFactory.java
+37
-36
MySqlUsuarioDAO.java
src/java/pe/siso/horario/MySqlDAO/MySqlUsuarioDAO.java
+3
-1
ServletUsuario.java
src/java/pe/siso/horario/Servlets/ServletUsuario.java
+2
-1
vistaDobleDisponibilidad.jsp
web/vista/vistaDobleDisponibilidad.jsp
+1003
-1008
No files found.
src/java/pe/siso/horario/Beans/Usuario.java
View file @
f3a10347
...
@@ -13,6 +13,7 @@ import java.io.Serializable;
...
@@ -13,6 +13,7 @@ import java.io.Serializable;
* @author fcelestino
* @author fcelestino
*/
*/
public
class
Usuario
implements
Serializable
{
public
class
Usuario
implements
Serializable
{
private
int
codarea
;
private
int
codigoUsuario
;
private
int
codigoUsuario
;
private
int
codigoTipoUsuario
;
private
int
codigoTipoUsuario
;
private
int
codigoSede
;
private
int
codigoSede
;
...
@@ -34,6 +35,14 @@ public class Usuario implements Serializable{
...
@@ -34,6 +35,14 @@ public class Usuario implements Serializable{
this
.
dni
=
dni
;
this
.
dni
=
dni
;
}
}
public
int
getCodarea
()
{
return
codarea
;
}
public
void
setCodarea
(
int
codarea
)
{
this
.
codarea
=
codarea
;
}
public
String
getNombreTipoUsuario
()
{
public
String
getNombreTipoUsuario
()
{
return
nombreTipoUsuario
;
return
nombreTipoUsuario
;
}
}
...
...
src/java/pe/siso/horario/MySqlDAO/MySqlDAOFactory.java
View file @
f3a10347
...
@@ -59,16 +59,16 @@ public class MySqlDAOFactory extends DAOFactory {
...
@@ -59,16 +59,16 @@ public class MySqlDAOFactory extends DAOFactory {
try
{
try
{
conexion
=
DriverManager
.
getConnection
(
conexion
=
DriverManager
.
getConnection
(
// "jdbc:mysql://
172.16.2.68
:3306/encuesta_docente",
// "jdbc:mysql://
SERVERPRUEBA
:3306/encuesta_docente",
// "
christian
",
// "
desarrollo
",
// "
serverpla
");
// "
5VC02019
");
//
"jdbc:mysql://localhost:3306/encuesta_docente",
"jdbc:mysql://localhost:3306/encuesta_docente"
,
// "root
",
"billy
"
,
// "mysql
");
"billy
"
);
// //server_winpla
// //server_winpla
"jdbc:mysql://172.16.2.68:3306/encuesta_docente"
,
//
"jdbc:mysql://172.16.2.68:3306/encuesta_docente",
"sis_horarios"
,
//
"sis_horarios",
"Sy356ho899"
);
//
"Sy356ho899");
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
...
@@ -80,16 +80,16 @@ public class MySqlDAOFactory extends DAOFactory {
...
@@ -80,16 +80,16 @@ public class MySqlDAOFactory extends DAOFactory {
try
{
try
{
conexion
=
DriverManager
.
getConnection
(
conexion
=
DriverManager
.
getConnection
(
// "jdbc:mysql://
172.16.2.68
:3306/nuevo",
// "jdbc:mysql://
SERVERPRUEBA
:3306/nuevo",
// "
christian
",
// "
desarrollo
",
// "
serverpla
");
// "
5VC02019
");
//
"jdbc:mysql://localhost:3306/nuevo",
"jdbc:mysql://localhost:3306/nuevo"
,
// "root
",
"billy
"
,
// "mysql
");
"billy
"
);
//server_winpla
//server_winpla
"jdbc:mysql://172.16.2.68:3306/nuevo"
,
//
"jdbc:mysql://172.16.2.68:3306/nuevo",
"sis_horarios"
,
//
"sis_horarios",
"Sy356ho899"
);
//
"Sy356ho899");
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
...
@@ -101,16 +101,16 @@ public class MySqlDAOFactory extends DAOFactory {
...
@@ -101,16 +101,16 @@ public class MySqlDAOFactory extends DAOFactory {
try
{
try
{
conexion
=
DriverManager
.
getConnection
(
conexion
=
DriverManager
.
getConnection
(
// "jdbc:mysql://
172.16.2.68
:3306/horarios_docente",
// "jdbc:mysql://
SERVERPRUEBA
:3306/horarios_docente",
// "
christian
",
// "
desarrollo
",
//
"serverpla
");
//
"5VC02019
");
//
"jdbc:mysql://localhost:3306/horarios_docente",
"jdbc:mysql://localhost:3306/horarios_docente"
,
// "root
",
"billy
"
,
// "mysql
");
"billy
"
);
//server_winpla
//server_winpla
"jdbc:mysql://172.16.2.68:3306/horarios_docente"
,
//
"jdbc:mysql://172.16.2.68:3306/horarios_docente",
"sis_horarios"
,
//
"sis_horarios",
"Sy356ho899"
);
//
"Sy356ho899");
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
...
@@ -121,16 +121,16 @@ public class MySqlDAOFactory extends DAOFactory {
...
@@ -121,16 +121,16 @@ public class MySqlDAOFactory extends DAOFactory {
try
{
try
{
conexion
=
DriverManager
.
getConnection
(
conexion
=
DriverManager
.
getConnection
(
// "jdbc:mysql://172.16.2.68
:3306/sacoolive3",
"jdbc:mysql://localhost
:3306/sacoolive3"
,
// "christian
",
"billy
"
,
// "serverpla
");
"billy
"
);
// "jdbc:mysql://
localhost
:3306/sacoolive3",
// "jdbc:mysql://
SERVERPRUEBA
:3306/sacoolive3",
// "
root
",
// "
desarrollo
",
// "
mysql
");
// "
5VC02019
");
//server_winpla
//server_winpla
"jdbc:mysql://172.16.2.68:3306/sacoolive3"
,
//
"jdbc:mysql://172.16.2.68:3306/sacoolive3",
"sis_horarios"
,
//
"sis_horarios",
"Sy356ho899"
);
//
"Sy356ho899");
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -306,4 +306,5 @@ public class MySqlDAOFactory extends DAOFactory {
...
@@ -306,4 +306,5 @@ public class MySqlDAOFactory extends DAOFactory {
return
new
MySqlPlanAcademicoDAO
();
return
new
MySqlPlanAcademicoDAO
();
}
}
}
}
src/java/pe/siso/horario/MySqlDAO/MySqlUsuarioDAO.java
View file @
f3a10347
...
@@ -52,15 +52,17 @@ public class MySqlUsuarioDAO implements UsuarioDAO {
...
@@ -52,15 +52,17 @@ public class MySqlUsuarioDAO implements UsuarioDAO {
cnx
=
MySqlDAOFactory
.
obtenerConexion
(
base
);
cnx
=
MySqlDAOFactory
.
obtenerConexion
(
base
);
Statement
st
=
cnx
.
createStatement
();
Statement
st
=
cnx
.
createStatement
();
String
query
=
"SELECT
usuario.cod_usu,usuario.cod_tip_usu,
usuario.ani_usu, usuario.usu_usu, usuario.cla_usu, usuario.cod_loc, usuario.est_usu, tipo_usuario.nom_tip_usu, sede.des_loc "
String
query
=
"SELECT
area.cod_area,usuario.cod_usu,usuario.cod_tip_usu,
usuario.ani_usu, usuario.usu_usu, usuario.cla_usu, usuario.cod_loc, usuario.est_usu, tipo_usuario.nom_tip_usu, sede.des_loc "
+
"FROM usuario "
+
"FROM usuario "
+
"LEFT JOIN sede ON sede.cod_loc = usuario.cod_loc "
+
"LEFT JOIN sede ON sede.cod_loc = usuario.cod_loc "
+
"LEFT JOIN area ON usuario.cod_usu=area.cod_usuario"
+
"INNER JOIN tipo_usuario ON tipo_usuario.cod_tip_usu = usuario.cod_tip_usu "
+
"INNER JOIN tipo_usuario ON tipo_usuario.cod_tip_usu = usuario.cod_tip_usu "
+
"WHERE usuario.usu_usu='"
+
usuario
+
"' and usuario.cla_usu='"
+
clave
+
"' and usuario.est_usu='1'"
;
+
"WHERE usuario.usu_usu='"
+
usuario
+
"' and usuario.cla_usu='"
+
clave
+
"' and usuario.est_usu='1'"
;
ResultSet
rs
=
st
.
executeQuery
(
query
);
ResultSet
rs
=
st
.
executeQuery
(
query
);
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
usuario1
.
setCodarea
(
rs
.
getInt
(
"cod_area"
));
usuario1
.
setCodigoUsuario
(
rs
.
getInt
(
"cod_usu"
));
usuario1
.
setCodigoUsuario
(
rs
.
getInt
(
"cod_usu"
));
usuario1
.
setCodigoTipoUsuario
(
rs
.
getInt
(
"cod_tip_usu"
));
usuario1
.
setCodigoTipoUsuario
(
rs
.
getInt
(
"cod_tip_usu"
));
usuario1
.
setCodigoSede
(
rs
.
getInt
(
"cod_loc"
));
usuario1
.
setCodigoSede
(
rs
.
getInt
(
"cod_loc"
));
...
...
src/java/pe/siso/horario/Servlets/ServletUsuario.java
View file @
f3a10347
...
@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServlet;
...
@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServlet;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
javax.servlet.http.HttpSession
;
import
pe.siso.horario.Beans.Area
;
import
pe.siso.horario.Beans.PeriodoAcademico
;
import
pe.siso.horario.Beans.PeriodoAcademico
;
import
pe.siso.horario.Beans.Usuario
;
import
pe.siso.horario.Beans.Usuario
;
import
pe.siso.horario.Beans.UsuarioDocente
;
import
pe.siso.horario.Beans.UsuarioDocente
;
...
@@ -111,7 +112,7 @@ public class ServletUsuario extends HttpServlet {
...
@@ -111,7 +112,7 @@ public class ServletUsuario extends HttpServlet {
String
SessionId
=
session_actual
.
getId
();
String
SessionId
=
session_actual
.
getId
();
//System.out.println(SessionId);
//System.out.println(SessionId);
usuarioConsul
.
setIdentificadorSesion
(
SessionId
);
usuarioConsul
.
setIdentificadorSesion
(
SessionId
);
session_actual
.
setAttribute
(
"usuario"
,
usuarioConsul
);
session_actual
.
setAttribute
(
"usuario"
,
usuarioConsul
);
periodo
.
setCodigoPeriodo
(
periodoAcademico
);
periodo
.
setCodigoPeriodo
(
periodoAcademico
);
periodo
.
setNombrePeriodo
(
nombrePeriodo
);
periodo
.
setNombrePeriodo
(
nombrePeriodo
);
...
...
web/vista/vistaDobleDisponibilidad.jsp
View file @
f3a10347
<
%
--
<
%@
page
import=
"pe.siso.horario.Beans.Usuario"
%
>
Document
:
vistaDobleDisponibilidad
Created
on
:
17-nov-2018
,
8:48:37
Author
:
sistem20user
--
%
>
<
%@
page
contentType=
"text/html"
pageEncoding=
"UTF-8"
%
>
<
%@
page
contentType=
"text/html"
pageEncoding=
"UTF-8"
%
>
<
%@
page
import=
"pe.siso.horario.Beans.PeriodoAcademico"
%
>
<
%@
page
import=
"pe.siso.horario.Beans.PeriodoAcademico"
%
>
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
VISTA DOBLE DISPONIBILIDAD
</title>
<title>
VISTA DOBLE DISPONIBILIDAD
</title>
<link
rel=
"stylesheet"
href=
"../assets/css/jquery-ui.css"
/>
<link
rel=
"stylesheet"
href=
"../assets/css/jquery-ui.css"
/>
<!-- Compiled and minified CSS -->
<!-- Compiled and minified CSS -->
<link
rel=
"stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"
>
<link
rel=
"stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"
>
<link
href=
"https://fonts.googleapis.com/icon?family=Material+Icons"
rel=
"stylesheet"
>
<link
href=
"https://fonts.googleapis.com/icon?family=Material+Icons"
rel=
"stylesheet"
>
<link
href=
"css/snackbar.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"css/snackbar.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"css/alert.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"css/alert.css"
rel=
"stylesheet"
type=
"text/css"
/>
<!-- Compiled and minified JavaScript -->
<!-- Compiled and minified JavaScript -->
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"
></script>
<!--jquery-->
<!--jquery-->
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
></script>
<!--axios-->
<!--axios-->
<script
src=
"https://unpkg.com/axios/dist/axios.min.js"
></script>
<script
src=
"https://unpkg.com/axios/dist/axios.min.js"
></script>
<
%
<
%
HttpSession
session_actual =
request.getSession(true);
HttpSession
session_actual =
request.getSession(true);
PeriodoAcademico
periodo=
(PeriodoAcademico)session_actual.getAttribute("periodo");
Usuario
usuario =
(Usuario)
session_actual
.
getAttribute
("
usuario
");
%
>
PeriodoAcademico
periodo =
(PeriodoAcademico)
session_actual
.
getAttribute
("
periodo
");
<style
type=
"text/css"
>
System
.
out
.
println
("*******************");
@media
print
{
System
.
out
.
println
(
usuario
.
getCodarea
());
#divBusqueda
{
display
:
none
}
%
>
#lblTitulo
{
text-align
:
center
;
font-size
:
40px
;
font-weight
:
bold
}
<style
type=
"text/css"
>
}
@media
print
{
td
{
#divBusqueda
{
display
:
none
}
border
:
3px
solid
;
#lblTitulo
{
text-align
:
center
;
font-size
:
40px
;
font-weight
:
bold
}
text-align
:
center
;
}
}
td
{
border
:
3px
solid
;
text-align
:
center
;
body
{
}
background-image
:
url(../assets/images/fondo-trismegisto.png)
;
height
:
500px
;
max-width
:
100%
;
body
{
background-repeat
:
no-repeat
;
background-image
:
url(../assets/images/fondo-trismegisto.png)
;
background-size
:
100%
100%
;
height
:
500px
;
background-attachment
:
fixed
;
max-width
:
100%
;
background-repeat
:
no-repeat
;
}
background-size
:
100%
100%
;
background-attachment
:
fixed
;
body
::after
{
}
content
:
""
;
position
:
absolute
;
top
:
0%
;
body
::after
{
left
:
0%
;
content
:
""
;
width
:
100%
;
position
:
absolute
;
height
:
100%
;
top
:
0%
;
background
:
rgba
(
255
,
255
,
255
,
0.9
);
left
:
0%
;
z-index
:
-1
;
width
:
100%
;
position
:
fixed
;
height
:
100%
;
}
background
:
rgba
(
255
,
255
,
255
,
0.9
);
z-index
:
-1
;
.colorVerde
{
position
:
fixed
;
background-color
:
#96d089
;
}
}
.colorVerde
{
.colorRojo
{
background-color
:
#96d089
;
background-color
:
#d0766f
;
}
}
.colorRojo
{
.colorAzul
{
background-color
:
#d0766f
;
background-color
:
#59a1da
;
}
}
.colorAzul
{
background-color
:
#59a1da
;
}
</style>
<script
type=
"text/javascript"
language=
"javascript"
>
</style>
function
alertDGC
(
mensaje
)
{
<script
type=
"text/javascript"
language=
"javascript"
>
var
dgcTiempo
=
500
var
ventanaCS
=
'<div class="dgcAlert"><div class="dgcVentana"><div class="dgcCerrar"></div><div class="dgcMensaje">'
+
mensaje
+
'<br><div class="dgcAceptar">Aceptar</div></div></div></div>'
;
function
alertDGC
(
mensaje
)
{
var
dgcTiempo
=
500
var
ventanaCS
=
'<div class="dgcAlert"><div class="dgcVentana"><div class="dgcCerrar"></div><div class="dgcMensaje">'
+
mensaje
+
'<br><div class="dgcAceptar">Aceptar</div></div></div></div>'
;
// var bodyCS='
<
input
type
=
"text"
value
=
"prueba"
>
';
// var bodyCS='
<
input
type
=
"text"
value
=
"prueba"
>
';
$('
body
').append(ventanaCS);
$('
body
').append(ventanaCS);
// $('
body
').append(bodyCS);
// $('
body
').append(bodyCS);
var alVentana = $('
.
dgcVentana
').height();
var alVentana = $('
.
dgcVentana
').height();
var alNav = $(window).height();
var alNav = $(window).height();
var supNav = $(window).scrollTop();
var supNav = $(window).scrollTop();
$('
.
dgcAlert
').css('
height
', $(document).height());
$('
.
dgcAlert
').css('
height
', $(document).height());
$('
.
dgcVentana
').css('
top
', ((alNav - alVentana) / 2 + supNav - 100) + '
px
');
$('
.
dgcVentana
').css('
top
', ((alNav - alVentana) / 2 + supNav - 100) + '
px
');
$('
.
dgcAlert
').css('
display
', '
block
');
$('
.
dgcAlert
').css('
display
', '
block
');
$('
.
dgcAlert
').animate({opacity: 1}, dgcTiempo);
$('
.
dgcAlert
').animate({opacity: 1}, dgcTiempo);
$('
.
dgcCerrar
,.
dgcAceptar
').click(function (e) {
$('
.
dgcCerrar
,.
dgcAceptar
').click(function (e) {
$('
.
dgcAlert
').animate({opacity: 0}, dgcTiempo);
$('
.
dgcAlert
').animate({opacity: 0}, dgcTiempo);
setTimeout("$('
.
dgcAlert
').remove()", dgcTiempo);
setTimeout("$('
.
dgcAlert
').remove()", dgcTiempo);
});
});
}
}
</script>
</script>
</head>
</head>
<body>
<body>
<script>
<script>
window
.
alert
=
function
(
message
)
{
window
.
alert
=
function
(
message
)
{
alertDGC
(
message
);
alertDGC
(
message
);
};
};
</script>
</script>
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"row"
id=
"divBusqueda"
>
<div
class=
"row"
id=
"divBusqueda"
>
<div
class=
"col s8 offset-s2"
>
<div
class=
"col s8 offset-s2"
>
<div
class=
"card"
>
<div
class=
"card"
>
<div
class=
"card-content"
>
<div
class=
"card-content"
>
<span
class=
"card-title"
style=
"font-weight: bold"
>
Buscar disponibilidad
</span>
<span
class=
"card-title"
style=
"font-weight: bold"
>
Buscar disponibilidad
</span>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"input-field col s6"
>
<div
class=
"input-field col s6"
>
<select
id=
"cbArea"
onchange=
"listarPlana(this);desactivarBuscar();desactivarPrint();"
>
<select
id=
"cbArea"
onchange=
"listarPlana(this);desactivarBuscar();desactivarPrint();"
>
</select>
</select>
<label>
Area:
</label>
<label>
Area:
</label>
</div>
</div>
<div
class=
"input-field col s6"
>
<div
class=
"input-field col s6"
>
<select
id=
"cbPlana"
onchange=
"activarBuscar();"
>
<select
id=
"cbPlana"
onchange=
"activarBuscar();"
>
</select>
</select>
<label>
Plana:
</label>
<label>
Plana:
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"card-action center"
>
<div
class=
"card-action center"
>
<a
class=
"waves-effect waves-light btn blue"
id=
"btnBuscar"
onclick=
"activarPrint();"
><i
class=
"material-icons left"
>
search
</i>
BUSCAR
</a>
<a
class=
"waves-effect waves-light btn blue"
id=
"btnBuscar"
onclick=
"activarPrint();"
><i
class=
"material-icons left"
>
search
</i>
BUSCAR
</a>
<a
class=
"waves-effect waves-light btn"
id=
"btnImprimir"
onclick=
"pintarTDRed();window.print();"
style=
"background-color: #5478a2;"
><i
class=
"material-icons dp48 left"
>
print
</i>
IMPRIMIR
</a><br>
<a
class=
"waves-effect waves-light btn"
id=
"btnImprimir"
onclick=
"pintarTDRed();window.print();"
style=
"background-color: #5478a2;"
><i
class=
"material-icons dp48 left"
>
print
</i>
IMPRIMIR
</a><br>
<!-- <a class="btn btn-app btn-light btn-xs align-left" onclick="window.print();" target="_blank" id="iconoImprimir">
<!-- <a class="btn btn-app btn-light btn-xs align-left" onclick="window.print();" target="_blank" id="iconoImprimir">
<i class="ace-icon fa fa-print bigger-160"></i>-->
<i class="ace-icon fa fa-print bigger-160"></i>-->
<label>
Zona:
</label>
<label>
Zona:
</label>
<select
id=
"cmbZonas"
onchange=
"listarDisponibilidad();activarPrint();"
>
<select
id=
"cmbZonas"
onchange=
"listarDisponibilidad();
</select>
activarPrint();"
>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col s12"
>
<div
class=
"row"
>
<div
class=
"card"
>
<div
class=
"col s12"
>
<div
class=
"card-content"
>
<div
class=
"card"
>
<span
class=
"card-title"
id=
"lblTitulo"
>
Lista de docentes y disponibilidad
</span>
<div
class=
"card-content"
>
<span
class=
"card-title"
id=
"lblTitulo"
>
Lista de docentes y disponibilidad
</span>
<div
class=
"row"
>
<div
id=
"divListaDisponibilidad"
>
<div
class=
"row"
>
<div
id=
"divListaDisponibilidad"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal Structure -->
</div>
<!-- Modal Structure -->
</div>
</div>
</div>
<!-- The actual snackbar -->
</div>
<div
id=
"snackbar"
>
Se bloqueo el dia correctamente..
</div>
<!-- The actual snackbar -->
<div
id=
"snackbar2"
>
Desbloqueado.
</div>
<div
id=
"snackbar"
>
Se bloqueo el dia correctamente..
</div>
<script>
<div
id=
"snackbar2"
>
Desbloqueado.
</div>
<script>
// $("#btnBuscar").attr('disabled','disabled');
// $("#btnBuscar").attr('disabled','disabled');
function
desactivarBuscar
()
{
function
desactivarBuscar
()
{
$
(
"#btnBuscar"
).
attr
(
'disabled'
,
'disabled'
);
$
(
"#btnBuscar"
).
attr
(
'disabled'
,
'disabled'
);
}
}
function
activarBuscar
()
{
function
activarBuscar
()
{
$
(
"#btnBuscar"
).
attr
(
'disabled'
,
false
);
$
(
"#btnBuscar"
).
attr
(
'disabled'
,
false
);
}
}
var
elems
=
document
.
querySelectorAll
(
'select'
);
var
elems
=
document
.
querySelectorAll
(
'select'
);
var
instances
=
M
.
FormSelect
;
var
instances
=
M
.
FormSelect
;
document
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
document
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
listarArea
()
listarArea
()
listarZona
()
listarZona
()
// setTimeout(function(){ alert("HOLA MASCOTA"); }, 5000);
// setTimeout(function(){ alert("HOLA MASCOTA"); }, 5000);
document
.
querySelector
(
'#btnBuscar'
).
addEventListener
(
'click'
,
function
()
{
document
.
querySelector
(
'#btnBuscar'
).
addEventListener
(
'click'
,
function
()
{
let
cmbZonas
=
$
(
"#cmbZonas option:selected"
).
text
();
let
cmbZonas
=
$
(
"#cmbZonas option:selected"
).
text
();
if
(
cmbZonas
===
"[SELECCIONE]"
)
{
if
(
cmbZonas
===
"[SELECCIONE]"
)
{
listarDisponibilidad
()
listarDisponibilidad
()
}
else
{
}
else
{
listarDisponibilidad
()
listarDisponibilidad
()
}
}
})
})
});
});
function
listarArea
()
{
function
listarArea
()
{
axios
.
get
(
'../ServletArea?Accion=cargarAreaJson'
)
axios
.
get
(
'../ServletArea?Accion=cargarAreaJson'
)
.
then
(
data
=>
{
.
then
(
data
=>
{
let
option
=
'<option value="">[SELECCIONE]</option>'
let
option
=
'<option value="">[SELECCIONE]</option>'
data
.
data
.
forEach
(
v
=>
{
data
.
data
.
forEach
(
v
=>
{
option
+=
'<option value="'
+
v
.
codigoArea
+
'">'
+
v
.
nombreArea
+
'</option>'
option
+=
'<option value="'
+
v
.
codigoArea
+
'">'
+
v
.
nombreArea
+
'</option>'
})
})
document
.
querySelector
(
'#cbArea'
).
innerHTML
=
option
document
.
querySelector
(
'#cbArea'
).
innerHTML
=
option
instances
.
init
(
elems
)
instances
.
init
(
elems
)
})
})
}
}
function
listarZona
()
{
function
listarZona
()
{
axios
.
get
(
'../ServletZona?Accion=cargarZonaJson'
)
axios
.
get
(
'../ServletZona?Accion=cargarZonaJson'
)
.
then
(
data
=>
{
.
then
(
data
=>
{
let
option
=
'<option value="">[SIN ZONA]</option><option value="T">TODAS LAS ZONAS</option>'
let
option
=
'<option value="">[SIN ZONA]</option><option value="T">TODAS LAS ZONAS</option>'
data
.
data
.
forEach
(
v
=>
{
data
.
data
.
forEach
(
v
=>
{
option
+=
'<option value="'
+
v
.
codigoZona
+
'">'
+
v
.
nombreZona
+
'</option>'
option
+=
'<option value="'
+
v
.
codigoZona
+
'">'
+
v
.
nombreZona
+
'</option>'
})
})
document
.
querySelector
(
'#cmbZonas'
).
innerHTML
=
option
document
.
querySelector
(
'#cmbZonas'
).
innerHTML
=
option
instances
.
init
(
elems
)
instances
.
init
(
elems
)
})
})
}
}
function
listarDisponibilidad
()
{
function
listarDisponibilidad
()
{
let
codigoPlana
=
document
.
querySelector
(
'#cbPlana'
).
value
let
codigoPlana
=
document
.
querySelector
(
'#cbPlana'
).
value
let
codigoPeriodo
=
'<%= periodo!=null?periodo.getCodigoPeriodo():
""%>'
let
codigoPeriodo
=
'<%= periodo != null ? periodo.getCodigoPeriodo() :
""%>'
console
.
log
(
codigoPeriodo
)
console
.
log
(
codigoPeriodo
)
let
codigoZona
=
document
.
querySelector
(
'#cmbZonas'
).
value
let
codigoZona
=
document
.
querySelector
(
'#cmbZonas'
).
value
// let distritos=new ZonaDistritoServices();
// let distritos=new ZonaDistritoServices();
if
(
codigoPlana
&&
codigoPeriodo
&&
codigoZona
)
{
if
(
codigoPlana
&&
codigoPeriodo
&&
codigoZona
)
{
let
json
=
{
codigoPlana
,
codigoPeriodo
,
codigoZona
}
let
json
=
{
peticionWith3Parameters
(
json
);
codigoPlana
,
codigoPeriodo
,
codigoZona
}
peticionWith3Parameters
(
json
);
}
else
{
let
codigoPeriodo2
=
'<%= periodo!=null?periodo.getCodigoPeriodo():""%>'
}
else
{
let
codigoPeriodo2
=
'<%= periodo != null ? periodo.getCodigoPeriodo() : ""%>'
// let codigoPlana2 = document.querySelector('#cbPlana').value
// let codigoPlana2 = document.querySelector('#cbPlana').value
let
json2
=
{
let
json2
=
{
codigoPlana
,
codigoPlana
,
codigoPeriodo2
codigoPeriodo2
}
}
peticionSimple
(
json2
);
}
}
function
peticionSimple
(
json
)
{
$
.
ajax
({
url
:
'../ServletHorario?Accion=listarVistaDobleDisponibilidadSinZona'
,
type
:
'POST'
,
dataType
:
'json'
,
data
:
{
json
:
JSON
.
stringify
(
json
)
},
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
let
html
=
''
let
nTurno
=
[]
let
nDia
=
[]
let
mensaje
=
'No registrado'
data
.
data
.
forEach
(
function
(
docente
)
{
if
(
typeof
(
docente
.
celular
&&
docente
.
distrito
)
==
"undefined"
)
{
html
+=
'<table>'
html
+=
'<div class="divider"></div>'
html
+=
'<div class="section">'
html
+=
'<h6 id="nombreDocente">'
+
docente
.
nombre
+
'<span></span><span></span><span style="margin-left:650px;font-size:20px;color:#6C7807"><i class="small material-icons" title="Puesto" style="color:black;">grade</i><strong>No registrado</strong></span></h6>'
html
+=
'<label id="codDocente" style="visibility:hidden;">'
+
docente
.
codDocente
+
'</label>'
html
+=
'<tr>'
html
+=
'<p>Celular: No registrado</p>'
html
+=
'<p>Distrito: No registrado</p>'
html
+=
'<p>Direccion: No registrado</p>'
html
+=
'<p>Correo: No registrado</p>'
html
+=
'</tr>'
html
+=
'<br>'
peticionSimple
(
json2
);
}
}
function
peticionSimple
(
json
)
{
if
(
docente
.
disponibilidad
)
{
$
.
ajax
({
let
disponibilidad
=
docente
.
disponibilidad
.
split
(
'-'
)
||
[]
url
:
'../ServletHorario?Accion=listarVistaDobleDisponibilidadSinZona'
,
let
diasM
=
[]
type
:
'POST'
,
let
diasT
=
[]
dataType
:
'json'
,
let
aulasM
=
[]
data
:
{
let
aulasT
=
[]
json
:
JSON
.
stringify
(
json
)
},
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
if
(
docente
.
arrayAulas
)
{
docente
.
arrayAulas
.
forEach
(
v
=>
{
if
(
v
.
turno
==
'1'
)
{
aulasM
.
push
(
v
)
}
else
if
(
v
.
turno
==
'2'
)
{
aulasT
.
push
(
v
)
}
})
}
let
html
=
''
let
diasin
=
docente
.
diasin
.
split
(
'-'
)
||
[]
let
nTurno
=
[]
let
diasMS
=
[]
let
nDia
=
[]
let
diasTS
=
[]
let
mensaje
=
'No registrado'
data
.
data
.
forEach
(
function
(
docente
)
{
if
(
typeof
(
docente
.
celular
&&
docente
.
distrito
)
==
"undefined"
)
{
diasin
.
forEach
(
function
(
b
)
{
let
nTurnoS
=
b
.
split
(
'#'
)[
0
]
let
nDiaS
=
b
.
split
(
'#'
)[
1
]
html
+=
'<table>'
if
(
nTurnoS
==
'1'
)
{
html
+=
'<div class="divider"></div>'
diasMS
.
push
(
nDiaS
)
html
+=
'<div class="section">'
}
else
if
(
nTurno
==
'2'
)
{
diasTS
.
push
(
nDiaS
)
}
html
+=
'<h6 id="nombreDocente">'
+
docente
.
nombre
+
'<span></span><span></span><span style="margin-left:650px;font-size:20px;color:#6C7807"><i class="small material-icons" title="Puesto" style="color:black;">grade</i><strong>No registrado</strong></span></h6>'
})
html
+=
'<label id="codDocente" style="visibility:hidden;">'
+
docente
.
codDocente
+
'</label>'
html
+=
'<tr>'
html
+=
'<p>Celular: No registrado</p>'
html
+=
'<p>Distrito: No registrado</p>'
html
+=
'<p>Direccion: No registrado</p>'
html
+=
'<p>Correo: No registrado</p>'
html
+=
'</tr>'
let
bloqueo
=
docente
.
bloqueo
.
split
(
'-'
)
||
[]
let
diasMB
=
[]
let
diasTB
=
[]
let
aulasMB
=
[]
let
aulasTB
=
[]
html
+=
'<br>'
bloqueo
.
forEach
(
function
(
b
)
{
let
nTurno
=
b
.
split
(
'#'
)[
0
]
let
nDia
=
b
.
split
(
'#'
)[
1
]
if
(
nTurno
==
'1'
)
{
diasMB
.
push
(
nDia
)
}
else
if
(
nTurno
==
'2'
)
{
diasTB
.
push
(
nDia
)
}
})
if
(
docente
.
disponibilidad
)
{
disponibilidad
.
forEach
(
function
(
d
)
{
let
turno
=
d
.
split
(
'#'
)[
0
]
let
dia
=
d
.
split
(
'#'
)[
1
]
let
disponibilidad
=
docente
.
disponibilidad
.
split
(
'-'
)
||
[]
if
(
turno
==
'1'
)
{
let
diasM
=
[]
diasM
.
push
(
dia
)
let
diasT
=
[]
}
else
if
(
turno
==
'2'
)
{
let
aulasM
=
[]
diasT
.
push
(
dia
)
let
aulasT
=
[]
}
})
if
(
docente
.
arrayAulas
)
{
html
+=
'<p class="col s12">'
docente
.
arrayAulas
.
forEach
(
v
=>
{
html
+=
'<table class="centered" id="tableDisponibilidad">'
if
(
v
.
turno
==
'1'
)
{
html
+=
'<thead>'
aulasM
.
push
(
v
)
html
+=
'<tr>'
}
else
if
(
v
.
turno
==
'2'
)
{
html
+=
'<td>TURNO</td>'
aulasT
.
push
(
v
)
html
+=
'<td id="dia">LUNES</td>'
}
html
+=
'<td id="dia">MARTES</td>'
})
html
+=
'<td id="dia">MIERCOLES</td>'
}
html
+=
'<td id="dia">JUEVES</td>'
html
+=
'<td id="dia">VIERNES</td>'
html
+=
'<td id="dia">SABADO</td>'
html
+=
'</tr>'
html
+=
'</thead>'
html
+=
'<tbody>'
let
diasin
=
docente
.
diasin
.
split
(
'-'
)
||
[]
let
diasMS
=
[]
let
diasTS
=
[]
diasin
.
forEach
(
function
(
b
)
{
html
+=
'<tr>'
let
nTurnoS
=
b
.
split
(
'#'
)[
0
]
html
+=
'<td id="turno">M</td>'
let
nDiaS
=
b
.
split
(
'#'
)[
1
]
if
(
nTurnoS
==
'1'
)
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
diasMS
.
push
(
nDiaS
)
let
aulas
=
aulasM
.
map
(
a
=>
{
}
else
if
(
nTurno
==
'2'
)
{
if
(
a
.
dia
==
i
+
1
)
{
diasTS
.
push
(
nDiaS
)
return
a
.
sede
+
' - '
+
a
.
aulas
}
}
})
})
if
(
diasM
.
some
(
d
=>
d
==
(
i
+
1
)))
{
html
+=
`<td class="colorVerde" onclick="colorChange(this);">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
let
bloqueo
=
docente
.
bloqueo
.
split
(
'-'
)
||
[]
}
else
if
(
diasMB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
let
diasMB
=
[]
let
diasTB
=
[]
let
aulasMB
=
[]
let
aulasTB
=
[]
bloqueo
.
forEach
(
function
(
b
)
{
html
+=
`<td class="blue" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
let
nTurno
=
b
.
split
(
'#'
)[
0
]
let
nDia
=
b
.
split
(
'#'
)[
1
]
if
(
nTurno
==
'1'
)
{
}
else
if
(
diasMS
.
some
(
r
=>
r
==
(
i
+
1
)))
{
diasMB
.
push
(
nDia
)
}
else
if
(
nTurno
==
'2'
)
{
diasTB
.
push
(
nDia
)
}
})
html
+=
`<td class="blue" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
}
else
{
disponibilidad
.
forEach
(
function
(
d
)
{
html
+=
`<td class="colorRojo" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
let
turno
=
d
.
split
(
'#'
)[
0
]
}
let
dia
=
d
.
split
(
'#'
)[
1
]
}
if
(
turno
==
'1'
)
{
diasM
.
push
(
dia
)
}
else
if
(
turno
==
'2'
)
{
diasT
.
push
(
dia
)
}
})
html
+=
'<p class="col s12">'
html
+=
'</tr>'
html
+=
'<table class="centered" id="tableDisponibilidad">'
html
+=
'<thead>'
html
+=
'<tr>'
html
+=
'<td>TURNO</td>'
html
+=
'<td id="dia">LUNES</td>'
html
+=
'<td id="dia">MARTES</td>'
html
+=
'<td id="dia">MIERCOLES</td>'
html
+=
'<td id="dia">JUEVES</td>'
html
+=
'<td id="dia">VIERNES</td>'
html
+=
'<td id="dia">SABADO</td>'
html
+=
'</tr>'
html
+=
'</thead>'
html
+=
'<tbody>'
html
+=
'<tr>'
html
+=
'<td id="turno">T</td>'
html
+=
'<tr>'
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
html
+=
'<td id="turno">M</td>'
let
aulas
=
aulasT
.
map
(
a
=>
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
if
(
a
.
dia
==
i
+
1
)
{
let
aulas
=
aulasM
.
map
(
a
=>
{
return
a
.
sede
+
' - '
+
a
.
aulas
if
(
a
.
dia
==
i
+
1
)
{
}
return
a
.
sede
+
' - '
+
a
.
aulas
})
}
if
(
diasT
.
some
(
d
=>
d
==
(
i
+
1
)))
{
})
if
(
diasM
.
some
(
d
=>
d
==
(
i
+
1
)))
{
html
+=
`<td class="colorVerde" onclick="colorChange(this);">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
`<td class="colorVerde" onclick="colorChange(this);">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
}
else
if
(
diasTB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
}
else
if
(
diasMB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
html
+=
`<td class="blue" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
`<td class="blue" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
}
else
if
(
diasTS
.
some
(
q
=>
q
==
(
i
+
1
)))
{
}
else
if
(
diasMS
.
some
(
r
=>
r
==
(
i
+
1
)))
{
html
+=
`<td class="blue" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
`<td class="blue" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
}
else
{
}
else
{
html
+=
`<td class="colorRojo" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
`<td class="colorRojo" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
}
}
}
}
html
+=
'</tr>'
html
+=
'</tr>'
html
+=
'<tr>'
html
+=
'</tbody>'
html
+=
'<td id="turno">T</td>'
html
+=
'</table>'
html
+=
'</p>'
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
let
aulas
=
aulasT
.
map
(
a
=>
{
if
(
a
.
dia
==
i
+
1
)
{
}
else
{
return
a
.
sede
+
' - '
+
a
.
aulas
html
+=
'<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
}
}
})
html
+=
`</div>`
if
(
diasT
.
some
(
d
=>
d
==
(
i
+
1
)))
{
html
+=
`<td class="colorVerde" onclick="colorChange(this);">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
}
else
{
}
else
if
(
diasTB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
html
+=
'<div class="divider"></div>'
html
+=
'<div class="section">'
html
+=
`<td class="blue" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
'<h6 id="nombreDocente" style="font-weight:bold;">'
+
docente
.
nombre
+
'</h6>'
html
+=
'<label id="codDocente" style="visibility:hidden;">'
+
docente
.
codDocente
+
'</label>'
}
else
if
(
diasTS
.
some
(
q
=>
q
==
(
i
+
1
)))
{
html
+=
`<td class="blue" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
'<div class="form-control">'
html
+=
'<div class="card grey lighten-2">'
html
+=
'<div class="card-content black-text">'
//PRIMERA FILA
html
+=
'<div class="row" style="margin-bottom:0px">'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">local_phone</i> <strong>'
+
docente
.
celular
+
'</strong></div>'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">school</i><strong> Puesto Nro: '
+
docente
.
puesto
+
'</strong></div>'
html
+=
'<div class="input-field col s6"><i class="material-icons dp48">hdr_weak</i> <strong>Exa. Encuesta: '
+
docente
.
notaEncuesta
+
'</strong></div>'
html
+=
'</div>'
}
else
{
//SEGUNDA FILA
html
+=
'<div class="row" style="margin-bottom:0px">'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">room</i> <strong>'
+
docente
.
distrito
+
'</strong></div>'
html
+=
'<div class="input-field col s6"><i class="material-icons dp48">hdr_strong</i> <strong> Exa. Academico: '
+
docente
.
examenNota
+
'</strong></div>'
html
+=
'</div>'
//TERCERA FILA
html
+=
'<div class="row" style="margin-bottom:0px">'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">email</i> <strong>'
+
docente
.
correo
+
'</strong></div>'
html
+=
'<div class="input-field col s6"><i class="material-icons dp48">home</i> <strong>'
+
docente
.
direccion
+
'</strong></div>'
html
+=
`<td class="colorRojo" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
'</div>'
}
html
+=
'</div>'
}
html
+=
'</div>'
html
+=
'</tr
>'
html
+=
'</div
>'
html
+=
'</tbody>'
html
+=
'<p></p>'
html
+=
'</table>'
html
+=
'</p>'
html
+=
'<br>'
}
else
{
html
+=
'<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
}
html
+=
`</div>`
}
else
{
html
+=
'<div class="divider"></div>'
html
+=
'<div class="section">'
html
+=
'<h6 id="nombreDocente" style="font-weight:bold;">'
+
docente
.
nombre
+
'</h6>'
if
(
docente
.
disponibilidad
)
{
html
+=
'<label id="codDocente" style="visibility:hidden;">'
+
docente
.
codDocente
+
'</label>'
html
+=
'<div class="form-control">'
html
+=
'<div class="card grey lighten-2">'
html
+=
'<div class="card-content black-text">'
//PRIMERA FILA
html
+=
'<div class="row" style="margin-bottom:0px">'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">local_phone</i> <strong>'
+
docente
.
celular
+
'</strong></div>'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">school</i><strong> Puesto Nro: '
+
docente
.
puesto
+
'</strong></div>'
html
+=
'<div class="input-field col s6"><i class="material-icons dp48">hdr_weak</i> <strong>Exa. Encuesta: '
+
docente
.
notaEncuesta
+
'</strong></div>'
html
+=
'</div>'
//SEGUNDA FILA
let
disponibilidad
=
docente
.
disponibilidad
.
split
(
'-'
)
||
[]
html
+=
'<div class="row" style="margin-bottom:0px">'
let
diasM
=
[]
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">room</i> <strong>'
+
docente
.
distrito
+
'</strong></div>'
let
diasT
=
[]
html
+=
'<div class="input-field col s6"><i class="material-icons dp48">hdr_strong</i> <strong> Exa. Academico: '
+
docente
.
examenNota
+
'</strong></div>'
let
aulasM
=
[]
html
+=
'</div>'
let
aulasT
=
[]
//TERCERA FILA
html
+=
'<div class="row" style="margin-bottom:0px">'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">email</i> <strong>'
+
docente
.
correo
+
'</strong></div>'
html
+=
'<div class="input-field col s6"><i class="material-icons dp48">home</i> <strong>'
+
docente
.
direccion
+
'</strong></div>'
html
+=
'</div>'
html
+=
'</div>'
html
+=
'</div>'
html
+=
'</div>'
html
+=
'<p></p>'
html
+=
'<br>'
if
(
docente
.
arrayAulas
)
{
docente
.
arrayAulas
.
forEach
(
v
=>
{
if
(
v
.
turno
==
'1'
)
{
aulasM
.
push
(
v
)
}
else
if
(
v
.
turno
==
'2'
)
{
aulasT
.
push
(
v
)
}
})
}
let
diasin
=
docente
.
diasin
.
split
(
'-'
)
||
[]
let
diasMS
=
[]
let
diasTS
=
[]
diasin
.
forEach
(
function
(
b
)
{
let
nTurnoS
=
b
.
split
(
'#'
)[
0
]
let
nDiaS
=
b
.
split
(
'#'
)[
1
]
if
(
docente
.
disponibilidad
)
{
if
(
nTurnoS
==
'1'
)
{
diasMS
.
push
(
nDiaS
)
}
else
if
(
nTurno
==
'2'
)
{
diasTS
.
push
(
nDiaS
)
}
let
disponibilidad
=
docente
.
disponibilidad
.
split
(
'-'
)
||
[]
})
let
diasM
=
[]
let
diasT
=
[]
let
aulasM
=
[]
let
aulasT
=
[]
if
(
docente
.
arrayAulas
)
{
docente
.
arrayAulas
.
forEach
(
v
=>
{
if
(
v
.
turno
==
'1'
)
{
aulasM
.
push
(
v
)
}
else
if
(
v
.
turno
==
'2'
)
{
aulasT
.
push
(
v
)
}
})
}
let
diasin
=
docente
.
diasin
.
split
(
'-'
)
||
[]
let
bloqueo
=
docente
.
bloqueo
.
split
(
'-'
)
||
[]
let
diasMS
=
[]
let
diasMB
=
[]
let
diasTS
=
[]
let
diasTB
=
[]
let
aulasMB
=
[]
let
aulasTB
=
[]
diasin
.
forEach
(
function
(
b
)
{
bloqueo
.
forEach
(
function
(
b
)
{
let
nTurnoS
=
b
.
split
(
'#'
)[
0
]
let
nTurno
=
b
.
split
(
'#'
)[
0
]
let
nDiaS
=
b
.
split
(
'#'
)[
1
]
let
nDia
=
b
.
split
(
'#'
)[
1
]
if
(
nTurnoS
==
'1'
)
{
if
(
nTurno
==
'1'
)
{
diasMS
.
push
(
nDiaS
)
diasMB
.
push
(
nDia
)
}
else
if
(
nTurno
==
'2'
)
{
}
else
if
(
nTurno
==
'2'
)
{
diasTS
.
push
(
nDiaS
)
diasTB
.
push
(
nDia
)
}
}
})
})
let
bloqueo
=
docente
.
bloqueo
.
split
(
'-'
)
||
[]
disponibilidad
.
forEach
(
function
(
d
)
{
let
diasMB
=
[]
let
turno
=
d
.
split
(
'#'
)[
0
]
let
diasTB
=
[]
let
dia
=
d
.
split
(
'#'
)[
1
]
let
aulasMB
=
[]
let
aulasTB
=
[]
bloqueo
.
forEach
(
function
(
b
)
{
if
(
turno
==
'1'
)
{
let
nTurno
=
b
.
split
(
'#'
)[
0
]
diasM
.
push
(
dia
)
let
nDia
=
b
.
split
(
'#'
)[
1
]
}
else
if
(
turno
==
'2'
)
{
diasT
.
push
(
dia
)
}
})
if
(
nTurno
==
'1'
)
{
html
+=
'<p class="col s12">'
diasMB
.
push
(
nDia
)
html
+=
'<table class="centered">'
}
else
if
(
nTurno
==
'2'
)
{
html
+=
'<thead>'
diasTB
.
push
(
nDia
)
html
+=
'<tr>'
}
html
+=
'<td>TURNO</td>'
html
+=
'<td id="dia">LUNES</td>'
html
+=
'<td id="dia">MARTES</td>'
html
+=
'<td id="dia">MIERCOLES</td>'
html
+=
'<td id="dia">JUEVES</td>'
html
+=
'<td id="dia">VIERNES</td>'
html
+=
'<td id="dia">SABADO</td>'
html
+=
'</tr>'
html
+=
'</thead>'
html
+=
'<tbody>'
})
html
+=
'<tr>'
html
+=
'<td id="turno">M</td>'
disponibilidad
.
forEach
(
function
(
d
)
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
let
turno
=
d
.
split
(
'#'
)[
0
]
let
aulas
=
aulasM
.
map
(
a
=>
{
let
dia
=
d
.
split
(
'#'
)[
1
]
if
(
a
.
dia
==
i
+
1
)
{
return
a
.
sede
+
' - '
+
a
.
aulas
}
})
if
(
turno
==
'1'
)
{
if
(
diasM
.
some
(
d
=>
d
==
(
i
+
1
)))
{
diasM
.
push
(
dia
)
}
else
if
(
turno
==
'2'
)
{
diasT
.
push
(
dia
)
}
})
html
+=
'<p class="col s12">'
html
+=
`<td class="colorVerde" onclick="colorChange(this);"> `
+
aulas
.
join
(
'
\
n '
)
+
`</td> `
html
+=
'<table class="centered">'
html
+=
'<thead>'
html
+=
'<tr>'
html
+=
'<td>TURNO</td>'
html
+=
'<td id="dia">LUNES</td>'
html
+=
'<td id="dia">MARTES</td>'
html
+=
'<td id="dia">MIERCOLES</td>'
html
+=
'<td id="dia">JUEVES</td>'
html
+=
'<td id="dia">VIERNES</td>'
html
+=
'<td id="dia">SABADO</td>'
html
+=
'</tr>'
html
+=
'</thead>'
html
+=
'<tbody>'
}
else
if
(
diasMB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
html
+=
'<tr>'
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
html
+=
'<td id="turno">M</td>'
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
}
else
if
(
diasMS
.
some
(
r
=>
r
==
(
i
+
1
)))
{
let
aulas
=
aulasM
.
map
(
a
=>
{
if
(
a
.
dia
==
i
+
1
)
{
return
a
.
sede
+
' - '
+
a
.
aulas
}
})
if
(
diasM
.
some
(
d
=>
d
==
(
i
+
1
)))
{
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
html
+=
`<td class="colorVerde" onclick="colorChange(this);"> `
+
aulas
.
join
(
'
\
n '
)
+
`</td> `
}
else
{
}
else
if
(
diasMB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
html
+=
'<td class="colorRojo" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
}
}
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
}
else
if
(
diasMS
.
some
(
r
=>
r
==
(
i
+
1
)))
{
html
+=
'</tr>'
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
html
+=
'<tr>'
html
+=
'<td id="turno">T</td>'
}
else
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
let
aulas
=
aulasT
.
map
(
a
=>
{
html
+=
'<td class="colorRojo" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
if
(
a
.
dia
==
i
+
1
)
{
}
return
a
.
sede
+
' - '
+
a
.
aulas
}
}
})
if
(
diasT
.
some
(
d
=>
d
==
(
i
+
1
)))
{
html
+=
`<td class="colorVerde" onclick="colorChange(this);"> `
+
aulas
.
join
(
'
\
n '
)
+
`</td> `
html
+=
'</tr>'
html
+=
'<tr>'
}
else
if
(
diasTB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
html
+=
'<td id="turno">T</td>'
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
let
aulas
=
aulasT
.
map
(
a
=>
{
if
(
a
.
dia
==
i
+
1
)
{
}
else
if
(
diasTS
.
some
(
q
=>
q
==
(
i
+
1
)))
{
return
a
.
sede
+
' - '
+
a
.
aulas
}
})
if
(
diasT
.
some
(
d
=>
d
==
(
i
+
1
)))
{
html
+=
`<td class="colorVerde" onclick="colorChange(this);"> `
+
aulas
.
join
(
'
\
n '
)
+
`</td> `
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td>'
}
else
{
}
else
if
(
diasTB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
html
+=
'<td class="colorAzul
" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
html
+=
'<td class="colorRojo
" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
}
else
if
(
diasTS
.
some
(
q
=>
q
==
(
i
+
1
)))
{
}
}
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td
>'
html
+=
'</tr
>'
}
else
{
html
+=
'</tbody>'
html
+=
'</table>'
html
+=
'</p>'
}
else
{
html
+=
'<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
}
html
+=
'<td class="colorRojo" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
html
+=
`</div>`
}
})
document
.
querySelector
(
'#divListaDisponibilidad'
).
innerHTML
=
html
}
})
}
}
}
html
+=
'</tr>'
html
+=
'</tbody>'
function
peticionWith3Parameters
(
json
)
{
html
+=
'</table>'
html
+=
'</p>'
}
$
.
ajax
({
else
{
url
:
'../ServletHorario?Accion=listarVistaDobleDisponibilidad'
,
html
+=
'<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
type
:
'POST'
,
}
dataType
:
'json'
,
data
:
{
json
:
JSON
.
stringify
(
json
)
},
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
html
+=
`</div>`
}
})
document
.
querySelector
(
'#divListaDisponibilidad'
).
innerHTML
=
html
}
})
}
let
html
=
''
let
nTurno
=
[]
let
nDia
=
[]
let
mensaje
=
'No registrado'
data
.
data
.
forEach
(
function
(
docente
)
{
if
(
typeof
(
docente
.
celular
&&
docente
.
distrito
)
==
"undefined"
)
{
html
+=
'<table>'
html
+=
'<div class="divider"></div>'
html
+=
'<div class="section">'
function
peticionWith3Parameters
(
json
)
{
html
+=
'<h6 id="nombreDocente">'
+
docente
.
nombre
+
'<span></span><span></span><span style="margin-left:650px;font-size:20px;color:#6C7807"><i class="small material-icons" title="Puesto" style="color:black;">grade</i><strong>No registrado</strong></span></h6>'
html
+=
'<label id="codDocente" style="visibility:hidden;">'
+
docente
.
codDocente
+
'</label>'
$
.
ajax
({
html
+=
'<tr>'
url
:
'../ServletHorario?Accion=listarVistaDobleDisponibilidad'
,
html
+=
'<p>Celular: No registrado</p>'
type
:
'POST'
,
html
+=
'<p>Distrito: No registrado</p>'
dataType
:
'json'
,
html
+=
'<p>Direccion: No registrado</p>'
data
:
{
html
+=
'<p>Correo: No registrado</p>'
json
:
JSON
.
stringify
(
json
)
html
+=
'<p>Zona: No registrado</p>'
},
html
+=
'</tr>'
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
html
+=
'<br>'
let
html
=
''
let
nTurno
=
[]
let
nDia
=
[]
let
mensaje
=
'No registrado'
data
.
data
.
forEach
(
function
(
docente
)
{
if
(
typeof
(
docente
.
celular
&&
docente
.
distrito
)
==
"undefined"
)
{
html
+=
'<table>'
html
+=
'<div class="divider"></div>'
html
+=
'<div class="section">'
html
+=
'<h6 id="nombreDocente">'
+
docente
.
nombre
+
'<span></span><span></span><span style="margin-left:650px;font-size:20px;color:#6C7807"><i class="small material-icons" title="Puesto" style="color:black;">grade</i><strong>No registrado</strong></span></h6>'
html
+=
'<label id="codDocente" style="visibility:hidden;">'
+
docente
.
codDocente
+
'</label>'
html
+=
'<tr>'
if
(
docente
.
disponibilidad
)
{
html
+=
'<p>Celular: No registrado</p>'
html
+=
'<p>Distrito: No registrado</p>'
html
+=
'<p>Direccion: No registrado</p>'
html
+=
'<p>Correo: No registrado</p>'
html
+=
'<p>Zona: No registrado</p>'
html
+=
'</tr>'
html
+=
'<br>'
let
disponibilidad
=
docente
.
disponibilidad
.
split
(
'-'
)
||
[]
let
diasM
=
[]
let
diasT
=
[]
let
aulasM
=
[]
let
aulasT
=
[]
if
(
docente
.
arrayAulas
)
{
docente
.
arrayAulas
.
forEach
(
v
=>
{
if
(
v
.
turno
==
'1'
)
{
aulasM
.
push
(
v
)
}
else
if
(
v
.
turno
==
'2'
)
{
aulasT
.
push
(
v
)
}
})
}
let
diasin
=
docente
.
diasin
.
split
(
'-'
)
||
[]
let
diasMS
=
[]
let
diasTS
=
[]
diasin
.
forEach
(
function
(
b
)
{
let
nTurnoS
=
b
.
split
(
'#'
)[
0
]
let
nDiaS
=
b
.
split
(
'#'
)[
1
]
if
(
docente
.
disponibilidad
)
{
if
(
nTurnoS
==
'1'
)
{
diasMS
.
push
(
nDiaS
)
}
else
if
(
nTurno
==
'2'
)
{
diasTS
.
push
(
nDiaS
)
}
let
disponibilidad
=
docente
.
disponibilidad
.
split
(
'-'
)
||
[]
})
let
diasM
=
[]
let
diasT
=
[]
let
aulasM
=
[]
let
aulasT
=
[]
if
(
docente
.
arrayAulas
)
{
docente
.
arrayAulas
.
forEach
(
v
=>
{
if
(
v
.
turno
==
'1'
)
{
aulasM
.
push
(
v
)
}
else
if
(
v
.
turno
==
'2'
)
{
aulasT
.
push
(
v
)
}
})
}
let
diasin
=
docente
.
diasin
.
split
(
'-'
)
||
[]
let
bloqueo
=
docente
.
bloqueo
.
split
(
'-'
)
||
[]
let
diasMS
=
[]
let
diasMB
=
[]
let
diasTS
=
[]
let
diasTB
=
[]
let
aulasMB
=
[]
let
aulasTB
=
[]
diasin
.
forEach
(
function
(
b
)
{
bloqueo
.
forEach
(
function
(
b
)
{
let
nTurnoS
=
b
.
split
(
'#'
)[
0
]
let
nTurno
=
b
.
split
(
'#'
)[
0
]
let
nDiaS
=
b
.
split
(
'#'
)[
1
]
let
nDia
=
b
.
split
(
'#'
)[
1
]
if
(
nTurnoS
==
'1'
)
{
if
(
nTurno
==
'1'
)
{
diasMS
.
push
(
nDiaS
)
diasMB
.
push
(
nDia
)
}
else
if
(
nTurno
==
'2'
)
{
}
else
if
(
nTurno
==
'2'
)
{
diasTS
.
push
(
nDiaS
)
diasTB
.
push
(
nDia
)
}
}
})
})
let
bloqueo
=
docente
.
bloqueo
.
split
(
'-'
)
||
[]
disponibilidad
.
forEach
(
function
(
d
)
{
let
diasMB
=
[]
let
turno
=
d
.
split
(
'#'
)[
0
]
let
diasTB
=
[]
let
dia
=
d
.
split
(
'#'
)[
1
]
let
aulasMB
=
[]
let
aulasTB
=
[]
bloqueo
.
forEach
(
function
(
b
)
{
if
(
turno
==
'1'
)
{
let
nTurno
=
b
.
split
(
'#'
)[
0
]
diasM
.
push
(
dia
)
let
nDia
=
b
.
split
(
'#'
)[
1
]
}
else
if
(
turno
==
'2'
)
{
diasT
.
push
(
dia
)
}
})
if
(
nTurno
==
'1'
)
{
html
+=
'<p class="col s12">'
diasMB
.
push
(
nDia
)
html
+=
'<table class="centered" id="tableDisponibilidad">'
}
else
if
(
nTurno
==
'2'
)
{
html
+=
'<thead>'
diasTB
.
push
(
nDia
)
html
+=
'<tr>'
}
html
+=
'<td>TURNO</td>'
html
+=
'<td id="dia">LUNES</td>'
html
+=
'<td id="dia">MARTES</td>'
html
+=
'<td id="dia">MIERCOLES</td>'
html
+=
'<td id="dia">JUEVES</td>'
html
+=
'<td id="dia">VIERNES</td>'
html
+=
'<td id="dia">SABADO</td>'
html
+=
'</tr>'
html
+=
'</thead>'
html
+=
'<tbody>'
})
html
+=
'<tr>'
html
+=
'<td id="turno">M</td>'
disponibilidad
.
forEach
(
function
(
d
)
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
let
turno
=
d
.
split
(
'#'
)[
0
]
let
aulas
=
aulasM
.
map
(
a
=>
{
let
dia
=
d
.
split
(
'#'
)[
1
]
if
(
a
.
dia
==
i
+
1
)
{
return
a
.
sede
+
' - '
+
a
.
aulas
}
})
if
(
turno
==
'1'
)
{
if
(
diasM
.
some
(
d
=>
d
==
(
i
+
1
)))
{
diasM
.
push
(
dia
)
}
else
if
(
turno
==
'2'
)
{
diasT
.
push
(
dia
)
}
})
html
+=
'<p class="col s12">'
html
+=
`<td class="colorVerde" onclick="colorChange(this);">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
'<table class="centered" id="tableDisponibilidad">'
html
+=
'<thead>'
html
+=
'<tr>'
html
+=
'<td>TURNO</td>'
html
+=
'<td id="dia">LUNES</td>'
html
+=
'<td id="dia">MARTES</td>'
html
+=
'<td id="dia">MIERCOLES</td>'
html
+=
'<td id="dia">JUEVES</td>'
html
+=
'<td id="dia">VIERNES</td>'
html
+=
'<td id="dia">SABADO</td>'
html
+=
'</tr>'
html
+=
'</thead>'
html
+=
'<tbody>'
}
else
if
(
diasMB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
html
+=
'<tr>'
html
+=
`<td class="colorAzul" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
'<td id="turno">M</td>'
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
}
else
if
(
diasMS
.
some
(
r
=>
r
==
(
i
+
1
)))
{
let
aulas
=
aulasM
.
map
(
a
=>
{
if
(
a
.
dia
==
i
+
1
)
{
return
a
.
sede
+
' - '
+
a
.
aulas
}
})
if
(
diasM
.
some
(
d
=>
d
==
(
i
+
1
)))
{
html
+=
`<td class="colorAzul" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
`<td class="colorVerde" onclick="colorChange(this);">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
}
else
{
}
else
if
(
diasMB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
html
+=
`<td class="colorRojo" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
}
}
html
+=
`<td class="colorAzul" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
}
else
if
(
diasMS
.
some
(
r
=>
r
==
(
i
+
1
)))
{
html
+=
'</tr>'
html
+=
`<td class="colorAzul" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
'<tr>'
html
+=
'<td id="turno">T</td>'
}
else
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
let
aulas
=
aulasT
.
map
(
a
=>
{
html
+=
`<td class="colorRojo" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
if
(
a
.
dia
==
i
+
1
)
{
}
return
a
.
sede
+
' - '
+
a
.
aulas
}
}
})
if
(
diasT
.
some
(
d
=>
d
==
(
i
+
1
)))
{
html
+=
`<td class="colorVerde" onclick="colorChange(this);">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
'</tr>'
}
else
if
(
diasTB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
html
+=
'<tr>'
html
+=
`<td class="colorAzul" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
'<td id="turno">T</td>'
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
}
else
if
(
diasTS
.
some
(
q
=>
q
==
(
i
+
1
)))
{
let
aulas
=
aulasT
.
map
(
a
=>
{
if
(
a
.
dia
==
i
+
1
)
{
html
+=
`<td class="colorAzul" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
return
a
.
sede
+
' - '
+
a
.
aulas
}
})
if
(
diasT
.
some
(
d
=>
d
==
(
i
+
1
)))
{
html
+=
`<td class="colorVerde" onclick="colorChange(this);">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
}
else
{
}
else
if
(
diasTB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
html
+=
`<td class="colorAzul
" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
`<td class="colorRojo
" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
}
else
if
(
diasTS
.
some
(
q
=>
q
==
(
i
+
1
)))
{
}
}
html
+=
`<td class="colorAzul" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
html
+=
'</tr>'
html
+=
'</tbody>'
html
+=
'</table>'
html
+=
'</p>'
}
else
{
}
else
{
html
+=
'<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
}
html
+=
`</div>`
html
+=
`<td class="colorRojo" onclick="colorChange(this);" id="changed">`
+
aulas
.
join
(
'
\
n '
)
+
`</td>`
}
else
{
}
html
+=
'<div class="divider"></div>'
}
html
+=
'<div class="section">'
html
+=
'</tr>'
html
+=
'<h6 id="nombreDocente" style="font-weight:bold;">'
+
docente
.
nombre
+
'<span></span><span></span> <span> </span> <a href="javascript:updateObservacion(this.value);" value='
+
docente
.
observacion
+
'>'
+
docente
.
observacion
+
'</a></span></h6>'
html
+=
'</tbody>'
html
+=
'<label id="codDocente" style="visibility:hidden;">'
+
docente
.
codDocente
+
'</label>'
html
+=
'</table>'
html
+=
'</p>'
html
+=
'<div class="form-control">'
html
+=
'<div class="card grey lighten-2">'
html
+=
'<div class="card-content black-text">'
//PRIMERA FILA
html
+=
'<div class="row" style="margin-bottom:0px">'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">local_phone</i> <strong>'
+
docente
.
celular
+
'</strong></div>'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">school</i><strong> Puesto Nro: '
+
docente
.
puesto
+
'</strong></div>'
html
+=
'<div class="input-field col s6"><i class="material-icons dp48">hdr_weak</i> <strong>Exa. Encuesta '
+
docente
.
notaEncuesta
+
'</strong></div>'
html
+=
'</div>'
}
else
{
//SEGUNDA FILA
html
+=
'<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
html
+=
'<div class="row" style="margin-bottom:0px">'
}
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">room</i> <strong>'
+
docente
.
distrito
+
'</strong></div>'
html
+=
`</div>`
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">room</i> <strong>'
+
docente
.
zona
+
'</strong></div>'
html
+=
'<div class="input-field col s6"><i class="material-icons dp48">hdr_strong</i> <strong> Exa. Academico '
+
docente
.
examen
+
'</strong></div>'
html
+=
'</div>'
//TERCERA FILA
}
html
+=
'<div class="row" style="margin-bottom:0px">'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">email</i> <strong>'
+
docente
.
correo
+
'</strong></div>'
else
{
html
+=
'<div class="input-field col s6"><i class="material-icons dp48">home</i> <strong>'
+
docente
.
direccion
+
'</strong></div>'
html
+=
'<div class="divider"></div>'
html
+=
'</div>'
html
+=
'<div class="section">'
html
+=
'</div>'
html
+=
'</div>'
html
+=
'</div>'
html
+=
'<h6 id="nombreDocente" style="font-weight:bold;">'
+
docente
.
nombre
+
'<span></span><span></span> <span> </span> <a href="javascript:updateObservacion(this.value);" value='
+
docente
.
observacion
+
'>'
+
docente
.
observacion
+
'</a></span></h6>'
html
+=
'<label id="codDocente" style="visibility:hidden;">'
+
docente
.
codDocente
+
'</label>'
html
+=
'<div class="form-control">'
html
+=
'<div class="card grey lighten-2">'
html
+=
'<div class="card-content black-text">'
//PRIMERA FILA
html
+=
'<div class="row" style="margin-bottom:0px">'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">local_phone</i> <strong>'
+
docente
.
celular
+
'</strong></div>'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">school</i><strong> Puesto Nro: '
+
docente
.
puesto
+
'</strong></div>'
html
+=
'<div class="input-field col s6"><i class="material-icons dp48">hdr_weak</i> <strong>Exa. Encuesta '
+
docente
.
notaEncuesta
+
'</strong></div>'
html
+=
'</div>'
//SEGUNDA FILA
html
+=
'<p></p>'
html
+=
'<div class="row" style="margin-bottom:0px">'
html
+=
'<br>'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">room</i> <strong>'
+
docente
.
distrito
+
'</strong></div>'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">room</i> <strong>'
+
docente
.
zona
+
'</strong></div>'
html
+=
'<div class="input-field col s6"><i class="material-icons dp48">hdr_strong</i> <strong> Exa. Academico '
+
docente
.
examen
+
'</strong></div>'
html
+=
'</div>'
//TERCERA FILA
html
+=
'<div class="row" style="margin-bottom:0px">'
html
+=
'<div class="input-field col s3"><i class="material-icons dp48">email</i> <strong>'
+
docente
.
correo
+
'</strong></div>'
html
+=
'<div class="input-field col s6"><i class="material-icons dp48">home</i> <strong>'
+
docente
.
direccion
+
'</strong></div>'
html
+=
'</div>'
html
+=
'</div>'
html
+=
'</div>'
html
+=
'</div>'
html
+=
'<p></p>'
html
+=
'<br>'
if
(
docente
.
disponibilidad
)
{
if
(
docente
.
disponibilidad
)
{
let
disponibilidad
=
docente
.
disponibilidad
.
split
(
'-'
)
||
[]
let
disponibilidad
=
docente
.
disponibilidad
.
split
(
'-'
)
||
[]
let
diasM
=
[]
let
diasM
=
[]
let
diasT
=
[]
let
diasT
=
[]
let
aulasM
=
[]
let
aulasM
=
[]
let
aulasT
=
[]
let
aulasT
=
[]
if
(
docente
.
arrayAulas
)
{
if
(
docente
.
arrayAulas
)
{
docente
.
arrayAulas
.
forEach
(
v
=>
{
docente
.
arrayAulas
.
forEach
(
v
=>
{
if
(
v
.
turno
==
'1'
)
{
if
(
v
.
turno
==
'1'
)
{
aulasM
.
push
(
v
)
aulasM
.
push
(
v
)
}
else
if
(
v
.
turno
==
'2'
)
{
}
else
if
(
v
.
turno
==
'2'
)
{
aulasT
.
push
(
v
)
aulasT
.
push
(
v
)
}
}
})
})
}
}
let
diasin
=
docente
.
diasin
.
split
(
'-'
)
||
[]
let
diasin
=
docente
.
diasin
.
split
(
'-'
)
||
[]
let
diasMS
=
[]
let
diasMS
=
[]
let
diasTS
=
[]
let
diasTS
=
[]
diasin
.
forEach
(
function
(
b
)
{
diasin
.
forEach
(
function
(
b
)
{
let
nTurnoS
=
b
.
split
(
'#'
)[
0
]
let
nTurnoS
=
b
.
split
(
'#'
)[
0
]
let
nDiaS
=
b
.
split
(
'#'
)[
1
]
let
nDiaS
=
b
.
split
(
'#'
)[
1
]
if
(
nTurnoS
==
'1'
)
{
if
(
nTurnoS
==
'1'
)
{
diasMS
.
push
(
nDiaS
)
diasMS
.
push
(
nDiaS
)
}
else
if
(
nTurno
==
'2'
)
{
}
else
if
(
nTurno
==
'2'
)
{
diasTS
.
push
(
nDiaS
)
diasTS
.
push
(
nDiaS
)
}
}
})
})
let
bloqueo
=
docente
.
bloqueo
.
split
(
'-'
)
||
[]
let
bloqueo
=
docente
.
bloqueo
.
split
(
'-'
)
||
[]
let
diasMB
=
[]
let
diasMB
=
[]
let
diasTB
=
[]
let
diasTB
=
[]
let
aulasMB
=
[]
let
aulasMB
=
[]
let
aulasTB
=
[]
let
aulasTB
=
[]
bloqueo
.
forEach
(
function
(
b
)
{
bloqueo
.
forEach
(
function
(
b
)
{
let
nTurno
=
b
.
split
(
'#'
)[
0
]
let
nTurno
=
b
.
split
(
'#'
)[
0
]
let
nDia
=
b
.
split
(
'#'
)[
1
]
let
nDia
=
b
.
split
(
'#'
)[
1
]
if
(
nTurno
==
'1'
)
{
if
(
nTurno
==
'1'
)
{
diasMB
.
push
(
nDia
)
diasMB
.
push
(
nDia
)
}
else
if
(
nTurno
==
'2'
)
{
}
else
if
(
nTurno
==
'2'
)
{
diasTB
.
push
(
nDia
)
diasTB
.
push
(
nDia
)
}
}
})
})
disponibilidad
.
forEach
(
function
(
d
)
{
disponibilidad
.
forEach
(
function
(
d
)
{
let
turno
=
d
.
split
(
'#'
)[
0
]
let
turno
=
d
.
split
(
'#'
)[
0
]
let
dia
=
d
.
split
(
'#'
)[
1
]
let
dia
=
d
.
split
(
'#'
)[
1
]
if
(
turno
==
'1'
)
{
if
(
turno
==
'1'
)
{
diasM
.
push
(
dia
)
diasM
.
push
(
dia
)
}
else
if
(
turno
==
'2'
)
{
}
else
if
(
turno
==
'2'
)
{
diasT
.
push
(
dia
)
diasT
.
push
(
dia
)
}
}
})
})
html
+=
'<p class="col s12">'
html
+=
'<p class="col s12">'
html
+=
'<table class="centered">'
html
+=
'<table class="centered">'
html
+=
'<thead>'
html
+=
'<thead>'
html
+=
'<tr>'
html
+=
'<tr>'
html
+=
'<td>TURNO</td>'
html
+=
'<td>TURNO</td>'
html
+=
'<td id="dia">LUNES</td>'
html
+=
'<td id="dia">LUNES</td>'
html
+=
'<td id="dia">MARTES</td>'
html
+=
'<td id="dia">MARTES</td>'
html
+=
'<td id="dia">MIERCOLES</td>'
html
+=
'<td id="dia">MIERCOLES</td>'
html
+=
'<td id="dia">JUEVES</td>'
html
+=
'<td id="dia">JUEVES</td>'
html
+=
'<td id="dia">VIERNES</td>'
html
+=
'<td id="dia">VIERNES</td>'
html
+=
'<td id="dia">SABADO</td>'
html
+=
'<td id="dia">SABADO</td>'
html
+=
'</tr>'
html
+=
'</tr>'
html
+=
'</thead>'
html
+=
'</thead>'
html
+=
'<tbody>'
html
+=
'<tbody>'
html
+=
'<tr>'
html
+=
'<tr>'
html
+=
'<td id="turno">M</td>'
html
+=
'<td id="turno">M</td>'
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
let
aulas
=
aulasM
.
map
(
a
=>
{
let
aulas
=
aulasM
.
map
(
a
=>
{
if
(
a
.
dia
==
i
+
1
)
{
if
(
a
.
dia
==
i
+
1
)
{
return
a
.
sede
+
' - '
+
a
.
aulas
return
a
.
sede
+
' - '
+
a
.
aulas
}
}
})
})
if
(
diasM
.
some
(
d
=>
d
==
(
i
+
1
)))
{
if
(
diasM
.
some
(
d
=>
d
==
(
i
+
1
)))
{
html
+=
`<td class="colorVerde" onclick="colorChange(this);"> `
+
aulas
.
join
(
'
\
n '
)
+
`</td> `
html
+=
`<td class="colorVerde" onclick="colorChange(this);"> `
+
aulas
.
join
(
'
\
n '
)
+
`</td> `
}
else
if
(
diasMB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
}
else
if
(
diasMB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
}
else
if
(
diasMS
.
some
(
r
=>
r
==
(
i
+
1
)))
{
}
else
if
(
diasMS
.
some
(
r
=>
r
==
(
i
+
1
)))
{
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
}
else
{
}
else
{
html
+=
'<td class="colorRojo" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
html
+=
'<td class="colorRojo" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
}
}
}
}
html
+=
'</tr>'
html
+=
'</tr>'
html
+=
'<tr>'
html
+=
'<tr>'
html
+=
'<td id="turno">T</td>'
html
+=
'<td id="turno">T</td>'
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
let
aulas
=
aulasT
.
map
(
a
=>
{
let
aulas
=
aulasT
.
map
(
a
=>
{
if
(
a
.
dia
==
i
+
1
)
{
if
(
a
.
dia
==
i
+
1
)
{
return
a
.
sede
+
' - '
+
a
.
aulas
return
a
.
sede
+
' - '
+
a
.
aulas
}
}
})
})
if
(
diasT
.
some
(
d
=>
d
==
(
i
+
1
)))
{
if
(
diasT
.
some
(
d
=>
d
==
(
i
+
1
)))
{
html
+=
`<td class="colorVerde" onclick="colorChange(this);"> `
+
aulas
.
join
(
'
\
n '
)
+
`</td> `
html
+=
`<td class="colorVerde" onclick="colorChange(this);"> `
+
aulas
.
join
(
'
\
n '
)
+
`</td> `
}
else
if
(
diasTB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
}
else
if
(
diasTB
.
some
(
t
=>
t
==
(
i
+
1
)))
{
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
}
else
if
(
diasTS
.
some
(
q
=>
q
==
(
i
+
1
)))
{
}
else
if
(
diasTS
.
some
(
q
=>
q
==
(
i
+
1
)))
{
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td>'
html
+=
'<td class="colorAzul" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td>'
}
else
{
}
else
{
html
+=
'<td class="colorRojo" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
html
+=
'<td class="colorRojo" onclick="colorChange(this);" id="changed"> '
+
aulas
.
join
(
'
\
n '
)
+
'</td> '
}
}
}
}
html
+=
'</tr>'
html
+=
'</tr>'
html
+=
'</tbody>'
html
+=
'</tbody>'
html
+=
'</table>'
html
+=
'</table>'
html
+=
'</p>'
html
+=
'</p>'
}
else
{
}
else
{
html
+=
'<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
html
+=
'<p>EL DOCENTE NO TIENE DISPONIBILIDAD REGISTRADA</p>'
}
}
html
+=
`
html
+=
`
</div>
</div>
`
`
}
}
})
})
document
.
querySelector
(
'#divListaDisponibilidad'
).
innerHTML
=
html
document
.
querySelector
(
'#divListaDisponibilidad'
).
innerHTML
=
html
}
}
})
})
}
}
function
btnDesactivarHorario
(
codDocente
)
{
function
btnDesactivarHorario
(
codDocente
)
{
let
question
=
confirm
(
"¿Esta seguro de eliminar su horario ?"
);
let
question
=
confirm
(
"¿Esta seguro de eliminar su horario ?"
);
if
(
question
)
{
if
(
question
)
{
console
.
log
(
codDocente
)
console
.
log
(
codDocente
)
var
periodo
=
"<%=periodo!=null?periodo.getCodigoPeriodo():
""%>"
;
var
periodo
=
"<%=periodo != null ? periodo.getCodigoPeriodo() :
""%>"
;
desactivarHorario
(
codDocente
,
periodo
)
desactivarHorario
(
codDocente
,
periodo
)
}
else
{
}
else
{
console
.
log
(
"cancel"
)
console
.
log
(
"cancel"
)
}
}
}
}
function
desactivarHorario
()
{
function
desactivarHorario
()
{
}
}
function
colorChange
(
obj
)
{
function
colorChange
(
obj
)
{
let
periodo
=
'<%= periodo!=null?periodo.getCodigoPeriodo():
""%>'
let
periodo
=
'<%= periodo != null ? periodo.getCodigoPeriodo() :
""%>'
let
codigoDoc
=
$
(
obj
).
parents
(
'div.section'
).
find
(
'#codDocente'
).
text
();
let
codigoDoc
=
$
(
obj
).
parents
(
'div.section'
).
find
(
'#codDocente'
).
text
();
let
nombreDoc
=
$
(
obj
).
parents
(
'div.section'
).
find
(
'#nombreDocente'
).
text
();
let
nombreDoc
=
$
(
obj
).
parents
(
'div.section'
).
find
(
'#nombreDocente'
).
text
();
let
turno
=
$
(
obj
).
parents
(
'tr'
).
find
(
'#turno'
).
text
();
let
turno
=
$
(
obj
).
parents
(
'tr'
).
find
(
'#turno'
).
text
();
let
numeroTurno
=
0
;
let
numeroTurno
=
0
;
if
(
turno
===
"T"
)
{
if
(
turno
===
"T"
)
{
numeroTurno
=
2
numeroTurno
=
2
}
else
if
(
turno
===
"M"
)
{
}
else
if
(
turno
===
"M"
)
{
numeroTurno
=
1
numeroTurno
=
1
}
}
let
dia
=
$
(
obj
).
parent
().
children
().
index
(
obj
);
let
dia
=
$
(
obj
).
parent
().
children
().
index
(
obj
);
if
(
$
(
obj
).
hasClass
(
'colorAzul'
))
{
if
(
$
(
obj
).
hasClass
(
'colorAzul'
))
{
let
question
=
confirm
(
"¿Esta seguro de querer desbloquear el dia "
+
convertirDia
(
dia
)
+
" ?"
);
let
question
=
confirm
(
"¿Esta seguro de querer desbloquear el dia "
+
convertirDia
(
dia
)
+
" ?"
);
if
(
question
)
{
if
(
question
)
{
$
.
ajax
({
$
.
ajax
({
url
:
'../ServletHorario?Accion=rollbackDisponibilidad'
,
url
:
'../ServletHorario?Accion=rollbackDisponibilidad'
,
type
:
'POST'
,
type
:
'POST'
,
data
:
{
data
:
{
codDocente
:
codigoDoc
,
codDocente
:
codigoDoc
,
diaBloquear
:
dia
,
diaBloquear
:
dia
,
periodo
:
periodo
,
periodo
:
periodo
,
turno
:
numeroTurno
turno
:
numeroTurno
},
},
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
if
(
data
.
trim
()
==
2
)
{
if
(
data
.
trim
()
==
2
)
{
if
(
$
(
obj
).
hasClass
(
'colorAzul'
))
{
if
(
$
(
obj
).
hasClass
(
'colorAzul'
))
{
$
(
obj
).
removeClass
(
'colorAzul'
);
$
(
obj
).
removeClass
(
'colorAzul'
);
$
(
obj
).
addClass
(
'colorRojo'
);
$
(
obj
).
addClass
(
'colorRojo'
);
mostrarSnackBarDesbloqueo
();
mostrarSnackBarDesbloqueo
();
}
}
}
else
if
(
data
.
trim
()
==
3
)
{
}
else
if
(
data
.
trim
()
==
3
)
{
if
(
$
(
obj
).
hasClass
(
'colorAzul'
))
{
if
(
$
(
obj
).
hasClass
(
'colorAzul'
))
{
$
(
obj
).
removeClass
(
'colorAzul'
);
$
(
obj
).
removeClass
(
'colorAzul'
);
$
(
obj
).
addClass
(
'colorVerde'
);
$
(
obj
).
addClass
(
'colorVerde'
);
mostrarSnackBarDesbloqueo
();
mostrarSnackBarDesbloqueo
();
}
}
}
}
}
}
})
})
}
}
}
else
{
}
else
{
let
question
=
confirm
(
"¿Esta seguro de querer bloquear el dia "
+
convertirDia
(
dia
)
+
" ?"
);
let
question
=
confirm
(
"¿Esta seguro de querer bloquear el dia "
+
convertirDia
(
dia
)
+
" ?"
);
if
(
question
)
{
if
(
question
)
{
//aqui realizar peticion AJAX
//aqui realizar peticion AJAX
$
.
ajax
({
$
.
ajax
({
url
:
'../ServletHorario?Accion=updateDisponibilidad'
,
url
:
'../ServletHorario?Accion=updateDisponibilidad'
,
type
:
'POST'
,
type
:
'POST'
,
data
:
{
data
:
{
codDocente
:
codigoDoc
,
codDocente
:
codigoDoc
,
diaBloquear
:
dia
,
diaBloquear
:
dia
,
periodo
:
periodo
,
periodo
:
periodo
,
turno
:
numeroTurno
turno
:
numeroTurno
},
},
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
if
(
data
.
trim
()
==
1
)
{
if
(
data
.
trim
()
==
1
)
{
if
(
$
(
obj
).
hasClass
(
'colorVerde'
))
{
if
(
$
(
obj
).
hasClass
(
'colorVerde'
))
{
$
(
obj
).
removeClass
(
'colorVerde'
);
$
(
obj
).
removeClass
(
'colorVerde'
);
$
(
obj
).
addClass
(
'colorAzul'
);
$
(
obj
).
addClass
(
'colorAzul'
);
mostrarSnackBar
();
mostrarSnackBar
();
}
else
{
}
else
{
$
(
obj
).
removeClass
(
'colorRojo'
);
$
(
obj
).
removeClass
(
'colorRojo'
);
$
(
obj
).
addClass
(
'colorAzul'
);
$
(
obj
).
addClass
(
'colorAzul'
);
mostrarSnackBar
();
mostrarSnackBar
();
}
}
}
else
{
}
else
{
console
.
log
(
"error"
);
console
.
log
(
"error"
);
}
}
}
}
})
})
}
else
{
}
else
{
window
.
exit
();
window
.
exit
();
}
}
}
}
// $(obj).parents('tr').find('#changed').removeClass('red');
// $(obj).parents('tr').find('#changed').removeClass('red');
// $(obj).parents('tr').find('#changed').addClass('blue');
// $(obj).parents('tr').find('#changed').addClass('blue');
}
}
function
convertirDia
(
dia
)
{
function
convertirDia
(
dia
)
{
let
diaLetras
=
""
;
let
diaLetras
=
""
;
switch
(
dia
)
{
switch
(
dia
)
{
case
1
:
case
1
:
diaLetras
=
"Lunes"
;
diaLetras
=
"Lunes"
;
break
;
break
;
case
2
:
case
2
:
diaLetras
=
"Martes"
;
diaLetras
=
"Martes"
;
break
;
break
;
case
3
:
case
3
:
diaLetras
=
"Miercoles"
;
diaLetras
=
"Miercoles"
;
break
;
break
;
case
4
:
case
4
:
diaLetras
=
"Jueves"
;
diaLetras
=
"Jueves"
;
break
;
break
;
case
5
:
case
5
:
diaLetras
=
"Viernes"
;
diaLetras
=
"Viernes"
;
break
;
break
;
case
6
:
case
6
:
diaLetras
=
"Sabado"
;
diaLetras
=
"Sabado"
;
break
;
break
;
default
:
default
:
break
;
break
;
}
}
return
diaLetras
;
return
diaLetras
;
}
}
function
mostrarSnackBar
()
{
function
mostrarSnackBar
()
{
// Get the snackbar DIV
// Get the snackbar DIV
var
x
=
document
.
getElementById
(
"snackbar"
);
var
x
=
document
.
getElementById
(
"snackbar"
);
// Add the "show" class to DIV
// Add the "show" class to DIV
x
.
className
=
"show"
;
x
.
className
=
"show"
;
// After 3 seconds, remove the show class from DIV
// After 3 seconds, remove the show class from DIV
setTimeout
(
function
()
{
setTimeout
(
function
()
{
x
.
className
=
x
.
className
.
replace
(
"show"
,
""
);
x
.
className
=
x
.
className
.
replace
(
"show"
,
""
);
},
3000
);
},
3000
);
}
}
function
mostrarSnackBarDesbloqueo
()
{
function
mostrarSnackBarDesbloqueo
()
{
// Get the snackbar DIV
// Get the snackbar DIV
var
x
=
document
.
getElementById
(
"snackbar2"
);
var
x
=
document
.
getElementById
(
"snackbar2"
);
// Add the "show" class to DIV
// Add the "show" class to DIV
x
.
className
=
"show"
;
x
.
className
=
"show"
;
// After 3 seconds, remove the show class from DIV
// After 3 seconds, remove the show class from DIV
setTimeout
(
function
()
{
setTimeout
(
function
()
{
x
.
className
=
x
.
className
.
replace
(
"show"
,
""
);
x
.
className
=
x
.
className
.
replace
(
"show"
,
""
);
},
3000
);
},
3000
);
}
}
function
listarPlana
(
select
)
{
function
listarPlana
(
select
)
{
let
codigoArea
=
select
.
value
let
codigoArea
=
select
.
value
axios
.
get
(
'../ServletPlana?Accion=cargarPlanaJson&codigoArea='
+
codigoArea
)
axios
.
get
(
'../ServletPlana?Accion=cargarPlanaJson&codigoArea='
+
codigoArea
)
.
then
(
data
=>
{
.
then
(
data
=>
{
let
option
=
'<option value="">[SELECCIONE]</option>'
let
option
=
'<option value="">[SELECCIONE]</option>'
data
.
data
.
forEach
(
v
=>
{
data
.
data
.
forEach
(
v
=>
{
option
+=
'<option value="'
+
v
.
cod_pla
+
'">'
+
v
.
nom_pla
+
'</option>'
option
+=
'<option value="'
+
v
.
cod_pla
+
'">'
+
v
.
nom_pla
+
'</option>'
})
})
document
.
querySelector
(
'#cbPlana'
).
innerHTML
=
option
document
.
querySelector
(
'#cbPlana'
).
innerHTML
=
option
instances
.
init
(
elems
)
instances
.
init
(
elems
)
$
(
"#btnBuscar"
).
attr
(
'enabled'
,
'enabled'
);
$
(
"#btnBuscar"
).
attr
(
'enabled'
,
'enabled'
);
})
})
}
}
function
pintarTDRed
()
{
function
pintarTDRed
()
{
//alert("holii");
//alert("holii");
$
(
".red"
).
text
(
"X"
);
$
(
".red"
).
text
(
"X"
);
}
}
function
desactivarPrint
()
{
function
desactivarPrint
()
{
$
(
"#btnImprimir"
).
attr
(
'disabled'
,
'disabled'
);
$
(
"#btnImprimir"
).
attr
(
'disabled'
,
'disabled'
);
}
}
function
activarPrint
()
{
function
activarPrint
()
{
$
(
"#btnImprimir"
).
attr
(
'disabled'
,
false
);
$
(
"#btnImprimir"
).
attr
(
'disabled'
,
false
);
}
}
function
updateObservacion
(
obs
)
{
function
updateObservacion
(
obs
)
{
let
textObs
=
prompt
(
"Ingresar Observación"
);
let
textObs
=
prompt
(
"Ingresar Observación"
);
if
(
textObs
!=
null
)
{
if
(
textObs
!=
null
)
{
$
.
ajax
({
$
.
ajax
({
type
:
'POST'
,
type
:
'POST'
,
url
:
'../ServletHorario?accion=updateObservacion'
,
url
:
'../ServletHorario?accion=updateObservacion'
,
data
:
{
data
:
{
observacion
:
textObs
observacion
:
textObs
},
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
},
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
alert
(
"Actualizado exitosamente !"
)
alert
(
"Actualizado exitosamente !"
)
}
}
})
})
}
}
}
}
</script>
</script>
<script
src=
"js/pages/webSocketHorario.js"
type=
"text/javascript"
></script>
<script
src=
"js/pages/webSocketHorario.js"
type=
"text/javascript"
></script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment