<%@ include file="SQL.jsp" %>
<%@ page import="java.sql.*" %>
<%@ include file="header.jsp"%>

<%
/*
Displays information about a specific reservation. And shows the floor map where the station is located.
*/

String self = "false"; //request.getParameter("self");
%>

<body>


<!--MENU -->

<div id="b3k_contentarea_header">
	 <div id="b3k_contentarea_header_nav">
                  <ul>

                    <li class="b3k_firstchild b3k_active">
			<a href="myReservations.jsp?self=
				<% if(self!=null && self.equals("true")) {
						out.print("false");
					}else{
						out.print("true");
					}
				%>
                         " title="Meine Reservierungen">Meine Reservierungen</a>
                     </li>
                    
                    
                    <li class="b3k_lastchild">
                      <a href="reservationDateTimeChooser.jsp" title="Neue Reservierung">Neue Reservierung</a>
                     </li>

		    <li class="b3k_lastchild">
                      <a href="logout.jsp" title="Logout">Logout</a>
                   </li>
                    
                  </ul>
       </div>
</div>


<!-- MENU END -->

<%

String station = request.getParameter("station");
String reservation = request.getParameter("reservation");
String user = (String) session.getAttribute("user");


if(user!=null){
	ResultSet res = queryDB("select * from bachelor_reservation where id="+reservation);
	ResultSet res2 = queryDB("select * from bachelor_station where id="+station);

	res.next();
	res2.next();



	out.println("<p><table class='resList'>");
	out.println("<tr class='first'><td>Datum<td>Beginn<td>Ende<td>Stock<td>Bereich<td>Station");
	out.println("<tr><td>"+res.getString("date")+
				"<td>"+res.getString("startTime")+
				"<td>"+res.getString("endTime")+
				"<td>"+res2.getString("level")+
				"<td>"+res2.getString("area")+
				"<td>"+res2.getString("id")  );

	out.println("</table><p>");
	out.println("<form class='search' action='deleteReservation.jsp'>");
	out.println("<input type='hidden' name='id' value='"+res.getString("id")+"'/>");
	out.println("<input type='submit' value='Stornieren'/>");
	out.println("</form>");

	out.println("<hr><p><h2>"+res2.getString("level")+". Stock</h2>");
	out.println("<img src='mobile-img/level"+res2.getString("level")+"explained.jpg' border='0' width='350' height='410'>");



}else{

out.println("<meta HTTP-EQUIV='REFRESH' content='0; url=index.jsp'>");

}
%>



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