PageRenderTime 40ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 1ms

/members_only/include/calendar/include/Copy of calendar_functions.asa

https://github.com/evizitei/bcfpd_asp
ASP | 1067 lines | 904 code | 86 blank | 77 comment | 6 complexity | dd73978b69d4fc86eb61fdbb38806835 MD5 | raw file
  1. <!-- #include virtual="/include/constants/database.asa"-->
  2. <!--#include file="times.asa"-->
  3. <style type="text/css">
  4. .DayBar {background-color: #CC0000;}
  5. .CurrentDay {background-color: #CCCCFF;}
  6. .SmallCurrentDay {background-color: #330099;}
  7. .AllDayEvent {background-color: #BDF8DD;}
  8. .ViewTab {background-color: #b0c4de;}
  9. .MonthBar {background-color: white;}
  10. .SelectedDay {background-color: #BDF8DD;}
  11. .ExtraDays {background-color: #dddddd;}
  12. .DateText {color: #CC0000;}
  13. .borders {background-color: #444444;}
  14. .TextField {font-family: "Trebuchet MS"; border-width: 1; border-style: solid}
  15. .TextAreaField {font-family: "Trebuchet MS"; border-width: 1; border-style: solid}
  16. .ComboField {font-family: "Trebuchet MS"; border-width: 1; border-style: solid}
  17. td{
  18. font-family:arial;
  19. }
  20. td.daysOfWeekBar{
  21. font-family:arial;
  22. background-color: #330099;
  23. }
  24. a.date{
  25. color: #330099;
  26. font-family:arial;
  27. text-decoration:underline;
  28. }
  29. a.date:hover{
  30. color: #330099;
  31. font-family:arial;
  32. text-decoration:none;
  33. }
  34. a.Todaydate{
  35. color: #CC0000;
  36. font-family:arial;
  37. text-decoration:underline;
  38. }
  39. a.Todaydate:hover{
  40. color: #CC0000;
  41. font-family:arial;
  42. text-decoration:none;
  43. }
  44. a.updateLinks{
  45. color: blue;
  46. font-family:arial;
  47. text-decoration:underline;
  48. }
  49. a.updateLinks:hover{
  50. color: blue;
  51. font-family:arial;
  52. text-decoration:none;
  53. }
  54. a.eventLinks{
  55. color: blue;
  56. font-family:arial;
  57. text-decoration:underline;
  58. }
  59. a.eventLinks:hover{
  60. color: blue;
  61. font-family:arial;
  62. text-decoration:none;
  63. }
  64. a.smallCalendarDate{
  65. color: #C00002;
  66. font-family:arial;
  67. text-decoration:none;
  68. }
  69. a.smallCalendarDate:hover{
  70. color: #C00002;
  71. font-family:arial;
  72. text-decoration:underline;
  73. }
  74. a.smallCalendarCurrentDate{
  75. color: white;
  76. font-family:arial;
  77. text-decoration:none;
  78. }
  79. a.smallCalendarCurrentDate:hover{
  80. color: white;
  81. font-family:arial;
  82. text-decoration:underline;
  83. }
  84. a.Black{
  85. color: Black;
  86. }
  87. a.Toolbar{
  88. color: White;
  89. font-family:arial;
  90. text-decoration:none;
  91. }
  92. a.Toolbar:hover{
  93. color: White;
  94. font-family:arial;
  95. text-decoration:underline;
  96. }
  97. a.tabLink{
  98. color: white;
  99. font-family:arial;
  100. text-decoration:none;
  101. }
  102. a.tabLink:hover{
  103. color: whites;
  104. font-family:arial;
  105. text-decoration:underline;
  106. }
  107. </style>
  108. <script language="JavaScript">
  109. //This function deletes records from current form
  110. function Delete() {
  111. if (confirm("Are you sure that you want to delete these items?")){
  112. document.CalendarForm.submit() ;
  113. }
  114. }
  115. </script>
  116. <script language="JavaScript">
  117. //File must enter a Title.
  118. function Verify() {
  119. if(document.all.Title.value == "") {
  120. alert("You must enter a Title before continuing.");
  121. }
  122. else {
  123. document.CalendarForm.submit()
  124. }
  125. }
  126. </script>
  127. <%'This function opens up the printable calendar in the new browser
  128. 'With Response
  129. '
  130. ' .Write "<script language=""javascript"">" & vbCrLf
  131. '
  132. ' .Write " function printMonth(){" & vbCrLf
  133. ' If Request("Date")<>"" Then
  134. ' .Write " window.open(""/news/calendars/printable.asp?Name=" & Server.URLEncode(Name) & "&Node_ID=" & Node_ID & "&Date=" & Request("Date") & "&view=printMonth"", ""new"", ""titlebar=no,scrollbars=yes,status=no,width=500,height=600,location=no,directories=no"")" & vbCrLf
  135. ' Else
  136. ' .Write " window.open(""/news/calendars/printable.asp?Name=" & Server.URLEncode(Name) & "&Node_ID=" & Node_ID & "&Date=" & Date() & "&view=printMonth"", ""new"", ""titlebar=no,scrollbars=yes,status=no,width=500,height=600,location=no,directories=no"")" & vbCrLf
  137. ' End If
  138. ' .Write " }" & vbCrLf
  139. ' .Write "</script>" & vbCrLf & vbCrLf
  140. 'End With
  141. %>
  142. <%
  143. 'With Response
  144. ' .Write "<script language=""javascript"">" & vbCrLf
  145. '
  146. ' .Write " function printYear(){" & vbCrLf
  147. '
  148. ' If Request("Date")<>"" Then
  149. ' .Write " window.open(""/news/calendars/printable.asp?Name=" & Server.URLEncode(Name) & "&Node_ID=" & Node_ID & "&Date=" & Request("Date") & "&view=printYear"", ""new"", ""titlebar=no,scrollbars=yes,status=no,width=500,height=600,location=no,directories=no"")" & vbCrLf
  150. ' Else
  151. ' .Write " window.open(""/news/calendars/printable.asp?Name=" & Server.URLEncode(Name) & "&Node_ID=" & Node_ID & "&Date=" & Date() & "&view=printYear"", ""new"", ""titlebar=no,scrollbars=yes,status=no,width=500,height=600,location=no,directories=no"")" & vbCrLf
  152. ' End If
  153. ' .Write " }" & vbCrLf
  154. ' .Write "</script>" & vbCrLf & vbCrLf
  155. 'End With
  156. Set rsCalendar = Server.CreateObject ("ADODB.RecordSet")
  157. '*************CONSTANTS******************
  158. bgColor = Array("dedede", "efefef")
  159. Dim tabsOutside, inactiveTab, activeTab, fontSize
  160. tabsOutside = "white"
  161. inactiveTab = "#330099"
  162. activeTab = "white"
  163. fontSize = "2"
  164. '****************************************
  165. 'The following functions take a date as an argument and return a modified date. The date is modified as each
  166. 'function name implies.
  167. Public Function SubtractOneYear(dDate)
  168. SubtractOneYear = DateAdd("yyyy", -1, dDate)
  169. End Function
  170. Function AddOneYear(dDate)
  171. AddOneYear = DateAdd("yyyy", 1, dDate)
  172. End Function
  173. Public Function SubtractOneMonth(dDate)
  174. SubtractOneMonth = DateAdd("m", -1, dDate)
  175. End Function
  176. Function AddOneMonth(dDate)
  177. AddOneMonth = DateAdd("m", 1, dDate)
  178. End Function
  179. Public Function SubtractOneDay(dDate)
  180. SubtractOneDay = DateAdd("d", -1, dDate)
  181. End Function
  182. Function AddOneDay(dDate)
  183. AddOneDay = DateAdd("d", 1, dDate)
  184. End Function
  185. 'takes a numeric value representing an hour as an argument and returns a numeric value appended with an AM or PM
  186. Function hourFunc(xHour)
  187. Dim mHour
  188. If xHour > 11 Then
  189. mHour = CStr(xHour - 12)
  190. endStr = " PM"
  191. Else
  192. mHour = xHour
  193. endStr = " AM"
  194. End If
  195. If mHour = 0 Then
  196. mHour = "12"
  197. End If
  198. hourFunc = mHour & endStr
  199. End Function
  200. 'This function takes a date as an argument and returns the number of days in that month
  201. 'Leap years are accounted for
  202. Public Function daysInMonth(dDate)
  203. Select Case Month(dDate)
  204. Case 1, 3, 5, 7, 8, 10, 12
  205. daysInMonth = 31
  206. Case 4, 6, 9, 11
  207. daysInMonth = 30
  208. Case 2
  209. If Year(dDate) mod 4 = 0 Then 'checking for leap year
  210. daysInMonth = 29
  211. Else
  212. daysInMonth = 28
  213. End If
  214. End Select
  215. End Function%>
  216. <%'Takes a date as an argument and builds a small month view calendar
  217. Public Sub makeSmallMonth(dDate)%>
  218. <table border="0" width="100%">
  219. <tr>
  220. <td class="borders">
  221. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  222. <tr>
  223. <td colspan="7" align="center" bgcolor="white"><font color="#330099" size="2"><a href="<%Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;Date=<%=SubtractOneMonth(dDate)%>&amp;Node_ID=<%=Node_ID%>"><img src="/images/calendar/7arrowleft.gif" border="0" WIDTH="7" HEIGHT="7"></a>&nbsp;&nbsp;<%=MonthName(Month(dDate))%>&nbsp;<%=DatePart("yyyy",dDate)%>&nbsp;&nbsp;<a href="<%Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;Date=<%=AddOneMonth(dDate)%>&amp;Node_ID=<%=Node_ID%>"><img src="/images/calendar/7arrowRight.gif" border="0" WIDTH="7" HEIGHT="7"></a></font></td>
  224. </tr>
  225. <tr>
  226. <td class="DayBar" align="center"><font color="white" size="1">S</font></td>
  227. <td class="DayBar" align="center"><font color="white" size="1">M</font></td>
  228. <td class="DayBar" align="center"><font color="white" size="1">T</font></td>
  229. <td class="DayBar" align="center"><font color="white" size="1">W</font></td>
  230. <td class="DayBar" align="center"><font color="white" size="1">T</font></td>
  231. <td class="DayBar" align="center"><font color="white" size="1">F</font></td>
  232. <td class="DayBar" align="center"><font color="white" size="1">S</font></td>
  233. </tr>
  234. <%
  235. 'Determine the day of the week the month starts on
  236. mstDate = WeekDay(CDate(Month(dDate) & "/1/" & Year(dDate)))
  237. 'This is the date that we start printing on the calendar
  238. eDate = DateAdd("d", -mstDate + 1,CDate(Month(dDate) & "/1/" & Year(dDate)))
  239. 'Determine how many rows in the calendar we need based on the number of days in the month
  240. If (daysInMonth(dDate) + mstDate - 1)/7 > 5 Then
  241. n = 6
  242. ElseIf (daysInMonth(dDate) + mstDate - 1)/7 > 4 Then
  243. n = 5
  244. Else
  245. n = 4
  246. End If
  247. For x = 1 to n%>
  248. <tr>
  249. <%For y = 1 to 7
  250. If eDate = Date() Then%>
  251. <td class="SmallCurrentDay" valign="top" align="center">
  252. <%ElseIf Month(eDate) = Month(dDate) Then%>
  253. <td bgcolor="White" valign="top" align="center">
  254. <%Else%>
  255. <td class="ExtraDays" valign="top" align="center">
  256. <%End If%>
  257. <font size="1"><a <%If eDate = Date() Then%>class="smallCalendarCurrentDate"<%else%>class="smallCalendarDate"<%end if%> href="<%Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;Date=<%=eDate%>&amp;Node_ID=<%=Node_ID%>"><%=Day(eDate)%></a>
  258. </td>
  259. <%eDate = eDate + 1
  260. Next%>
  261. </tr>
  262. <%Next%>
  263. </table>
  264. </td>
  265. </tr>
  266. </table>
  267. <%End Sub%>
  268. <%Public Sub UpdateRec (Table, IDName, IDVal, cnn)
  269. 'Update the Records From A Page
  270. 'Any field starting with an "_" will not be updated
  271. Set rs = Server.CreateObject ("ADODB.Recordset")
  272. aDate = Request.Form("a1")
  273. aHour = Request.Form("a2")
  274. aExtra = Request.Form("a3")
  275. aMin = Request.Form("a4")
  276. aMerge = aDate & " " & aHour & ":" & aMin & aExtra
  277. durHour = Request.Form("b1")
  278. durMin = Request.Form("b2")
  279. durExtra = Request.Form("b3")
  280. durMerge = durHour & ":" & durMin & durExtra
  281. rs.Open "Select * From " & Table & " Where Title = '" & Request.Form("Title") & "' AND Date='" & aMerge & "' AND End_Date='" & durMerge & "'", cnnMain, 3, 3
  282. If rs.EOF Then
  283. rs.Close
  284. rs.Open "Select * From " & Table & " Where " & IDName & "='" & IDVal & "'", cnnMain, 3, 3
  285. If rs.EOF Then
  286. rs.AddNew
  287. End If
  288. rs("Node_ID") = Request.Form("Node_ID")
  289. rs("Title") = Request.Form("Title")
  290. rs("Description") = Request.Form("Description")
  291. rs("Link") = Request.Form("Link")
  292. rs("Date") = aMerge
  293. rs("End_Date") = durMerge
  294. If Request.Form("Event") = Checked Then
  295. rs("Event") = 0
  296. Else
  297. rs("Event") = 1
  298. End If
  299. rs.Update
  300. End If
  301. rs.Close
  302. End Sub
  303. Public Sub DeleteRec (Table, ID, cnn)
  304. 'If there is a request to delete, delete the record.
  305. Set rs = Server.CreateObject ("ADODB.Recordset")
  306. rs.Open Table, cnnMain, 3, 3
  307. Do While Not rs.EOF
  308. If Request.Form("Delete" & rs(ID)) Then
  309. rs.Delete
  310. End If
  311. rs.MoveNext
  312. Loop
  313. rs.Close
  314. End Sub
  315. 'Displays a month view of a calendar for the given date
  316. 'The calendar to be displayed is indicated by the Node_ID passed
  317. Public Sub dispMonth (byVal Node_ID, dDate)
  318. %>
  319. <div align="left">
  320. <table border="0" cellpadding="0" cellspacing="0" width="500">
  321. <!--<tr>
  322. <td colspan="2" nowrap align="right"><font size="1">Print events for this <a href="javascript:printMonth()">month</a> or this <a href="javascript:printYear()">year</a>.</font></td>
  323. </tr>-->
  324. <tr>
  325. <td valign="top"><%dispMonthToolbar Node_ID, dDate%></td>
  326. <td valign="top">
  327. <table border="0" cellpadding="0" cellspacing="0">
  328. <tr>
  329. <td><%dispTabs Node_ID, dDate, "month"%></td>
  330. </tr>
  331. <tr>
  332. <td>
  333. <table border="0" cellpadding="0" cellspacing="0" width="400">
  334. <tr>
  335. <td bgcolor=#CCCCFF>
  336. <table border="0" cellpadding="1" cellspacing="1" width="100%">
  337. <tr>
  338. <td align="center" width="14%" class="daysOfWeekBar"><font size="2" color="white">Sun</font></td>
  339. <td align="center" width="14%" class="daysOfWeekBar"><font size="2" color="white">Mon</font></td>
  340. <td align="center" width="14%" class="daysOfWeekBar"><font size="2" color="white">Tue</font></td>
  341. <td align="center" width="14%" class="daysOfWeekBar"><font size="2" color="white">Wed</font></td>
  342. <td align="center" width="14%" class="daysOfWeekBar"><font size="2" color="white">Thu</font></td>
  343. <td align="center" width="14%" class="daysOfWeekBar"><font size="2" color="white">Fri</font></td>
  344. <td align="center" width="14%" class="daysOfWeekBar"><font size="2" color="white">Sat</font></td>
  345. </tr>
  346. <%
  347. 'Determine the day of the week the month starts on
  348. mstDate = WeekDay(CDate(Month(dDate) & "/1/" & Year(dDate)))
  349. 'This is the date that we start printing on the calendar
  350. tDate = DateAdd("d", -mstDate + 1,CDate(Month(dDate) & "/1/" & Year(dDate)))
  351. 'Determine how many rows in the calendar we need based on the number of days in the month
  352. If (daysInMonth(dDate) + mstDate - 1)/7 > 5 Then
  353. n = 6
  354. ElseIf (daysInMonth(dDate) + mstDate - 1)/7 > 4 Then
  355. n = 5
  356. Else
  357. n = 4
  358. End If
  359. %>
  360. <%For x = 1 to n%>
  361. <tr>
  362. <%For y = 1 to 7
  363. If tDate = Date() Then%>
  364. <td height="100" class="CurrentDay" valign="top" width="10%">&nbsp
  365. <%ElseIf Month(tDate) = Month(dDate) Then%>
  366. <td height="100" bgcolor="White" valign="top" width="10%">
  367. <%Else%>
  368. <td height="100" class="ExtraDays" valign="top" width="10%">
  369. <%End If%>
  370. <font size="2"><a class="date" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;Date=<%=tDate%>&amp;Node_ID=<%=Node_ID%>"><strong><%=Day(tDate)%></strong></a></font><br>
  371. <%rsCalendar.MaxRecords = 4
  372. rsCalendar.Open "Select * From calendar Where DatePart(mm,Date) = " & Month(tDate) & " And DatePart(dd,Date) = " & Day(tDate) & " And DatePart(yy,Date) = " & Year(tDate) & " And Node_ID = " & Node_ID & "Order by Date",cnnMain, 3%>
  373. <%Do While Not rsCalendar.EOF%>
  374. <img src="/images/calendar/7arrowRight.gif" WIDTH="7" HEIGHT="7"><font size="1"><%=rsCalendar("Title")%></font><br>
  375. <%rsCalendar.MoveNext
  376. Loop
  377. If rsCalendar.RecordCount > 3 Then%>
  378. <img src="/images/Calendar/7arrowDOWN.gif" WIDTH="7" HEIGHT="7"><font size="1"><a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;Date=<%=tDate%>&amp;Node_ID=<%=Node_ID%>">more info</a></font>
  379. <%End If
  380. rsCalendar.Close%>
  381. </td>
  382. <%tDate = tDate + 1
  383. Next%>
  384. </tr>
  385. <%Next%>
  386. </table>
  387. </td>
  388. </tr>
  389. </table>
  390. </td>
  391. </tr>
  392. </table>
  393. </td>
  394. </tr>
  395. </table>
  396. </div>
  397. <%End Sub%>
  398. <%'Displays a calendar with a day view for a particular date.
  399. 'The calendar to be displayed is indicated by the Node_ID passed
  400. 'The Admin argument is a boolean value that specifies whether the user has editing abilities
  401. Public Sub dispDay (byVal Node_ID, dDate, Admin)
  402. z = 8
  403. %>
  404. <div align="left">
  405. <table border="0" width="500" cellspacing="2" cellpadding="0">
  406. <tr>
  407. <td valign="top" width="13%" align="center">
  408. <span class="DateText"><font size="4"><strong><%=MonthName(Month(dDate))%><br><%=Day(dDate)%><br><%=Year(dDate)%></strong></font></span><p>
  409. <%dispToolbar Node_ID, dDate, Admin%>
  410. </td>
  411. <td>
  412. <table border="0" width="100%" cellpadding="0" cellspacing="0">
  413. <tr>
  414. <td><%dispTabs Node_ID, dDate, "day"%></td>
  415. <tr>
  416. <tr>
  417. <td valign="top" class="DayBar">
  418. <table border="0" width="100%" cellspacing="0" cellpadding="0">
  419. <tr>
  420. <td class="borders" colspan="3">
  421. <table border="0" cellspacing="1" cellpadding="2" width="100%">
  422. <%
  423. strCal ="SELECT * FROM calendar Where DatePart(mm,Date) = " & Month(dDate) & " And DatePart(dd,Date) = " & Day(dDate) & " And DatePart(yy,Date) = " & Year(dDate) & " And Event = 1 And Node_ID = " & Node_ID
  424. rsCalendar.Open strCal, cnnMain, 3
  425. Do While Not rsCalendar.EOF
  426. %>
  427. <tr>
  428. <td valign="top" class="AllDayEvent" colspan="2"><font size="2">
  429. <%If Admin Then%>
  430. <a class="eventLinks" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Edit=<%=rsCalendar("Calendar_ID")%>&amp;Node_ID=<%=Node_ID%>&amp;Date=<%=dDate%>&amp;startTime=ignore"><%=rsCalendar("Title")%></a></font>
  431. <%Else
  432. If rsCalendar("Link") <> "" Then%>
  433. <a class="eventLinks" href="http://<%=rsCalendar("Link")%>" target="_new"><%=rsCalendar("Title")%></a>
  434. <%Else
  435. Response.Write rsCalendar("Title")
  436. End If%>
  437. <%End If%>
  438. <%If rsCalendar("Description") <> "" Then%>
  439. <font size="2">- <%=rsCalendar("Description")%></font>
  440. <%End If%>
  441. </td>
  442. </tr>
  443. <%
  444. rsCalendar.MoveNext
  445. Loop
  446. rsCalendar.Close
  447. For x = 0 to 23
  448. HourPart = CStr(x)
  449. If HourPart = "0" Then
  450. HourPart = "00"
  451. End If
  452. rsCalendar.Open "SELECT * FROM calendar Where DatePart(mm,Date) = " & Month(dDate) & " And DatePart(dd,Date) = " & Day(dDate) & " And DatePart(yy,Date) = " & Year(dDate) & " And DatePart(hh, Date)=" & HourPart & " And Event = 0 And Node_ID = " & Node_ID & " Order By Date", cnnMain, 3
  453. If Not rsCalendar.EOF Or (x > 7 AND x < 20) Then
  454. %>
  455. <tr>
  456. <%
  457. If Admin Then%>
  458. <td bgcolor="white" valign="top" width="15%"><font size="2"><a class="updateLinks" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Edit=0&amp;Date=<%=dDate%>&amp;Node_ID=<%=Node_ID%>&amp;startTime=<%=x%>"><%=hourFunc(x)%></a></font></td>
  459. <%Else%>
  460. <td bgcolor="white" valign="top" width="15%"><font size="2"><%=hourFunc(x)%></a></font></td>
  461. <%End If%>
  462. <td bgcolor="white" width="88%">&nbsp;<%
  463. Do While Not rsCalendar.EOF
  464. If CInt(Left(FormatDateTime(rsCalendar("Date"), vbShortTime),2)) = x Then%>
  465. <font size="2">
  466. <%If Admin Then%>
  467. <a class="eventLinks" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Edit=<%=rsCalendar("Calendar_ID")%>&amp;Node_ID=<%=Node_ID%>&amp;Date=<%=dDate%>&amp;startTime=ignore"><%=rsCalendar("Title")%></a>
  468. <%Else
  469. If rsCalendar("Link") <> "" Then%>
  470. <a class="eventLinks" href="http://<%=rsCalendar("Link")%>" target="_new"><%End If%><%=rsCalendar("Title")%></a>
  471. <%End If
  472. If rsCalendar("Description") <> "" Then%>
  473. - <%Response.Write rsCalendar("Description")
  474. End If%>
  475. &nbsp;<%endPartDate = Right(FormatDateTime(rsCalendar("Date"),vbLongTime), 2)
  476. endPartEndDate = Right(FormatDateTime(rsCalendar("End_Date"),vbLongTime), 2)%>
  477. (<%=Left(FormatDateTime(rsCalendar("Date"),vbLongTime), InStrRev(FormatDateTime(rsCalendar("Date"),vbLongTime),":")-1) & " " & endPartDate & " "%>-<%=Left(FormatDateTime(rsCalendar("End_Date"),vbLongTime), InStrRev(FormatDateTime(rsCalendar("End_Date"),vbLongTime),":")-1) & " " & endPartEndDate%>)
  478. </font>
  479. <br>
  480. <%End If
  481. rsCalendar.MoveNext
  482. Loop
  483. %>
  484. </td>
  485. </tr>
  486. <%
  487. End If
  488. rsCalendar.Close
  489. Next%>
  490. </table>
  491. </td>
  492. </tr>
  493. </table>
  494. </td>
  495. </tr>
  496. </table>
  497. </td>
  498. </tr>
  499. </table>
  500. </div>
  501. <%End Sub%>
  502. <%'Displays the form for adding or editing an event in a calendar
  503. 'Node_ID - (int)indeicates the calendar to edit
  504. 'Calendar_ID - (int) this is the unique identifier for the event record to be editted; if no event exists, then
  505. ' a new one is created
  506. 'dDate - (datetime) the date of the event
  507. 'startTime - (string) takes a string that is a number represntinf the start time; if no start time
  508. ' is to be specified, then the value should be "ignore"; when the value is "ignore" the default
  509. ' start and end time is 12 AM
  510. Public Sub dispEdit(byVal Node_ID, Calendar_ID, dDate, startTime)%>
  511. <form method="POST" action="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;Date=<%=dDate%>&amp;Node_ID=<%=Node_ID%>" name="CalendarForm">
  512. <input type="hidden" name="Calendar_ID" value="<%=Request.QueryString("Edit")%>">
  513. <!-- <input type="hidden" name="Calendar_ID" value="<%=Calendar_ID%>"> -->
  514. <input type="hidden" name="Node_ID" value="<%=Node_ID%>">
  515. <input type="hidden" name="updateAction" value="update">
  516. <table border="0" width="720" cellpadding="5">
  517. <tr>
  518. <td colspan="7"><strong>Edit Screen</strong>
  519. <table border="0" cellspacing="0">
  520. <tr>
  521. <td bgcolor="#F2F2F2">
  522. <table border="0" width="100%">
  523. <tr>
  524. <td colspan="2">
  525. <font size="2">click save to add event information</font>
  526. </td>
  527. <td colspan="5" align="right"><a href="javascript:history.go(-1)"><strong>Cancel</strong></a></td>
  528. </tr>
  529. <tr>
  530. <td colspan="7" align="right"><a href="javascript:Verify()"><strong>Save</strong></a></td>
  531. </tr>
  532. <tr>
  533. <td valign="top"><strong>Title</strong></td>
  534. <td><input class="TextField" type="text" name="Title" size="53" value="<%=rsCalendar("Title")%>"></td>
  535. <td><strong>Start Time</strong></td>
  536. <td><select NAME="a2" class="ComboField">
  537. <%For x = 0 to UBound(strTimeHr)%>
  538. <%'Find the value to set the selected time when the edit screen appears
  539. If startTime <> "ignore" Then
  540. selHour = trim(startTime)
  541. Else
  542. selHour = Hour(rsCalendar("Date"))
  543. End If
  544. If selHour = 0 Then
  545. selHour = 12
  546. ElseIf selHour = 12 Then
  547. pm = true
  548. ElseIf selHour < 12 Then
  549. pm = false
  550. Else
  551. If selHour > 12 Then
  552. selHour = selHour - 12
  553. pm = true
  554. End If
  555. End If%>
  556. <option value="<%=strTimeHr(x)%>" <%If strTimeHr(x) = selHour Then%> Selected <%End If%>><%=strTimeHr(x)%>
  557. <%Next%>
  558. </select>
  559. </td>
  560. <td><font size="2">hr</font></td>
  561. <td><select NAME="a4" class="ComboField">
  562. <%For x = 0 to UBound(strTimeMin)%>
  563. <option value="<%=strTimeMin(x)%>" <%If strTimeMin(x) = Minute(rsCalendar("Date")) Then%> Selected <%End If%>><%=strTimeMin(x)%>
  564. <%Next%>
  565. </select>
  566. </td>
  567. <td><font size="2">min</font></td>
  568. <td><select name="a3" class="ComboField">
  569. <option <%If Left(FormatDateTime(rsCalendar("Date"), vbShortTime),2) >= 0 Then%> Selected <%End If%>>AM</option>
  570. <option <%If Left(FormatDateTime(rsCalendar("Date"), vbShortTime),2) >= 12 or pm Then%> Selected <%End If%>>PM</option>
  571. </select>
  572. </td>
  573. </tr>
  574. <tr>
  575. <td rowspan="3" valign="top" rowspan="2"><strong>Description</strong></td>
  576. <td rowspan="3"><textarea class="TextAreaField" cols="52" rows="5" name="Description"><%=rsCalendar("Description")%></textarea></td>
  577. <td valign="top"><strong>End Time</strong></td>
  578. <td valign="top"><select NAME="b1" class="ComboField">
  579. <%For x = 0 to UBound(strTimeHr)
  580. 'Find the value to set the selected time when the edit screen appears
  581. If startTime <> "ignore" Then
  582. selHour = startTime
  583. Else
  584. selHour = Hour(rsCalendar("End_Date"))
  585. End If
  586. If selHour = 0 Then
  587. selHour = 12
  588. Else
  589. If selHour > 12 Then
  590. selHour = selHour - 12
  591. End If
  592. End If%>
  593. <option value="<%=strTimeHr(x)%>" <%If strTimeHr(x) = selHour Then%> Selected <%End If%>><%=strTimeHr(x)%>
  594. <%Next%>
  595. </select>
  596. </td>
  597. <td><font size="2">hr</font></td>
  598. <td valign="top"><select NAME="b2" class="ComboField">
  599. <%For x = 0 to UBound(strTimeMin)%>
  600. <option value="<%=strTimeMin(x)%>" <%If strTimeMin(x) = Minute(rsCalendar("End_Date")) Then%> Selected <%End If%>><%=strTimeMin(x)%>
  601. <%Next%>
  602. </select>
  603. </td>
  604. <td><font size="2">min</font></td>
  605. <td valign="top"><select name="b3" class="ComboField">
  606. <option <%If Left(FormatDateTime(rsCalendar("Date"), vbShortTime),2) >= 0 Then%> Selected <%End If%>>AM</option>
  607. <option <%If Left(FormatDateTime(rsCalendar("Date"), vbShortTime),2) >= 12 or pm Then%> Selected <%End If%>>PM</option>
  608. </select>
  609. </td>
  610. </tr>
  611. <tr>
  612. <td align="right" valign="top"><input type="checkbox" name="Event" value="true" <%If rsCalendar("Event") Then%>Checked<%End If%>></td>
  613. <td valign="top" colspan="4"><font size="1">All Day Event</font></td>
  614. </tr>
  615. <tr>
  616. <td colspan="5">&nbsp;</td>
  617. </tr>
  618. <tr>
  619. <td><strong>Date</strong></td>
  620. <td colspan="6"><%If Request.QueryString("Edit") = 0 Then%>
  621. <input class="TextField" type="text" name="a1" value="<%=dDate%>">
  622. <%Else%>
  623. <input class="TextField" type="text" name="a1" value="<%=FormatDateTime(rsCalendar("Date"), vbShortDate)%>">
  624. <%End If%></td>
  625. </tr>
  626. <tr>
  627. <td><strong>Link</strong><br><font size="2">i.e. www.test.com</font></td>
  628. <td valign="top"><input class="TextField" type="text" name="Link" size="40" value="<%=rsCalendar("Link")%>"></td>
  629. </tr>
  630. </table>
  631. </table>
  632. </td>
  633. </tr>
  634. </table>
  635. </td>
  636. </tr>
  637. </table>
  638. </form>
  639. <%End Sub%>
  640. <%'Displays a screen that allows the administrator to choose which events to delete from the database
  641. 'Node_ID - (int) specifies the calendar the events are associated with
  642. 'Calendar_ID - (int) a unique ID of the event record to be deleted
  643. 'dDate - (datetime) the date used to specify a range of records to delete
  644. 'dispType - (string) takes a string indicating which records to display
  645. ' "day" - displays records for the given day
  646. ' "month" - displays records for the given month
  647. ' "year" - displays records for the given year
  648. Public Sub dispDelete(byVal Node_ID, Calendar_ID, dDate, dispType)%>
  649. <form method="POST" action="<%=Request.ServerVariables("SCRIPT_NAME")%>?Action=Delete&amp;Date=<%=dDate%>&amp;Node_ID=<%=Node_ID%>" name="CalendarForm">
  650. <table border="0" width="100%">
  651. <tr>
  652. <td><strong>Delete Screen</strong>
  653. <table border="0" cellspacing="0" bordercolor="#F2F2F2">
  654. <tr>
  655. <td bgcolor="#F2F2F2">
  656. <table border="0" width="100%">
  657. <tr>
  658. <td><font size="2">click delete to delete an event</font></td>
  659. <td align="right"><a href="<%Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;Date=<%=dDate%>&amp;Node_ID=<%=Node_ID%>"><strong>Cancel</strong></a></td>
  660. </tr>
  661. <tr>
  662. <td colspan="2">
  663. <table border="0" width="100%">
  664. <tr>
  665. <td colspan="2" align="right"><a href="javascript:Delete();"><strong>Delete</strong></a></td>
  666. </tr>
  667. <tr>
  668. <td colspan="2">
  669. <table border="0" width="100%">
  670. <%'Build the query string based on whether they want it displayed by day, month, or year
  671. If dispType = "day" Then
  672. strCal = "SELECT * FROM calendar WHERE DatePart(mm,Date) = " & Month(dDate) & " And DatePart(dd,Date) = " & Day(dDate) & " And DatePart(yy,Date) = " & Year(dDate) & " And Node_ID = " & Node_ID & " Order By Date Asc"%>
  673. <input type="hidden" name="View" value="Day">
  674. <%ElseIf dispType = "month" Then
  675. strCal = "SELECT * FROM calendar WHERE DatePart(mm,Date) = " & Month(dDate) & " And DatePart(yy,Date) = " & Year(dDate) & " And Node_ID = " & Node_ID & " Order By Date Asc"%>
  676. <input type="hidden" name="View" value="Month">
  677. <%Else 'dispType = year
  678. strCal = "SELECT * FROM calendar WHERE Node_ID= " & Node_ID & " Order By Date Asc"%>
  679. <input type="hidden" name="View" value="Year">
  680. <%End If%>
  681. <%'open the recordset and display the events records with a checkbox to mark for deletion
  682. rsCalendar.Open strCal,cnnMain, 3, 3
  683. Do While Not rsCalendar.EOF%>
  684. <tr><%If MonthName(DatePart("m",rsCalendar("Date"))) <> x Then%>
  685. <td colspan="3" bgcolor="Lavender"><strong><em><%=MonthName(DatePart("m",rsCalendar("Date")))%></em></strong></td>
  686. <%End If%>
  687. </tr>
  688. <%x = MonthName(DatePart("m",rsCalendar("Date")))%>
  689. <tr>
  690. <td ><input class="CheckField" type="checkbox" name="Delete<%=rsCalendar("Calendar_ID")%>" value="true"></td>
  691. <td ><font size="2"><%if rsCalendar("Event") then%>
  692. <%="All Day"%>
  693. <%else%>
  694. <%=FormatDateTime(rsCalendar("Date"),vbLongDate) & "<br>" & FormatDateTime(rsCalendar("Date"),vbLongTime)%>
  695. <%end if %></font></td>
  696. <td bgcolor="#<%=bgColor(0)%>"><font size="2"><%=rsCalendar("Title")%></font></td>
  697. </tr>
  698. <tr>
  699. <td colspan="2">&nbsp;</td>
  700. <td width bgcolor="#<%=bgColor(1)%>"><ul><font size="2"><%=rsCalendar("Description")%></font></td>
  701. </tr>
  702. <%rsCalendar.MoveNext
  703. Loop%>
  704. <input type="hidden" name="updateAction" value="delete">
  705. </table>
  706. </td>
  707. </tr>
  708. </table>
  709. </td>
  710. </tr>
  711. </table>
  712. </td>
  713. </tr>
  714. </table>
  715. </td>
  716. </tr>
  717. </table>
  718. </form>
  719. <%End Sub%>
  720. <%'This builds a toolbarthat can go on the side of a calendar. The most logical calendar to add it to is
  721. 'the day view but it could be used on others. It uses the makeSmallMonth function to build a small month
  722. 'calendar. Then it will display links to add or delete events if the user is an administrator
  723. '
  724. 'Node_ID - (int) specifies which calendar is being used
  725. 'dDate - (datetime) the date to build the display for
  726. 'Admin - (boolean) indicates whether the user is an administrator
  727. Public Sub dispToolbar(byVal Node_ID, dDate, Admin)
  728. tDate = dDate
  729. %>
  730. <input type="hidden" value="Month" name="View">
  731. <table border="0" width="125" cellpadding="0" cellspacing="0">
  732. <tr>
  733. <td colspan="2">
  734. <%makeSmallMonth dDate%>
  735. </td>
  736. </tr>
  737. <%If Admin Then%>
  738. <tr>
  739. <td>&nbsp;</td>
  740. </tr>
  741. <tr>
  742. <td colspan="2" align="left"><font size="2"><strong><a class="updateLinks" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Edit=0&amp;Date=<%=dDate%>&amp;Node_ID=<%=Node_ID%>&amp;startTime=ignore">Add Event</a></strong></font></td>
  743. </tr>
  744. <tr>
  745. <td colspan="2" align="left"><font size="2"><strong><a class="updateLinks" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?updateAction=dispDeletePage&amp;Date=<%=tDate%>&amp;Node_ID=<%=Node_ID%>&amp;dispType=day">Delete Event(s)</a></strong></font></td>
  746. </tr>
  747. <%End If%>
  748. </table>
  749. <%End Sub%>
  750. <%'Builds a toolbar that has a list of months on it for the user to quickly navigate to another month in the
  751. 'current year. It also has the year on it with navigation arrows so that the user can skip to the previous
  752. 'or next year. Finally, it displays a link to the current day called "today."
  753. Public Sub dispMonthToolbar(byVal Node_ID, dDate)%>
  754. <table border="0" cellpadding="0" cellspacing="0" width="125">
  755. <tr>
  756. <td align="right">
  757. <table border="0" cellpadding="1" cellspacing="1">
  758. <tr>
  759. <td bgcolor="CC0000">
  760. <table border="0" cellpadding="1" cellspacing="0">
  761. <tr>
  762. <td bgcolor="white" colspan="3" align="center"><font size="5" face="verdana" color="#CC0000 "><strong><%=UCase((MonthName(Month(dDate), TRUE)))%></strong></font></td>
  763. </tr>
  764. <tr>
  765. <td bgcolor="white" valign="middle"><a href="<%Request.ServerVariables("SCRIPT_NAME")%>?View=Month&amp;Date=<%=SubtractOneYear(dDate)%>&amp;Node_ID=<%=Node_ID%>"><img src="/images/calendar/7arrowleft.gif" border="0" width="7" height="7"></a></td>
  766. <td bgcolor="white" align="center"><font size="2" face="arial" color="#CC0000 "><%=DatePart("yyyy",dDate)%></font></td>
  767. <td bgcolor="white" valign="middle"><a href="<%Request.ServerVariables("SCRIPT_NAME")%>?View=Month&amp;Date=<%=AddOneYear(dDate)%>&amp;Node_ID=<%=Node_ID%>"><img src="/images/calendar/7arrowRight.gif" border="0" width="7" height="7"></a></td>
  768. </tr>
  769. <tr>
  770. <td colspan="3">
  771. <table border="0" cellpadding="3" cellspacing="0">
  772. <tr>
  773. <td>
  774. <table border="0" cellpadding="1" cellspacing="0">
  775. <%For x = 1 to 6
  776. xDate = CDate(x & "/" & 1 & "/" & Year(dDate))%>
  777. <tr>
  778. <td align="center" colspan="3"><a class="Toolbar" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Month&amp;Date=<%=xDate%>&amp;Node_ID=<%=Node_ID%>"><font size="1" face="arial"><%=UCase(MonthName(x,True))%></font></a></td>
  779. </tr>
  780. <%Next%>
  781. </table>
  782. </td>
  783. <td>
  784. <table border="0" cellpadding="1" cellspacing="0">
  785. <%For x = 7 to 12
  786. xDate = CDate(x & "/" & 1 & "/" & Year(dDate))%>
  787. <tr>
  788. <td align="center" colspan="3"><a class="Toolbar" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Month&amp;Date=<%=xDate%>&amp;Node_ID=<%=Node_ID%>"><font size="1" face="arial"><%=UCase(MonthName(x,True))%></font></a></td>
  789. </tr>
  790. <%Next%>
  791. </table>
  792. </td>
  793. </tr>
  794. </table>
  795. </td>
  796. </tr>
  797. <tr>
  798. <td colspan="3" bgcolor="white" align="center"><font size="2"><strong><a class="Todaydate" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;Date=<%=Date%>&amp;Node_ID=<%=Node_ID%>">Today</a></font></strong></td>
  799. </tr>
  800. </table>
  801. </td>
  802. </tr>
  803. </table>
  804. </td>
  805. </tr>
  806. </table>
  807. <%End Sub%>
  808. <%'This displays the tabs for all three view types.
  809. 'tabView - (string) Indicates which view to display the tabs for.
  810. ' "day" - day tab is selected; month and year tabs are active links
  811. ' "month" - month tab is selected; day and year tabs are active links
  812. ' "year" - year tab is selected; day and month tabs are active links
  813. Public Sub dispTabs(byVal Node_ID, dDate, tabView)%>
  814. <%If tabView = "day" Then%>
  815. <TABLE CELLPADDING="0" CELLSPACING="0" HEIGHT="17" WIDTH="100%" BORDER="0">
  816. <TR ALIGN="center" BGCOLOR="<%=inactiveTab%>">
  817. <TD WIDTH="5" BGCOLOR="<%=tabsOutside%>" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="5" HEIGHT="16"></TD>
  818. <TD WIDTH="1" ROWSPAN="3"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="17"></TD>
  819. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  820. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  821. <TD WIDTH="5" BGCOLOR="<%=tabsOutside%>" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="5" HEIGHT="16"></TD>
  822. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  823. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  824. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  825. <TD WIDTH="5" BGCOLOR="<%=tabsOutside%>" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="5" HEIGHT="16"></TD>
  826. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  827. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  828. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  829. <TD WIDTH="100%" BGCOLOR="<%=tabsOutside%>" NOWRAP ROWSPAN="2" align="right"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1">
  830. <a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;Date=<%=SubtractOneDay(dDate)%>&amp;Node_ID=<%=Node_ID%>"><img src="/images/calendar/7arrowleft.gif" border="0" WIDTH="7" HEIGHT="7"></a>
  831. <font size="2" face="verdana"><strong><%=MonthName(Month(dDate)) & " " & Day(dDate) & ", " & Year(dDate)%></strong></font>
  832. <a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;Date=<%=AddOneDay(dDate)%>&amp;Node_ID=<%=Node_ID%>"><img src="/images/calendar/7arrowRight.gif" border="0" WIDTH="7" HEIGHT="7"></a>
  833. </TD>
  834. </TR>
  835. <TR ALIGN="center" BGCOLOR="<%=inactiveTab%>">
  836. <TD BGCOLOR="<%=activeTab%>" HEIGHT="15" NOWRAP>&nbsp;&nbsp;<FONT size="<%=fontSize%>" color="<%=inactiveTab%>"><STRONG>Day</STRONG></FONT>&nbsp;&nbsp;</TD>
  837. <TD HEIGHT="15" NOWRAP>&nbsp;&nbsp;<A class="tabLink" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Month&amp;Date=<%=dDate%>&amp;Node_ID=<%=Node_ID%>"><FONT size="<%=fontSize%>"><strong>Month</strong></FONT></A>&nbsp;&nbsp;</TD>
  838. <TD HEIGHT="15" NOWRAP>&nbsp;&nbsp;<A class="tabLink" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Year&amp;Date=<%=dDate%>&amp;Node_ID=<%=Node_ID%>"><FONT size="<%=fontSize%>"><strong>Year</strong></FONT></A>&nbsp;&nbsp;</TD>
  839. </TR>
  840. <TR ALIGN="center" BGCOLOR="<%=inactiveTab%>">
  841. <TD WIDTH="5" HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  842. <TD BGCOLOR="<%=activeTab%>" HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  843. <TD WIDTH="7" COLSPAN="3"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="7" HEIGHT="1"></TD>
  844. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  845. <TD WIDTH="7" COLSPAN="3"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="7" HEIGHT="1"></TD>
  846. <TD HEIGHT="1" NOWRAP COLSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  847. <TD WIDTH="100%" HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  848. </TR>
  849. <TR BGCOLOR="<%=tabsOutside%>">
  850. <TD HEIGHT="3" COLSPAN="17"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="3" HEIGHT="3"></TD>
  851. </TR>
  852. </TABLE>
  853. <%ElseIf tabView = "month" Then 'View = day%>
  854. <TABLE CELLPADDING="0" CELLSPACING="0" HEIGHT="17" WIDTH="100%" BORDER="0">
  855. <TR ALIGN="center" BGCOLOR="<%=inactiveTab%>">
  856. <TD WIDTH="5" BGCOLOR="<%=tabsOutside%>" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="5" HEIGHT="16"></TD>
  857. <TD WIDTH="1" ROWSPAN="3"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="17"></TD>
  858. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  859. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  860. <TD WIDTH="5" BGCOLOR="<%=tabsOutside%>" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="5" HEIGHT="16"></TD>
  861. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  862. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  863. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  864. <TD WIDTH="5" BGCOLOR="<%=tabsOutside%>" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="5" HEIGHT="16"></TD>
  865. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  866. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  867. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  868. <TD WIDTH="100%" BGCOLOR="<%=tabsOutside%>" NOWRAP ROWSPAN="2" align="right"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1">
  869. <a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Month&amp;Date=<%=SubtractOneMonth(dDate)%>&amp;Node_ID=<%=Node_ID%>"><img src="/include/calendar/images/7arrowleft.gif" border="0" WIDTH="7" HEIGHT="7"></a>
  870. <font size="2" face="verdana"><strong><%=(MonthName(Month(dDate))) & ", " & DatePart("yyyy",dDate)%></strong></font>
  871. <a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Month&amp;Date=<%=AddOneMonth(dDate)%>&amp;Node_ID=<%=Node_ID%>"><img src="/include/calendar/images/7arrowRight.gif" border="0" WIDTH="7" HEIGHT="7"></a>
  872. </TD>
  873. </TR>
  874. <TR ALIGN="center" BGCOLOR="<%=inactiveTab%>">
  875. <TD HEIGHT="15" NOWRAP>&nbsp;&nbsp;<A class="tabLink" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;Date=<%=dDate%>&amp;Node_ID=<%=Node_ID%>"><FONT size="<%=fontSize%>"><strong>Day</strong></FONT></A>&nbsp;&nbsp;</TD>
  876. <TD BGCOLOR="<%=activeTab%>" HEIGHT="15" NOWRAP>&nbsp;&nbsp;<FONT size="<%=fontSize%>" color="<%=inactiveTab%>"><STRONG>Month</STRONG></FONT>&nbsp;&nbsp;</TD>
  877. <TD HEIGHT="15" NOWRAP>&nbsp;&nbsp;<A class="tabLink" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Year&amp;Date=<%=dDate%>&amp;Node_ID=<%=Node_ID%>"><FONT size="<%=fontSize%>"><strong>Year</strong></FONT></A>&nbsp;&nbsp;</TD>
  878. </TR>
  879. <TR ALIGN="center" BGCOLOR="<%=inactiveTab%>">
  880. <TD WIDTH="5" HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  881. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  882. <TD WIDTH="7" COLSPAN="3"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="7" HEIGHT="1"></TD>
  883. <TD BGCOLOR="<%=activeTab%>" HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  884. <TD WIDTH="7" COLSPAN="3"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="7" HEIGHT="1"></TD>
  885. <TD HEIGHT="1" NOWRAP COLSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  886. <TD WIDTH="100%" HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  887. </TR>
  888. <TR BGCOLOR="<%=tabsOutside%>">
  889. <TD HEIGHT="3" COLSPAN="17"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="3" HEIGHT="3"></TD>
  890. </TR>
  891. </TABLE>
  892. <%Else 'View = year%>
  893. <TABLE CELLPADDING="0" CELLSPACING="0" HEIGHT="17" WIDTH="100%" BORDER="0">
  894. <TR ALIGN="center" BGCOLOR="<%=inactiveTab%>">
  895. <TD WIDTH="5" BGCOLOR="<%=tabsOutside%>" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="5" HEIGHT="16"></TD>
  896. <TD WIDTH="1" ROWSPAN="3"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="17"></TD>
  897. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  898. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  899. <TD WIDTH="5" BGCOLOR="<%=tabsOutside%>" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="5" HEIGHT="16"></TD>
  900. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  901. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  902. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  903. <TD WIDTH="5" BGCOLOR="<%=tabsOutside%>" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="5" HEIGHT="16"></TD>
  904. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  905. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  906. <TD WIDTH="1" ROWSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="16"></TD>
  907. <TD WIDTH="100%" BGCOLOR="<%=tabsOutside%>" NOWRAP ROWSPAN="2" align="right"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1">
  908. <a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Year&amp;Date=<%=SubtractOneYear(dDate)%>&amp;Node_ID=<%=Node_ID%>"><img src="/include/calendar/images/7arrowleft.gif" border="0" WIDTH="7" HEIGHT="7"></a>
  909. <font size="2" face="verdana"><strong><%=Year(dDate)%></strong></font>
  910. <a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Year&amp;Date=<%=AddOneYear(dDate)%>&amp;Node_ID=<%=Node_ID%>"><img src="/include/calendar/images/7arrowRight.gif" border="0" WIDTH="7" HEIGHT="7"></a>
  911. </TD>
  912. </TR>
  913. <TR ALIGN="center" BGCOLOR="<%=inactiveTab%>">
  914. <TD HEIGHT="15" NOWRAP>&nbsp;&nbsp;<A class="tabLink" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;Date=<%=dDate%>&amp;Node_ID=<%=Node_ID%>"><FONT size="<%=fontSize%>"><strong>Day</strong></FONT></A>&nbsp;&nbsp;</TD>
  915. <TD HEIGHT="15" NOWRAP>&nbsp;&nbsp;<A class="tabLink" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Month&amp;Date=<%=dDate%>&amp;Node_ID=<%=Node_ID%>"><FONT size="<%=fontSize%>"><strong>Month</strong></FONT></A>&nbsp;&nbsp;</TD>
  916. <TD BGCOLOR="<%=activeTab%>" HEIGHT="15" NOWRAP>&nbsp;&nbsp;<FONT size="<%=fontSize%>" color="<%=inactiveTab%>"><STRONG>Year</STRONG></FONT>&nbsp;&nbsp;</TD>
  917. </TR>
  918. <TR ALIGN="center" BGCOLOR="<%=inactiveTab%>">
  919. <TD WIDTH="5" HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  920. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  921. <TD WIDTH="7" COLSPAN="3"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="7" HEIGHT="1"></TD>
  922. <TD HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  923. <TD WIDTH="7" COLSPAN="3"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="7" HEIGHT="1"></TD>
  924. <TD BGCOLOR="<%=activeTab%>" HEIGHT="1" NOWRAP COLSPAN="2"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  925. <TD WIDTH="100%" HEIGHT="1" NOWRAP><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="1" HEIGHT="1"></TD>
  926. </TR>
  927. <TR BGCOLOR="<%=tabsOutside%>">
  928. <TD HEIGHT="3" COLSPAN="17"><IMG SRC="/include/calendar/images/spacer.gif" WIDTH="3" HEIGHT="3"></TD>
  929. </TR>
  930. </TABLE>
  931. <%End If%>
  932. <%End Sub%>
  933. <%'Builds a page full of monthly calendars for the particular year
  934. Public Sub dispYear (byVal Node_ID, dDate)%>
  935. <div align="left">
  936. <table cellspacing="0" cellpadding="0" border="0">
  937. <tr>
  938. <!--This first column is only here to make the year view consistent with the month and day views-->
  939. <td width="125">&nbsp</td>
  940. <td>
  941. <table cellspacing="2" cellpadding="2" border="0">
  942. <tr>
  943. <td><%dispTabs Node_ID, dDate, "year"%></td>
  944. </tr>
  945. <tr>
  946. <td>
  947. <table cellspacing="2" cellpadding="2" border="0">
  948. <%'The month index will represent each month, starting with January. Then a table will be built
  949. 'that has 4 rows and 3 columns to hold each monthly calendar.
  950. monthIndex = 1
  951. For y = 1 to 4%>
  952. <tr>
  953. <%For x = 1 to 3
  954. newDate = monthIndex & "/1/" & Year(dDate)%>
  955. <td valign="top">
  956. <table border="0" cellpadding="2" cellspacing="0" width="100%">
  957. <tr>
  958. <td colspan="7" align="center" bgcolor="white"><font size="2"><a class="Date" href="<%=Request.ServerVariables("SCRIPT_NAME")%>?View=Month&amp;Date=<%=newDate%>&amp;Node_ID=<%=Node_ID%>"><%=MonthName(monthIndex)%></a></font></td>
  959. </tr>
  960. <tr>
  961. <td class="DayBar" align="center"><font color="white" size="1">S</font></td>
  962. <td class="DayBar" align="center"><font color="white" size="1">M</font></td>
  963. <td class="DayBar" align="center"><font color="white" size="1">T</font></td>
  964. <td class="DayBar" align="center"><font color="white" size="1">W</font></td>
  965. <td class="DayBar" align="center"><font color="white" size="1">T</font></td>
  966. <td class="DayBar" align="center"><font color="white" size="1">F</font></td>
  967. <td class="DayBar" align="center"><font color="white" size="1">S</font></td>
  968. </tr>
  969. <%'Find the weekday of the first day of the month
  970. mstDate = WeekDay(CDate(newDate))
  971. 'eDate is the day that the monthly calendar needs to start on - it may be the first day
  972. 'of the current month, or it may be one of the last days of the previous months
  973. eDate = DateAdd("d", -mstDate + 1,CDate(newDate))%>
  974. <%'Build the calendar - Builds a default 6 rows for each calendar. If there is no data in the
  975. 'first or last row then it won't matter because the background will be white
  976. For row = 1 to 6%>
  977. <tr>
  978. <%For column = 1 to 7%>
  979. <%If eDate = Date() Then 'highlite the current day%>
  980. <td class="CurrentDay" valign="top" align="center">
  981. <font size="1"><a class="smallCalendarDate" href="<%Request.ServerVariables("SCRIPT_NAME")%>?View=Day&amp;