main.jsp 4.33 KB
Newer Older
Cesar Giulano Gonzalez Maqueda committed
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
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
    <head>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
        <c:set var="valores" scope="session" value="${{1, 2, 3, 4, 5, 6}}"/>
    </head>
    <body>
        <div class="container">
            <div class="row mt-3"><h2>Films</h2></div>
            <div class="row">
                <form action="/findByDates" method="GET">
                    <label for="start">Desde: </label>
                    <input type="date" id="start" name="desde"
                           value="2018-07-22"
                           min="1900-01-01" max="2021-09-31">
                    <label for="end">Hasta: </label>
                    <input type="date" id="end" name="hasta"
                           value="2018-07-22"
                           min="1900-01-01" max="2021-09-31">
                    <input class="btn btn-dark" type="submit" name="action" value="buscar">
                </form>
            </div>
            <div class="row mt-3">
                <div class="col-md-6">
                    <h4>Films</h4>
                    <ul>
                        <c:forEach items="${films}" var="numero">
                            <li>${numero.title}
                                <a class="btn btn-primary" href="/films?id=${numero.id}">Actualizar</a>
                                <a class="btn btn-danger" href="/eliminar/${numero.id}/">Eliminar</a></li>
                            <hr/>
                        </c:forEach>
                    </ul>
                </div>
                <div class="col-md-6">
                    <form:form method="POST" action="addFilm" modelAttribute="film">
                        <form:input type="hidden" name="id" path="id"/>
                        <div class="form-group">
                            <form:label path="title">Titulo</form:label>
                            <form:input class="form-control" type="text" path="title"/>
                        </div>

                        <div class="form-group">
                            <form:label path="description">Descripcion</form:label>
                            <form:input class="form-control" type="text" path="description"/>
                        </div>

                        <div class="form-group">
                            <form:label path="releaseYear">Anho de Lanzamiento</form:label>
                            <form:input class="form-control" type="number" path="releaseYear"/>
                        </div>


                        <div class="form-group">
                            <form:label path="duration">Duracion</form:label>
                            <form:input class="form-control" type="number" path="duration"/>
                        </div>


                        <div class="form-group">
                            <div class="mb-2">
                                Lenguaje: ${lenguaje}
                            </div>
                            <form:label path="language">Nuevo Lenguaje: </form:label>
                            <form:select path="language">
                                <option value="1">English</option>
                                <option value="2">Italian</option>
                                <option value="3">Japanese</option>
                                <option value="4">Mandarin</option>
                                <option value="5">French</option>
                                <option value="6">German</option>
                            </form:select>
                        </div>
                        <ul>
                            <c:forEach items="${actors}" var="numero">
                                <li>${numero.first_name}
                            </c:forEach>
                        </ul>
                        <input class="btn btn-dark" type="submit" name="action" value="create">
                        <input class="btn btn-dark" type="submit" name="action" value="update">
                    </form:form>
                </div>
            </div>
        </div>
    </body>
</html>