aboutsummaryrefslogtreecommitdiff
path: root/src/main/webapp/pages/history.jsp
blob: 7e36faf167b879e6d51f98ec3b75ea9d43451fa4 (plain) (blame)
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
<%@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>