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

<%@ 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>Insert title here</title>
</head>
<body>
<%@include file="../pages/header.jsp" %>     

<div style="margin: 5%">

<% String id_moderator = request.getParameter("id_moderator"); %>
<h2 style="padding-top: 1em;">Add a retro</h2>
<h3>
	Insert sprint
</h3>

<form method="post" action="../controller/create/insert_sprint_controller.jsp?id_moderator=<%=id_moderator%>">
		<p>
			<label style="width: 300px; display: block; float: left;">Sprint Title
				:</label><input type="text" name="libelle_sprint" class="form-control" style="width: 30%" required>
		</p>
<input class="btn btn-success" type="submit" value="Add">
		
</form>

<h3>
	Last insert sprint
</h3>

<div style="padding: 5%">
		<%
			MeetingDAO obj_ReadValues1 = new MeetingDAO();
			List<Meeting> list1 = obj_ReadValues1.get_LastMeeting();
			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>ID</th>
				<th>Libelle</th>
				<th>Date</th>
				
				
				<%
					while (it_list1.hasNext()) {
						Meeting obj_Meeting = new Meeting();
						obj_Meeting = it_list1.next();
				%>

						<tr>
							<td><%=obj_Meeting.getId_meeting()%></td>
							<td><%=obj_Meeting.getLibelle_sprint()%></td>
							<td><%=obj_Meeting.getDate_meeting()%></td>
							<td><a href="add-at-meeting.jsp?id_meeting=<%=obj_Meeting.getId_meeting()%>&id_moderator=<%=request.getParameter("id_moderator")%>">Access</a></td>
						</tr>

				<%
					}
				%>
			</table>
			</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>