diff options
Diffstat (limited to 'src/main/webapp')
-rw-r--r-- | src/main/webapp/pages/history.jsp | 34 | ||||
-rw-r--r-- | src/main/webapp/pages/userIndex.jsp | 5 |
2 files changed, 39 insertions, 0 deletions
diff --git a/src/main/webapp/pages/history.jsp b/src/main/webapp/pages/history.jsp new file mode 100644 index 0000000..7e36faf --- /dev/null +++ b/src/main/webapp/pages/history.jsp @@ -0,0 +1,34 @@ +<%@page import="java.util.ArrayList"%> +<%@page import="pokemon.IService"%> +<%@page import="models.History"%> +<%@page import="models.CONSTS"%> +<%@page import="java.rmi.Naming"%> +<%@ 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 charset="ISO-8859-1"> +</head> +<body> +<% + long userId=(long)session.getAttribute("id"); + IService service=(IService)Naming.lookup(CONSTS.rmiUrl); + ArrayList<History> history=service.getUserHistory(userId); + request.setAttribute("history", history); + + +%> +<table> +<c:forEach items="${history}" var="item"> + <tr bgcolor="${item.result eq 1 ? 'LawnGreen': 'IndianRed'}"> + <td><c:out value="${item.pokemon.name}"/></td> + <td><img style="height: 50px" src="data:image/*;base64, ${item.pokemon.base64Image}" /></td> + <td><c:out value="${item.time}"/></td> + <td><c:out value="${item.result eq 1 ? 'Victory': 'Defeat'}"/></td> + </tr> + </c:forEach> +</table> +</body> +</html>
\ No newline at end of file diff --git a/src/main/webapp/pages/userIndex.jsp b/src/main/webapp/pages/userIndex.jsp index b06d966..57e4a16 100644 --- a/src/main/webapp/pages/userIndex.jsp +++ b/src/main/webapp/pages/userIndex.jsp @@ -89,5 +89,10 @@ Trenutno izabran pokemon: </c:forEach> </table> +<br><br><br> +<h1>Istorija</h1> +<jsp:include page="history.jsp"/> + + </body> </html>
\ No newline at end of file |