<%@page import="org.mynonglam.entitys.Account"%>
<%@page import="org.mynonglam.dao.AdminDAO"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
function checkBlock(){
	if(confirm("Are you sure?")){
		return true;
	}
	else{
		return false;
	}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<%
	List<Account> listACC = AdminDAO.getListAcc();
%>
<body>
	<h1>Account Manager</h1>
	
	<div style="overflow: auto; width: 900px; height: 300px;">
		<table>
		<tr style="background: #639ECB; height: 35px; color: white;">
		<th style="border-right: 1px solid white ;">Email</th><th style="border-right: 1px solid white ;">fullname</th>
		<th style="border-right: 1px solid white ;">gender</th><th style="border-right: 1px solid white ;">dayofbirth</th><th style="border-right: 1px solid white ;">country</th><th style="border-right: 1px solid white ;">avatar</th>
		<th style="border-right: 1px solid white ;">coverphoto</th><th style="border-right: 1px solid white ;">isblock</th><th style="border-right: 1px solid white ;">orthername</th><th style="border-right: 1px solid white ;">slogan</th>
		<th>Status</th>
		</tr>
		<% for(int i= 0; i < listACC.size(); i++) {%>
		<tr style="background: #CDE4F6; border-bottom: 1px solid white ;  ">
		<td style="padding-top: 10px; border-right: 1px solid white ; width: 180px;"><%= listACC.get(i).getEmail() %></td><td style="border-right: 1px solid white ; width: 150px;"><%= listACC.get(i).getFullname() %></td>
		<%if(listACC.get(i).getGender() == true) {%>
			<td style="border-right: 1px solid white ; width: 70px;">male</td>
		<%}else {%>
		<td style="border-right: 1px solid white ; width: 70px;">female</td>
		<%} %>
		<td style="border-right: 1px solid white ; width: 90px;"><%= listACC.get(i).getDayofbirth() %></td>
		<td style="border-right: 1px solid white ;"><%= listACC.get(i).getCountry() %></td><td style="border-right: 1px solid white ;"><img alt="" src="<%= listACC.get(i).getAvatar() %>" width="50px"></td>
		<td style="border-right: 1px solid white ;"><img alt="" src="<%= listACC.get(i).getCoverphoto() %>" width="60px"> </td><td style="border-right: 1px solid white ;"><%= listACC.get(i).getIsblock() %></td>
		<td style="border-right: 1px solid white ;"><%= listACC.get(i).getOrthername() %></td><td style="border-right: 1px solid white ;"><%= listACC.get(i).getSlogan() %></td>
		<% if(listACC.get(i).getIsblock() == false) {%>
		<td><a href="updateisblock?id=<%=listACC.get(i).getEmail() %>&&status=<%=listACC.get(i).getIsblock()%>"><input  onclick="return checkBlock()" type="button" value="block"></a></td>
		<%}else {%>
		<td><a href="updateisblock?id=<%=listACC.get(i).getEmail() %>&&status=<%=listACC.get(i).getIsblock()%>"><input  onclick="return checkBlock()"  type="button" value="unblock"></a></td>
		<%} %>
		</tr>
		<%} %>
		</table>
	</div>
</body>
</html>