formulario_bootcamp.jsp 5.88 KB
Newer Older
Jose Baez committed
1 2
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
3 4 5
    <!DOCTYPE html>
    <html>

6 7
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8
        <link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
9 10
        <title>JSP Page</title>
    </head>
11

12 13 14 15
    <body>
        <div class="container">
            <h1>Crear Bootcamp</h1>

16
            <%@ 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" %>
17

18
                <%
19 20 21
             LenguajeDao lenDao = new LenguajeDao();
             List<Lenguaje> listLenguaje = lenDao.listar();
             Iterator<Lenguaje> iter =  listLenguaje.iterator();
22
<<<<<<< HEAD
23
             Lenguaje len = null;
24

25 26 27 28
             ProfesorDao profeDao = new ProfesorDao();
             List<Profesor> listProfesor = profeDao.listar();
             Iterator<Profesor> iterProfe =  listProfesor.iterator();
             Profesor profe = null;
29
=======
30
                         Lenguaje len = null;
31
>>>>>>> develop
32
             %>
33 34 35
                    <form action="" method="post">
                        <label for="lenguaje">Lenguajes:</label>
                        <select name="lenguaje" id="lenguaje">
36 37 38 39 40
                    <% while(iter.hasNext()){
                        len = iter.next();

                    %>
                        <option value=<%= len.getId() %> >
41 42 43 44
                            <%= len.getNombre_lenguaje() %>
                        </option>
                        <% } %>
                    </select>
45
<<<<<<< HEAD
46 47 48 49 50 51 52 53 54 55 56 57

                    <label for="lenguaje">Profesores:</label>
                    <select name="lenguaje" id="lenguaje">
                    <% while(iterProfe.hasNext()){
                        profe = iterProfe.next();

                    %>
                        <option value=<%= profe.getId() %> >
                            <%= profe.getNombre() + " " + profe.getApellido() %>
                        </option>
                        <% } %>
                    </select>
58
                </form>
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
            <%=
                                Bootcamp editBootcampList = (Bootcamp)request.getAttribute("id");
                                if (editBootcampList) {

                                <form action="" method="post">
                                        <label for="titulo">titulo:</label>
                                        <input type="text" name="titulo" id="titulo" value=<%= editBootcampList.getTitulo() %>>
                                        <label for="descripcion">descripcion:</label>
                                        <input type="text" name="descripcion" id="descripcion" value=<%= editBootcampList.getDescripcion() %>>
                                        <label for="fecha_inicio">fecha de inicio:</label>
                                        <input type="text" name="fecha_inicio" id="fecha_inicio" value=<%= editBootcampList.getFecha_inicio() %>>
                                        <label for="fecha_fin">fecha de fin:</label>
                                        <input type="text" name="fecha_fin" id="fecha_fin" value=<%= editBootcampList.getFecha_inicio() %>>
                                        <label for="profesor"> profesor: </label>
                                        <input type="text" name="profesor" id="profesor" value=<%= editBootcampList.getNombre_profesor() %>>
                                        <label for="lenguaje"> lenguaje </label>
                                        <input type="text" name="lenguaje" id="lenguaje">
                                    </form>
                                }%>

        </div>

        <div>
            <%
                BootcampDao bootDao = new BootcampDao();
                List<Bootcamp> listBoot = bootDao.listar();
                Iterator<Bootcamp> iterBoot =  listBoot.iterator();
                Bootcamp boot = null;
            %>
            <table>
              <thead>
                <tr>
                  <th>Titulo</th>
                  <th>Descripcion</th>
                  <th>fecha de Inicio</th>
                  <th>Fecha de Fin</th>
                  <th>Lenguaje</th>
                  <th>Profesor</th>
                  <th>Activo</th>
                </tr>
              </thead>
              <tbody>
                <% while(iterBoot.hasNext()){
                    boot = iterBoot.next();

                    %>
                    <tr>
                    <th> <%= boot.getTitulo() %> </th>
                    <th> <%= boot.getDescripcion() %> </th>
                    <th> <%= boot.getFecha_inicio() %> </th>
                    <th> <%= boot.getFecha_fin() %> </th>
                    <th> <%= boot.getNombre_lenguaje() %> </th>
                    <th> <%= boot.getNombre_profesor() + " " + boot.getApellido_profesor() %> </th>
                    <th> <%= boot.getActivo() %> </th>
                    <th>  <form action="/bootcamp/EditServlet">
                            <input type="hidden" name="id" value=<%= boot.getId() %>>
                            <input type="submit" value="Editar" > </input>
                          </form>
                    </th>
                    <th>
                        <form action="DeleteServlet" method="get">
                            <input type="hidden" name="id" value= <%= boot.getId() %> >
                            <input type="submit" value="Borrar" > </input>
                        </form>
                    </th>
                    </tr>
                    <% } %>
              </tbody>
            </table>
128
=======
129
                    </form>
130
>>>>>>> develop
131 132
        </div>
    </body>
133 134

    </html>