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
d325353d
Commit
d325353d
authored
Jan 14, 2020
by
sistem02 user
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] disponibilidad por cada jefe de area
parent
f3a10347
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
361 additions
and
356 deletions
+361
-356
Area.java
src/java/pe/siso/horario/Beans/Area.java
+0
-1
AreaDAO.java
src/java/pe/siso/horario/DAO/AreaDAO.java
+1
-1
MySqlAreaDAO.java
src/java/pe/siso/horario/MySqlDAO/MySqlAreaDAO.java
+8
-4
MySqlUsuarioDAO.java
src/java/pe/siso/horario/MySqlDAO/MySqlUsuarioDAO.java
+3
-3
AreaServices.java
src/java/pe/siso/horario/Services/AreaServices.java
+2
-2
ServletArea.java
src/java/pe/siso/horario/Servlets/ServletArea.java
+347
-341
validar.jsp
web/vista/validar.jsp
+0
-1
vistaDobleDisponibilidad.jsp
web/vista/vistaDobleDisponibilidad.jsp
+0
-3
No files found.
src/java/pe/siso/horario/Beans/Area.java
View file @
d325353d
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
package
pe
.
siso
.
horario
.
Beans
;
package
pe
.
siso
.
horario
.
Beans
;
public
class
Area
{
public
class
Area
{
private
int
codigoArea
;
private
int
codigoArea
;
private
String
nombreArea
;
private
String
nombreArea
;
...
...
src/java/pe/siso/horario/DAO/AreaDAO.java
View file @
d325353d
...
@@ -20,7 +20,7 @@ public interface AreaDAO {
...
@@ -20,7 +20,7 @@ public interface AreaDAO {
public
void
Actualizar
(
String
codigo
,
String
nombreArea
)
throws
Exception
;
public
void
Actualizar
(
String
codigo
,
String
nombreArea
)
throws
Exception
;
public
int
registrarAreas
(
String
nombreArea
)
throws
Exception
;
public
int
registrarAreas
(
String
nombreArea
)
throws
Exception
;
public
void
cambiarEstado
(
String
dato
,
String
codigoArea
)
throws
Exception
;
public
void
cambiarEstado
(
String
dato
,
String
codigoArea
)
throws
Exception
;
public
ArrayList
<
Area
>
cargarArea
()
throws
Exception
;
public
ArrayList
<
Area
>
cargarArea
(
int
cod
)
throws
Exception
;
public
int
cantidadAreaUso
(
String
codigoArea
)
throws
Exception
;
public
int
cantidadAreaUso
(
String
codigoArea
)
throws
Exception
;
public
Area
datosArea
(
String
codDocente
)
throws
Exception
;
public
Area
datosArea
(
String
codDocente
)
throws
Exception
;
public
int
registrarAreaDocente
(
String
codigoArea
,
String
codigoDocente
)
throws
Exception
;
public
int
registrarAreaDocente
(
String
codigoArea
,
String
codigoDocente
)
throws
Exception
;
...
...
src/java/pe/siso/horario/MySqlDAO/MySqlAreaDAO.java
View file @
d325353d
...
@@ -94,15 +94,19 @@ public class MySqlAreaDAO implements AreaDAO {
...
@@ -94,15 +94,19 @@ public class MySqlAreaDAO implements AreaDAO {
}
}
@Override
@Override
public
ArrayList
<
Area
>
cargarArea
()
throws
Exception
{
public
ArrayList
<
Area
>
cargarArea
(
int
cod
)
throws
Exception
{
ArrayList
<
Area
>
lista
=
new
ArrayList
<
Area
>();
ArrayList
<
Area
>
lista
=
new
ArrayList
<
Area
>();
Connection
cnx
=
null
;
Connection
cnx
=
null
;
try
{
try
{
String
base
=
"horario"
;
String
base
=
"horario"
;
cnx
=
MySqlDAOFactory
.
obtenerConexion
(
base
);
String
codarea
=
""
;
cnx
=
MySqlDAOFactory
.
obtenerConexion
(
base
);
Statement
st
=
cnx
.
createStatement
();
Statement
st
=
cnx
.
createStatement
();
if
(
cod
!=
0
){
String
query
=
"SELECT cod_are,nom_are,est_are from area WHERE est_are = '1'"
;
codarea
=
" and cod_are ="
+
cod
;
}
String
query
=
"SELECT cod_are,nom_are,est_are from area WHERE est_are = '1'"
+
codarea
;
ResultSet
rs
=
st
.
executeQuery
(
query
);
ResultSet
rs
=
st
.
executeQuery
(
query
);
...
...
src/java/pe/siso/horario/MySqlDAO/MySqlUsuarioDAO.java
View file @
d325353d
...
@@ -52,17 +52,17 @@ public class MySqlUsuarioDAO implements UsuarioDAO {
...
@@ -52,17 +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 area.cod_are
a
,usuario.cod_usu,usuario.cod_tip_usu,usuario.ani_usu, usuario.usu_usu, usuario.cla_usu, usuario.cod_loc, usuario.est_usu, tipo_usuario.nom_tip_usu, sede.des_loc "
String
query
=
"SELECT area.cod_are,usuario.cod_usu,usuario.cod_tip_usu,usuario.ani_usu, usuario.usu_usu, usuario.cla_usu, usuario.cod_loc, usuario.est_usu, tipo_usuario.nom_tip_usu, sede.des_loc "
+
"FROM usuario "
+
"FROM usuario "
+
"LEFT JOIN sede ON sede.cod_loc = usuario.cod_loc "
+
"LEFT JOIN sede ON sede.cod_loc = usuario.cod_loc "
+
"LEFT JOIN area ON usuario.cod_usu=area.cod_usuario"
+
"LEFT JOIN area ON usuario.cod_usu=area.cod_usuario
"
+
"INNER JOIN tipo_usuario ON tipo_usuario.cod_tip_usu = usuario.cod_tip_usu "
+
"INNER JOIN tipo_usuario ON tipo_usuario.cod_tip_usu = usuario.cod_tip_usu "
+
"WHERE usuario.usu_usu='"
+
usuario
+
"' and usuario.cla_usu='"
+
clave
+
"' and usuario.est_usu='1'"
;
+
"WHERE usuario.usu_usu='"
+
usuario
+
"' and usuario.cla_usu='"
+
clave
+
"' and usuario.est_usu='1'"
;
ResultSet
rs
=
st
.
executeQuery
(
query
);
ResultSet
rs
=
st
.
executeQuery
(
query
);
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
usuario1
.
setCodarea
(
rs
.
getInt
(
"cod_are
a
"
));
usuario1
.
setCodarea
(
rs
.
getInt
(
"cod_are"
));
usuario1
.
setCodigoUsuario
(
rs
.
getInt
(
"cod_usu"
));
usuario1
.
setCodigoUsuario
(
rs
.
getInt
(
"cod_usu"
));
usuario1
.
setCodigoTipoUsuario
(
rs
.
getInt
(
"cod_tip_usu"
));
usuario1
.
setCodigoTipoUsuario
(
rs
.
getInt
(
"cod_tip_usu"
));
usuario1
.
setCodigoSede
(
rs
.
getInt
(
"cod_loc"
));
usuario1
.
setCodigoSede
(
rs
.
getInt
(
"cod_loc"
));
...
...
src/java/pe/siso/horario/Services/AreaServices.java
View file @
d325353d
...
@@ -62,10 +62,10 @@ public class AreaServices {
...
@@ -62,10 +62,10 @@ public class AreaServices {
}
}
public
ArrayList
<
Area
>
cargarArea
()
{
public
ArrayList
<
Area
>
cargarArea
(
int
cod
)
{
ArrayList
<
Area
>
lista
=
null
;
ArrayList
<
Area
>
lista
=
null
;
try
{
try
{
lista
=
objAreaDAO
.
cargarArea
();
lista
=
objAreaDAO
.
cargarArea
(
cod
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
src/java/pe/siso/horario/Servlets/ServletArea.java
View file @
d325353d
...
@@ -12,8 +12,10 @@ import javax.servlet.ServletException;
...
@@ -12,8 +12,10 @@ import javax.servlet.ServletException;
import
javax.servlet.http.HttpServlet
;
import
javax.servlet.http.HttpServlet
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
org.json.JSONArray
;
import
org.json.JSONArray
;
import
pe.siso.horario.Beans.Area
;
import
pe.siso.horario.Beans.Area
;
import
pe.siso.horario.Beans.Usuario
;
import
pe.siso.horario.Services.AreaServices
;
import
pe.siso.horario.Services.AreaServices
;
/**
/**
...
@@ -22,346 +24,350 @@ import pe.siso.horario.Services.AreaServices;
...
@@ -22,346 +24,350 @@ import pe.siso.horario.Services.AreaServices;
*/
*/
public
class
ServletArea
extends
HttpServlet
{
public
class
ServletArea
extends
HttpServlet
{
protected
void
service
(
HttpServletRequest
request
,
HttpServletResponse
response
)
protected
void
service
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
throws
ServletException
,
IOException
{
String
param
=
request
.
getParameter
(
"Accion"
);
String
param
=
request
.
getParameter
(
"Accion"
);
if
(
"listarAreas"
.
equals
(
param
))
{
if
(
"listarAreas"
.
equals
(
param
))
{
listarAreas
(
request
,
response
);
listarAreas
(
request
,
response
);
}
else
if
(
"cambiarEstado"
.
equals
(
param
))
{
}
else
if
(
"cambiarEstado"
.
equals
(
param
))
{
cambiarEstado
(
request
,
response
);
cambiarEstado
(
request
,
response
);
}
else
if
(
"registrarAreas"
.
equals
(
param
))
{
}
else
if
(
"registrarAreas"
.
equals
(
param
))
{
registrarAreas
(
request
,
response
);
registrarAreas
(
request
,
response
);
}
else
if
(
"armarEdicion"
.
equals
(
param
))
{
}
else
if
(
"armarEdicion"
.
equals
(
param
))
{
armarEdicion
(
request
,
response
);
armarEdicion
(
request
,
response
);
}
else
if
(
"cargarArea"
.
equals
(
param
))
{
}
else
if
(
"cargarArea"
.
equals
(
param
))
{
cargarArea
(
request
,
response
);
cargarArea
(
request
,
response
);
}
else
if
(
"Actualizar"
.
equals
(
param
))
{
}
else
if
(
"Actualizar"
.
equals
(
param
))
{
Actualizar
(
request
,
response
);
Actualizar
(
request
,
response
);
}
else
if
(
"cantidadUsoArea"
.
equals
(
param
))
{
}
else
if
(
"cantidadUsoArea"
.
equals
(
param
))
{
cantidadUsoArea
(
request
,
response
);
cantidadUsoArea
(
request
,
response
);
}
else
if
(
"consultarAreas"
.
equals
(
param
))
{
}
else
if
(
"consultarAreas"
.
equals
(
param
))
{
consultarAreas
(
request
,
response
);
consultarAreas
(
request
,
response
);
}
else
if
(
"registraAreaDocente"
.
equals
(
param
))
{
}
else
if
(
"registraAreaDocente"
.
equals
(
param
))
{
registraAreaDocente
(
request
,
response
);
registraAreaDocente
(
request
,
response
);
}
else
if
(
"cargarAreaJson"
.
equals
(
param
))
{
}
else
if
(
"cargarAreaJson"
.
equals
(
param
))
{
cargarAreaJson
(
request
,
response
);
cargarAreaJson
(
request
,
response
);
}
else
if
(
"cargarAreaEditar"
.
equals
(
param
)){
}
else
if
(
"cargarAreaEditar"
.
equals
(
param
))
{
cargarAreaEditar
(
request
,
response
);
cargarAreaEditar
(
request
,
response
);
}
}
}
}
private
void
listarAreas
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
private
void
listarAreas
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
AreaServices
servicios
=
new
AreaServices
();
AreaServices
servicios
=
new
AreaServices
();
ArrayList
<
Area
>
lista
=
null
;
ArrayList
<
Area
>
lista
=
null
;
lista
=
servicios
.
listarAreas
();
lista
=
servicios
.
listarAreas
();
response
.
setContentType
(
"text/html"
);
response
.
setContentType
(
"text/html"
);
PrintWriter
pw
=
response
.
getWriter
();
PrintWriter
pw
=
response
.
getWriter
();
pw
.
println
(
"<div style=\"border: 1px solid #CCCCCC;\"> "
pw
.
println
(
"<div style=\"border: 1px solid #CCCCCC;\"> "
+
" <div class=\"table-header\"> "
+
" <div class=\"table-header\"> "
+
" Listado de Áreas "
+
" Listado de Áreas "
+
" </div> "
+
" </div> "
+
" <div> "
+
" <div> "
+
" <div class=\"dataTables_wrapper form-inline no-footer\" id=\"sample-table-2_wrapper\"> "
+
" <div class=\"dataTables_wrapper form-inline no-footer\" id=\"sample-table-2_wrapper\"> "
+
" <table class=\"table table-striped table-bordered table-hover dataTable no-footer\" id=\"sample-table-2\" role=\"grid\" aria-describedby=\"sample-table-2_info\" > "
+
" <table class=\"table table-striped table-bordered table-hover dataTable no-footer\" id=\"sample-table-2\" role=\"grid\" aria-describedby=\"sample-table-2_info\" > "
+
" <thead> "
+
" <thead> "
+
" <tr role=\"row\"> "
+
" <tr role=\"row\"> "
+
" <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\" >N°</th> "
+
" <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\" >N°</th> "
+
" <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">ÁREA</th> "
+
" <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">ÁREA</th> "
+
" <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">EDICIÓN</th> "
+
" <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">EDICIÓN</th> "
+
" <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">ESTADO</th> "
+
" <th tabindex=\"0\" class=\"center\" rowspan=\"1\" colspan=\"1\">ESTADO</th> "
+
" </tr> "
+
" </tr> "
+
" </thead> "
+
" </thead> "
+
" <tbody>"
);
+
" <tbody>"
);
int
cont
=
1
;
int
cont
=
1
;
for
(
int
i
=
0
;
i
<
lista
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
lista
.
size
();
i
++)
{
if
(
cont
%
2
==
0
)
{
if
(
cont
%
2
==
0
)
{
pw
.
println
(
"<tr class=\"alt\" >"
);
pw
.
println
(
"<tr class=\"alt\" >"
);
}
else
{
}
else
{
pw
.
println
(
"<tr >"
);
pw
.
println
(
"<tr >"
);
}
}
String
estado
=
""
;
String
estado
=
""
;
if
(
lista
.
get
(
i
).
getEstaArea
()
==
1
)
{
if
(
lista
.
get
(
i
).
getEstaArea
()
==
1
)
{
estado
=
"<a id='btnValidarEstado' href=\"javascript:validar_estado(0,"
+
lista
.
get
(
i
).
getCodigoArea
()
+
");\" class=\"regular\" > "
estado
=
"<a id='btnValidarEstado' href=\"javascript:validar_estado(0,"
+
lista
.
get
(
i
).
getCodigoArea
()
+
");\" class=\"regular\" > "
+
"<img src=\"imagenes/icons/lightbulb.png\" /> "
+
"<img src=\"imagenes/icons/lightbulb.png\" /> "
+
"</a>"
;
+
"</a>"
;
}
else
{
}
else
{
estado
=
"<a id='btnValidarEstado2' href=\"javascript:validar_estado(1,"
+
lista
.
get
(
i
).
getCodigoArea
()
+
");\" class=\"regular\" > "
estado
=
"<a id='btnValidarEstado2' href=\"javascript:validar_estado(1,"
+
lista
.
get
(
i
).
getCodigoArea
()
+
");\" class=\"regular\" > "
+
"<img src=\"imagenes/icons/lightbulb_off.png\" /> "
+
"<img src=\"imagenes/icons/lightbulb_off.png\" /> "
+
"</a>"
;
+
"</a>"
;
}
}
pw
.
println
(
" <td align='center'>"
+
cont
+
"</td>"
pw
.
println
(
" <td align='center'>"
+
cont
+
"</td>"
+
" <td>"
+
lista
.
get
(
i
).
getNombreArea
()
+
"</td>"
+
" <td>"
+
lista
.
get
(
i
).
getNombreArea
()
+
"</td>"
+
" <td align='center'><a id='btnEditar' href=\"javascript:armarEdicion("
+
lista
.
get
(
i
).
getCodigoArea
()
+
");\" class=\"regular\" > "
+
" <td align='center'><a id='btnEditar' href=\"javascript:armarEdicion("
+
lista
.
get
(
i
).
getCodigoArea
()
+
");\" class=\"regular\" > "
+
" <img src=\"imagenes/icons/page_edit.png\" /> "
+
" <img src=\"imagenes/icons/page_edit.png\" /> "
+
" </a>"
+
" </a>"
+
" </td>"
+
" </td>"
+
" <td align='center' valign='middle'>"
+
estado
+
"</td>"
+
" <td align='center' valign='middle'>"
+
estado
+
"</td>"
+
" </tr>"
);
+
" </tr>"
);
cont
++;
cont
++;
}
}
if
(
cont
==
1
)
{
if
(
cont
==
1
)
{
pw
.
println
(
"<tr><td colspan='4' align='center'>No hay Áreas registradas</td></tr>"
);
pw
.
println
(
"<tr><td colspan='4' align='center'>No hay Áreas registradas</td></tr>"
);
}
}
pw
.
println
(
" </tbody> "
pw
.
println
(
" </tbody> "
+
" </table> "
+
" </table> "
+
" </div>"
+
" </div>"
+
" </div>"
+
" </div>"
+
" </div>"
);
+
" </div>"
);
}
}
private
void
cambiarEstado
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
private
void
cambiarEstado
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
//String codArea=request.getParameter("codArea");
//String codArea=request.getParameter("codArea");
String
cod_area
=
request
.
getParameter
(
"cod_area"
);
String
cod_area
=
request
.
getParameter
(
"cod_area"
);
AreaServices
servicios
=
new
AreaServices
();
AreaServices
servicios
=
new
AreaServices
();
int
cantidad
=
servicios
.
cantidadAreaUso
(
cod_area
);
int
cantidad
=
servicios
.
cantidadAreaUso
(
cod_area
);
String
dato
=
request
.
getParameter
(
"dato"
);
String
dato
=
request
.
getParameter
(
"dato"
);
response
.
setContentType
(
"text/html"
);
response
.
setContentType
(
"text/html"
);
PrintWriter
pw
=
response
.
getWriter
();
PrintWriter
pw
=
response
.
getWriter
();
if
(
cantidad
==
0
)
{
if
(
cantidad
==
0
)
{
servicios
.
cambiarEstado
(
dato
,
cod_area
);
servicios
.
cambiarEstado
(
dato
,
cod_area
);
pw
.
println
(
"0"
);
pw
.
println
(
"0"
);
}
else
{
}
else
{
pw
.
println
(
"1"
);
pw
.
println
(
"1"
);
}
}
}
}
private
void
registrarAreas
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
private
void
registrarAreas
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
AreaServices
servicios
=
new
AreaServices
();
AreaServices
servicios
=
new
AreaServices
();
String
nombreArea
=
request
.
getParameter
(
"Tcentro"
);
String
nombreArea
=
request
.
getParameter
(
"Tcentro"
);
int
dato
=
servicios
.
registrarAreas
(
nombreArea
);
int
dato
=
servicios
.
registrarAreas
(
nombreArea
);
response
.
setContentType
(
"text/html"
);
response
.
setContentType
(
"text/html"
);
PrintWriter
pw
=
response
.
getWriter
();
PrintWriter
pw
=
response
.
getWriter
();
if
(
dato
==
0
)
{
if
(
dato
==
0
)
{
pw
.
println
(
"1"
);
pw
.
println
(
"1"
);
}
else
if
(
dato
>
0
)
{
}
else
if
(
dato
>
0
)
{
pw
.
println
(
"0"
);
pw
.
println
(
"0"
);
}
else
{
}
else
{
pw
.
println
(
"2"
);
pw
.
println
(
"2"
);
}
}
}
}
private
void
armarEdicion
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
private
void
armarEdicion
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
AreaServices
servicios
=
new
AreaServices
();
AreaServices
servicios
=
new
AreaServices
();
Area
area
=
new
Area
();
Area
area
=
new
Area
();
String
cod_area
=
request
.
getParameter
(
"codarea"
);
String
cod_area
=
request
.
getParameter
(
"codarea"
);
area
=
servicios
.
NombreAreas
(
cod_area
);
area
=
servicios
.
NombreAreas
(
cod_area
);
//String dato = request.getParameter("dato");
//String dato = request.getParameter("dato");
response
.
setContentType
(
"text/html"
);
response
.
setContentType
(
"text/html"
);
PrintWriter
pw
=
response
.
getWriter
();
PrintWriter
pw
=
response
.
getWriter
();
pw
.
println
(
"<center>"
pw
.
println
(
"<center>"
+
" <table border='0'>"
+
" <table border='0'>"
+
" <tr>"
+
" <tr>"
+
" <td colspan='4' height='30'></td>"
+
" <td colspan='4' height='30'></td>"
+
" </tr>"
+
" </tr>"
+
" <tr>"
+
" <tr>"
+
" <td><b>Nombre de Área: </b> <font color=\"#FF0000\">*</font></td>"
+
" <td><b>Nombre de Área: </b> <font color=\"#FF0000\">*</font></td>"
+
" <td width='10'></td>"
+
" <td width='10'></td>"
+
" <td><input id='txt_nom' type='text' class='form-control validate[required,custom[onlyLetterSp]]' value='"
+
area
.
getNombreArea
()
+
"' onChange='conMayusculas(this);' > </td>"
+
" <td><input id='txt_nom' type='text' class='form-control validate[required,custom[onlyLetterSp]]' value='"
+
area
.
getNombreArea
()
+
"' onChange='conMayusculas(this);' > </td>"
+
" <td width='20'></td>"
+
" <td width='20'></td>"
+
" </tr>"
+
" </tr>"
+
" </table>"
+
" </table>"
+
"</center>"
);
+
"</center>"
);
}
}
private
void
cargarArea
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
private
void
cargarArea
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
AreaServices
servicios
=
new
AreaServices
();
AreaServices
servicios
=
new
AreaServices
();
ArrayList
<
Area
>
lista
=
null
;
ArrayList
<
Area
>
lista
=
null
;
String
accion
=
request
.
getParameter
(
"accion"
);
String
accion
=
request
.
getParameter
(
"accion"
);
String
nombreId
=
request
.
getParameter
(
"nombre"
);
String
nombreId
=
request
.
getParameter
(
"nombre"
);
lista
=
servicios
.
cargarArea
();
lista
=
servicios
.
cargarArea
(
0
);
response
.
setContentType
(
"text/html"
);
response
.
setContentType
(
"text/html"
);
PrintWriter
pw
=
response
.
getWriter
();
PrintWriter
pw
=
response
.
getWriter
();
pw
.
println
(
"<select id='"
+
nombreId
+
"' class='chosen-select form-control validate[required]' onChange='"
+
accion
+
"'>"
);
pw
.
println
(
"<select id='"
+
nombreId
+
"' class='chosen-select form-control validate[required]' onChange='"
+
accion
+
"'>"
);
pw
.
println
(
"<option value=''>[Seleccione]</option>"
);
pw
.
println
(
"<option value=''>[Seleccione]</option>"
);
for
(
int
i
=
0
;
i
<
lista
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
lista
.
size
();
i
++)
{
pw
.
println
(
"<option value='"
+
lista
.
get
(
i
).
getCodigoArea
()
+
"'>"
+
lista
.
get
(
i
).
getNombreArea
()
+
"</option>"
);
pw
.
println
(
"<option value='"
+
lista
.
get
(
i
).
getCodigoArea
()
+
"'>"
+
lista
.
get
(
i
).
getNombreArea
()
+
"</option>"
);
}
}
pw
.
println
(
"</select>"
);
pw
.
println
(
"</select>"
);
}
}
private
void
cargarAreaEditar
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
AreaServices
servicios
=
new
AreaServices
();
private
void
cargarAreaEditar
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
ArrayList
<
Area
>
lista
=
null
;
AreaServices
servicios
=
new
AreaServices
();
String
accion
=
request
.
getParameter
(
"accion"
);
ArrayList
<
Area
>
lista
=
null
;
String
nombreId
=
request
.
getParameter
(
"nombre"
);
String
accion
=
request
.
getParameter
(
"accion"
);
String
nombreId
=
request
.
getParameter
(
"nombre"
);
String
codDocente
=
request
.
getParameter
(
"codDocente"
);
String
codDocente
=
request
.
getParameter
(
"codDocente"
);
lista
=
servicios
.
listarAreasDocente
(
codDocente
);
lista
=
servicios
.
listarAreasDocente
(
codDocente
);
response
.
setContentType
(
"text/html"
);
PrintWriter
pw
=
response
.
getWriter
();
response
.
setContentType
(
"text/html"
);
PrintWriter
pw
=
response
.
getWriter
();
pw
.
println
(
"<select id='"
+
nombreId
+
"' class='chosen-select form-control validate[required]' onChange='"
+
accion
+
"'>"
);
pw
.
println
(
"<option value=''>[SELECCIONE]</option>"
);
pw
.
println
(
"<select id='"
+
nombreId
+
"' class='chosen-select form-control validate[required]' onChange='"
+
accion
+
"'>"
);
for
(
int
i
=
0
;
i
<
lista
.
size
();
i
++)
{
pw
.
println
(
"<option value=''>[SELECCIONE]</option>"
);
pw
.
println
(
"<option value='"
+
lista
.
get
(
i
).
getCodigoArea
()
+
"' selected>"
+
lista
.
get
(
i
).
getNombreArea
()
+
"</option>"
);
for
(
int
i
=
0
;
i
<
lista
.
size
();
i
++)
{
}
pw
.
println
(
"<option value='"
+
lista
.
get
(
i
).
getCodigoArea
()
+
"' selected>"
+
lista
.
get
(
i
).
getNombreArea
()
+
"</option>"
);
}
pw
.
println
(
"</select>"
);
}
pw
.
println
(
"</select>"
);
}
private
void
Actualizar
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
AreaServices
servicios
=
new
AreaServices
();
private
void
Actualizar
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
nombre
=
request
.
getParameter
(
"nombre"
);
AreaServices
servicios
=
new
AreaServices
();
String
cod_area
=
request
.
getParameter
(
"cod_area"
);
String
nombre
=
request
.
getParameter
(
"nombre"
);
servicios
.
Actualizar
(
cod_area
,
nombre
);
String
cod_area
=
request
.
getParameter
(
"cod_area"
);
}
servicios
.
Actualizar
(
cod_area
,
nombre
);
}
private
void
cantidadUsoArea
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
String
cod_area
=
request
.
getParameter
(
"cod_area"
);
private
void
cantidadUsoArea
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
AreaServices
servicios
=
new
AreaServices
();
String
cod_area
=
request
.
getParameter
(
"cod_area"
);
int
cantidad
=
servicios
.
cantidadAreaUso
(
cod_area
);
AreaServices
servicios
=
new
AreaServices
();
int
cantidad
=
servicios
.
cantidadAreaUso
(
cod_area
);
response
.
setContentType
(
"text/html"
);
PrintWriter
pw
=
response
.
getWriter
();
response
.
setContentType
(
"text/html"
);
if
(
cantidad
==
0
)
{
PrintWriter
pw
=
response
.
getWriter
();
pw
.
println
(
"0"
);
if
(
cantidad
==
0
)
{
}
else
{
pw
.
println
(
"0"
);
pw
.
println
(
"1"
);
}
else
{
}
pw
.
println
(
"1"
);
}
}
}
private
void
consultarAreas
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
String
codDoc
=
request
.
getParameter
(
"codDoc"
);
private
void
consultarAreas
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
AreaServices
servicios
=
new
AreaServices
();
String
codDoc
=
request
.
getParameter
(
"codDoc"
);
Area
area
=
new
Area
();
AreaServices
servicios
=
new
AreaServices
();
area
=
servicios
.
datosArea
(
codDoc
);
Area
area
=
new
Area
();
response
.
setContentType
(
"text/html"
);
area
=
servicios
.
datosArea
(
codDoc
);
PrintWriter
pw
=
response
.
getWriter
();
response
.
setContentType
(
"text/html"
);
if
(
area
.
getCodigoArea
()
>
0
)
{
PrintWriter
pw
=
response
.
getWriter
();
pw
.
println
(
"<input id='idAreasDocente' type='hidden' value='1' >"
);
if
(
area
.
getCodigoArea
()
>
0
)
{
pw
.
println
(
"<input id='idAreasSelect' type='hidden' value='"
+
area
.
getCodigoArea
()
+
"' >"
);
pw
.
println
(
"<input id='idAreasDocente' type='hidden' value='1' >"
);
pw
.
println
(
"<div class='widget-box widget-color-dark'> "
pw
.
println
(
"<input id='idAreasSelect' type='hidden' value='"
+
area
.
getCodigoArea
()
+
"' >"
);
+
" <div class='widget-header'> "
pw
.
println
(
"<div class='widget-box widget-color-dark'> "
+
" <h4 class='widget-title'>ÁREA</h4> "
+
" <div class='widget-header'> "
+
" </div> "
+
" <h4 class='widget-title'>ÁREA</h4> "
+
" <div class='widget-body'> "
+
" </div> "
+
" <div class='widget-main no-padding'> "
+
" <div class='widget-body'> "
+
" <form id='registroAreaFormulario' class='formular' method='post'> "
+
" <div class='widget-main no-padding'> "
+
" <fieldset> "
+
" <form id='registroAreaFormulario' class='formular' method='post'> "
+
" <div class='col-sm-6'> "
+
" <fieldset> "
+
" <br> "
+
" <div class='col-sm-6'> "
+
" <div class='alert alert-block alert-success'> "
+
" <br> "
+
" <button type='button' class='close' data-dismiss='alert'> "
+
" <div class='alert alert-block alert-success'> "
+
" <i class='ace-icon fa fa-times'></i> "
+
" <button type='button' class='close' data-dismiss='alert'> "
+
" </button> "
+
" <i class='ace-icon fa fa-times'></i> "
+
" <strong>ÁREA!</strong> <br> "
+
" </button> "
+
" "
+
area
.
getNombreArea
()
+
" "
+
" <strong>ÁREA!</strong> <br> "
+
" <br> "
+
" "
+
area
.
getNombreArea
()
+
" "
+
" </div> "
+
" <br> "
+
" </div> "
+
" </div> "
+
" <div class='col-sm-6'> "
+
" </div> "
+
" <br> "
+
" <div class='col-sm-6'> "
+
" <div class='alert alert-warning'> "
+
" <br> "
+
" <button type='button' class='close' data-dismiss='alert'> "
+
" <div class='alert alert-warning'> "
+
" <i class='ace-icon fa fa-times'></i> "
+
" <button type='button' class='close' data-dismiss='alert'> "
+
" </button> "
+
" <i class='ace-icon fa fa-times'></i> "
+
" <strong>NOTA!</strong> "
+
" </button> "
+
" Seleccione su area perteneciente para poder registrar su disponibilidad horaria. "
+
" <strong>NOTA!</strong> "
+
" <br> "
+
" Seleccione su area perteneciente para poder registrar su disponibilidad horaria. "
+
" </div> "
+
" <br> "
+
" </div> "
+
" </div> "
+
" </fieldset> "
+
" </div> "
+
" "
+
" </fieldset> "
+
" </form> "
+
" "
+
" </div> "
+
" </form> "
+
" </div> "
+
" </div> "
+
" </div>"
);
+
" </div> "
}
else
{
+
" </div>"
);
pw
.
println
(
"<input id='idAreasDocente' type='hidden' value='0' >"
);
}
else
{
pw
.
println
(
"<input id='idAreasSelect' type='hidden' value='0' >"
);
pw
.
println
(
"<input id='idAreasDocente' type='hidden' value='0' >"
);
pw
.
println
(
"<div class='widget-box widget-color-dark'> "
pw
.
println
(
"<input id='idAreasSelect' type='hidden' value='0' >"
);
+
" <div class='widget-header'> "
pw
.
println
(
"<div class='widget-box widget-color-dark'> "
+
" <h4 class='widget-title'>ÁREA</h4> "
+
" <div class='widget-header'> "
+
" </div> "
+
" <h4 class='widget-title'>ÁREA</h4> "
+
" <div class='widget-body'> "
+
" </div> "
+
" <div class='widget-main no-padding'> "
+
" <div class='widget-body'> "
+
" <form id='registroAreaFormulario' class='formular' method='post'> "
+
" <div class='widget-main no-padding'> "
+
" <fieldset> "
+
" <form id='registroAreaFormulario' class='formular' method='post'> "
+
" <div class='col-sm-6'> "
+
" <fieldset> "
+
" <label for='form-field-select-3'>¿A qué área asiste? <span style='color: red;'>(*)</span></label> "
+
" <div class='col-sm-6'> "
+
" <br> "
+
" <label for='form-field-select-3'>¿A qué área asiste? <span style='color: red;'>(*)</span></label> "
+
" <span > "
+
" <br> "
+
" <select id='cmbAreaSelect' class='form-control validate[required]'> "
+
" <span > "
+
" <option value=''>[Seleccione]</option> "
);
+
" <select id='cmbAreaSelect' class='form-control validate[required]'> "
+
" <option value=''>[Seleccione]</option> "
);
pw
.
println
(
"<option value='1'>MATEMÁTICA</option>"
);
pw
.
println
(
"<option value='2'>COMUNICACIÓN</option>"
);
pw
.
println
(
"<option value='1'>MATEMÁTICA</option>"
);
pw
.
println
(
"<option value='3'>CIENCIAS SOCIALES</option>"
);
pw
.
println
(
"<option value='2'>COMUNICACIÓN</option>"
);
pw
.
println
(
"<option value='4'>C.T.A.</option>"
);
pw
.
println
(
"<option value='3'>CIENCIAS SOCIALES</option>"
);
pw
.
println
(
"<option value='5'>C.E.F.</option>"
);
pw
.
println
(
"<option value='4'>C.T.A.</option>"
);
pw
.
println
(
"<option value='5'>C.E.F.</option>"
);
pw
.
println
(
" </select> "
pw
.
println
(
" </select> "
+
" </span> "
+
" </span> "
+
" <br> "
+
" <br> "
+
" </div> "
+
" </div> "
+
" <div class='col-sm-6'> "
+
" <div class='col-sm-6'> "
+
" <br> "
+
" <br> "
+
" <div class='alert alert-warning'> "
+
" <div class='alert alert-warning'> "
+
" <button type='button' class='close' data-dismiss='alert'> "
+
" <button type='button' class='close' data-dismiss='alert'> "
+
" <i class='ace-icon fa fa-times'></i> "
+
" <i class='ace-icon fa fa-times'></i> "
+
" </button> "
+
" </button> "
+
" <strong>NOTA!</strong> "
+
" <strong>NOTA!</strong> "
+
" Seleccione su area perteneciente para poder registrar su disponibilidad horaria. "
+
" Seleccione su area perteneciente para poder registrar su disponibilidad horaria. "
+
" <br> "
+
" <br> "
+
" </div> "
+
" </div> "
+
" </div> "
+
" </div> "
+
" </fieldset> "
+
" </fieldset> "
+
" <div class='form-actions center'> "
+
" <div class='form-actions center'> "
+
" <button class='btn btn-sm btn-primary' type='button' onclick='validar_seleccion();'> "
+
" <button class='btn btn-sm btn-primary' type='button' onclick='validar_seleccion();'> "
+
" <i class='ace-icon fa fa-save icon-on-right bigger-110'></i> "
+
" <i class='ace-icon fa fa-save icon-on-right bigger-110'></i> "
+
" Seleccionar "
+
" Seleccionar "
+
" </button> "
+
" </button> "
+
" </div> "
+
" </div> "
+
" "
+
" "
+
" </form> "
+
" </form> "
+
" </div> "
+
" </div> "
+
" </div> "
+
" </div> "
+
" </div>"
);
+
" </div>"
);
}
}
}
}
private
void
registraAreaDocente
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
private
void
registraAreaDocente
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
codArea
=
request
.
getParameter
(
"cmbAreaSelect"
);
String
codArea
=
request
.
getParameter
(
"cmbAreaSelect"
);
String
codDocente
=
request
.
getParameter
(
"codDocente"
);
String
codDocente
=
request
.
getParameter
(
"codDocente"
);
AreaServices
servicios
=
new
AreaServices
();
AreaServices
servicios
=
new
AreaServices
();
int
dato
=
0
;
int
dato
=
0
;
dato
=
servicios
.
registrarAreaDocente
(
codArea
,
codDocente
);
dato
=
servicios
.
registrarAreaDocente
(
codArea
,
codDocente
);
}
}
private
void
cargarAreaJson
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
private
void
cargarAreaJson
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
AreaServices
servicios
=
new
AreaServices
();
AreaServices
servicios
=
new
AreaServices
();
ArrayList
<
Area
>
lista
=
null
;
ArrayList
<
Area
>
lista
=
null
;
HttpSession
session_actual
=
request
.
getSession
(
true
);
lista
=
servicios
.
cargarArea
();
Usuario
usuario
=
(
Usuario
)
session_actual
.
getAttribute
(
"usuario"
);
int
codarea
=
usuario
.
getCodarea
();
response
.
setContentType
(
"application/json"
);
System
.
out
.
println
(
"***********************************"
);
PrintWriter
pw
=
response
.
getWriter
();
System
.
out
.
println
(
codarea
);
lista
=
servicios
.
cargarArea
(
codarea
);
JSONArray
jArray
=
new
JSONArray
(
lista
);
pw
.
print
(
jArray
);
response
.
setContentType
(
"application/json"
);
}
PrintWriter
pw
=
response
.
getWriter
();
JSONArray
jArray
=
new
JSONArray
(
lista
);
pw
.
print
(
jArray
);
}
}
}
web/vista/validar.jsp
View file @
d325353d
...
@@ -19,7 +19,6 @@ Menu menu=(Menu)session_actual.getAttribute("menu");
...
@@ -19,7 +19,6 @@ Menu menu=(Menu)session_actual.getAttribute("menu");
Sede SedeCod=(Sede)session_actual.getAttribute("sedeSessionCod");
Sede SedeCod=(Sede)session_actual.getAttribute("sedeSessionCod");
PeriodoAcademico periodo=(PeriodoAcademico)session_actual.getAttribute("periodo");
PeriodoAcademico periodo=(PeriodoAcademico)session_actual.getAttribute("periodo");
Horario armandoHorario=(Horario)session_actual.getAttribute("armandoHorario");
Horario armandoHorario=(Horario)session_actual.getAttribute("armandoHorario");
Grupo CadenaGrupo=(Grupo)session_actual.getAttribute("sessionGrupoHorario");
Grupo CadenaGrupo=(Grupo)session_actual.getAttribute("sessionGrupoHorario");
if(usuario == null || periodo== null){
if(usuario == null || periodo== null){
...
...
web/vista/vistaDobleDisponibilidad.jsp
View file @
d325353d
...
@@ -24,10 +24,7 @@
...
@@ -24,10 +24,7 @@
<
%
<
%
HttpSession
session_actual =
request.getSession(true);
HttpSession
session_actual =
request.getSession(true);
Usuario
usuario =
(Usuario)
session_actual
.
getAttribute
("
usuario
");
PeriodoAcademico
periodo =
(PeriodoAcademico)
session_actual
.
getAttribute
("
periodo
");
PeriodoAcademico
periodo =
(PeriodoAcademico)
session_actual
.
getAttribute
("
periodo
");
System
.
out
.
println
("*******************");
System
.
out
.
println
(
usuario
.
getCodarea
());
%
>
%
>
<style
type=
"text/css"
>
<style
type=
"text/css"
>
@media
print
{
@media
print
{
...
...
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