Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
ProyectoFinal-Bootcamp
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jose Baez
ProyectoFinal-Bootcamp
Commits
aca99328
Commit
aca99328
authored
May 15, 2022
by
Josebaezx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filtro por aceptados
parent
28ebb919
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
7 deletions
+76
-7
src/main/java/com/roshka/proyectofinal/Postulante/Filtros.java
+11
-2
src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java
+36
-0
src/main/webapp/postulante-consulta.jsp
+29
-5
No files found.
src/main/java/com/roshka/proyectofinal/Postulante/Filtros.java
View file @
aca99328
...
...
@@ -20,10 +20,12 @@ public class Filtros extends HttpServlet {
protected
void
doGet
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
List
<
Postulante
>
postulantes
=
listarPostulante
();
String
respuesta
=
req
.
getParameter
(
"id"
);
String
nombre
=
req
.
getParameter
(
"nombreBuscar"
);
String
nombre
=
req
.
getParameter
(
"nombreBuscar"
)==
null
?
"0"
:
req
.
getParameter
(
"nombreBuscar"
);
System
.
out
.
println
(
nombre
);
if
(
respuesta
!=
null
)
{
update
(
Integer
.
parseInt
(
req
.
getParameter
(
"id"
)));
}
else
if
(
nombre
!=
null
){
postulantes
=
listarPostulante
();
}
else
if
(
nombre
.
length
()
>
1
){
postulantes
=
buscarPorNombre
(
nombre
);
}
...
...
@@ -32,4 +34,11 @@ public class Filtros extends HttpServlet {
reqDisp
.
forward
(
req
,
resp
);
}
@Override
protected
void
doPost
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
List
<
Postulante
>
postulantes
=
listarPostulanteAceptados
();
req
.
getServletContext
().
setAttribute
(
"postulantes"
,
postulantes
);
RequestDispatcher
reqDisp
=
req
.
getRequestDispatcher
(
"postulante-consulta.jsp"
);
reqDisp
.
forward
(
req
,
resp
);
}
}
src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java
View file @
aca99328
...
...
@@ -125,4 +125,40 @@ public class PostulanteDao {
}
return
postulante
;
}
public
static
List
<
Postulante
>
listarPostulanteAceptados
(){
List
<
Postulante
>
postulante
=
null
;
try
{
Connection
con
=
DataBase
.
getConnection
();
PreparedStatement
ps
=
con
.
prepareStatement
(
"select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo, "
+
"a.telefono, a.direccion, a.experiencia_laboral, a.estudio_universitario, a.bootcamp_id, a.notebook, "
+
"c.nombre_lenguaje as bootcamp, \n"
+
"a.aceptado from postulante a\n"
+
" inner join bootcamp b on b.id= a.bootcamp_id\n"
+
" inner join lenguaje c on c.id=b.id_lenguaje\n"
+
" where a.aceptado= true "
);
ResultSet
rs
=
ps
.
executeQuery
();
postulante
=
new
ArrayList
<>();
Postulante
postulanteObject
=
new
Postulante
();
while
(
rs
.
next
()){
postulanteObject
.
setId
(
rs
.
getInt
(
"id"
));
postulanteObject
.
setNombre
(
rs
.
getString
(
"nombre"
));
postulanteObject
.
setApellido
(
rs
.
getString
(
"apellido"
));
postulanteObject
.
setNroCedula
(
rs
.
getInt
(
"nro_cedula"
));
postulanteObject
.
setCorreo
(
rs
.
getString
(
"correo"
));
postulanteObject
.
setTelefono
(
rs
.
getString
(
"telefono"
));
postulanteObject
.
setDireccion
(
rs
.
getString
(
"direccion"
));
postulanteObject
.
setExpLaboral
(
rs
.
getBoolean
(
"experiencia_laboral"
));
postulanteObject
.
setEstudioUniversitario
(
rs
.
getBoolean
(
"estudio_universitario"
));
postulanteObject
.
setBootcampId
(
rs
.
getInt
(
"bootcamp_id"
));
postulanteObject
.
setNotebook
(
rs
.
getBoolean
(
"notebook"
));
postulanteObject
.
setNombreBootcamp
(
rs
.
getString
(
"bootcamp"
));
postulanteObject
.
setAceptado
(
rs
.
getBoolean
(
"aceptado"
));
postulante
.
add
(
postulanteObject
);
}
con
.
close
();
}
catch
(
Exception
ex
){
ex
.
printStackTrace
();
}
return
postulante
;
}
}
src/main/webapp/postulante-consulta.jsp
View file @
aca99328
...
...
@@ -16,6 +16,10 @@
placeholder=
"Buscar por nombre"
>
<button
type=
"submit"
>
Buscar
</button>
</form>
<form
action=
"filtros-postulante"
method=
"post"
>
<input
type=
"hidden"
name=
"aceptado"
value=
"si"
>
<button
type=
"submit"
>
Aceptados
</button>
</form>
<table>
<tr>
<th>
#
</th>
...
...
@@ -42,14 +46,34 @@
<td>
${postulante.correo}
</td>
<td>
${postulante.telefono}
</td>
<td>
${postulante.direccion}
</td>
<td>
${postulante.expLaboral}
</td>
<td>
${postulante.estudioUniversitario}
</td>
<td>
${postulante.notebook}
</td>
<td>
<c:if
test=
"${postulante.expLaboral == true}"
>
SI
</c:if>
<c:if
test=
"${postulante.expLaboral != true}"
>
NO
</c:if>
</td>
<td>
<c:if
test=
"${postulante.estudioUniversitario == true}"
>
SI
</c:if>
<c:if
test=
"${postulante.estudioUniversitario != true}"
>
NO
</c:if>
</td>
<td>
<c:if
test=
"${postulante.notebook == true}"
>
SI
</c:if>
<c:if
test=
"${postulante.notebook != true}"
>
NO
</c:if>
</td>
<td>
${postulante.nombreBootcamp}
</td>
<td>
${postulante.aceptado}
</td>
<td>
<c:if
test=
"${postulante.aceptado == true}"
>
<button>
Aceptado
</button>
SI
</c:if>
<c:if
test=
"${postulante.aceptado != true}"
>
<button><a
href=
"filtros-postulante?id=${postulante.id}"
>
Aceptar postulante
</a></button>
...
...
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