Si sigues interesado y cumples con los requisitos, completa el siguiente formulario:
- -diff --git a/src/main/java/com/roshka/proyectofinal/DataBase.java b/src/main/java/com/roshka/proyectofinal/DataBase.java
index 12d2450..49e9a55 100644
--- a/src/main/java/com/roshka/proyectofinal/DataBase.java
+++ b/src/main/java/com/roshka/proyectofinal/DataBase.java
@@ -10,7 +10,7 @@ public class DataBase {
try{
Class.forName("org.postgresql.Driver");
con= DriverManager
- .getConnection("jdbc:postgresql://localhost:5432/bootcamp_th",
+ .getConnection("jdbc:postgresql://localhost:5433/bootcamp_th",
"postgres", "postgres");
if(con != null){
diff --git a/src/main/java/com/roshka/proyectofinal/Postulante/EditServletPostulante.java b/src/main/java/com/roshka/proyectofinal/Postulante/EditServletPostulante.java
new file mode 100644
index 0000000..2eb5167
--- /dev/null
+++ b/src/main/java/com/roshka/proyectofinal/Postulante/EditServletPostulante.java
@@ -0,0 +1,49 @@
+package com.roshka.proyectofinal.Postulante;
+
+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.ServletException;
+import jakarta.servlet.annotation.WebServlet;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import javafx.geometry.Pos;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.sql.*;
+import java.util.List;
+
+@WebServlet("/EditServletPostulante")
+ public class EditServletPostulante extends HttpServlet {
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html");
+ PrintWriter out = response.getWriter();
+
+ String sid = request.getParameter("id");
+ boolean accion;
+ if (request.getParameter("value") == "Rechazar") {
+ accion = false;
+ } else {
+ accion = true;
+ }
+ int id = Integer.parseInt(sid);
+ Postulante e = new Postulante();
+ e.setId(id);
+ e.setAceptado(accion);
+
+
+ int status = PostulanteDao.update(e);
+ if (status > 0) {
+ response.sendRedirect("ViewServlet");
+ } else {
+ out.println("Sorry! unable to update record");
+ }
+
+ out.close();
+ }
+ }
+
diff --git a/src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java b/src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java
index f820d82..1d69e58 100644
--- a/src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java
+++ b/src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java
@@ -1,11 +1,17 @@
package com.roshka.proyectofinal.Postulante;
import com.roshka.proyectofinal.DataBase;
import com.roshka.proyectofinal.entity.Postulante;
+import jakarta.servlet.http.HttpServlet;
+import javafx.geometry.Pos;
+import javax.xml.crypto.Data;
import java.sql.Connection;
import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.List;
-public class PostulanteDao {
+public class PostulanteDao extends HttpServlet {
public static int save(Postulante postulante){
int status=0;
@@ -30,4 +36,48 @@ public class PostulanteDao {
return status;
}
+ public static List Record saved successfully! El correo ingresado ya esta registrado para el bootcamp actual ");
+ request.getRequestDispatcher("").include(request, response);
}
}else{
- out.println("Sorry! unable to save record");
+ out.println("Error");
+ out.println("");
}
}
diff --git a/src/main/java/com/roshka/proyectofinal/Postulante/ViewServletPostulantes.java b/src/main/java/com/roshka/proyectofinal/Postulante/ViewServletPostulantes.java
new file mode 100644
index 0000000..84bc05c
--- /dev/null
+++ b/src/main/java/com/roshka/proyectofinal/Postulante/ViewServletPostulantes.java
@@ -0,0 +1,60 @@
+package com.roshka.proyectofinal.Postulante;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+
+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.ServletException;
+import jakarta.servlet.annotation.WebServlet;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import javafx.geometry.Pos;
+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.ServletException;
+import jakarta.servlet.annotation.WebServlet;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.sql.*;
+import java.util.List;
+@WebServlet("/ViewServletPostulante")
+public class ViewServletPostulantes extends HttpServlet{
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html");
+ PrintWriter out=response.getWriter();
+ out.println(" BOOTCAMP JAVA Inicio: 18/04/2023 Fin: 18/05/2023 BOOTCAMP ANDROID Inicio: 18/06/2023 Fin: 18/07/2023 BOOTCAMP JAVA Inicio: 18/04/2023 Fin: 18/05/2023 BOOTCAMP iOS Inicio: 18/08/2023 Fin: 18/09/2023 BOOTCAMP ANDROID Inicio: 18/06/2023 Fin: 18/07/2023 BOOTCAMP iOS Inicio: 18/08/2023 Fin: 18/09/2023Lista de Postulantes
");
+
+ List
");
+
+ out.close();
+ }
+}
+
+
+
+
+
diff --git a/src/main/java/com/roshka/proyectofinal/entity/Postulante.java b/src/main/java/com/roshka/proyectofinal/entity/Postulante.java
index 459696f..3efe249 100644
--- a/src/main/java/com/roshka/proyectofinal/entity/Postulante.java
+++ b/src/main/java/com/roshka/proyectofinal/entity/Postulante.java
@@ -30,6 +30,11 @@ public class Postulante {
public int getId() {
return id;
}
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
public int getNro_cedula() {
return nroCedula;
}
diff --git a/src/main/webapp/Javascript.js b/src/main/webapp/Javascript.js
index b125cd2..b40dba6 100644
--- a/src/main/webapp/Javascript.js
+++ b/src/main/webapp/Javascript.js
@@ -1,5 +1,5 @@
(function() {
- const form = document.querySelector('#sectionForm');
+ const form = document.querySelector('#agarraunolaputa');
const checkboxes = form.querySelectorAll('input[type=checkbox]');
const checkboxLength = checkboxes.length;
const firstCheckbox = checkboxLength > 0 ? checkboxes[0] : null;
@@ -22,9 +22,8 @@
}
function checkValidity() {
- const errorMessage = !isChecked() ? 'Debe de selecionar al menos un lenguaje' : '';
+ const errorMessage = !isChecked() ? 'Debe seleccionar al menos un lenguaje que conozca' : '';
firstCheckbox.setCustomValidity(errorMessage);
}
-
init();
})();
\ No newline at end of file
diff --git a/src/main/webapp/bootcamp.html b/src/main/webapp/bootcamp.html
index 0d08989..5910df2 100644
--- a/src/main/webapp/bootcamp.html
+++ b/src/main/webapp/bootcamp.html
@@ -521,42 +521,44 @@
Id Nombre Apellido Email Direccion Edit Delete ");
+ for(Postulante e:list){
+ out.print(" ");
+ }
+ out.print(""+e.getId()+" "+e.getNombre()+" "+e.getApellido()+" "+e.getCorreo()+" "+e.getDireccion()+" edit delete
Si sigues interesado y cumples con los requisitos, completa el siguiente formulario:
- -diff --git a/src/main/webapp/formulario.jsp b/src/main/webapp/formulario.jsp index a5ea3e1..7b35070 100644 --- a/src/main/webapp/formulario.jsp +++ b/src/main/webapp/formulario.jsp @@ -1,134 +1,168 @@ -<<<<<<< HEAD=======>>>>>>> 83a3c531a8a7130549d357f69034fe5d79ee8984 - <%@ page language="java" contentType="text/html; charset=UTF-8" +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> - - - -
- - <<<<<<< HEAD - -
- ======= - - - -
- >>>>>>> 83a3c531a8a7130549d357f69034fe5d79ee8984 - - -
- \ No newline at end of file + \ No newline at end of file diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html index abe047c..25c514e 100644 --- a/src/main/webapp/index.html +++ b/src/main/webapp/index.html @@ -24,9 +24,9 @@
diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index a026d71..10d3215 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -1,5 +1,3 @@ -<<<<<<< HEAD -======= <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> @@ -18,5 +16,4 @@ -