formulario_profesor.jsp 3.05 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 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
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <!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" />
        <title>JSP Page</title>
    </head>

    <body>
        <div>
            <h1>Crear Profesor</h1>

            <%@ page import="com.roshka.proyectofinal.entity.Profesor, com.roshka.proyectofinal.profesor.ProfesorDao, java.util.List,java.util.Iterator" %>

        </div>

        <div>
            <%
                ProfesorDao profeDao = new ProfesorDao();
                List<Profesor> listProfe = profeDao.listar();
                Iterator<Profesor> iterProfe =  listProfe.iterator();
                Profesor profesor = null;
            %>

            <form method="post" action="SaveServletProfesor">
                <label for="nombre">
                    Nombre:
                </label>
                <input name="nombre"></input>

                <label for="apellido">
                    Apellido:
                </label>
                <input name="apellido"></input>

                <label for="correo">
                    Correo:
                </label>
                <input name="correo"></input>

                <label for="nro_cedula">
                    Numero de Cedula:
                </label>
                <input name="nro_cedula"></input>

                <button type="submit">
                    Crear Profesor
                </button>
            </form>

            <table>
              <thead>
                <tr>
                  <th>Nombre</th>
                  <th>Apellido</th>
                  <th>Numero de Cedula</th>
                  <th>Correo</th>
                  <th>Editar</th>
                  <th>Eliminar</th>
                </tr>
              </thead>
              <tbody>
                <% while(iterProfe.hasNext()){
                    profesor = iterProfe.next();

                %>
                    <th> <%= profesor.getNombre() %> </th>
                    <th> <%= profesor.getApellido() %> </th>
                    <th> <%= profesor.getNro_cedula() %> </th>
                    <th> <%= profesor.getCorreo() %> </th>

                    <th>  <form action="EditServlet" method="get">
                            <input type="hidden" name="id" value=<%= profesor.getId() %>>
                            <input type="submit" value="Editar" > </input>
                          </form>
                    </th>
                    <th>
                        <form action="DeleteServletProfesor" method="get">
                            <input type="hidden" name="id" value= <%= profesor.getId() %> >
                            <input type="submit" value="Borrar" ></input>
                        </form>
                    </th>
                    </tr>
                    <% } %>
              </tbody>
            </table>
                    </form>
        </div>
    </body>

    </html>