<% Function FormatStr(String) on Error resume next String = Replace(String, CHR(13), "") String = Replace(String, CHR(10) & CHR(10), "

") String = Replace(String, CHR(10), "
") FormatStr = String End Function '-------------------------------------------------- Function DtPrevSunday(ByVal dt) Do While WeekDay(dt) > vbSunday dt = DateAdd("d", -1, dt) Loop DtPrevSunday = dt End Function '-------------------------------------------------- function dNum(n) if n >= 10 then dNum = cstr(n) Else dNum = "0" & cstr(n) End If End Function 'SQL Formatted Date Function SQLDate(dt) SQLDate = cdbl(dt) End Function Sub diary(dtView,days) if days > "" then arDates = split(days, ",") End if dtToday = Date() ' Get fiobjRst day of month dttmp = dtView dtday = day(dttmp) dttmp = dateadd("d", (-dtday+1), dttmp) dtCurViewMonth = dttmp %> <% For iDay = vbSunday To vbSaturday %> <%Next %> <% dtCurViewDay = DtPrevSunday(dtCurViewMonth) For iWeek = 0 To 5 Response.Write "" & vbCrLf For iDay = 0 To 6 If Month(dtCurViewDay) = Month(dtCurViewMonth) Then if days > "" then Done = false for i = 0 to ubound(arDates) if cdbl(dtCurViewday) = cdbl(arDates(i)) then Response.Write "" & vbCrLf dtCurViewDay = DateAdd("d", 1, dtCurViewDay) Next Response.Write "" & vbCrLf Next %> <% ' --------END OF DRAW CALENDAR SECTION-------- Response.Write "
<%=MonthName(Month(dtCurViewMonth)) & " " & Year(dtCurViewMonth)%>
<%=WeekDayName(iDay, true)%>
" Done = true End If next if Done = false then Response.Write "" Else Response.Write "" End if Response.Write Day(dtCurViewDay) & "" Else Response.Write "" End If Response.Write "
" End Sub %> Diary Manager
Return to events Calendar 
FUTURE EVENTs
<% strsql="select * from Diary_Categorys order by Category" set rs=cn.execute(strsql) while not rs.eof set objRs = Server.CreateObject("ADODB.Recordset") SQL = "SELECT * from diary where dte >= " & cdbl(date()) & " and Category="&rs("Cat_ID")&" order by dte" objRs.Open SQL,cn, 1, 1 %> <% if objRs.EOF or objRs.BOF then d = cdbl(date()) Else d = cdbl(objRs("dte")) %> <% do until objRs.EOF i=i+1 %> <% objRs.movenext loop %>
<%=rs("Category")%>
<%=i%>. "><%= objRs("etitle")%> (<%= day(objRs("dte")) & " "& monthname(month(objRs("dte"))) & " " & year(objRs("dte")) & ""%> - <%= day(objRs("enddate")) & " "& monthname(month(objRs("enddate"))) & " " & year(objRs("enddate")) & ""%>)

<% end if rs.movenext wend if i=0 then Response.Write "
No Events Found
" end if %>
<% data = Replace(data, ",", "", 1, 1) if d = "" then d = now diary d, data%>
<% diary dateadd("m", 1, d), data %>
<% diary dateadd("m", 2, d), "" %>