<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html>
<%
    com.ferienclub.vacancymgm.beans.Room room = (com.ferienclub.vacancymgm.beans.Room)request.getSession().getAttribute("room");
    java.lang.String roomId = room.getRoomId();
    java.util.List persons = (java.util.List)request.getSession().getAttribute("persons");
%>
  <head>
    <title>Travel-Agency Booking Page</title>
  <script type="text/javascript">

  roomId="<%= roomId %>";

    function makeBooking()
    {
      document.forms[0].elements[0].value=roomId;
      document.forms[0].submit();
    }

    function addUser()
    {
      document.forms[0].action="booking.do?action=addUser";
      document.forms[0].elements[0].value=roomId;      
      document.forms[0].submit();
    }
  </script>
  </head>
<body>
 <h1>Travel Agency Software V0.1</h1><br><br>
 <h2>Make a Booking</h2>
 Current Booking Details: <br>
 Room Number: <%= room.getRoomNo() %><br>
 Persons: <br>
 <ul>
 <%
    for (java.util.Iterator itor = persons.iterator(); itor.hasNext();)
    {
       com.ferienclub.custadmin.beans.User u = (com.ferienclub.custadmin.beans.User)itor.next();
       %><li><%= u.getFirstName() + " " + u.getName() %></li><%    
    }
 %>
 </ul>
 <html:errors/><p>
 <html:form action="booking.do?action=makeBooking">
   <html:hidden property="roomId" name="DetailBookingForm"/>
 <table border="0">
   <tr><td><b>First Name:</b></td><td><html:text property="firstName" size="30" maxlength="50"/></td></tr>
   <tr><td><b>Last Name:</b></td><td><html:text property="name" size="30" maxlength="50"/></td></tr>
   <tr><td><b>E-Mail:</b></td><td><html:text property="email" size="30" maxlength="50"/></td></tr>
   <tr><td><b>Phone:</b></td><td><html:text property="phone" size="30" maxlength="50"/></td></tr>
   <tr><td><b>Street:</b></td><td><html:text property="street" size="30" maxlength="50"/></td></tr>
   <tr><td><b>Country:</b></td><td><html:text property="country" size="30" maxlength="50"/></td></tr>
   <tr><td><b>Province:</b></td><td><html:text property="province" size="30" maxlength="50"/></td></tr>
   <tr><td><b>ZIP:</b></td><td><html:text property="zipcode" size="30" maxlength="50"/></td></tr>
   <tr></tr>
   <tr><td><b>From:</b></td><td><html:text property="from" size="30" maxlength="50"/></td></tr>
   <tr><td><b>To:</b></td><td><html:text property="to" size="30" maxlength="50"/></td></tr>
 </table>
 </html:form>
 
 <html:form action="back.do"/>
 
 <input type="button" value="Submit" onClick="makeBooking()"/> <input type="button" value="Back" onClick="document.forms[1].submit()"/> <input type="button" value="Add User" onClick="addUser()"/>
</body>
</html>