<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<%@ page import="java.util.*, com.example.model.*" %>      
      <title>sechudulerform</title>
<script language="javascript" src="genvalidationv5.js"></script>
<script type="text/javascript">
function setFlagAddToSchedule()
{
var flag = document.getElementById("formflag");
flag.value=5;
}
function setFlagReset()
{
var flag = document.getElementById("formflag");
flag.value=6;
}
function setFlagGetUser()
{
var flag = document.getElementById("formflag");
flag.value=7;
}
function setFlagFreeTimePage()
{
var flag = document.getElementById("formflag");
flag.value=10;
}
function setFlagLogOut()
{
var flag = document.getElementById("formflag");
flag.value=4;
}

      </script></head>

   <body>
      
         <form name="scheduler" method="POST" action="Schedule.do">
                  
<hr>
                  
                        <select name="daysofweek" size="7" multiple="multiple"><option value="1" selected="selected">
Sunday
                           </option><option value="2">
Monday
                           </option><option value="3">
Tuesday
                           </option><option value="4">
Wednesday
                           </option><option value="5">
Thursday
                           </option><option value="6">
Friday
                           </option><option value="7">
Saturday
                           </option>
                           </select><br/>
                     
                  
                  
                 
                     
                    	Start Time
                        <select name="Shours" size="1">
			  <% for (int x = 1; x <= 12; x++)
          {out.println("<option value=" + x + ">" +  x + "</option>");}%>
                           </select>
                   
                  
                
                     
                        <select name="Sminutes" size="1">
                          <% for (int x =0; x<=59; x++){
				if(x < 10)
					out.println("<option value=" + x + ">"+ "0" +  x + "</option>");
				else
          				out.println("<option value=" + x + ">"+  x + "</option>");
			     }
			   %>
                           </select>
                  
                        <select name="SAM" size="1">
			<option value="1">AM</option>
			<option value="2">PM</option>
                        </select><br/>
                    End Time
                        <select name="Ehours" size="1">
                          <% for (int x =1; x<=12; x++)
          {out.println("<option value=" + x + ">" +  x + "</option>");}%>
                        </select>
                     
                        <select name="Eminutes" size="1">
                          <% for (int x =0; x<=59; x++){
                                if(x < 10)
                                        out.println("<option value=" + x + ">"+ "0" +  x + "</option>");
                                else
                                        out.println("<option value=" + x + ">"+  x + "</option>");   
                             }  
                           %>

                           </select>
                   
                        <select name="EAM" size="1">
			<option value="1">AM</option>
			<option value="2">PM</option>
                           </select>
			<%
			    String user = (String)request.getAttribute("user");
			    out.println("<input type=hidden name=user value=" + user + " id=user>");
			%>
			<br/>
			<input type="hidden" name="formflag" value="-1" id="formflag">
			<input type="submit" name="add_time" value="Add To Schedule" onclick="setFlagAddToSchedule()">
			<input type="submit" name="reset_schedule" value="Reset Schedule" onclick="setFlagReset()">
			<input type="submit" name="user_schedule" value="Get User Schedule" onclick="setFlagGetUser()">
			<input type="submit" name="free_times" value="Free Time Finder" onclick="setFlagFreeTimePage()">
			<input type="submit" name="logout" value="Log Out" onclick="setFlagLogOut()">
			<br/>
			<hr>                   
                       <br><hr>
                    
            <script language="JavaScript">
var schedulerValidator = new Validator("scheduler");
schedulerValidator.addValidation("daysofweek","req","Please select an option for the days of the week");
            </script>
         </form>
    
<p>
    <br/>
	Created By Team F: Brian Hermann, Brian Johnson, Bill Meehan, Brian Sheehan, Graham Becker
  </p>
   </body></html>
