<% Response.ExpiresAbsolute = dateadd("d", -5, date()) Response.Expires = -10 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 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 '-------------------------------------------------- Function DtPrevSunday(ByVal dt) Do While WeekDay(dt) > vbSunday dt = DateAdd("d", -1, dt) Loop DtPrevSunday = dt End Function '-------------------------------------------------- Sub diary(dtView,days) if days > "" then arDates = split(days, ",") End if dtToday = Date() ' Get first day of month dttmp = dtView dtday = day(dttmp) dttmp = dateadd("d", (-dtday+1), dttmp) dtCurViewMonth = dttmp %> Diary Manager <% 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) Response.Write cdbl(dtCurViewday) = cdbl(arDates(i)) & "
" 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 %>

Events
<%if Session("DiaryAdmin") then %> ', 400, 400)">Edit Event | <% end if %> Back
<% set objCon= Server.CreateObject("ADODB.Connection") set objrs = Server.CreateObject("ADODB.Recordset") objCon.Open strCon SQL = "SELECT diary.id, diary.dte, diary.etime, diary.stime, diary.text_field, Diary_Categorys.Category, diary.Details, diary.location FROM Diary_Categorys RIGHT JOIN diary ON Diary_Categorys.Cat_ID = diary.Category WHERE " & _ " id = " & clng(Request.QueryString("ID")) objrs.Open SQL, objCon if objrs.EOF or objrs.BOF then Response.Write "
No Events Found
" d = cdbl(date) Else d = objrs("dte") End If %> <% if not (objrs.EOF or objrs.BOF) then if session("bDiaryAdmin") then%> <% end if end If %>
<%= objrs("text_field")%>, <%= day(objrs("dte")) & " "& monthname(month(objrs("dte"))) & " " & year(objrs("dte")) & " " & objrs("etime") & " to " & objrs("stime")%>
<%= objrs("category")%> at <%= formatStr(objrs("location"))%>
<%= formatStr(objrs("details"))%>
', 400, 400)">
Edit Event
<% if d = "" then d = cdbl(date) diary d, "" %>
<% diary dateadd("m", 1, d), "" %>
<% diary dateadd("m", 2, d), "" %>