diff options
Diffstat (limited to 'src/main/webapp/pages/adminIndex.jsp')
-rw-r--r-- | src/main/webapp/pages/adminIndex.jsp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/main/webapp/pages/adminIndex.jsp b/src/main/webapp/pages/adminIndex.jsp index 1b0f4e7..25d021f 100644 --- a/src/main/webapp/pages/adminIndex.jsp +++ b/src/main/webapp/pages/adminIndex.jsp @@ -21,14 +21,26 @@ </style> </head> <body> +<% +boolean isAdmin=(Boolean)session.getAttribute("admin"); +if(!isAdmin){ + response.sendRedirect("../index.jsp"); +} +%> <a href="logout.jsp"> <button>Log out</button> +</a><br><br> +<a href="addNewPokemon.jsp"> + <button>DodajNovogPokemona</button> </a> + <h1>Lista korisnika</h1> <% IService service=(IService)Naming.lookup(CONSTS.rmiUrl); ArrayList<User>users=service.getAllUsers(); request.setAttribute("users", users); +ArrayList<Monster> monsters=service.getMonsters(); +request.setAttribute("monsters", monsters); %> @@ -95,6 +107,40 @@ request.setAttribute("users", users); </h1> +<h1>Svi pokemoni</h1> +<table> +<tr> +<th>Ime</th> +<th>Opis</th> +<th>Hp</th> +<th>Slika</th> +<th></th> +</tr> +<c:forEach items="${monsters}" var="item"> +<tr> + <td> + <c:out value="${item.name}"/> + </td> + <td> + <c:out value="${item.description}"/> + </td> + <td> + <c:out value="${item.hp}"/> + </td> + <td> + <img style="height: 50px" src="data:image/*;base64, ${item.base64Image }" /> + </td> + <td> + <a href="deletePokemon.jsp?monsterId=${item.id}"> + <button>Izbrisi</button> +</a> + </td> +</tr> +</c:forEach> + +</table> + + </body> |