<%@ page import="java.util.*" %>

<?xml version="1.0" encoding="iso-8859-1"?>
<!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>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
      <style type="text/css"> body  {background-color: #C0C0C0; font-family: Georgia, 'Times New Roman', 
				    Garamond; font-size:10pt;}
			      p	    {font-size:10pt;}
			      a	    {font-weight:normal; font-size: 10pt;}
                              h1    {font-size:18pt; font-weight:bold; text-align: center;}
			      h2    {font-size:10pt; font-weight:bold; text-align: center;}
			      h3    {font-size:14pt; color: C0C0C0;}
			      h4    {font-size:10pt; font-weight:bold;}
			      h5    {font-size:12pt; font-weight:normal;}
			      ul    {list-style-type:square; font-size:10pt;} 
			      ol    {font-size:10pt;}
			      table {background-color: #FFFFFF;}
			      .center-content {text-align:center;}
      </style>
       <script type="text/javascript">
         function getSelected(opt) {
            var selected = new Array();
            var index = 0;
            for (var intLoop = 0; intLoop < opt.length; intLoop++) {
               if ((opt[intLoop].selected) ||
                   (opt[intLoop].checked)) {
                  index = selected.length;
                  selected[index] = new Object;
                  selected[index].value = opt[intLoop].value;
                  selected[index].index = intLoop;
               }
            }
            return selected;
         }

         function outputSelected(opt) {
            var sel = getSelected(opt);
            var names = "";
            for (var item in sel)       
               names += sel[item].value + "\n";
            
	    return names;
         }
      </script>
      <title>CISC474 : Group E's Scheduler Webapp</title>
   </head>

   <body >
      <!-- generate an outertable to frame the content of the page -->
      <table border = "2" cellspacing = "1" cellpadding = "4" width = "800px" style="align:center" >
      <tr> <td align = "center" valign = "middle">

	 <h1>Group E's Scheduler Webapp</h1>
	 <!-- 	Name: 		Matthew Arbaugh, Anthony Furst, Yana Novikova, Steve Parise, Tara Strobel 
	 	Course Number: 	CISC474 (06S); 
		Assignment: 	A10; --> 

        <%
                String user = (String)request.getAttribute("user");
                out.print("<p align='center'>Welcome " + user + "</p>");
        %>


	 <!-- generate an innertable to frame the content of my page -->
	 <table border ="0" cellspacing ="1" cellpadding ="4" width ="750px" >
	    <tr>
		<td>
                        <form method="post" action="GetMenu.do">
                         <%
                                out.print("<p><input type='text' name='user' style=                                     'display:none' value='" + user + "' /></p>");
                        %>

                        <p><input type= "submit" value="Main Menu" /></p>
                        </form>

		</td>
		<td>
                        <form method="post" action="ChangeSched.do">
                         <%
                                out.print("<p><input type='text' name='user' style=                                             'display:none' value='" + user + "' /></p>");
                        %>

                        <p><input type= "submit" value="Enter/Change Schedule" /></p>
                        </form>
		</td>
		<td>
                        <form method="post" action="GetFreeTime.do" >
                         <%
                                out.print("<p><input type='text' name='user' style=                                             'display:none' value='" + user + "' /></p>");
                        %>

                        <p><input type= "submit" value="Find Common Free Times" disabled /></p>
                        </form>
		</td>
		<td>
                        <form method="post" action="Lookup.do">
                         <%
                                out.print("<p><input type='text' name='user' style= 'display:none' value='" + user + "' /></p>");
                        %>

                        <p><input type= "submit" value="Lookup Schedules" /></p>
                        </form>
		</td>
		<td>
                        <form method="post" action="login.html">
                        <p><input type= "submit" value="Logout" /></p>
                        </form>
		</td>
	    </tr>
	    <tr>
	       <td align = "left" valign = "top" style="width:50%" colspan="5"> 
		  <h3>Choose your schedule settings...</h3>
		  <p align="center">
			<form method="post" action="GetFreeTimeResult.do">
		     <table border="0" cellpadding="1" cellspacing="0" align="center" >
			<tr valign="top">
			   <td width="250px"><b>Select Time Constraints:</b></td>
			   <td width="150px"><b>Select Users to Add:</b></td>
			</tr>
			<tr valign="top">
			   <td>
			      <table border="0" cellpadding="1" cellspacing="0" >
			      	<tr>
				   <td valign="bottom"><b>From&nbsp;</b></td>
				   <td>
	   			      Hour<br />
           			      <select name="start_h">
              				<option value="0">0</option>
					<option value="1">1</option>
					<option value="2">2</option>
					<option value="3">3</option>
					<option value="4">4</option>
					<option value="5">5</option>
					<option value="6">6</option>
					<option value="7">7</option>
					<option value="8" selected >8</option>
					<option value="9">9</option>
					<option value="10">10</option>
					<option value="11">11</option>
					<option value="12">12</option>
					<option value="13">13</option>
					<option value="14">14</option>
					<option value="15">15</option>
					<option value="16">16</option>
					<option value="17">17</option>
					<option value="18">18</option>
					<option value="19">19</option>
					<option value="20">20</option>
					<option value="21">21</option>
					<option value="22">22</option>
					<option value="23">23</option>
           			      </select>
           			      :
        			   </td>
				   <td>
	   			      Minutes<br />
           			      <select name="start_m">
	      				<option value="0" selected>0</option>
					<option value="1">1</option>
					<option value="2">2</option>
					<option value="3">3</option>
					<option value="4">4</option>
					<option value="5">5</option>
					<option value="6">6</option>
					<option value="7">7</option>
					<option value="8">8</option>
					<option value="9">9</option>
					<option value="10">10</option>
					<option value="11">11</option>
					<option value="12">12</option>
					<option value="13">13</option>
					<option value="14">14</option>
					<option value="15">15</option>
					<option value="16">16</option>
					<option value="17">17</option>
					<option value="18">18</option>
					<option value="19">19</option>
					<option value="20">20</option>
					<option value="21">21</option>
					<option value="22">22</option>
					<option value="23">23</option>
					<option value="24">24</option>
					<option value="25">25</option>
					<option value="26">26</option>
					<option value="27">27</option>
					<option value="28">28</option>
					<option value="29">29</option>
					<option value="30">30</option>
					<option value="31">31</option>
					<option value="32">32</option>
					<option value="33">33</option>
					<option value="34">34</option>
					<option value="35">35</option>
					<option value="36">36</option>
					<option value="37">37</option>
					<option value="38">38</option>
					<option value="39">39</option>
					<option value="40">40</option>
					<option value="41">41</option>
					<option value="42">42</option>
					<option value="43">43</option>
					<option value="44">44</option>
					<option value="45">45</option>
					<option value="46">46</option>
					<option value="47">47</option>
					<option value="48">48</option>
					<option value="49">49</option>
					<option value="50">50</option>
					<option value="51">51</option>
					<option value="52">52</option>
					<option value="53">53</option>
					<option value="54">54</option>
					<option value="55">55</option>
					<option value="56">56</option>
                                        <option value="57">57</option>
                                        <option value="58">58</option>
					<option value="59">59</option>
           			      </select>
        			   </td>
			        </tr>
			        <tr>
                                   <td valign="bottom"><b>To&nbsp;</b></td>
                                   <td>
                                      Hour<br />
                                      <select name="end_h">
                                        <option value="0">0</option>
                                        <option value="1">1</option>
                                        <option value="2">2</option>
                                        <option value="3">3</option>
                                        <option value="4">4</option>
                                        <option value="5">5</option>
                                        <option value="6">6</option>
                                        <option value="7">7</option>
                                        <option value="8">8</option>
                                        <option value="9">9</option>
                                        <option value="10">10</option>
                                        <option value="11">11</option>
                                        <option value="12">12</option>
                                        <option value="13">13</option>
                                        <option value="14">14</option>
                                        <option value="15">15</option>
                                        <option value="16">16</option>
                                        <option value="17" selected>17</option>
                                        <option value="18">18</option>
                                        <option value="19">19</option>
                                        <option value="20">20</option>
                                        <option value="21">21</option>
                                        <option value="22">22</option>
                                        <option value="23">23</option>
                                      </select>
                                      :
                                   </td>

                                   <td>
                                      Minutes<br />
                                      <select name="end_m">
                                        <option value="0" selected>0</option>
                                        <option value="1">1</option>
                                        <option value="2">2</option>
                                        <option value="3">3</option>
                                        <option value="4">4</option>
                                        <option value="5">5</option>
                                        <option value="6">6</option>
                                        <option value="7">7</option>
                                        <option value="8">8</option>
                                        <option value="9">9</option>
                                        <option value="10">10</option>
                                        <option value="11">11</option>
                                        <option value="12">12</option>
                                        <option value="13">13</option>
                                        <option value="14">14</option>
                                        <option value="15">15</option>
                                        <option value="16">16</option>
                                        <option value="17">17</option>
                                        <option value="18">18</option>
                                        <option value="19">19</option>
                                        <option value="20">20</option>
                                        <option value="21">21</option>
                                        <option value="22">22</option>
                                        <option value="23">23</option>
                                        <option value="24">24</option>
                                        <option value="25">25</option>
                                        <option value="26">26</option>
                                        <option value="27">27</option>
                                        <option value="28">28</option>
                                        <option value="29">29</option>
                                        <option value="30">30</option>
                                        <option value="31">31</option>
                                        <option value="32">32</option>
                                        <option value="33">33</option>
                                        <option value="34">34</option>
                                        <option value="35">35</option>
                                        <option value="36">36</option>
                                        <option value="37">37</option>
                                        <option value="38">38</option>
                                        <option value="39">39</option>
                                        <option value="40">40</option>
                                        <option value="41">41</option>
                                        <option value="42">42</option>
                                        <option value="43">43</option>
                                        <option value="44">44</option>
                                        <option value="45">45</option>
                                        <option value="46">46</option>
                                        <option value="47">47</option>
                                        <option value="48">48</option>
                                        <option value="49">49</option>
                                        <option value="50">50</option>
                                        <option value="51">51</option>
                                        <option value="52">52</option>
                                        <option value="53">53</option>
                                        <option value="54">54</option>
                                        <option value="55">55</option>
                                        <option value="56">56</option>
                                        <option value="57">57</option>
                                        <option value="58">58</option>
                                        <option value="59">59</option>
                                      </select>
                                   </td>
			         </tr>
			       </table>
			    </td> 
			    <td valign="top" >
				<%
					List styles = (List)request.getAttribute("styles");
					Iterator it = styles.iterator();
                                        out.print("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");

					while(it.hasNext()) {
						String temp = (String) it.next();
						out.print("<tr valign=\"top\"><td align=\"left\"><input name='name' type='checkbox' value='"
							 + temp + "'>" + temp + "</td></tr>");
					}
					out.print("</table>");
                                        out.print("<p><input type='text' name='user' style=                                                                                          'display:none' value='" + user + "' /></p>");

				%>
			    </td>
			  </tr>
		       </table>
                      <p align = "center"> <input type="submit" value="Find Common Free Times"></p>
		    </form>
		  </p>
               </td>
	    </tr>
	 </table>
	 <p> - Spring 2006 - </p>
      </td></tr>
      </table>

      <!-- Validation coding for my page. -->
      <p>
         <a href="http://validator.w3.org/check?uri=referer"><img
             src="http://www.w3.org/Icons/valid-xhtml11"
             alt="Valid XHTML 1.1" height="31" width="88" /></a>
      </p>
   </body>
</html>
