| [66] | 1 | <HTML> | 
|---|
|  | 2 | <!-- | 
|---|
|  | 3 | Licensed to the Apache Software Foundation (ASF) under one or more | 
|---|
|  | 4 | contributor license agreements.  See the NOTICE file distributed with | 
|---|
|  | 5 | this work for additional information regarding copyright ownership. | 
|---|
|  | 6 | The ASF licenses this file to You under the Apache License, Version 2.0 | 
|---|
|  | 7 | (the "License"); you may not use this file except in compliance with | 
|---|
|  | 8 | the License.  You may obtain a copy of the License at | 
|---|
|  | 9 |  | 
|---|
|  | 10 | http://www.apache.org/licenses/LICENSE-2.0 | 
|---|
|  | 11 |  | 
|---|
|  | 12 | Unless required by applicable law or agreed to in writing, software | 
|---|
|  | 13 | distributed under the License is distributed on an "AS IS" BASIS, | 
|---|
|  | 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|---|
|  | 15 | See the License for the specific language governing permissions and | 
|---|
|  | 16 | limitations under the License. | 
|---|
|  | 17 | --> | 
|---|
|  | 18 | <HEAD><TITLE> | 
|---|
|  | 19 | Calendar: A JSP APPLICATION | 
|---|
|  | 20 | </TITLE></HEAD> | 
|---|
|  | 21 |  | 
|---|
|  | 22 |  | 
|---|
|  | 23 | <BODY BGCOLOR="white"> | 
|---|
|  | 24 |  | 
|---|
|  | 25 | <%@ page language="java" import="cal.*" %> | 
|---|
|  | 26 | <jsp:useBean id="table" scope="session" class="cal.TableBean" /> | 
|---|
|  | 27 |  | 
|---|
|  | 28 | <% | 
|---|
|  | 29 | table.processRequest(request); | 
|---|
|  | 30 | if (table.getProcessError() == false) { | 
|---|
|  | 31 | %> | 
|---|
|  | 32 |  | 
|---|
|  | 33 | <!-- html table goes here --> | 
|---|
|  | 34 | <CENTER> | 
|---|
|  | 35 | <TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15> | 
|---|
|  | 36 | <TR> | 
|---|
|  | 37 | <TD ALIGN=CENTER> <A HREF=cal1.jsp?date=prev> prev </A> | 
|---|
|  | 38 | <TD ALIGN=CENTER> Calendar:<%= table.getDate() %></TD> | 
|---|
|  | 39 | <TD ALIGN=CENTER> <A HREF=cal1.jsp?date=next> next </A> | 
|---|
|  | 40 | </TR> | 
|---|
|  | 41 | </TABLE> | 
|---|
|  | 42 |  | 
|---|
|  | 43 | <!-- the main table --> | 
|---|
|  | 44 | <TABLE WIDTH=60% BGCOLOR=lightblue BORDER=1 CELLPADDING=10> | 
|---|
|  | 45 | <TR> | 
|---|
|  | 46 | <TH> Time </TH> | 
|---|
|  | 47 | <TH> Appointment </TH> | 
|---|
|  | 48 | </TR> | 
|---|
|  | 49 | <FORM METHOD=POST ACTION=cal1.jsp> | 
|---|
|  | 50 | <% | 
|---|
|  | 51 | for(int i=0; i<table.getEntries().getRows(); i++) { | 
|---|
|  | 52 | cal.Entry entr = table.getEntries().getEntry(i); | 
|---|
|  | 53 | %> | 
|---|
|  | 54 | <TR> | 
|---|
|  | 55 | <TD> | 
|---|
|  | 56 | <A HREF=cal2.jsp?time=<%= entr.getHour() %>> | 
|---|
|  | 57 | <%= entr.getHour() %> </A> | 
|---|
|  | 58 | </TD> | 
|---|
|  | 59 | <TD BGCOLOR=<%= entr.getColor() %>> | 
|---|
|  | 60 | <% out.print(util.HTMLFilter.filter(entr.getDescription())); %> | 
|---|
|  | 61 | </TD> | 
|---|
|  | 62 | </TR> | 
|---|
|  | 63 | <% | 
|---|
|  | 64 | } | 
|---|
|  | 65 | %> | 
|---|
|  | 66 | </FORM> | 
|---|
|  | 67 | </TABLE> | 
|---|
|  | 68 | <BR> | 
|---|
|  | 69 |  | 
|---|
|  | 70 | <!-- footer --> | 
|---|
|  | 71 | <TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15> | 
|---|
|  | 72 | <TR> | 
|---|
|  | 73 | <TD ALIGN=CENTER>  <% out.print(util.HTMLFilter.filter(table.getName())); %> : | 
|---|
|  | 74 | <% out.print(util.HTMLFilter.filter(table.getEmail())); %> </TD> | 
|---|
|  | 75 | </TR> | 
|---|
|  | 76 | </TABLE> | 
|---|
|  | 77 | </CENTER> | 
|---|
|  | 78 |  | 
|---|
|  | 79 | <% | 
|---|
|  | 80 | } else { | 
|---|
|  | 81 | %> | 
|---|
|  | 82 | <font size=5> | 
|---|
|  | 83 | You must enter your name and email address correctly. | 
|---|
|  | 84 | </font> | 
|---|
|  | 85 | <% | 
|---|
|  | 86 | } | 
|---|
|  | 87 | %> | 
|---|
|  | 88 |  | 
|---|
|  | 89 |  | 
|---|
|  | 90 | </BODY> | 
|---|
|  | 91 | </HTML> | 
|---|
|  | 92 |  | 
|---|
|  | 93 |  | 
|---|
|  | 94 |  | 
|---|
|  | 95 |  | 
|---|