<%@page import="java.util.Iterator"%>
<%@page import="retro.Idea"%>
<%@page import="java.util.List"%>
<%@page import="fonctions.IdeaDAO"%>
<%@page import="retro.Member" %>
<%@page import="fonctions.MemberDAO" %>


<%@ 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" />

    <!--     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'>
<%
String id_member2 = request.getParameter("id_member");
String id_meeting2 = request.getParameter("id_meeting");
%>
<meta charset="ISO-8859-1">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/                            
libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
var auto_refresh = setInterval(
		function()
			{
				$("#block").load(location.href + " #block>*", "");
			}, 3000);  
			
</script>

<title>Insert title here</title>
</head>
<body>

<div style="margin: 5%;">
<h2>Summary : </h2>
<div id="summary" style="padding: 5%;">			
			<style>
			#block 
			{
  						display: grid;
  						grid-template-columns: repeat(2, 1fr);
  						grid-gap: 10px;
  						grid-auto-rows: minmax(100px, auto);
			}
			
			.one {
			  grid-column: 1;
			  grid-row: 1;
 			  background-color: #DAF1FF; 
			}
			.two {
			  grid-column: 2;
			  grid-row: 1;
     		  background-color: #BDCDD8; 
			}
			.three {
			  grid-column: 1;
			  grid-row: 2;
 			  background-color: #AFDBF9; 
			}
			.four {
			  grid-column: 2;
			  grid-row: 2;
 			  background-color: #75C7FF; 
			}
			</style>
			
			<div id="block">
  				<div class="one">
  				<%
					IdeaDAO obj_ReadValues5 = new IdeaDAO();
					List<Idea> list5 = obj_ReadValues5.get_IdeaLikedByIDmeeting(id_meeting2);
					Iterator<Idea> it_list5 = list5.iterator();
				%>

		<center>

		<h3>Liked</h3>
		<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 style="width: 5% !important"></th>
				<th>Title</th>
				<th>Description</th>
				<th>Auteur</th>
				<th style="width: 10% !important">Nb vote</th>
				

				<%
					while (it_list5.hasNext()) {
						Idea obj_Idea5 = new Idea();
						obj_Idea5 = it_list5.next();
				%>
				
				
				<%
					MemberDAO obj_ReadValues6 = new MemberDAO();
					List<Member> list6 = obj_ReadValues6.get_MemberByID(obj_Idea5.getId_member());
					Iterator<Member> it_list6 = list6.iterator();
				%>

						<tr>
							<td><span class="label label-default"><%=obj_Idea5.getId_idea() %></span></td>
							<td><%=obj_Idea5.getLibelle_idea()%></td>
							<td><%=obj_Idea5.getDescription_idea()%></td>
							<%
					while (it_list6.hasNext()) {
						Member obj_Idea6 = new Member();
						obj_Idea6 = it_list6.next();
				%>
							<td><%=obj_Idea6.getPrenom_member()%></td>
							<td><a href="../controller/join/delete_vote.jsp?id_meeting=<%=id_meeting2%>&id_member=<%=id_member2%>&id_idea=<%=obj_Idea5.getId_idea()%>"><span class="label label-warning">   -</span></a> <%=obj_Idea5.getNb_vote()%>  <a href="../controller/join/add_vote.jsp?id_meeting=<%=id_meeting2%>&id_member=<%=id_member2%>&id_idea=<%=obj_Idea5.getId_idea()%>"><span class="label label-success">   +</span></a></td>
							<%} %>
							
						</tr>
				<%
					}
				%>
			</table>
			<br>
  				</div>
				<div class="two">
				<%
					IdeaDAO obj_ReadValues2 = new IdeaDAO();
					List<Idea> list2 = obj_ReadValues2.get_IdeaLearnedByIDmeeting(id_meeting2);
					Iterator<Idea> it_list2 = list2.iterator();
				%>

		<center>
		<h3>Learned</h3>
			<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 style="width: 5% !important"></th>
				<th>Title</th>
				<th>Description</th>
				<th>Auteur</th>
				<th style="width: 10% !important">Nb vote</th>
								
				<%
					while (it_list2.hasNext()) {
						Idea obj_Idea2 = new Idea();
						obj_Idea2 = it_list2.next();
				%>
								
				<%
					MemberDAO obj_ReadValues7 = new MemberDAO();
					List<Member> list7 = obj_ReadValues7.get_MemberByID(obj_Idea2.getId_member());
					Iterator<Member> it_list7 = list7.iterator();
				%>
				
						<tr>
							<td><span class="label label-default"><%=obj_Idea2.getId_idea() %></span></td>
							<td><%=obj_Idea2.getLibelle_idea()%></td>
							<td><%=obj_Idea2.getDescription_idea()%></td>
				<%
					while (it_list7.hasNext()) {
						Member obj_Idea7 = new Member();
						obj_Idea7 = it_list7.next();
				%>
							
							<td><%=obj_Idea7.getPrenom_member()%></td>
							<td><a href="../controller/join/delete_vote.jsp?id_meeting=<%=id_meeting2%>&id_member=<%=id_member2%>&id_idea=<%=obj_Idea2.getId_idea()%>"><span class="label label-warning">   -</span></a> <%=obj_Idea2.getNb_vote()%>  <a href="../controller/join/add_vote.jsp?id_meeting=<%=id_meeting2%>&id_member=<%=id_member2%>&id_idea=<%=obj_Idea2.getId_idea()%>"><span class="label label-success">   +</span></a></td>
							
							</tr>

				<%
					}
				%>
				<%
					}
				%>
			</table>
						<br>
			
				</div>
				<div class="three">
				<%
					IdeaDAO obj_ReadValues3 = new IdeaDAO();
					List<Idea> list3 = obj_ReadValues3.get_IdeaLackedByIDmeeting(id_meeting2);
					Iterator<Idea> it_list3 = list3.iterator();
				%>

		<center>
		<h3>Lacked</h3>
			<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 style="width: 5% !important"></th>
				<th>Title</th>
				<th>Description</th>
				<th>Auteur</th>
				<th style="width: 10% !important">Nb vote</th>
				
				<%
					while (it_list3.hasNext()) {
						Idea obj_Idea3 = new Idea();
						obj_Idea3 = it_list3.next();
				%>
				
				<%
					MemberDAO obj_ReadValues8 = new MemberDAO();
					List<Member> list8 = obj_ReadValues8.get_MemberByID(obj_Idea3.getId_member());
					Iterator<Member> it_list8 = list8.iterator();
				%>

				
						<tr>
							<td><span class="label label-default"><%=obj_Idea3.getId_idea() %></span></td>
							<td><%=obj_Idea3.getLibelle_idea()%></td>
							<td><%=obj_Idea3.getDescription_idea()%></td>
							
				<%
					while (it_list8.hasNext()) {
						Member obj_Idea8 = new Member();
						obj_Idea8 = it_list8.next();
				%>							
							<td><%=obj_Idea8.getPrenom_member()%></td>
							<td><a href="../controller/join/delete_vote.jsp?id_meeting=<%=id_meeting2%>&id_member=<%=id_member2%>&id_idea=<%=obj_Idea3.getId_idea()%>"><span class="label label-warning">   -</span></a> <%=obj_Idea3.getNb_vote()%>  <a href="../controller/join/add_vote.jsp?id_meeting=<%=id_meeting2%>&id_member=<%=id_member2%>&id_idea=<%=obj_Idea3.getId_idea()%>"><span class="label label-success">   +</span></a></td>
						</tr>			
				<%
					}
				%>
				<%
					}
				%>
			</table>
						<br>
			
				</div>
				<div class="four">
				<%
					IdeaDAO obj_ReadValues4 = new IdeaDAO();
					List<Idea> list4 = obj_ReadValues4.get_IdeaLongedForByIDmeeting(id_meeting2);
					Iterator<Idea> it_list4 = list4.iterator();
				%>

		<center>
		<h3>Longed For</h3>
			<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 style="width: 5% !important"></th>
				<th>Title</th>
				<th>Description</th>
				<th>Auteur</th>
				<th style="width: 10% !important">Nb vote</th>
				
				
				<%
					while (it_list4.hasNext()) {
						Idea obj_Idea4 = new Idea();
						obj_Idea4 = it_list4.next();
				%>
				
				
				<%
					MemberDAO obj_ReadValues9 = new MemberDAO();
					List<Member> list9 = obj_ReadValues9.get_MemberByID(obj_Idea4.getId_member());
					Iterator<Member> it_list9 = list9.iterator();
				%>
						<tr>
							<td><span class="label label-default"><%=obj_Idea4.getId_idea() %></span></td>
							<td><%=obj_Idea4.getLibelle_idea()%></td>
							<td><%=obj_Idea4.getDescription_idea()%></td>

				<%
					while (it_list9.hasNext()) {
						Member obj_Idea9 = new Member();
						obj_Idea9 = it_list9.next();
				%>
				
							<td><%=obj_Idea9.getPrenom_member()%></td>
							<td><a href="../controller/join/delete_vote.jsp?id_meeting=<%=id_meeting2%>&id_member=<%=id_member2%>&id_idea=<%=obj_Idea4.getId_idea()%>"><span class="label label-warning">   -</span></a> <%=obj_Idea4.getNb_vote()%>  <a href="../controller/join/add_vote.jsp?id_meeting=<%=id_meeting2%>&id_member=<%=id_member2%>&id_idea=<%=obj_Idea4.getId_idea()%>"><span class="label label-success">   +</span></a></td>
						</tr>
				<%
					}
				%>
				<%
					}
				%>
			</table>
						<br>					
			</div>
			
			<br>
