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

<%
/*
Deletes a reservation fro the database.
*/

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

if(user!=null){ //check if the user is logged in

	int res = updateDB("delete from bachelor_reservation where id="+id);
	out.println("<meta HTTP-EQUIV='REFRESH' content='0; url=myReservations.jsp'>");
	
}else{
	//user not logged in -> redirect
	out.println("<meta HTTP-EQUIV='REFRESH' content='0; url=index.jsp'>");

}
%>
<%@ include file="footer.jsp"%>