Commit 95bee732 by Rebecca Arzamendia

Merge branch 'develop' of…

Merge branch 'develop' of https://phoebe.roshka.com/gitlab/jbaez/ProyectoFinal-Bootcamp into trabajovistas
parents 0ff36db1 f99c98ca
......@@ -6,6 +6,7 @@ target/
### IntelliJ IDEA ###
.idea/gitmisc.xml
.idea/encodings.xml
.idea/misc.xml
.idea/**
.idea/modules.xml
.idea/jarRepositories.xml
......@@ -14,6 +15,7 @@ target/
*.iws
*.iml
*.ipr
/encodings.xml
### Eclipse ###
.apt_generated
......
......@@ -20,10 +20,11 @@ public class Filtros extends HttpServlet {
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
List<Postulante> postulantes = listarPostulante();
String respuesta = req.getParameter("id");
boolean valor = Boolean.parseBoolean(req.getParameter("valor"));
String valor = req.getParameter("valor");
String nombre = req.getParameter("nombreBuscar")== null ? "0" : req.getParameter("nombreBuscar");
System.out.println(nombre);
if(respuesta != null) {
System.out.println(valor);
System.out.println(respuesta);
update(Integer.parseInt(req.getParameter("id")), valor);
postulantes = listarPostulante();
} else if(nombre.length() > 1){
......
......@@ -72,30 +72,20 @@ import java.util.List;
return postulante;
}
public static void update(int id, Boolean valor) {
if (valor == true) {
public static void update(int id, String valor) {
boolean v = valor.equals("0") ? false : true;
try {
Connection con = DataBase.getConnection();
PreparedStatement ps = con.prepareStatement("update postulante set aceptado= false\n" +
"where id=?");
ps.setInt(1, id);
PreparedStatement ps = con.prepareStatement("update postulante set aceptado= ? where id=?");
ps.setBoolean(1, v);
ps.setInt(2, id);
ps.executeUpdate();
con.close();
} catch (Exception ex) {
ex.printStackTrace();
}
} else {
try {
Connection con = DataBase.getConnection();
PreparedStatement ps = con.prepareStatement("update postulante set aceptado= true\n" +
"where id=?");
ps.setInt(1, id);
ps.executeUpdate();
con.close();
} catch (Exception ex) {
catch (Exception ex) {
ex.printStackTrace();
}
}
}
......
......@@ -4,6 +4,7 @@ import com.roshka.proyectofinal.DataBase;
import com.roshka.proyectofinal.entity.Postulante;
import com.roshka.proyectofinal.entity.Bootcamp;
import com.roshka.proyectofinal.entity.PostulanteLenguaje;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
......@@ -18,13 +19,13 @@ import java.sql.Statement;
@WebServlet("/SaveServlet")
public class SaveServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response)
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out=response.getWriter();
boolean rechazarDatos = false;
int bootcampActual = Integer.parseInt(request.getParameter("bootcamp_id"));
int bootcampActual = Integer.parseInt(request.getParameter("bootcamp"));
try {
Connection con = DataBase.getConnection();
......@@ -107,25 +108,38 @@ public class SaveServlet extends HttpServlet {
}
if(status>0){
//out.print("<p>Record saved successfully!</p>");
out.print(" <div class=\"alert\">\n" +
" <span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">&times;</span> \n" +
" <strong>Formulario Cargado!</strong> EXITOSAMENTE CARGADO\n" +
"</div>");
request.getRequestDispatcher("formulario.jsp").include(request, response);
request.setAttribute("bootcamp", bootcampActual);
RequestDispatcher rd = request.getRequestDispatcher("formulario.jsp");
rd.include(request, response);
//RequestDispatcher rd = request.getRequestDispatcher("formulario.jsp");
//rd.include(request, response);
}else{
if (rechazarDatos){
out.print(" <div class=\"alert info\">\n" +
" <span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">&times;</span> \n" +
" <strong>Formulario ya Cargado!</strong> YA EXISTE EL FORMULARIO\n" +
"</div>");
request.getRequestDispatcher("formulario.jsp").include(request, response);
out.print("<div class='alert info''>");
out.print("<span class='closebtn'' onclick='this.parentElement.style.display='none';'>&times;</span>");
out.print("<strong>Formulario ya Cargado!</strong> YA EXISTE EL FORMULARIO");
out.print("</div>");
//request.getRequestDispatcher("formulario.jsp").include(request, response);
request.setAttribute("bootcamp", bootcampActual);
RequestDispatcher rd = request.getRequestDispatcher("formulario.jsp");
rd.include(request, response);
}else {
out.println("Error al cargar datos");
out.print(" <div class=\"alert info error\">\n" +
" <span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">&times;</span> \n" +
" <strong>Formulario ya Cargado!</strong> YA EXISTE EL FORMULARIO\n" +
out.print("<div class='alert info error'>" +
"<span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">&times;</span> \n" +
"<strong>Formulario ya Cargado!</strong> YA EXISTE EL FORMULARIO\n" +
"</div>");
request.getRequestDispatcher("formulario.jsp").include(request, response);
request.setAttribute("bootcamp", bootcampActual);
RequestDispatcher rd = request.getRequestDispatcher("formulario.jsp");
rd.include(request, response);
//request.getRequestDispatcher("formulario.jsp").include(request, response);
}
}
}catch (Exception ex){
......
......@@ -78,7 +78,7 @@ public class LoginServlet extends HttpServlet {
catch (Exception ignored) { }
// Si no es posible redireccionar a la pagina solicitada, llevar a la main page
RequestDispatcher rd = request.getRequestDispatcher("menu.html");
RequestDispatcher rd = request.getRequestDispatcher("menu.jsp");
rd.include(request,response);
} else {
......
......@@ -5,19 +5,15 @@ html,body{
}
/* damos los estilos a todo lo que contiene el body */
body{
font-family: 'Quicksand', sans-serif;
color: white;
webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
align-items: center;
height: 150%;}
p{
font-family: 'Quicksand', sans-serif;
color: white;
webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-color: rgba(11, 49, 110, 0.75);
font-family:Calibri, Candara, Segoe, Segoe UI, Optima, Arial, sans-serif;
color: wheat;
font-weight: bold;
display: flex;
justify-content: center;
align-items: center;
height: 150%;}
height: 160%;
}
/* para el logo */
......@@ -32,7 +28,7 @@ p.enter{
}
/* para el parrafo */
p:hover{
color: white;
color: yellow;
}
/* para el create o sea para el main */
......@@ -51,7 +47,7 @@ p:hover{
display: block;
border: none;
align-items:center;
color:white
}
......@@ -62,12 +58,10 @@ p:hover{
align-items:center;
}
.form input[type="email"],.form input[type="text"],.form input[type="number"]{
background-color: transparente;
background-color: transparent;
border-radius: 10px;
border: 1px solid #000;
}
.form input:hover{
background-color: wheat;
......@@ -77,12 +71,10 @@ p:hover{
a{
text-decoration: none;
}
ul{
list-style:none;
font-size:15px;
}
a{
......@@ -98,19 +90,19 @@ border-radius: 10px;
background-image: url(imagenes/descarga.svg);
}
.form input[type="reset"] , .form input[type="submit"]{
text-decoration:none;
background-color: rgba(11, 49, 110, 0.75);
background-image: url(imagenes/descarga.svg);
border-radius: 5px;;
padding: 10px;
border-radius: 10px;
margin:10px;
text-decoration: none;
color:#ffff;
text-align:left;
cursor: pointer;
width:80px;
text-align:center;
text-decoration:none;
background-color: rgba(11, 49, 110, 0.75);
background-image: url(imagenes/descarga.svg);
border-radius: 5px;;
padding: 10px;
border-radius: 10px;
margin:10px;
text-decoration: none;
color:#ffff;
text-align:left;
cursor: pointer;
width:80px;
text-align:center;
}
/*hola mundo*/
......@@ -122,12 +114,14 @@ input#experiencia_laboral,input#notebook,input#universidad{
width:500px;
}
/* para el alert */
.alert {
padding: 10px;
background-color: background-color: #2196F3;
color: white;
}
.alert.info {background-color: #2196F3;}
.alert.error {background-color: #ff0000;}
.closebtn {
......@@ -140,7 +134,7 @@ width:500px;
cursor: pointer;
transition: 0.3s;
}
.closebtn:hover {
color: black;
}
Contraer
\ No newline at end of file
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ pageEncoding="UTF-8"%>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="Javascript.js"></script>
<link rel="stylesheet" media="(max-width: 800px)" href="example.css" />
<title>Formulario Postulante</title>
<title>Formulario Postulante</title>
</head>
<body>
......@@ -39,10 +39,9 @@ pageEncoding="UTF-8"%>
</p>
<p class="enter">Si sigues interesado y cumples con los requisitos, completa el siguiente formulario: </p>
<form method="post" action="SaveServlet" class="form">
<form method="get" action="SaveServlet" class="form">
<input type="hidden" name="bootcamp_id" value="<%= request.getParameter("bootcamp") %>">
<input type="hidden" name="bootcamp" value="<%= request.getParameter(" bootcamp ") %>">
<label for="nombre">Ingrese su Nombre:</label>
<input required id="nombre" name="nombre" type="text"><br>
......@@ -98,9 +97,11 @@ pageEncoding="UTF-8"%>
<input class="borrar" type="reset" value="Borrar"><br>
<a href="index.html">volver</a>
</form>
</div>
</article>
</main>
</body>
</html>
<script>
(function() {
......
......@@ -18,6 +18,10 @@
<%@ page import="com.roshka.proyectofinal.entity.Lenguaje, com.roshka.proyectofinal.entity.Bootcamp, com.roshka.proyectofinal.lenguaje.LenguajeDao, com.roshka.proyectofinal.bootcamp.BootcampDao, com.roshka.proyectofinal.entity.Profesor, com.roshka.proyectofinal.profesor.ProfesorDao, java.util.List,java.util.Iterator" %>
<%
LenguajeDao lenDao = new LenguajeDao();
List<Lenguaje> listLen = lenDao.listar();
Iterator<Lenguaje> iter = listLen.iterator();
Lenguaje len = null;
ProfesorDao profeDao = new ProfesorDao();
List<Profesor> listProfesor = profeDao.listar();
......
......@@ -26,18 +26,7 @@
<ul>
<li class="link-menu"><a href="">Home</a></li>
<li class="link-menu"><a href="bootcamp.jsp">Postulate</a></li>
<li class="link-menu"><a href="formulario_bootcamp.jsp">Crear bootcamp</a></li>
<li class="link-menu"><a href="manage_postulantes.jsp">Manage Postulantes(perdon angel)</a></li>
<li class="link-menu"><a href="formulario.jsp">Postulate</a></li>
<li class="link-menu"><a href="formulario_bootcamp.jsp">Crear bootcamp</a>
<li class="link-menu"><a href="login.jsp">Login</a>
<li class="link-menu"><a href="protected">Recurso Protegido</a></li>
</li>
<li class="link-menu"><a href="formulario_lenguaje.jsp">Crear lenguaje</a>
</li>
<li class="link-menu"><a href="formulario_profesor.jsp">Crear profesor</a>
</li>
</ul>
......@@ -68,7 +57,7 @@
<p data-block-key="cwggy">Es un campo de entrenamiento intensivo y gratuito para principiantes que ya programan y quieren ser parte de la empresa</p>
</div>
<div class="postulacion">
<a href="formulario.jsp"><button type="submit" class="cta-main">POSTULACION</button></a>
<a href="bootcamp.jsp"><button type="submit" class="cta-main">POSTULACION</button></a>
<!-- <a href="/postulacion" class="cta-main">POSTULACION</a> -->
</div>
</div>
......
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="imagenes/roshkaicon.ico" sizes="any" />
<link rel="shortcut icon" href="imagenes/roshkaicon.ico" sizes="any" />
</head>
<style>
<link href="https://fonts.googleapis.com/css2?family=Concert+One&family=Francois+One&family=Satisfy&family=Staatliches&display=swap" rel="stylesheet">
* {
box-sizing: border-box;
}
body {
font-family: 'Concert One', cursive;
font-family: 'Francois One', sans-serif;
font-family: 'Satisfy', cursive;
font-family: 'Staatliches', cursive;
font-size: 13px
}
.header, .footer {
background-color:rgb(18, 18, 98);
color: white;
padding: 60px;
}
.column {
float: left;
padding: 30px;
}
.clearfix::after {
content: "";
clear: both;
display: table;
}
a{
color:white;
}
.menu {
width: 50%;
}
.content {
width: 50%;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 8px;
background-color: rgb(18, 18, 98);
color: #ffffff;
}
.menu li:hover {
background-color: rgb(18, 18, 98);
}
<link href="https://fonts.googleapis.com/css2?family=Concert+One&family=Francois+One&family=Satisfy&family=Staatliches&display=swap" rel="stylesheet">* {
box-sizing: border-box;
}
body {
font-family: 'Concert One', cursive;
font-family: 'Francois One', sans-serif;
font-family: 'Satisfy', cursive;
font-family: 'Staatliches', cursive;
font-size: 13px
}
.header,
.footer {
background-color: rgb(18, 18, 98);
color: white;
padding: 60px;
}
.column {
float: left;
padding: 30px;
}
.clearfix::after {
content: "";
clear: both;
display: table;
}
a {
color: white;
}
.menu {
width: 50%;
}
.content {
width: 50%;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 8px;
background-color: rgb(18, 18, 98);
color: #ffffff;
}
.menu li:hover {
background-color: rgb(18, 18, 98);
}
</style>
</head>
<body>
<div class="header">
<h1> MENU TH</h1>
<h2> EN LOS SIGUIENTES LINKS PUEDE MODIFICAR, AGREGAR O ELIMINAR DATOS DE LA BASE DE DATOS DEL BOOTCAMP </h2>
</div>
<div class="header">
<h1> MENU TH</h1>
<h2> EN LOS SIGUIENTES LINKS PUEDE MODIFICAR, AGREGAR O ELIMINAR DATOS DE LA BASE DE DATOS DEL BOOTCAMP </h2>
</div>
<div class="column content">
<h1>PUEDE ACCEDER A LOS SIGUIENTES LINKS:</h1>
</div>
<div class="column content">
<h1>PUEDE ACCEDER A LOS SIGUIENTES LINKS:</h1>
</div>
<div class="clearfix">
<div class="column menu">
<ul>
<li><a href="#"> MANAGE BOOTCAMP </a></li>
<li><a href="filtros-postulante"> MANAGE POSTULANTE </a></li>
<li><a href="#"> MANAGE LENGUAJES </a></li>
<li><a href="#"> MANAGE PROFESORES </a></li>
<li><a href="#"> USUARIO NUEVO (ADMINISTRADOR) </a></li>
</ul>
</div>
<div class="clearfix">
<div class="column menu">
<ul>
<li><a href="formulario_bootcamp.jsp"> MANAGE BOOTCAMP </a></li>
<li><a href="filtros-postulante"> MANAGE POSTULANTE </a></li>
<li><a href="formulario_lenguaje.jsp"> MANAGE LENGUAJES </a></li>
<li><a href="formulario_profesor.jsp"> MANAGE PROFESORES </a></li>
</div>
</ul>
</div>
</body>
</html>
</div>
</body>
</html>
\ No newline at end of file
......@@ -96,14 +96,22 @@
</c:if>
</td>
<td>
<c:if test="${postulante.aceptado == true}">
<input type="hidden" name="valor" value="false">
<button><a href="filtros-postulante?id=${postulante.id}">Rechazar</a></button>
</c:if>
<c:if test="${postulante.aceptado != true}">
<input type="hidden" name="valor" value="true">
<button><a href="filtros-postulante?id=${postulante.id}">Aceptar</a></button>
</c:if>
<c:choose>
<c:when test="${postulante.aceptado == true}">
<form action="filtros-postulante" method="get">
<input type="hidden" name="valor" value="0">
<input type="hidden" name="id" value="${postulante.id}">
<button type="submit">Rechazar</button>
</form>
</c:when>
<c:otherwise>
<form action="filtros-postulante" method="get">
<input type="hidden" name="valor" value="1">
<input type="hidden" name="id" value="${postulante.id}">
<button type="submit">Aceptado</button>
</form>
</c:otherwise>
</c:choose>
</td>
</tr>
</c:forEach>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment