Commit 0b41fb7d by Angel Zarate

Merge con develop

parents efea4bc6 d3a6ea52
......@@ -4,7 +4,9 @@ target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/gitmisc.xml
.idea/encodings.xml
.idea/misc.xml
.idea/**
.idea/modules.xml
.idea/jarRepositories.xml
......@@ -13,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();
......@@ -106,13 +107,20 @@ public class SaveServlet extends HttpServlet {
}
}
}
<<<<<<< HEAD
if (status > 0) {
// out.print("<p>Record saved successfully!</p>");
=======
if(status>0){
//out.print("<p>Record saved successfully!</p>");
>>>>>>> d3a6ea52ee1614cfbff576707fd6717fb6a81036
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>");
<<<<<<< HEAD
request.getRequestDispatcher("formulario.jsp").include(request, response);
} else {
if (rechazarDatos) {
......@@ -128,8 +136,35 @@ public class SaveServlet extends HttpServlet {
" <span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">&times;</span> \n"
+
" <strong>Formulario ya Cargado!</strong> YA EXISTE EL FORMULARIO\n" +
=======
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''>");
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'>" +
"<span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">&times;</span> \n" +
"<strong>Formulario ya Cargado!</strong> YA EXISTE EL FORMULARIO\n" +
>>>>>>> d3a6ea52ee1614cfbff576707fd6717fb6a81036
"</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) {
......
......@@ -15,7 +15,7 @@ public class BootcampDao {
try{
Connection con= DataBase.getConnection();
PreparedStatement ps=con.prepareStatement(
"insert into bootcamp (id_lenguaje,id_profesor,fecha_inicio,fecha_fin,descripcion,imagen,titulo,activo) values (?,?,?,?,?,?,?,?)");
"insert into bootcamp (id_lenguaje,id_profesor,fecha_inicio,fecha_fin,descripcion,imagen,titulo,activo) values (?,?,?::date,?::date,?,?,?,?)");
ps.setInt(1,b.getId_lenguaje());
ps.setInt(2,b.getId_profesor());
ps.setString(3,b.getFecha_inicio());
......@@ -38,7 +38,7 @@ public class BootcampDao {
try{
Connection con= DataBase.getConnection();
PreparedStatement ps=con.prepareStatement(
"update Bootcamp set id_lenguaje=?,id_profesor=?,fecha_inicio=?,fecha_fin=?,descripcion=?,titulo=?,activo=? where id=?");
"update bootcamp set id_lenguaje=?,id_profesor=?,fecha_inicio=?::date,fecha_fin=?::date,descripcion=?,titulo=?,activo=? where id=?");
ps.setInt(1,b.getId_lenguaje());
ps.setInt(2,b.getId_profesor());
ps.setString(3,b.getFecha_inicio());
......@@ -50,13 +50,13 @@ public class BootcampDao {
status=ps.executeUpdate();
System.out.println(status);
con.close();
}catch(Exception ex){ex.printStackTrace();}
return status;
}
public static List<Bootcamp> listar(){
ArrayList<Bootcamp> list = new ArrayList<>();
String sql = "select a.id, a.fecha_inicio, a.fecha_fin, a.descripcion, a.titulo,\n" +
......@@ -126,9 +126,8 @@ public class BootcampDao {
b.setTitulo(rs.getString("titulo"));
b.setFecha_fin(rs.getString("fecha_fin"));
b.setFecha_inicio(rs.getString("fecha_inicio"));
b.setNombre_profesor(rs.getString("nombre"));
b.setApellido_profesor(rs.getString("apellido"));
b.setNombre_lenguaje(rs.getString("nombre_lenguaje"));
b.setId_profesor(rs.getInt("id_profesor"));
b.setId_lenguaje(rs.getInt("id_lenguaje"));
b.setImagen(rs.getString("imagen"));
}
con.close();
......
package com.roshka.proyectofinal.bootcamp;
import com.roshka.proyectofinal.entity.Bootcamp;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import java.io.IOException;
@WebServlet("/EditServletBootcamp")
public class EditServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
String sid=request.getParameter("id");
int id=Integer.parseInt(sid);
request.setAttribute("id", id);
BootcampDao bootcampDao = new BootcampDao();
Bootcamp bootcamp = bootcampDao.getBootcampById(id);
request.setAttribute("Bootcamp", bootcamp);
RequestDispatcher rd = request.getRequestDispatcher("formulario_bootcamp.jsp");
rd.forward(request, response);
rd.include(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
int id_lenguaje= Integer.parseInt(request.getParameter("id_lenguaje2"));
int id_profesor= Integer.parseInt(request.getParameter("id_profesor2"));
String fecha_inicio=request.getParameter("fecha_inicio2");
String fecha_fin=request.getParameter("fecha_fin2");
String descripcion=request.getParameter("descripcion2");
String imagen=request.getParameter("imagen2");
String titulo=request.getParameter("titulo2");
int id = Integer.parseInt(request.getParameter("id"));
String activoStr = request.getParameter("activo2");
System.out.println(activoStr);
Boolean activo = true;
if ( activoStr == null ) {
activo = false;
}else if (activoStr.equals("on")) {
activo = true;
}
System.out.println(activo);
Bootcamp bootcamp =new Bootcamp( id_lenguaje, id_profesor, fecha_inicio, fecha_fin, descripcion, imagen, titulo, activo);
bootcamp.setId(id);
int status=BootcampDao.update(bootcamp);
if(status>0){
response.sendRedirect("formulario_bootcamp.jsp");
}else{
System.out.println("Sorry! unable to update record");
}
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.roshka.proyectofinal.bootcamp;
import com.roshka.proyectofinal.entity.Bootcamp;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
......@@ -9,6 +10,7 @@ import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@WebServlet("/SaveServletBootcamp")
public class SaveServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
......@@ -23,8 +25,9 @@ public class SaveServlet extends HttpServlet {
String imagen=request.getParameter("imagen");
String titulo=request.getParameter("titulo");
String activoStr=request.getParameter("activo");
System.out.println(activoStr);
Boolean activo = false;
if ( activoStr == "on" ) {
if ( activoStr.equals("on") ) {
activo = true;
}
......@@ -33,7 +36,7 @@ public class SaveServlet extends HttpServlet {
int status= BootcampDao.save(b);
if(status>0){
out.print("<p>Record saved successfully!</p>");
request.getRequestDispatcher("index.html").include(request, response);
request.getRequestDispatcher("formulario_bootcamp.jsp").include(request, response);
}else{
out.println("Sorry! unable to save record");
}
......
......@@ -8,6 +8,11 @@ public class Lenguaje {
}
public Lenguaje(int id, String nombre_lenguaje) {
this.id = id;
this.nombre_lenguaje = nombre_lenguaje;
}
public int getId() {
return id;
}
......
package com.roshka.proyectofinal.lenguaje;
import com.roshka.proyectofinal.entity.Lenguaje;
import jakarta.servlet.RequestDispatcher;
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;
@WebServlet("/EditServletLenguaje")
public class EditServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String sid=request.getParameter("id");
int id=Integer.parseInt(sid);
LenguajeDao lenguajeDao = new LenguajeDao();
Lenguaje lenguaje = lenguajeDao.getLenguajeById(id);
request.setAttribute("Lenguaje", lenguaje);
RequestDispatcher rd = request.getRequestDispatcher("formulario_lenguaje.jsp");
rd.include(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String nombre_lenguaje=request.getParameter("nombre_lenguaje");
int id = Integer.parseInt(request.getParameter("id"));
System.out.println(id);
Lenguaje lenguaje =new Lenguaje(id,nombre_lenguaje);
int status=LenguajeDao.update(lenguaje);
if(status>0){
response.sendRedirect("formulario_lenguaje.jsp");
}else{
System.out.println("Sorry! unable to update record");
}
}
}
......@@ -66,6 +66,22 @@ public class LenguajeDao {
return status;
}
public static int update(Lenguaje l){
int status=0;
try{
Connection con= DataBase.getConnection();
PreparedStatement ps=con.prepareStatement(
"update lenguaje set nombre_lenguaje=? where id=?");
ps.setString(1,l.getNombre_lenguaje());
ps.setInt(2,l.getId());
status=ps.executeUpdate();
con.close();
}catch(Exception ex){ex.printStackTrace();}
return status;
}
public static Lenguaje getLenguajeById(int id){
Lenguaje lenguaje=new Lenguaje();
......
......@@ -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 {
......
package com.roshka.proyectofinal.profesor;
import com.roshka.proyectofinal.entity.Lenguaje;
import com.roshka.proyectofinal.entity.Profesor;
import jakarta.servlet.RequestDispatcher;
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;
@WebServlet("/EditServletProfesor")
public class EditServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
int id = Integer.parseInt(request.getParameter("id"));
ProfesorDao profesorDao = new ProfesorDao();
// Profesor profesor = profesorDao.getProfesorById(id);
// request.setAttribute("Profesor", profesor);
RequestDispatcher rd = request.getRequestDispatcher("formulario_profesor.jsp");
rd.include(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
int id = Integer.parseInt(request.getParameter("id"));
String nombre = request.getParameter("nombre");
String apellido = request.getParameter("apellido");
String email = request.getParameter("correo");
int nro_cedula = Integer.parseInt(request.getParameter("nro_cedula"));
Profesor profesor =new Profesor(nro_cedula, nombre, apellido, email);
profesor.setId(id);
// int status=ProfesorDao.update(profesor);
// if(status>0){
// response.sendRedirect("formulario_profesor.jsp");
// }else{
// System.out.println("Sorry! unable to update record");
// }
}
}
package com.roshka.proyectofinal.profesor;
import com.roshka.proyectofinal.entity.Profesor;
import jakarta.servlet.RequestDispatcher;
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.util.List;
import static com.roshka.proyectofinal.profesor.ProfesorDao.buscarPorNombre;
import static com.roshka.proyectofinal.profesor.ProfesorDao.listarProfesor;
@WebServlet("/filtros-profesor")
public class Filtros extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
List<Profesor> profesores = listarProfesor();
String nombre = req.getParameter("nombreBuscar");
String apellido = req.getParameter("apellidoBuscar");
System.out.println(nombre);
System.out.println(apellido);
if(nombre!=null || apellido!=null){
profesores = buscarPorNombre(nombre, apellido);
}
req.getServletContext().setAttribute("profesores", profesores);
RequestDispatcher reqDisp= req.getRequestDispatcher("profesor-consulta.jsp");
reqDisp.forward(req,resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
List<Profesor > nombre = listarProfesor();
List<Profesor > apellido = listarProfesor();
req.getServletContext().setAttribute("nombre", nombre);
req.getServletContext().setAttribute("apellido", apellido);
RequestDispatcher reqDisp= req.getRequestDispatcher("profesor-consulta.jsp");
reqDisp.forward(req,resp);
}
}
......@@ -30,35 +30,54 @@ public class ProfesorDao {
return status;
}
public static List<Profesor> listar(){
public static List<Profesor> listarProfesor(){
ArrayList<Profesor> list = new ArrayList<>();
String sql = "select * from profesor";
try{
Connection con= DataBase.getConnection();
PreparedStatement ps=con.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
while(rs.next()){
Profesor profe = new Profesor();
profe.setId(rs.getInt("id"));
profe.setNombre(rs.getString("nombre"));
profe.setApellido(rs.getString("apellido"));
profe.setNro_cedula(rs.getInt("nro_cedula"));
profe.setCorreo(rs.getString("correo"));
list.add(profe);
Profesor profesorObject = new Profesor();
profesorObject.setNombre(rs.getString("nombre"));
profesorObject.setApellido(rs.getString("apellido"));
profesorObject.setNro_cedula(rs.getInt("nro_cedula"));
profesorObject.setCorreo(rs.getString("correo"));
list.add(profesorObject);
}
con.close();
} catch (SQLException e) {
throw new RuntimeException(e);
}
return list;
}
public static List<Profesor> buscarPorNombre(String nombre, String apellido){
List<Profesor> profesores = new ArrayList<>();
Profesor profesorObject = new Profesor();
try{
Connection con= DataBase.getConnection();
PreparedStatement ps=con.prepareStatement("select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo from profesor a " +
" where a.nombre ilike ? and a.apellido ilike ? ");
ps.setString(1, "%" + nombre + "%");
ps.setString(2, "%" + apellido + "%");
System.out.println(nombre);
ResultSet rs = ps.executeQuery();
while(rs.next()){
profesorObject.setNombre(rs.getString("nombre"));
profesorObject.setApellido(rs.getString("apellido"));
profesorObject.setNro_cedula(rs.getInt("nro_cedula"));
profesorObject.setCorreo(rs.getString("correo"));
profesores.add(profesorObject);
}
con.close();
}catch(Exception ex){
ex.printStackTrace();
}
return profesores;
}
public static int delete(int id){
int status=0;
try{
......@@ -72,25 +91,4 @@ public class ProfesorDao {
return status;
}
public static Profesor getProfesorById(int id){
Profesor p=new Profesor();
try{
Connection con=DataBase.getConnection();
PreparedStatement ps=con.prepareStatement("select * from profesor where id=?");
ps.setInt(1,id);
ResultSet rs=ps.executeQuery();
if(rs.next()){
p.setId(rs.getInt("id"));
p.setNombre(rs.getString("nombre"));
p.setApellido(rs.getString("apellido"));
p.setNro_cedula(rs.getInt("nro_cedula"));
p.setCorreo(rs.getString("correo"));
}
con.close();
}catch(Exception ex){ex.printStackTrace();}
return p;
}
}
}
\ No newline at end of file
......@@ -137,4 +137,4 @@ width:500px;
.closebtn:hover {
color: black;
}
}
\ No newline at end of file
......@@ -2,8 +2,6 @@
pageEncoding="UTF-8"%>
<%@ page import="java.sql.*,java.sql.Connection,java.sql.ResultSet,com.roshka.proyectofinal.DataBase,jakarta.servlet.http.HttpServlet,jakarta.servlet.http.HttpServletRequest"%>
<!DOCTYPE html>
<html>
<head>
<link href="estilos/form.css" rel="stylesheet" type="text/css" />
......@@ -17,7 +15,6 @@ pageEncoding="UTF-8"%>
<script src="Javascript.js"></script>
<link rel="stylesheet" media="(max-width: 800px)" href="example.css" />
<title>Formulario Postulante</title>
</head>
<body>
......@@ -43,10 +40,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>
......@@ -102,9 +98,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() {
......
<%@ 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, java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<!-- coneccion con el de css -->
<link rel="stylesheet" href="postulante.css">
<title>JSP Page</title>
</head>
<body>
<div class="container">
<h1>Crear Bootcamp</h1>
<h1> CREAR BOOTCAMP </h1>
<%@ 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> listLenguaje = lenDao.listar();
Iterator<Lenguaje> iter = listLenguaje.iterator();
LenguajeDao lenDao = new LenguajeDao();
List<Lenguaje> listLen = lenDao.listar();
Iterator<Lenguaje> iter = listLen.iterator();
Lenguaje len = null;
ProfesorDao profeDao = new ProfesorDao();
......@@ -26,12 +28,23 @@
Iterator<Profesor> iterProfe = listProfesor.iterator();
Profesor profe = null;
%>
<form action="" method="post">
<label for="lenguaje">Lenguajes:</label>
<select name="lenguaje" id="lenguaje">
<form action="SaveServletBootcamp" method="post">
<label for="titulo">titulo:</label>
<input type="text" name="titulo" id="titulo">
<label for="descripcion">descripcion:</label>
<input type="text" name="descripcion" id="descripcion">
<label for="fecha_inicio">fecha de inicio:</label>
<input type="text" name="fecha_inicio" id="fecha_inicio">
<label for="fecha_fin">fecha de fin:</label>
<input type="text" name="fecha_fin" id="fecha_fin">
<label for="activo">Activo:</label>
<input type="checkbox" name="activo" id="activo">
<label for="imagen">Imagen:</label>
<input type="text" name="imagen" id="imagen">
<label for="id_lenguaje">Lenguajes:</label>
<select name="id_lenguaje" id="id_lenguaje">
<% while(iter.hasNext()){
len = iter.next();
%>
<option value=<%= len.getId() %> >
<%= len.getNombre_lenguaje() %>
......@@ -39,8 +52,8 @@
<% } %>
</select>
<label for="lenguaje">Profesores:</label>
<select name="lenguaje" id="lenguaje">
<label for="id_profesor">Profesores:</label>
<select name="id_profesor" id="id_profesor">
<% while(iterProfe.hasNext()){
profe = iterProfe.next();
......@@ -48,10 +61,13 @@
<option value=<%= profe.getId() %> >
<%= profe.getNombre() + " " + profe.getApellido() %>
</option>
<% } %>
<% } %>
</select>
</form>
<button type="submit">
Crear Bootcamp
</button>
</form>
</div>
......@@ -87,9 +103,9 @@
<th> <%= boot.getNombre_lenguaje() %> </th>
<th> <%= boot.getNombre_profesor() + " " + boot.getApellido_profesor() %> </th>
<th> <%= boot.getActivo() %> </th>
<th> <form action="/bootcamp/EditServlet">
<th> <form action="EditServletBootcamp" method="get">
<input type="hidden" name="id" value=<%= boot.getId() %>>
<input type="submit" value="Editar" > </input>
<input type="submit" value="Editar" ></input>
</form>
</th>
<th>
......@@ -104,6 +120,64 @@
</table>
</form>
</div>
</body>
<%
LenguajeDao lenDao2 = new LenguajeDao();
List<Lenguaje> listLenguaje2 = lenDao2.listar();
Iterator<Lenguaje> iter2 = listLenguaje2.iterator();
Lenguaje len2 = null;
ProfesorDao profeDao2 = new ProfesorDao();
List<Profesor> listProfesor2 = profeDao2.listar();
Iterator<Profesor> iterProfe2 = listProfesor2.iterator();
Profesor profe2 = null;
Bootcamp bootcampToEdit = (Bootcamp)request.getAttribute("Bootcamp");
if(bootcampToEdit != null){
%>
<form method="post" action="EditServletBootcamp">
<label for="titulo2">titulo:</label>
<input type="text" id="titulo2" name="titulo2" value="<%= bootcampToEdit.getTitulo() %>">
<label for="descripcion2">descripcion:</label>
<input type="text" id="descripcion2" name="descripcion2" value="<%= bootcampToEdit.getDescripcion() %>">
<label for="fecha_inicio2">fecha de inicio:</label>
<input type="text" id="fecha_inicio2" name="fecha_inicio2" value="<%= bootcampToEdit.getFecha_inicio() %>">
<label for="fecha_fin2">fecha de fin:</label>
<input type="text" id="fecha_fin2" name="fecha_fin2" value="<%= bootcampToEdit.getFecha_fin() %>">
<label for="activo2">Activo:</label>
<input type="checkbox" id="activo2" name="activo2">
<label for="imagen2">Imagen:</label>
<input type="text" name="imagen2" id="imagen2" value=<%= bootcampToEdit.getImagen() %>>
<input type="hidden" value=<%= bootcampToEdit.getId() %> name="id" id="id" />
<label for="id_lenguaje2">Lenguajes:</label>
<select name="id_lenguaje2" id="id_lenguaje2">
<% while(iter2.hasNext()){
len2 = iter2.next();
%>
<option value=<%= len2.getId() %> >
<%= len2.getNombre_lenguaje() %>
</option>
<% } %>
</select>
<label for="id_profesor2">Profesores:</label>
<select id="id_profesor2" name="id_profesor2">
<% while(iterProfe2.hasNext()){
profe2 = iterProfe2.next();
%>
<option value=<%= profe2.getId() %> >
<%= profe2.getNombre() + " " + profe2.getApellido() %>
</option>
<% } %>
</select>
<button type="submit">
Editar Bootcamp
</button>
</form>
<% } %>
</body>
</html>
\ No newline at end of file
......@@ -6,12 +6,13 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="postulante.css">
<title>JSP Page</title>
</head>
<body>
<div>
<h1>Crear Lenguaje</h1>
<h1> CREAR LENGUAJE </h1>
<%@ page import="com.roshka.proyectofinal.entity.Lenguaje, com.roshka.proyectofinal.lenguaje.LenguajeDao, java.util.List,java.util.Iterator" %>
......@@ -37,6 +38,7 @@
Crear Lenguaje
</button>
</form>
<br>
<table>
<thead>
......@@ -53,14 +55,14 @@
%>
<th> <%= lenguaje.getNombre_lenguaje() %> </th>
<th> <form action="EditServlet" method="get">
<th> <form action="EditServletLenguaje" method="get">
<input type="hidden" name="id" value=<%= lenguaje.getId() %>>
<input type="submit" value="Editar" > </input>
</form>
</th>
<th>
<form action="DeleteServletLenguaje" method="get">
<input type="hidden" name="id" value= <%= lenguaje.getId() %> >
<input type="hidden" name="id" value= <%= lenguaje.getId() %> name="id" id="id" >
<input type="submit" value="Borrar" > </input>
</form>
</th>
......@@ -70,6 +72,19 @@
</table>
</form>
</div>
<%
Lenguaje lenguajeToEdit = (Lenguaje)request.getAttribute("Lenguaje");
if(lenguajeToEdit != null){
%>
<form method="post" action="EditServletLenguaje">
<input type="hidden" value="<%= lenguajeToEdit.getId() %>" name="id" id="id" />
<label for="nombre_lenguaje">Lenguaje:</label>
<input type="text" name="nombre_lenguaje" value="<%= lenguajeToEdit.getNombre_lenguaje() %>">
<button type="submit">Editar Lenguaje </button>
</form>
<% } %>
</body>
</html>
\ No newline at end of file
......@@ -6,12 +6,14 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="postulante.css">
<title>JSP Page</title>
</head>
<body>
<div>
<h1>Crear Profesor</h1>
<h1> CREAR PROFESOR Y FILTRAR </h1>
<%@ page import="com.roshka.proyectofinal.entity.Profesor, com.roshka.proyectofinal.profesor.ProfesorDao, java.util.List,java.util.Iterator" %>
......@@ -20,7 +22,7 @@
<div>
<%
ProfesorDao profeDao = new ProfesorDao();
List<Profesor> listProfe = profeDao.listar();
List<Profesor> listProfe = profeDao.listarProfesor();
Iterator<Profesor> iterProfe = listProfe.iterator();
Profesor profesor = null;
%>
......@@ -50,6 +52,15 @@
Crear Profesor
</button>
</form>
<br>
<form action="filtros-profesor">
<input name="nombreBuscar">
<input name="apellidoBuscar">
<button type="submit">
Filtrar
</button>
</form>
<br>
<table>
<thead>
......@@ -72,9 +83,9 @@
<th> <%= profesor.getNro_cedula() %> </th>
<th> <%= profesor.getCorreo() %> </th>
<th> <form action="EditServlet" method="get">
<th> <form action="EditServletProfesor" method="get">
<input type="hidden" name="id" value=<%= profesor.getId() %>>
<input type="submit" value="Editar" > </input>
<input type="submit" value="Editar"> </input>
</form>
</th>
<th>
......@@ -89,6 +100,25 @@
</table>
</form>
</div>
<%
Profesor profesorToEdit = (Profesor)request.getAttribute("Profesor");
if(profesorToEdit != null){
%>
<form method="post" action="EditServletProfesor">
<input type="hidden" value="<%= profesorToEdit.getId() %>" name="id" id="id" />
<label for="nombre">Nombre:</label>
<input type="text" name="nombre" value="<%= profesorToEdit.getNombre() %>" />
<label for="apellido">Apellido:</label>
<input type="text" name="apellido" value="<%= profesorToEdit.getApellido() %>"></input>
<label for="correo">Correo:</label>
<input type="text" name="correo" value="<%= profesorToEdit.getCorreo() %>"></input>
<label for="nro_cedula">Numero de Cedula:</label>
<input type="number" name="nro_cedula" value="<%= profesorToEdit.getNro_cedula() %>"></input>
<button type="submit">Editar Profesor </button>
</form>
<% } %>
</body>
</html>
\ No newline at end of file
......@@ -26,8 +26,8 @@
<ul>
<li class="link-menu"><a href="">Home</a></li>
<li class="link-menu"><a href="bootcamp.jsp">Postulate</a></li>
<<<<<<< HEAD
<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="login.jsp">Login</a>
......@@ -36,6 +36,8 @@
<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>
=======
>>>>>>> d3a6ea52ee1614cfbff576707fd6717fb6a81036
</li>
</ul>
......
<!DOCTYPE html>
<html>
<head>
<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);
}
</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="column content">
<h1>PUEDE ACCEDER A LOS SIGUIENTES LINKS:</h1>
</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>
</ul>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -10,10 +10,11 @@
<link rel="shortcut icon" href="imagenes/roshkaicon.ico" sizes="any" />
<!-- coneccion con el de css -->
<link rel="stylesheet" href="postulante.css">
<title>Postulantes Manage</title>
<title> POSTULANTE MANAGE </title>
</head>
<body>
<<<<<<< HEAD
<div class="logo">
<a href="./index.html"> <img class="logoi" src="imagenes/logo-roshka.svg" alt="" /> </a>
<!-- logo con link -->
......@@ -47,6 +48,14 @@
</div>
=======
<div>
<h1>LISTA POSTULANTES</h1>
<form action="filtros-postulante" >
<input type="search" name="nombreBuscar"
placeholder="Buscar por nombre">
<button type="submit">Buscar</button>
>>>>>>> d3a6ea52ee1614cfbff576707fd6717fb6a81036
</form>
<table>
......@@ -67,7 +76,14 @@
Bootcamps
</th>
<th>
<<<<<<< HEAD
Aceptados
=======
<form action="filtros-posjtulante" method="post">
<input type="hidden" name="nombre" value="aceptado">
<button type="submit">Aceptado</button>
</form>
>>>>>>> d3a6ea52ee1614cfbff576707fd6717fb6a81036
</th>
</tr>
......@@ -115,14 +131,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>
......
<<<<<<< HEAD
body{
background-image: url(imagenes/descarga.svg);
......@@ -80,3 +81,15 @@ th { border: 1px solid black; height: 30px;
}
button:hover{
color: yellow;}
=======
@import 'https://fonts.googleapis.com/css?family=Open+Sans|Quicksand:400,700';
body{
background-image: url(imagenes/descarga.svg);
height: 100%;
font-family: 'Quicksand', sans-serif;
color: white;
webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
h1{ font-size: 40px
>>>>>>> d3a6ea52ee1614cfbff576707fd6717fb6a81036
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<!-- el icono para la pagina -->
<link rel="shortcut icon" href="imagenes/roshkaicon.ico" sizes="any" />
<!-- coneccion con el de css -->
<link rel="stylesheet" href="postulante.css">
<title> Profesor MANAGE </title>
</head>
<body>
<div>
<h1>LISTA PROFESORES</h1>
<form action="filtros-profesor" >
<input type="search" name="nombreBuscar"
placeholder="Buscar por nombre">
<input type="search" name="apellidoBuscar"
placeholder="Buscar por apellido">
<button type="submit">Buscar</button>
</form>
<table>
<tr>
<th>#</th>
<th>Nombre</th>
<th>Apellido</th>
<th>Numero de Cedula</th>
<th>Correo</th>
<th>Editar</th>
<th>Eliminar</th>
</tr>
<tbody>
<c:forEach var="profesor" items="${profesores}" varStatus="myIndex">
<tr>
<td> ${myIndex.index + 1}-</td>
<td> ${profesor.nombre}</td>
<td> ${profesor.apellido}</td>
<td> ${profesor.nro_cedula}</td>
<td> ${profesor.correo}</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</body>
</html>
\ 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