WebHostal/war/WEB-INF/View/Users/view.jsp

61 lines
1.6 KiB
Plaintext
Raw Normal View History

2018-06-15 02:24:08 +00:00
<%@ page import="model.User" %>
<%@ page import="model.Role" %>
<%--
Created by IntelliJ IDEA.
User: Fernando
Date: 07/06/2018
Time: 16:39
To change this template use File | Settings | File Templates.
--%>
2018-06-15 02:24:08 +00:00
<% User user = (User) request.getAttribute("User");
boolean editAllowed = (Boolean) request.getAttribute("editAllowed");
String action = (String) request.getAttribute("action");%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
2018-06-15 02:24:08 +00:00
<title><%=action%> a User</title>
</head>
<body>
2018-06-15 02:24:08 +00:00
Datos del usuario:<br />
<br />
<% if (editAllowed) {%>
<form action="./add" method="post">
<input name="userID" value="<%=user.getId()%>" type="hidden">
<input name="action" value="update" type="hidden">
Nombre:<br />
<input name="userName" value="<%=user.getName()%>" placeholder="Nombre" required><br/>
<br/>
Email:<br />
<input name="userEmail" value="<%=user.getEmail()%>" placeholder="Email" type="email" required><br />
<br />
Imagen de perfil<br />
<input name="userImg" value="<%=user.getImgUrl()%>" placeholder="Link de la imagen" required><br />
<br />
Rol<br />
<input name="userRole" value="<%=user.getRole()%>" placeholder="Rol" required><br />
<br />
<input type="submit"><br />
</form>
<% } else {%>
<img src="<%=user.getImgUrl()%>"><br />
<br />
Nombre: <%=user.getName()%><br />
Email: <%=user.getEmail()%><br />
Rol: <%= user.getRole()%><br />
<% } %>
Eso es todo :c
</body>
</html>