Commit 0466997c by Angel Zarate

merge con develop

parents 27a9d53c 1154ca50
...@@ -13,7 +13,7 @@ target/ ...@@ -13,7 +13,7 @@ target/
*.iws *.iws
*.iml *.iml
*.ipr *.ipr
/encodings.xml
### Eclipse ### ### Eclipse ###
.apt_generated .apt_generated
.classpath .classpath
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
...@@ -11,7 +11,7 @@ public class DataBase { ...@@ -11,7 +11,7 @@ public class DataBase {
Class.forName("org.postgresql.Driver"); Class.forName("org.postgresql.Driver");
con= DriverManager con= DriverManager
.getConnection("jdbc:postgresql://localhost:5432/bootcamp_th", .getConnection("jdbc:postgresql://localhost:5432/bootcamp_th",
"postgres", "postgres"); "postgres", "2022roshka");
if(con != null){ if(con != null){
System.out.println("---> CONNECTED TO SERVER"); System.out.println("---> CONNECTED TO SERVER");
......
package com.roshka.proyectofinal.Postulante; package com.roshka.proyectofinal.Postulante;
import com.roshka.proyectofinal.DataBase; import com.roshka.proyectofinal.DataBase;
import com.roshka.proyectofinal.entity.Postulante; import com.roshka.proyectofinal.entity.Postulante;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
...@@ -9,245 +8,247 @@ import java.sql.SQLException; ...@@ -9,245 +8,247 @@ import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class PostulanteDao { public class PostulanteDao {
List<Postulante> postulante = null; public static int save(Postulante postulante) {
int status = 0;
try {
Connection con = DataBase.getConnection();
PreparedStatement ps = con.prepareStatement(
"insert into postulante(nombre,apellido,nro_cedula,correo,telefono,direccion,experiencia_laboral,estudio_universitario,notebook,bootcamp_id,aceptado) values (?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1, postulante.getNombre());
ps.setString(2, postulante.getApellido());
ps.setInt(3, postulante.getNro_cedula());
ps.setString(4, postulante.getCorreo());
ps.setString(5, postulante.getTelefono());
ps.setString(6, postulante.getDireccion());
ps.setBoolean(7, postulante.getExpLaboral());
ps.setBoolean(8, postulante.getEstudioUniversitario());
ps.setBoolean(9, postulante.getNotebook());
ps.setInt(10, postulante.getBootcampId());
ps.setBoolean(11, postulante.getAceptado());
status = ps.executeUpdate();
con.close();
} catch (Exception ex) {
ex.printStackTrace();
}
public static int save(Postulante postulante){ return status;
int status=0; }
try{
Connection con= DataBase.getConnection();
PreparedStatement ps=con.prepareStatement(
"insert into postulante(nombre,apellido,nro_cedula,correo,telefono,direccion,experiencia_laboral,estudio_universitario,notebook,bootcamp_id,aceptado) values (?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1,postulante.getNombre());
ps.setString(2,postulante.getApellido());
ps.setInt(3,postulante.getNro_cedula());
ps.setString(4,postulante.getCorreo());
ps.setString(5,postulante.getTelefono());
ps.setString(6,postulante.getDireccion());
ps.setBoolean(7,postulante.getExpLaboral());
ps.setBoolean(8,postulante.getEstudioUniversitario());
ps.setBoolean(9,postulante.getNotebook());
ps.setInt(10,postulante.getBootcampId());
ps.setBoolean(11,postulante.getAceptado());
status=ps.executeUpdate();
con.close();
}catch(Exception ex){ex.printStackTrace();}
return status; public static List<Postulante> listarPostulante() {
} List<Postulante> postulante = new ArrayList<>();
String sql = "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" +
" order by a.id;";
try {
Connection con = DataBase.getConnection();
PreparedStatement ps = con.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
while (rs.next()) {
Postulante postulanteObject = new Postulante();
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);
}
public static List<Postulante> listarPostulante(){ con.close();
List<Postulante> postulante = new ArrayList<>(); } catch (SQLException e) {
String sql = "select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo, a.telefono, a.direccion, " + throw new RuntimeException(e);
"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" +
" order by a.id;";
try{
Connection con= DataBase.getConnection();
PreparedStatement ps=con.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
while(rs.next()){
Postulante postulanteObject = new Postulante();
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);
} }
return postulante;
con.close();
} catch (SQLException e) {
throw new RuntimeException(e);
} }
return postulante;
}
public static void update(int id, Boolean valor){ public static void update(int id, Boolean valor) {
if(valor==true){ if (valor == true) {
try{ try {
Connection con= DataBase.getConnection(); Connection con = DataBase.getConnection();
PreparedStatement ps=con.prepareStatement("update postulante set aceptado= false\n" + PreparedStatement ps = con.prepareStatement("update postulante set aceptado= false\n" +
"where id=?"); "where id=?");
ps.setInt(1,id); ps.setInt(1, id);
ps.executeUpdate(); ps.executeUpdate();
con.close(); con.close();
}catch(Exception ex){ } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
}else { } else {
try{ try {
Connection con= DataBase.getConnection(); Connection con = DataBase.getConnection();
PreparedStatement ps=con.prepareStatement("update postulante set aceptado= true\n" + PreparedStatement ps = con.prepareStatement("update postulante set aceptado= true\n" +
"where id=?"); "where id=?");
ps.setInt(1,id); ps.setInt(1, id);
ps.executeUpdate(); ps.executeUpdate();
con.close(); con.close();
}catch(Exception ex){ } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
} }
} }
public static List<Postulante> buscarPorNombre(String nombre){ public static List<Postulante> buscarPorNombre(String nombre) {
List<Postulante> postulante = null; List<Postulante> postulante = null;
Postulante postulanteObject = null; Postulante postulanteObject = null;
try{ try {
Connection con= DataBase.getConnection(); Connection con = DataBase.getConnection();
PreparedStatement ps=con.prepareStatement("select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo, " + 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, " + "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" + "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 bootcamp b on b.id= a.bootcamp_id\n" +
" inner join lenguaje c on c.id=b.id_lenguaje\n" + " inner join lenguaje c on c.id=b.id_lenguaje\n" +
" where a.nombre ilike ? "); " where a.nombre ilike ? ");
ps.setString(1, "%" + nombre + "%"); ps.setString(1, "%" + nombre + "%");
System.out.println(nombre); System.out.println(nombre);
ResultSet rs = ps.executeQuery(); ResultSet rs = ps.executeQuery();
postulante = new ArrayList<>(); postulante = new ArrayList<>();
postulanteObject= new Postulante(); postulanteObject = new Postulante();
while(rs.next()){ while (rs.next()) {
postulanteObject.setId(rs.getInt("id")); postulanteObject.setId(rs.getInt("id"));
postulanteObject.setNombre(rs.getString("nombre")); postulanteObject.setNombre(rs.getString("nombre"));
postulanteObject.setApellido(rs.getString("apellido")); postulanteObject.setApellido(rs.getString("apellido"));
postulanteObject.setNroCedula(rs.getInt("nro_cedula")); postulanteObject.setNroCedula(rs.getInt("nro_cedula"));
postulanteObject.setCorreo(rs.getString("correo")); postulanteObject.setCorreo(rs.getString("correo"));
postulanteObject.setTelefono(rs.getString("telefono")); postulanteObject.setTelefono(rs.getString("telefono"));
postulanteObject.setDireccion(rs.getString("direccion")); postulanteObject.setDireccion(rs.getString("direccion"));
postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral")); postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral"));
postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario")); postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario"));
postulanteObject.setBootcampId(rs.getInt("bootcamp_id")); postulanteObject.setBootcampId(rs.getInt("bootcamp_id"));
postulanteObject.setNotebook(rs.getBoolean("notebook")); postulanteObject.setNotebook(rs.getBoolean("notebook"));
postulanteObject.setNombreBootcamp(rs.getString("bootcamp")); postulanteObject.setNombreBootcamp(rs.getString("bootcamp"));
postulanteObject.setAceptado(rs.getBoolean("aceptado")); postulanteObject.setAceptado(rs.getBoolean("aceptado"));
postulante.add(postulanteObject); postulante.add(postulanteObject);
}
con.close();
} catch (Exception ex) {
ex.printStackTrace();
} }
con.close(); return postulante;
}catch(Exception ex){
ex.printStackTrace();
} }
return postulante;
}
public static List<Postulante> listarPostulanteAceptados(){ public static List<Postulante> listarPostulanteAceptados() {
List<Postulante> postulante = null; List<Postulante> postulante = null;
try{ try {
Connection con= DataBase.getConnection(); Connection con = DataBase.getConnection();
PreparedStatement ps=con.prepareStatement("select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo, " + 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, " + "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" + "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 bootcamp b on b.id= a.bootcamp_id\n" +
" inner join lenguaje c on c.id=b.id_lenguaje\n" + " inner join lenguaje c on c.id=b.id_lenguaje\n" +
" where a.aceptado= true "); " where a.aceptado= true ");
ResultSet rs = ps.executeQuery(); ResultSet rs = ps.executeQuery();
postulante = new ArrayList<>(); postulante = new ArrayList<>();
Postulante postulanteObject= new Postulante(); Postulante postulanteObject = new Postulante();
while(rs.next()){ while (rs.next()) {
postulanteObject.setId(rs.getInt("id")); postulanteObject.setId(rs.getInt("id"));
postulanteObject.setNombre(rs.getString("nombre")); postulanteObject.setNombre(rs.getString("nombre"));
postulanteObject.setApellido(rs.getString("apellido")); postulanteObject.setApellido(rs.getString("apellido"));
postulanteObject.setNroCedula(rs.getInt("nro_cedula")); postulanteObject.setNroCedula(rs.getInt("nro_cedula"));
postulanteObject.setCorreo(rs.getString("correo")); postulanteObject.setCorreo(rs.getString("correo"));
postulanteObject.setTelefono(rs.getString("telefono")); postulanteObject.setTelefono(rs.getString("telefono"));
postulanteObject.setDireccion(rs.getString("direccion")); postulanteObject.setDireccion(rs.getString("direccion"));
postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral")); postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral"));
postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario")); postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario"));
postulanteObject.setBootcampId(rs.getInt("bootcamp_id")); postulanteObject.setBootcampId(rs.getInt("bootcamp_id"));
postulanteObject.setNotebook(rs.getBoolean("notebook")); postulanteObject.setNotebook(rs.getBoolean("notebook"));
postulanteObject.setNombreBootcamp(rs.getString("bootcamp")); postulanteObject.setNombreBootcamp(rs.getString("bootcamp"));
postulanteObject.setAceptado(rs.getBoolean("aceptado")); postulanteObject.setAceptado(rs.getBoolean("aceptado"));
postulante.add(postulanteObject); postulante.add(postulanteObject);
}
con.close();
} catch (Exception ex) {
ex.printStackTrace();
} }
con.close(); return postulante;
}catch(Exception ex){
ex.printStackTrace();
} }
return postulante;
}
public static List<Postulante> listarPorBootcamp(String nombre){ public static List<Postulante> listarPorBootcamp(String nombre) {
List<Postulante> postulante = null; List<Postulante> postulante = null;
try{ try {
Connection con= DataBase.getConnection(); Connection con = DataBase.getConnection();
PreparedStatement ps=con.prepareStatement("select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo, a.telefono, a.direccion, \n" + PreparedStatement ps = con.prepareStatement("select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo, a.telefono, a.direccion, \n" +
" a.experiencia_laboral, a.estudio_universitario, a.bootcamp_id, a.notebook, c.nombre_lenguaje as bootcamp, \n" + " a.experiencia_laboral, a.estudio_universitario, a.bootcamp_id, a.notebook, c.nombre_lenguaje as bootcamp, \n" +
" a.aceptado from postulante a\n" + " a.aceptado from postulante a\n" +
" inner join bootcamp b on b.id= a.bootcamp_id\n" + " inner join bootcamp b on b.id= a.bootcamp_id\n" +
" inner join lenguaje c on c.id=b.id_lenguaje\n" + " inner join lenguaje c on c.id=b.id_lenguaje\n" +
" where c.nombre_lenguaje ilike ? "); " where c.nombre_lenguaje ilike ? ");
ps.setString(1, "%" + nombre + "%"); ps.setString(1, "%" + nombre + "%");
ResultSet rs = ps.executeQuery(); ResultSet rs = ps.executeQuery();
postulante = new ArrayList<>(); postulante = new ArrayList<>();
Postulante postulanteObject= new Postulante(); Postulante postulanteObject = new Postulante();
while(rs.next()){ while (rs.next()) {
postulanteObject.setId(rs.getInt("id")); postulanteObject.setId(rs.getInt("id"));
postulanteObject.setNombre(rs.getString("nombre")); postulanteObject.setNombre(rs.getString("nombre"));
postulanteObject.setApellido(rs.getString("apellido")); postulanteObject.setApellido(rs.getString("apellido"));
postulanteObject.setNroCedula(rs.getInt("nro_cedula")); postulanteObject.setNroCedula(rs.getInt("nro_cedula"));
postulanteObject.setCorreo(rs.getString("correo")); postulanteObject.setCorreo(rs.getString("correo"));
postulanteObject.setTelefono(rs.getString("telefono")); postulanteObject.setTelefono(rs.getString("telefono"));
postulanteObject.setDireccion(rs.getString("direccion")); postulanteObject.setDireccion(rs.getString("direccion"));
postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral")); postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral"));
postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario")); postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario"));
postulanteObject.setBootcampId(rs.getInt("bootcamp_id")); postulanteObject.setBootcampId(rs.getInt("bootcamp_id"));
postulanteObject.setNotebook(rs.getBoolean("notebook")); postulanteObject.setNotebook(rs.getBoolean("notebook"));
postulanteObject.setNombreBootcamp(rs.getString("bootcamp")); postulanteObject.setNombreBootcamp(rs.getString("bootcamp"));
postulanteObject.setAceptado(rs.getBoolean("aceptado")); postulanteObject.setAceptado(rs.getBoolean("aceptado"));
postulante.add(postulanteObject); postulante.add(postulanteObject);
}
con.close();
} catch (Exception ex) {
ex.printStackTrace();
} }
con.close(); return postulante;
}catch(Exception ex){
ex.printStackTrace();
} }
return postulante;
}
public static List<Postulante> buscarPorNoteBook(){ public static List<Postulante> buscarPorNoteBook() {
List<Postulante> postulante = null; List<Postulante> postulante = null;
Postulante postulanteObject = null; Postulante postulanteObject = null;
try{ try {
Connection con= DataBase.getConnection(); Connection con = DataBase.getConnection();
PreparedStatement ps=con.prepareStatement("select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo, " + 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, " + "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" + "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 bootcamp b on b.id= a.bootcamp_id\n" +
" inner join lenguaje c on c.id=b.id_lenguaje\n" + " inner join lenguaje c on c.id=b.id_lenguaje\n" +
" where a.notebook=true "); " where a.notebook=true ");
ResultSet rs = ps.executeQuery(); ResultSet rs = ps.executeQuery();
postulante = new ArrayList<>(); postulante = new ArrayList<>();
postulanteObject= new Postulante(); postulanteObject = new Postulante();
while(rs.next()){ while (rs.next()) {
postulanteObject.setId(rs.getInt("id")); postulanteObject.setId(rs.getInt("id"));
postulanteObject.setNombre(rs.getString("nombre")); postulanteObject.setNombre(rs.getString("nombre"));
postulanteObject.setApellido(rs.getString("apellido")); postulanteObject.setApellido(rs.getString("apellido"));
postulanteObject.setNroCedula(rs.getInt("nro_cedula")); postulanteObject.setNroCedula(rs.getInt("nro_cedula"));
postulanteObject.setCorreo(rs.getString("correo")); postulanteObject.setCorreo(rs.getString("correo"));
postulanteObject.setTelefono(rs.getString("telefono")); postulanteObject.setTelefono(rs.getString("telefono"));
postulanteObject.setDireccion(rs.getString("direccion")); postulanteObject.setDireccion(rs.getString("direccion"));
postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral")); postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral"));
postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario")); postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario"));
postulanteObject.setBootcampId(rs.getInt("bootcamp_id")); postulanteObject.setBootcampId(rs.getInt("bootcamp_id"));
postulanteObject.setNotebook(rs.getBoolean("notebook")); postulanteObject.setNotebook(rs.getBoolean("notebook"));
postulanteObject.setNombreBootcamp(rs.getString("bootcamp")); postulanteObject.setNombreBootcamp(rs.getString("bootcamp"));
postulanteObject.setAceptado(rs.getBoolean("aceptado")); postulanteObject.setAceptado(rs.getBoolean("aceptado"));
postulante.add(postulanteObject); postulante.add(postulanteObject);
}
con.close();
} catch (Exception ex) {
ex.printStackTrace();
} }
con.close(); return postulante;
}catch(Exception ex){
ex.printStackTrace();
} }
return postulante;
} }
}
...@@ -3,6 +3,7 @@ package com.roshka.proyectofinal.Postulante; ...@@ -3,6 +3,7 @@ package com.roshka.proyectofinal.Postulante;
import com.roshka.proyectofinal.DataBase; import com.roshka.proyectofinal.DataBase;
import com.roshka.proyectofinal.entity.Postulante; import com.roshka.proyectofinal.entity.Postulante;
import com.roshka.proyectofinal.entity.Bootcamp; import com.roshka.proyectofinal.entity.Bootcamp;
import com.roshka.proyectofinal.entity.PostulanteLenguaje;
import jakarta.servlet.ServletException; import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet; import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServlet;
...@@ -15,57 +16,66 @@ import java.sql.PreparedStatement; ...@@ -15,57 +16,66 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Statement; import java.sql.Statement;
@WebServlet("/SaveServlet") @WebServlet("/SaveServlet")
public class SaveServlet extends HttpServlet { public class SaveServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { throws ServletException, IOException {
response.setContentType("text/html"); response.setContentType("text/html");
PrintWriter out=response.getWriter(); PrintWriter out = response.getWriter();
boolean rechazarDatos = false; boolean rechazarDatos = false;
int bootcampActual = 3; int bootcampActual = Integer.parseInt(request.getParameter("bootcamp_id"));
try { try {
Connection con = DataBase.getConnection(); Connection con = DataBase.getConnection();
//
Statement stmt = con.createStatement(); Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT correo,bootcamp_id FROM postulante WHERE postulante.bootcamp_id =" + bootcampActual); ResultSet rs = stmt.executeQuery(
// "SELECT correo,bootcamp_id FROM postulante WHERE postulante.bootcamp_id =" + bootcampActual);
String nombre=request.getParameter("nombre");
String apellido=request.getParameter("apellido"); String nombre = request.getParameter("nombre");
int cedula=Integer.parseInt(request.getParameter("cedula")); String apellido = request.getParameter("apellido");
String correo=request.getParameter("correo"); int cedula = Integer.parseInt(request.getParameter("cedula"));
//BUCLE PARA VERIFICAR EL CORREO EN EL BOOTCAMP ACTUAL String correo = request.getParameter("correo");
while (rs.next()){ // BUCLE PARA VERIFICAR EL CORREO EN EL BOOTCAMP ACTUAL
String correoBase =rs.getString("correo"); while (rs.next()) {
String correoBase = rs.getString("correo");
int bootcampIdBase = rs.getInt("bootcamp_id"); int bootcampIdBase = rs.getInt("bootcamp_id");
if(correo.equals(correoBase) && (bootcampIdBase==bootcampActual)){ if (correo.equals(correoBase) && (bootcampIdBase == bootcampActual)) {
rechazarDatos = true; rechazarDatos = true;
} }
} }
String telefono=request.getParameter("telefono"); rs = stmt.executeQuery("SELECT * FROM lenguaje");
String direccion=request.getParameter("direccion"); int contador = 0;
boolean experienciaProgramando = false; while (rs.next()) {
String nombreLenguaje = rs.getString("nombre_lenguaje");
if (request.getParameter(nombreLenguaje) != null) {
contador++;
}
}
if (contador == 0) {
rechazarDatos = true;
}
String telefono = request.getParameter("telefono");
String direccion = request.getParameter("direccion");
boolean experienciaLaboral = false; boolean experienciaLaboral = false;
boolean universidad = false; boolean universidad = false;
boolean notebook = false; boolean notebook = false;
if (request.getParameter("experiencia_laboral") != null){ if (request.getParameter("experiencia_laboral") != null) {
experienciaLaboral = true; experienciaLaboral = true;
} }
if (request.getParameter("experiencia_programando") != null) { if (request.getParameter("notebook") != null) {
experienciaProgramando = true;
}
if (request.getParameter("notebook") != null){
notebook = true; notebook = true;
} }
if (request.getParameter("universidad") != null){ if (request.getParameter("universidad") != null) {
universidad = true; universidad = true;
} }
Bootcamp bootcamp = new Bootcamp();
Postulante postulante=new Postulante(); Postulante postulante = new Postulante();
//SI LOS DATOS SON CORRECTOS NO SE RECHAZAN ENTONCES CARGA A LA BASE PostulanteLenguaje cargarLenguaje = new PostulanteLenguaje();
if (!rechazarDatos){ int status = 0;
int statusLenguaje = 0;
// SI LOS DATOS SON CORRECTOS NO SE RECHAZAN ENTONCES CARGA A LA BASE
if (!rechazarDatos) {
postulante.setNombre(nombre); postulante.setNombre(nombre);
postulante.setApellido(apellido); postulante.setApellido(apellido);
postulante.setNro_cedula(cedula); postulante.setNro_cedula(cedula);
...@@ -77,35 +87,53 @@ public class SaveServlet extends HttpServlet { ...@@ -77,35 +87,53 @@ public class SaveServlet extends HttpServlet {
postulante.setNotebook(notebook); postulante.setNotebook(notebook);
postulante.setBootcampId(bootcampActual); postulante.setBootcampId(bootcampActual);
postulante.setAceptado(false); postulante.setAceptado(false);
status = PostulanteDao.save(postulante);
rs = stmt.executeQuery("SELECT id FROM postulante WHERE postulante.nro_cedula=" + cedula
+ " AND postulante.bootcamp_id=" + bootcampActual + " ORDER BY id DESC LIMIT 1");
int idUltimoPostulante = 0;
while (rs.next()) {
idUltimoPostulante = rs.getInt("id");
}
rs = stmt.executeQuery("SELECT * FROM lenguaje");
while (rs.next()) {
int idLenguaje = rs.getInt("id");
String nombreLenguaje = rs.getString("nombre_lenguaje");
if (request.getParameter(nombreLenguaje) != null) {
cargarLenguaje.setIdLenguaje(idLenguaje);
cargarLenguaje.setIdPostulante(idUltimoPostulante);
statusLenguaje = PostulanteLenguajeDao.save(cargarLenguaje);
}
}
} }
int status=PostulanteDao.save(postulante); if (status > 0) {
if(status>0){ // out.print("<p>Record saved successfully!</p>");
//out.print("<p>Record saved successfully!</p>"); out.print(" <div class=\"alert\">\n" +
out.print(" <div class=\"alert\">\n" + " <span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">&times;</span> \n"
" <span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">&times;</span> \n" + +
" <strong>Formulario Cargado!</strong> EXITOSAMENTE CARGADO\n" + " <strong>Formulario Cargado!</strong> EXITOSAMENTE CARGADO\n" +
"</div>");
request.getRequestDispatcher("formulario.jsp").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);
} 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" +
"</div>"); "</div>");
request.getRequestDispatcher("formulario.jsp").include(request, response); request.getRequestDispatcher("formulario.jsp").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);
}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" +
"</div>");
request.getRequestDispatcher("formulario.jsp").include(request, response);
}
} }
}
}catch (Exception ex){ } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
out.close(); out.close();
} }
......
...@@ -44,9 +44,34 @@ public class Postulante { ...@@ -44,9 +44,34 @@ public class Postulante {
this.aceptado = aceptado; this.aceptado = aceptado;
} }
public int getNroCedula() {
return nroCedula;
}
public String getNombreBootcamp() {
return nombreBootcamp;
}
public boolean isExpLaboral() {
return expLaboral;
}
public boolean isEstudioUniversitario() {
return estudioUniversitario;
}
public boolean isNotebook() {
return notebook;
}
public boolean isAceptado() {
return aceptado;
}
public int getId() { public int getId() {
return id; return id;
} }
public int getNro_cedula() { public int getNro_cedula() {
return nroCedula; return nroCedula;
} }
...@@ -118,35 +143,13 @@ public class Postulante { ...@@ -118,35 +143,13 @@ public class Postulante {
this.id = id; this.id = id;
} }
public int getNroCedula() {
return nroCedula;
}
public void setNroCedula(int nroCedula) { public void setNroCedula(int nroCedula) {
this.nroCedula = nroCedula; this.nroCedula = nroCedula;
} }
public String getNombreBootcamp() {
return nombreBootcamp;
}
public void setNombreBootcamp(String nombreBootcamp) { public void setNombreBootcamp(String nombreBootcamp) {
this.nombreBootcamp = nombreBootcamp; this.nombreBootcamp = nombreBootcamp;
} }
public boolean isExpLaboral() {
return expLaboral;
}
public boolean isEstudioUniversitario() {
return estudioUniversitario;
}
public boolean isNotebook() {
return notebook;
}
public boolean isAceptado() {
return aceptado;
}
} }
(function() {
const form = document.querySelector('#agarraunolaputa');
const checkboxes = form.querySelectorAll('input[type=checkbox]');
const checkboxLength = checkboxes.length;
const firstCheckbox = checkboxLength > 0 ? checkboxes[0] : null;
function init() {
if (firstCheckbox) {
for (let i = 0; i < checkboxLength; i++) {
checkboxes[i].addEventListener('change', checkValidity);
}
checkValidity();
}
}
function isChecked() {
for (let i = 0; i < checkboxLength; i++) {
if (checkboxes[i].checked) return true;
}
return false;
}
function checkValidity() {
const errorMessage = !isChecked() ? 'Debe seleccionar al menos un lenguaje que conozca' : '';
firstCheckbox.setCustomValidity(errorMessage);
}
init();
})();
\ No newline at end of file
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootcamp</title>
<meta name="author" content="cssremix.com">
<meta name="robots" content="index,follow">
<link rel="canonical" href="https://cssremix.com">
<style>
@charset "UTF-8";:root{--bs-font-bold:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",bold,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--bs-font-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bs-gradient:linear-gradient;--bs-body-font-family:var(--bs-font-bold);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:white;--bs-body-bg:#fff}*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{background:url('https://www.bgeneral.com/wp-content/uploads/2020/09/landing%20recargas/fondo-azul-desktop.png');margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}p{margin-top:0;margin-bottom:1rem}ul{padding-left:2rem;margin-top:0;margin-bottom:1rem}img{vertical-align:middle}::-moz-focus-inner{padding:0;border-style:none}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}.lead{font-size:1.25rem;font-weight:300}.img-fluid{max-width:100%;height:auto}.container{width:100%;padding-right:var(--bs-gutter-x,.75rem);padding-left:var(--bs-gutter-x,.40rem);margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){h3{font-size:1.75rem}.container{max-width:1140px}}@media (min-width:1400px){.container{max-width:1320px}}.row{--bs-gutter-x:1.5rem;--bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-top:calc(var(--bs-gutter-y) * -1);margin-right:calc(var(--bs-gutter-x) * -.5);margin-left:calc(var(--bs-gutter-x) * -.5)}.row>*{flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x) * .5);padding-left:calc(var(--bs-gutter-x) * .5);margin-top:var(--bs-gutter-y)}@media (min-width:992px){.col-lg-10{flex:0 0 auto;width:83.33333333%}.col-lg-12{flex:0 0 auto;width:100%}}.mx-auto{margin-right:auto!important;margin-left:auto!important}.text-center{text-align:center!important}#hero{padding:80px 0;margin-bottom:40px;background-color:#3f51b5;color:white}#hero h1{margin-bottom:30px;color:white}
</style>
<style>#hero{padding:40px 0;margin-bottom:40px;background-color:white;color:white}#hero h1{margin-bottom:40px;color:#fff}.footer{margin-top:40px;padding:40px 0;background-color:white;color:white}.footer a{color:white}.table-responsive{font-size:15px}
h2 { color: white;font-weight: bold;font-family: 'Monaco', sans-serif font-weight: 100; }
h1 { color: white; font-weight: bold;font-family: 'Monaco', sans-serif font-weight: 100;}
h3 { color: white;font-weight: bold;font-family: 'Monaco', sans-serif font-weight: 100; }
h4 { color: white;font-weight: bold;font-family: 'Monaco', sans-serif font-weight: 100; }
h6 { color: white;font-weight: bold;font-family: 'Monaco', sans-serif font-weight: 100; }
mb-1 { color: black; }
@media (min-width: 400px) {p {font-size: 17px, color white;} .leading{font-size:1.25rem;font-weight:300;} }
.card-body p {font-size: 0rem,background-color white ;font-weight: bold;}
.star-ratings-css {
unicode-bidi: bidi-override;
color: white;
font-size: 25px;
height: 25px;
position: relative;
padding: 0;
margin-left: 10px;
}
.star-ratings-css-top {
color: white;
padding: 0;
position: absolute;
z-index: 1;
display: block;
top: 0;
left: 0;
overflow: hidden;
}
.star-ratings-css-bottom {
padding: 0;
display: block;
z-index: 0;
}
.card-h{
transition: .3s transform cubic-bezier(.155,1.105,.295,1.12),.3s box-shadow,.3s -webkit-transform cubic-bezier(.155,1.105,.295,1.12);
cursor: pointer;
height: 90%;
background-color: white;
}
.card-h:hover{
transform: scale(1.025);
box-shadow: 0 10px 20px white, 0 4px 8px white;
background-color: white;
}
.card-h .card-body {padding: 1rem;}
.card-h {height: unset;}
.card-img-top {
width: 70%;
height: 400px;
object-fit: cover;
}
lite-youtube{background-color:white;position:relative;display:block;contain:content;background-position:center center;background-size:cover;cursor:pointer;}lite-youtube::before{content:'';display:block;position:absolute;top:0;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==);background-position:top;background-repeat:repeat-x;height:60px;padding-bottom:50px;width:100%;transition:all .2s cubic-bezier(0,0,.2,1)}lite-youtube::after{content:"";display:block;padding-bottom:calc(100% / (16 / 9))}lite-youtube>iframe{width:100%;height:100%;position:absolute;top:0;left:0;border:0}lite-youtube>.lty-playbtn{width:68px;height:48px;position:absolute;cursor:pointer;transform:translate3d(-50%,-50%,0);top:50%;left:50%;z-index:1;background-color:transparent;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 68 48"><path fill="%23f00" fill-opacity="0.8" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z"></path><path d="M 45,24 27,14 27,34" fill="%23fff"></path></svg>');filter:grayscale(100%);transition:filter .1s cubic-bezier(0,0,.2,1);border:none}lite-youtube .lty-playbtn:focus,lite-youtube:hover>.lty-playbtn{filter:none}lite-youtube.lyt-activated{cursor:unset}lite-youtube.lyt-activated::before,lite-youtube.lyt-activated>.lty-playbtn{opacity:0;pointer-events:none}.lyt-visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}
</style>
<link rel="preload" as="image" href="images/1280x853.webp">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet"></noscript>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6907191851278817" crossorigin="anonymous"></script>
</head>
<body>
<div class="col-lg-7 mx-auto mt-5 mb-5">
<h3 class="h3 mt-5">¿QUE ES UN BOOTCAMP?</h3>
<br>
<h6> ES UN CAMPO DE ENTRENAMIENTO INTENSIVO Y GRATUITO PARA PRINCIPIANTES QUE YA PROGRAMAN Y QUIEREN SER PARTE DE LA EMPRESA </h6>
<br>
<h3 class="h4">¿CUANTOS MESES DURA EL ENTRENAMIENTO Y CUAL ES SU HORARIO?</h3>
<br>
<h6>AL SER INTENSIVO Y TENIENDO EN CUENTA QUE LOS ASPIRANTES DEBEN FINALIZARLO CON UN CONOCIMIENTO APTO PARA REALIZAR UN PROYECTO DEL ÁREA, SE DA COMO LAPSO DE TIEMPO UN MES CON UN HORARIO DE 8:00 A 18:00 HS </h6>
</div>
</div><!-- /row -->
</div><!-- /container -->
<div class="col-lg-7 mx-auto mb-5">
<h3> REQUISITOS</h3>
</div>
<div class="col-lg-7 mx-auto mb-2">
<i class="fal fa-fast-forward"></i>
</div>
<div class="col-lg-7 mx-auto mb-2">
<h3 class="h6">1. DISPOSICION DE TIEMPO </h6>
<br>
</div>
<div class="col-lg-7 mx-auto mb-2">
<i class="fal fa-clone"></i>
</div>
<div class="col-lg-7 mx-auto mb-2">
<h3 class="h6">2. DISPONER DE UNA NOTEBOOK </h6>
<br>
</div>
<div class="col-lg-7 mx-auto mb-2">
<i class="fal fa-highlighter"></i>
</div>
<div class="col-lg-7 mx-auto mb-2">
<h3 class="h6">3. APROBAR EXAMENES </h6>
<br>
</div>
<div class="col-lg-7 mx-auto mb-2">
<i class="fal fa-dumbbell"></i>
</div>
<div class="col-lg-7 mx-auto mb-2">
<h3 class="h6">4. FIRMAR CARTA DE COMPROMISO </h3>
<br>
</div>
</div>
</div>
</div><!-- /row -->
</div><!-- /container -->
<div class="col-lg-7 mx-auto mb-5">
<h3> EDICIONES DE BOOTCAMP </h3>
</div>
</div><!-- /row -->
<div class="row">
<div class="col-lg-7 mx-auto mb-2" >
<div class="card card-h mb-4">
<img src="https://zetsan.com/wp-content/uploads/2020/10/1366_2000.jpeg" lazyload" alt="">
<div class="card-body">
<p class="mb-1"> BOOTCAMP JAVA </p>
<p class="mb-1"> Inicio: 18/04/2023</p>
<p class="mb-1"> Fin: 18/05/2023</p>
<form action="aca el link de la pestaña postulacion">
<input type="submit" value="POSTULAR" />
</form>
</div></div>
</div>
<div class="col-lg-7 mx-auto mb-2">
<div class="card card-h mb-4">
<img src="https://www.pngmart.com/files/13/Android-Logo-PNG-File.png" class="card-img-top lazyload" alt="Learning Web Design: A Beginner's Guide to HTML, CSS, JavaScript, and Web Graphics">
<div class="card-body">
<p class="mb-1"> BOOTCAMP ANDROID </p>
<p class="mb-1"> Inicio: 18/06/2023</p>
<p class="mb-1"> Fin: 18/07/2023</p>
<form action="aca el link de la pestaña postulacion">
<input type="submit" value="POSTULAR" />
</form>
</div></div>
</div>
<div class="col-lg-7 mx-auto mb-2">
<div class="card card-h mb-4">
<img src="https://p4.wallpaperbetter.com/wallpaper/710/859/671/technology-apple-ios-12-wallpaper-preview.jpg" lazyload" alt="">
<div class="card-body">
<p class="mb-1"> BOOTCAMP iOS </p>
<p class="mb-1"> Inicio: 18/08/2023</p>
<p class="mb-1"> Fin: 18/09/2023</p>
<form action="aca el link de la pestaña postulacion">
<input type="submit" value="POSTULAR" />
</form>
</div></div>
</div>
</div>
</body>
</div>
</div>
</div>
</div>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.sql.*,java.sql.Connection,java.sql.ResultSet,com.roshka.proyectofinal.DataBase"%>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootcamp</title>
<meta name="author" content="cssremix.com">
<meta name="robots" content="index,follow">
<link rel="canonical" href="https://cssremix.com">
<style>
@charset "UTF-8";
:root {
--bs-font-bold: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", bold, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-gradient: linear-gradient;
--bs-body-font-family: var(--bs-font-bold);
--bs-body-font-size: 1rem;
--bs-body-font-weight: 400;
--bs-body-line-height: 1.5;
--bs-body-color: white;
--bs-body-bg: #fff
}
*,
::after,
::before {
box-sizing: border-box
}
@media (prefers-reduced-motion:no-preference) {
:root {
scroll-behavior: smooth
}
}
body {
background: url('https://www.bgeneral.com/wp-content/uploads/2020/09/landing%20recargas/fondo-azul-desktop.png');
margin: 0;
font-family: var(--bs-body-font-family);
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--bs-body-line-height);
color: var(--bs-body-color);
text-align: var(--bs-body-text-align);
background-color: var(--bs-body-bg);
-webkit-text-size-adjust: 100%
}
h1 {
font-size: calc(1.375rem + 1.5vw)
}
@media (min-width:1200px) {
h1 {
font-size: 2.5rem
}
}
h2 {
font-size: calc(1.325rem + .9vw)
}
@media (min-width:1200px) {
h2 {
font-size: 2rem
}
}
h3 {
font-size: calc(1.3rem + .6vw)
}
p {
margin-top: 0;
margin-bottom: 1rem
}
ul {
padding-left: 2rem;
margin-top: 0;
margin-bottom: 1rem
}
img {
vertical-align: middle
}
::-moz-focus-inner {
padding: 0;
border-style: none
}
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-year-field {
padding: 0
}
::-webkit-inner-spin-button {
height: auto
}
::-webkit-search-decoration {
-webkit-appearance: none
}
::-webkit-color-swatch-wrapper {
padding: 0
}
::file-selector-button {
font: inherit
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button
}
.lead {
font-size: 1.25rem;
font-weight: 300
}
.img-fluid {
max-width: 100%;
height: auto
}
.container {
width: 100%;
padding-right: var(--bs-gutter-x, .75rem);
padding-left: var(--bs-gutter-x, .40rem);
margin-right: auto;
margin-left: auto
}
@media (min-width:576px) {
.container {
max-width: 540px
}
}
@media (min-width:768px) {
.container {
max-width: 720px
}
}
@media (min-width:992px) {
.container {
max-width: 960px
}
}
@media (min-width:1200px) {
h3 {
font-size: 1.75rem
}
.container {
max-width: 1140px
}
}
@media (min-width:1400px) {
.container {
max-width: 1320px
}
}
.row {
--bs-gutter-x: 1.5rem;
--bs-gutter-y: 0;
display: flex;
flex-wrap: wrap;
margin-top: calc(var(--bs-gutter-y) * -1);
margin-right: calc(var(--bs-gutter-x) * -.5);
margin-left: calc(var(--bs-gutter-x) * -.5)
}
.row>* {
flex-shrink: 0;
width: 100%;
max-width: 100%;
padding-right: calc(var(--bs-gutter-x) * .5);
padding-left: calc(var(--bs-gutter-x) * .5);
margin-top: var(--bs-gutter-y)
}
@media (min-width:992px) {
.col-lg-10 {
flex: 0 0 auto;
width: 83.33333333%
}
.col-lg-12 {
flex: 0 0 auto;
width: 100%
}
}
.mx-auto {
margin-right: auto!important;
margin-left: auto!important
}
.text-center {
text-align: center!important
}
#hero {
padding: 80px 0;
margin-bottom: 40px;
background-color: #3f51b5;
color: white
}
#hero h1 {
margin-bottom: 30px;
color: white
}
</style>
<style>
#hero {
padding: 40px 0;
margin-bottom: 40px;
background-color: white;
color: white
}
#hero h1 {
margin-bottom: 40px;
color: #fff
}
.footer {
margin-top: 40px;
padding: 40px 0;
background-color: white;
color: white
}
.footer a {
color: white
}
.table-responsive {
font-size: 15px
}
h2 {
color: white;
font-weight: bold;
font-family: 'Monaco', sans-serif font-weight: 100;
}
h1 {
color: white;
font-weight: bold;
font-family: 'Monaco', sans-serif font-weight: 100;
}
h3 {
color: white;
font-weight: bold;
font-family: 'Monaco', sans-serif font-weight: 100;
}
h4 {
color: white;
font-weight: bold;
font-family: 'Monaco', sans-serif font-weight: 100;
}
h6 {
color: white;
font-weight: bold;
font-family: 'Monaco', sans-serif font-weight: 100;
}
mb-1 {
color: black;
}
@media (min-width: 400px) {
p {
font-size: 17px, color white;
}
.leading {
font-size: 1.25rem;
font-weight: 300;
}
}
.card-body p {
font-size: 0rem, background-color white;
font-weight: bold;
}
.star-ratings-css {
unicode-bidi: bidi-override;
color: white;
font-size: 25px;
height: 25px;
position: relative;
padding: 0;
margin-left: 10px;
}
.star-ratings-css-top {
color: white;
padding: 0;
position: absolute;
z-index: 1;
display: block;
top: 0;
left: 0;
overflow: hidden;
}
.star-ratings-css-bottom {
padding: 0;
display: block;
z-index: 0;
}
.card-h {
transition: .3s transform cubic-bezier(.155, 1.105, .295, 1.12), .3s box-shadow, .3s -webkit-transform cubic-bezier(.155, 1.105, .295, 1.12);
cursor: pointer;
height: 90%;
background-color: white;
}
.card-h:hover {
transform: scale(1.025);
box-shadow: 0 10px 20px white, 0 4px 8px white;
background-color: white;
}
.card-h .card-body {
padding: 1rem;
}
.card-h {
height: unset;
}
.card-img-top {
width: 70%;
height: 400px;
object-fit: cover;
}
lite-youtube {
background-color: white;
position: relative;
display: block;
contain: content;
background-position: center center;
background-size: cover;
cursor: pointer;
}
lite-youtube::before {
content: '';
display: block;
position: absolute;
top: 0;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==);
background-position: top;
background-repeat: repeat-x;
height: 60px;
padding-bottom: 50px;
width: 100%;
transition: all .2s cubic-bezier(0, 0, .2, 1)
}
lite-youtube::after {
content: "";
display: block;
padding-bottom: calc(100% / (16 / 9))
}
lite-youtube>iframe {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
border: 0
}
lite-youtube>.lty-playbtn {
width: 68px;
height: 48px;
position: absolute;
cursor: pointer;
transform: translate3d(-50%, -50%, 0);
top: 50%;
left: 50%;
z-index: 1;
background-color: transparent;
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 68 48"><path fill="%23f00" fill-opacity="0.8" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z"></path><path d="M 45,24 27,14 27,34" fill="%23fff"></path></svg>');
filter: grayscale(100%);
transition: filter .1s cubic-bezier(0, 0, .2, 1);
border: none
}
lite-youtube .lty-playbtn:focus,
lite-youtube:hover>.lty-playbtn {
filter: none
}
lite-youtube.lyt-activated {
cursor: unset
}
lite-youtube.lyt-activated::before,
lite-youtube.lyt-activated>.lty-playbtn {
opacity: 0;
pointer-events: none
}
.lyt-visually-hidden {
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px
}
</style>
<link rel="preload" as="image" href="images/1280x853.webp">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet"></noscript>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6907191851278817" crossorigin="anonymous"></script>
</head>
<body>
<div class="col-lg-7 mx-auto mt-5 mb-5">
<h3 class="h3 mt-5">¿QUE ES UN BOOTCAMP?</h3>
<br>
<h6> ES UN CAMPO DE ENTRENAMIENTO INTENSIVO Y GRATUITO PARA PRINCIPIANTES QUE YA PROGRAMAN Y QUIEREN SER PARTE DE LA EMPRESA </h6>
<br>
<h3 class="h4">¿CUANTOS MESES DURA EL ENTRENAMIENTO Y CUAL ES SU HORARIO?</h3>
<br>
<h6>AL SER INTENSIVO Y TENIENDO EN CUENTA QUE LOS ASPIRANTES DEBEN FINALIZARLO CON UN CONOCIMIENTO APTO PARA REALIZAR UN PROYECTO DEL ÁREA, SE DA COMO LAPSO DE TIEMPO UN MES CON UN HORARIO DE 8:00 A 18:00 HS </h6>
</div>
</div>
<!-- /row -->
</div>
<!-- /container -->
<div class="col-lg-7 mx-auto mb-5">
<h3> REQUISITOS</h3>
</div>
<div class="col-lg-7 mx-auto mb-2">
<i class="fal fa-fast-forward"></i>
</div>
<div class="col-lg-7 mx-auto mb-2">
<h3 class="h6">1. DISPOSICION DE TIEMPO </h6>
<br>
</div>
<div class="col-lg-7 mx-auto mb-2">
<i class="fal fa-clone"></i>
</div>
<div class="col-lg-7 mx-auto mb-2">
<h3 class="h6">2. DISPONER DE UNA NOTEBOOK </h6>
<br>
</div>
<div class="col-lg-7 mx-auto mb-2">
<i class="fal fa-highlighter"></i>
</div>
<div class="col-lg-7 mx-auto mb-2">
<h3 class="h6">3. APROBAR EXAMENES </h6>
<br>
</div>
<div class="col-lg-7 mx-auto mb-2">
<i class="fal fa-dumbbell"></i>
</div>
<div class="col-lg-7 mx-auto mb-2">
<h3 class="h6">4. FIRMAR CARTA DE COMPROMISO </h3>
<br>
</div>
</div>
</div>
</div>
<!-- /row -->
</div>
<!-- /container -->
<div class="col-lg-7 mx-auto mb-5">
<h3> EDICIONES DE BOOTCAMP </h3>
</div>
</div>
<!-- /row -->
<div class="row">
<%
Connection con = DataBase.getConnection();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM bootcamp WHERE activo=true");
while(rs.next()){
%>
<div class="col-lg-7 mx-auto mb-2">
<div class="card card-h mb-4">
<img src="https://zetsan.com/wp-content/uploads/2020/10/1366_2000.jpeg" lazyload alt=<%=rs.getString( "titulo") %>>
<div class="card-body ">
<p class="mb-1 ">
<%= rs.getString("titulo") %>
</p>
<p class="mb-1 "> Inicio:
<%=rs.getString("fecha_inicio")%>
</p>
<p class="mb-1 "> Fin:
<%=rs.getString("fecha_fin")%>
</p>
<form action="formulario.jsp">
<input name="bootcamp" type="hidden" value=<%=rs.getInt( "id") %>>
<button type="submit">POSTULAR</button>
</form>
</div>
</div>
</div>
<%
}
%>
</div>
</body>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<%@ page language="java" contentType="text/html; charset=UTF-8" <%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%> pageEncoding="UTF-8"%>
<!DOCTYPE html> <%@ page import="java.sql.*,java.sql.Connection,java.sql.ResultSet,com.roshka.proyectofinal.DataBase,jakarta.servlet.http.HttpServlet,jakarta.servlet.http.HttpServletRequest"%>
<html>
<!DOCTYPE html>
<head> <html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="form.css" rel="stylesheet" type="text/css" /> <head>
<link rel="shortcut icon" href="imagenes/roshkaicon.ico" sizes="any" /> <link href="estilos/form.css" rel="stylesheet" type="text/css" />
<!-- CSS only --> <link rel="shortcut icon" href="imagenes/roshkaicon.ico" sizes="any" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous"> <!-- CSS only -->
<link rel="stylesheet" media="(max-width: 800px)" href="example.css" /> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<title>Formulario Postulante</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head> <link rel="stylesheet" href="form.css" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<body> <script src="Javascript.js"></script>
<header> <link rel="stylesheet" media="(max-width: 800px)" href="example.css" />
<div class="logo"> <title>Formulario Postulante</title>
<img src="imagenes/logo-roshka.svg" alt="log-roshka" />
</div> </head>
</header>
<main class="create"> <body>
<article class="contenedor"> <header>
<div> <div class="logo">
<p class="enter">Si sigues interesado y cumples con los requisitos, completa el siguiente formulario: </p> <img src="imagenes/logo-roshka.svg" alt="log-roshka" />
</div>
<form method="post" action="SaveServlet" class="form"> </header>
<main class="create">
<label class="mr-2" for="nombre">Ingrese su Nombre:</label> <article class="contenedor">
<input required id="nombre" name="nombre" type="text"><br> <div>
<label for="apellido">Ingrese su Apellido:</label>
<input required id="apellido" name="apellido" type="text"><br>
<label for="cedula">Numero de cedula:</label>
<input required id="cedula" name="cedula" type="number"><br>
<label for="correo">Correo:</label>
<input required id="correo" name="correo" type="email"><br>
<label for="telefono">Telefono:</label>
<input required id="telefono" name="telefono" type="text"><br>
<label for="direccion">Direccion:</label>
<input required id="direccion" name="direccion" type="text"><br>
<%@ page import="com.roshka.proyectofinal.entity.Lenguaje, com.roshka.proyectofinal.lenguaje.LenguajeDao, java.util.List,java.util.Iterator" %>
<% <%
LenguajeDao lenDao = new LenguajeDao(); int id =Integer.parseInt(request.getParameter("bootcamp"));
List<Lenguaje> listLenguaje = lenDao.listar(); Connection con = DataBase.getConnection();
Iterator<Lenguaje> iter = listLenguaje.iterator(); Statement stmt = con.createStatement();
Lenguaje len = null; ResultSet rs = stmt.executeQuery("SELECT * FROM bootcamp WHERE id= "+id+ " LIMIT 1" );
rs.next();
%>
<ul>
<% while(iter.hasNext()){
len = iter.next();
%> %>
<li class="d-flex check-inline" >
<label for=<%=len.getNombre_lenguaje() %> > <%= len.getNombre_lenguaje() %> </label><input value=<%=len.getId() %> id=
<%=len.getNombre_lenguaje() %> name=
<%=len.getNombre_lenguaje() %> type="checkbox"><br>
</li>
<% } %>
</ul>
<li class="d-flex">
<label for="experiencia_laboral" >Experiencia laboral</label>
</li>
<!-- Si no lo marca el valor que envia es null y si lo marca es "ON" -->
<input id="experiencia_laboral" name="experiencia_laboral" type="checkbox" ><br>
<p for="experiencia_programando">Lenguajes de programacion que conoces:</p>
<label for="notebook">Cuenta con notebook</label>
<input id="notebook" name="notebook" type="checkbox"><br>
<label for="universidad">Estudio Universitario </label>
<input id="universidad" name="universidad" type="checkbox"><br>
<input class="enviar info error" type="submit">
<input class="borrar" type="reset" value="Borrar"><br>
<a href="index.html">volver</a>
</form>
</article>
</main>
</body>
</html>
<h2>Descripcion:</h2>
<p>
<%= rs.getString("descripcion") %>
</p>
<p class="enter">Si sigues interesado y cumples con los requisitos, completa el siguiente formulario: </p>
<form method="post" action="SaveServlet" class="form">
<input type="hidden" name="bootcamp_id" value="<%= request.getParameter("bootcamp") %>">
<label for="nombre">Ingrese su Nombre:</label>
<input required id="nombre" name="nombre" type="text"><br>
<label for="apellido">Ingrese su Apellido:</label>
<input required id="apellido" name="apellido" type="text"><br>
<label for="cedula">Numero de cedula:</label>
<input required id="cedula" name="cedula" type="number"><br>
<label for="correo">Correo:</label>
<input required id="correo" name="correo" type="email"><br>
<label for="telefono">Telefono:</label>
<input required id="telefono" name="telefono" type="text"><br>
<label for="direccion">Direccion:</label>
<input required id="direccion" name="direccion" type="text"><br>
<label for="experiencia_laboral">Experiencia laboral</label>
<!-- Si no lo marca el valor que envia es null y si lo marca es "ON" -->
<input id="experiencia_laboral" name="experiencia_laboral" type="checkbox"><br>
<label for="notebook">Cuenta con notebook</label>
<input id="notebook" name="notebook" type="checkbox"><br>
<label for="universidad">Estudio Universitario </label>
<input id="universidad" name="universidad" type="checkbox"><br>
<p for="experiencia_programando">Lenguajes de programacion que conoces:</p>
<%@ page import="com.roshka.proyectofinal.entity.Lenguaje, com.roshka.proyectofinal.lenguaje.LenguajeDao, java.util.List,java.util.Iterator" %>
<%
LenguajeDao lenDao = new LenguajeDao();
List<Lenguaje> listLenguaje = lenDao.listar();
Iterator<Lenguaje> iter = listLenguaje.iterator();
Lenguaje len = null;
%>
<ul id="agarraunolaputa">
<% while(iter.hasNext()){
len = iter.next();
%>
<li class="d-flex">
<label for=<%=len.getNombre_lenguaje() %> > <%= len.getNombre_lenguaje() %> </label>
<input onclick="enviar(id)" value=<%=len.getId() %> id=
<%=len.getNombre_lenguaje() %> name=
<%=len.getNombre_lenguaje() %> type="checkbox" >
</li>
<% } %>
</ul>
<input class="enviar info error" type="submit">
<input class="borrar" type="reset" value="Borrar"><br>
<a href="index.html">volver</a>
</form>
</article>
</main>
</body>
</html>
<script>
(function() {
const form = document.querySelector('#agarraunolaputa');
const checkboxes = form.querySelectorAll('input[type=checkbox]');
const checkboxLength = checkboxes.length;
const firstCheckbox = checkboxLength > 0 ? checkboxes[0] : null;
function init() {
if (firstCheckbox) {
for (let i = 0; i < checkboxLength; i++) {
checkboxes[i].addEventListener('change', checkValidity);
}
checkValidity();
}
}
function isChecked() {
for (let i = 0; i < checkboxLength; i++) {
if (checkboxes[i].checked) return true;
}
return false;
}
function checkValidity() {
const errorMessage = !isChecked() ? 'Debe seleccionar al menos un lenguaje que conozca' : '';
firstCheckbox.setCustomValidity(errorMessage);
}
init();
})();
</script>
\ No newline at end of file
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
<ul> <ul>
<li class="link-menu"><a href="">Home</a></li> <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.jsp">Postulate</a></li>
<li class="link-menu"><a href="formulario_bootcamp.jsp">Crear bootcamp</a> <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="login.jsp">Login</a>
...@@ -35,6 +39,7 @@ ...@@ -35,6 +39,7 @@
</li> </li>
<li class="link-menu"><a href="formulario_profesor.jsp">Crear profesor</a> <li class="link-menu"><a href="formulario_profesor.jsp">Crear profesor</a>
</li> </li>
</ul> </ul>
</div> </div>
......
<<<<<<< HEAD
=======
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
...@@ -22,5 +20,4 @@ ...@@ -22,5 +20,4 @@
</body> </body>
</html> </html>
>>>>>>> origin/develop \ No newline at end of file
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