<%@page import="java.util.Iterator"%>
<%@page import="retro.Meeting"%>
<%@page import="java.util.List"%>
<%@page import="fonctions.MeetingDAO"%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!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>access-page</title>
</head>
<body>
<%@include file="../pages/header.jsp" %>     

<div style="margin: 5%;">
<%String id = request.getParameter("id_member"); %>
<h2 style="padding-top: 1em;>Access</h2>
<h3>Please find the Retro which you were invited:</h3>

<h4">Last Retro : </h4>
<div style="padding: 5%"> 

<%
			MeetingDAO obj_ReadValues1 = new MeetingDAO();
			List<Meeting> list1 = obj_ReadValues1.get_MeetingMAXByIDmember(request.getParameter("id_member"));
			Iterator<Meeting> 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>Sprint Title</th>
				<th>Date</th>
				<th>Is Validate ?</th>
				<%
					while (it_list1.hasNext()) {
						Meeting obj_Meeting1 = new Meeting();
						obj_Meeting1 = it_list1.next();
				%>
						<tr>
							<td style="text-transform: uppercase"><%=obj_Meeting1.getLibelle_sprint()%></td>
							<td><%=obj_Meeting1.getDate_meeting()%></td>
							<%
								if (obj_Meeting1.getIs_done()==0)
								{
							%>
							<td><span class="label label-danger">Non</span>
							<%
							} else if (obj_Meeting1.getIs_done()==1)
								{
							%>
							<td><span class="label label-success">Oui</span>
							<%} %>							
							<%
								if (obj_Meeting1.getIs_done()==0)
								{
							%>
							<td><a href="access-meeting.jsp?id_meeting=<%=obj_Meeting1.getId_meeting()%>&id_member=<%=id%>">Go</a></td>					
							<%
								} else if (obj_Meeting1.getIs_done()==1)
								{
							%>
							<td><a href="../display-ideas.jsp?id_meeting=<%=obj_Meeting1.getId_meeting()%>">Display</a></td>
								<%} %>						
						</tr>
				<%
					}
				%>
			</table>
</div>



<h4>Historical : </h4>
<div style="padding: 5%"> 

		<%
			MeetingDAO obj_ReadValues = new MeetingDAO();
			List<Meeting> list2 = obj_ReadValues.get_MeetingByIDmember(request.getParameter("id_member"));
			Iterator<Meeting> it_list2 = list2.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>ID</th> -->
				<th>Sprint Title</th>
				<th>Date</th>
				<th>Is Validate ?</th>
				
				<%
					while (it_list2.hasNext()) {
						Meeting obj_Meeting = new Meeting();
						obj_Meeting = it_list2.next();
				%>

					<tr>
<%-- 							<td><%=obj_Meeting.getId_meeting() %></td> --%>
							<td style="text-transform: uppercase"><%=obj_Meeting.getLibelle_sprint()%></td>
							<td><%= obj_Meeting.getDate_meeting() %></td>
<%
								if (obj_Meeting.getIs_done() == 0)
								{
							%>
							<td><span class="label label-danger">No</span>
							<%
							} else if (obj_Meeting.getIs_done()==1)
								{
							%>
							<td><span class="label label-success">Yes</span>
							<%} %>							<%
								if (obj_Meeting.getIs_done() == 0)
								{
							%>
							<td><a href="access-meeting.jsp?id_meeting=<%=obj_Meeting.getId_meeting()%>&id_member=<%=id%>">Go</a></td>					
							<%
								} else if (obj_Meeting.getIs_done()==1)
								{
							%>
							<td><a href="../display-ideas.jsp?id_meeting=<%=obj_Meeting.getId_meeting()%>">Display</a></td>
								<%} %>
								
					</tr>
				<%
					}
				%>
			</table>
			
</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>