<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@page import="fonctions.MemberDAO"%>
<%@page import="retro.Member"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>

<!DOCTYPE html>
<html>
<head>
    <link href="../bootstrap3/css/bootstrap.css" rel="stylesheet" />
    <link href="../assets/css/ct-paper.css" rel="stylesheet"/>
    <link href="../assets/css/demo.css" rel="stylesheet" /> 
    <link href="../assets/css/examples.css" rel="stylesheet" /> 
        
    <!--     Fonts and icons     -->
    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
    <link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
			<%@include file="../pages/header.jsp" %>     

<div style="margin:5%">

<h2 style="padding-top: 1em;">Add at meeting :</h2>
<h3>Available Members : </h3>
<div style="padding: 5%">
<%
			MemberDAO obj_ReadValues = new MemberDAO();
			List<Member> list = obj_ReadValues.get_MemberNOTInMeeting(request.getParameter("id_meeting"));
			Iterator<Member> it_list = list.iterator();
		%>

		<center>
			<table style="width: 100%; border-collapse: collapse;">

				<style>
th, td {
	padding: 3px;
	border: 1px solid #fff;
	text-align: center;
}

th {
	background: #999690;
	color: white;
	font-weight: bold;
}
</style>

				<th>Name</th>
				<th>First Name</th>

				<%
					while (it_list.hasNext()) {
						Member obj_Member = new Member();
						obj_Member = it_list.next();
				%>

						<tr>
							<td style="text-transform: uppercase"><%=obj_Member.getNom_member()%></td>
							<td><%=obj_Member.getPrenom_member()%></td>
							<td><a href="../controller/create/insert_member_at_meeting.jsp?id_meeting=<%=request.getParameter("id_meeting") %>&id_member=<%=obj_Member.getId_member()%>">Add</a></td>					
						</tr>

				<%
					}
				%>
			</table>
			</center>
</div>


			
<h3>Invited Members : </h3>
<div style="padding: 5%">


		<%
			MemberDAO obj_ReadValues1 = new MemberDAO();
			List<Member> list1 = obj_ReadValues1.get_MemberInMeeting(request.getParameter("id_meeting"));
			Iterator<Member> it_list1 = list1.iterator();
		%>

		<center>
			<table style="width: 100%; border-collapse: collapse;">

				<style>
th, td {
	padding: 3px;
	border: 1px solid #fff;
	text-align: center;
}

th {
	background: #999690;
	color: white;
	font-weight: bold;
}
</style>

				<th>Name</th>
				<th>First Name</th>

				<%
					while (it_list1.hasNext()) {
						Member obj_Member1 = new Member();
						obj_Member1 = it_list1.next();
				%>

						<tr>
							<td style="text-transform: uppercase"><%=obj_Member1.getNom_member()%></td>
							<td><%=obj_Member1.getPrenom_member()%></td>
							<td><a href="../controller/create/delete_member_at_meeting.jsp?id_member=<%=obj_Member1.getId_member()%>&id_meeting=<%=request.getParameter("id_meeting")%>">Delete</a></td>
						</tr>

				<%
					}
				%>
			</table>
			<br>
			<br>
			<a href="list-meeting-admin.jsp"><button class="btn btn-info">DONE</button></a>
			
			</center>
</div>

			
</div>
			<%@include file="footer.jsp" %>     

</body>
<script src="../assets/js/jquery-1.10.2.js" type="text/javascript"></script>
	<script src="../assets/js/jquery-ui-1.10.4.custom.min.js" type="text/javascript"></script>

	<script src="../bootstrap3/js/bootstrap.js" type="text/javascript"></script>

	<!--  Plugins -->
	<script src="../assets/js/ct-paper-checkbox.js"></script>
	<script src="../assets/js/ct-paper-radio.js"></script>
	<script src="../assets/js/bootstrap-select.js"></script>
	<script src="../assets/js/bootstrap-datepicker.js"></script>

	<script src="../assets/js/ct-paper.js"></script>
</html>