<hr> 

<h2>Action Plan : </h2>
		
<br><br>

			<%
				int i=0; 
			%>
			
			<form method="post" action="../controller/join/insert_action-plan_controller.jsp?id_meeting=<%=id_meeting2%>">	
			
				<%
					IdeaDAO obj_ReadValues10 = new IdeaDAO();
					List<Idea> list10 = obj_ReadValues10.get_Idea5MaxVote(id_meeting2);
					Iterator<Idea> it_list10 = list10.iterator();
				%>
				
				<%
					while (it_list10.hasNext()) {
						Idea obj_Idea10 = new Idea();
						obj_Idea10 = it_list10.next();
						i++;	
				%>

					 <p>
						<label style="width: 300px; display: block; float: left;">Title <%=i %> : </label>
					</p>
						
						<div class="form-group">
          				
          				<p>
          				<input name="libelle<%=i%>" type="text" value="<%=obj_Idea10.getLibelle_idea() %>" placeholder="Libelle" class="form-control" />
     	  				</p>
     	  				</div>
									
				<%
					}
				%>

                   <input class="btn btn-success" type="submit" value="Add">
			</form>
							</div>
		
		<a href = "http://10.70.135.145:8080/RetroV/pdfexport?idMeeting=<%=id_meeting2%>">
		<img class="fit-picture" src="http://10.70.135.145:8080/RetroV/assets/paper_img/pdf.png" alt="Download PDF" width="5%" height="5%">
		</a>
</div>

</div>
</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>

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