aboutsummaryrefslogtreecommitdiff
path: root/src/main/webapp
diff options
context:
space:
mode:
authorcirakg <ciraboxkg@gmail.com>2023-01-02 17:00:24 +0100
committercirakg <ciraboxkg@gmail.com>2023-01-02 17:00:24 +0100
commitcd694d64cf1a9be635df6b15168a5950644e5ce2 (patch)
tree11350c2857b71617c6a2de1e9adf95c4777c9c42 /src/main/webapp
parentfc569fa42d3dd1f8709103c7dae7e995597072ca (diff)
Omogucen prikaz istorije korisnika.
Diffstat (limited to 'src/main/webapp')
-rw-r--r--src/main/webapp/pages/history.jsp34
-rw-r--r--src/main/webapp/pages/userIndex.jsp5
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