<% option explicit 'on error resume next %> <% dim oConn set oConn = server.createobject("adodb.connection") oConn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("/db/kcrhca.mdb") & ";" %> <% dim anchorDate dim nextAnchor dim prevAnchor dim iYear dim iMonth dim iDay dim iWeekDay dim iMonthLen dim ssDate dim linkDate dim startDate dim ssNextMo dim oRS dim sql dim aRS dim cal dim w1, w2, w3, w4, w5, w6 dim ii dim bNothing dim rr dim headline dim output function getMonthLen() dim str dim dat dim monthlength iDay = day(anchorDate) iMonth = month(anchorDate) iYear = year(anchorDate) if iMonth = 12 then str = "01/01/" & cstr(cint(iYear) + 1) else str = cstr(cint(iMonth) + 1) & "/01/" & iYear end if dat = cdate(str) - 1 monthlength = day(dat) getMonthLen = monthlength end function function getCell(d) dim displaymeeting, fid, gC dim sDate dim rr gC = "" & formatnumber(d,0) & "
" if bNothing then getCell = gC exit function end if for rr = 0 to ubound(aRS,2) if day(aRS(1,rr)) = d then sDate = formatdatetime(aRS(1,rr),0) gC = "" & formatnumber(d,0) & "
CLICK" end if next getCell = gC end function '****************** if request.querystring("date") = "" then anchorDate = date else anchorDate = cdate(request.querystring("date")) end if nextAnchor = DateAdd("m", 1, anchorDate) prevAnchor = DateAdd("m", -1, anchorDate) 'response.write "raw: " & request.querystring("date") & "
" 'response.write "anchorDate: " & anchorDate & "
" 'response.write "nextAnchor: " & nextAnchor & "
" 'response.write "prevAnchor: " & prevAnchor & "
" 'response.end iDay = day(anchorDate) iMonth = month(anchorDate) iYear = year(anchorDate) ssDate = iMonth & "/01/" & iYear if iMonth = 12 then ssNextMo = "01/01/" & cstr(cint(iYear) + 1) else ssNextMo = cstr(cint(iMonth) + 1) & "/01/" & iYear end if startDate = cdate(ssDate) iWeekDay = cint(weekday(startDate)) iMonthLen = getMonthLen() sql = "SELECT id, [date], title, body, location, [time] FROM calendar WHERE [date] >= #" & ssDate & "# AND [date] < #" & ssNextMo & "# ORDER BY [date], title " oConn.errors.clear() set oRS = oConn.execute(sql) if oConn.errors.count > 0 then response.write "SQL error: " & oConn.errors(0).description & "

" & sql response.end end if if oRS.eof then bNothing = true else aRS = oRS.getrows() end if set oRS = nothing cal = cal & "" cal = cal & "" cal = cal & "
" cal = cal & "
<<Prev" & monthname(iMonth) & " " & iYear & "Next>>
" cal = cal & "
" cal = cal & "" cal = cal & "" if iWeekday > 1 then for ii = 1 to (iWeekday - 1) cal = cal & "" next for w1 = 1 to 7 - (ii - 1) linkDate = iMonth & "/" & w1 & "/" & iYear cal = cal & getCell(w1) next else for w1 = 1 to 7 linkDate = iMonth & "/" & w1 & "/" & iYear cal = cal & getCell(w1) next end if cal = cal & "" for w2 = (w1) to (w1 + 6) linkDate = iMonth & "/" & w2 & "/" & iYear cal = cal & getCell(w2) next cal = cal & "" for w3 = (w2) to (w2 + 6) linkDate = iMonth & "/" & w3 & "/" & iYear cal = cal & getCell(w3) next cal = cal & "" for w4 = (w3) to (w3 + 6) linkDate = iMonth & "/" & w4 & "/" & iYear cal = cal & getCell(w4) next cal = cal & "" for w5 = (w4) to (w4 + 6) if w5 <= iMonthLen then linkDate = iMonth & "/" & w5 & "/" & iYear cal = cal & getCell(w5) end if next if w5 <= iMonthLen then cal = cal & "" end if for w6 = (w5) to (w5 + 6) if w6 <= iMonthLen then linkDate = iMonth & "/" & w6 & "/" & iYear cal = cal & getCell(w6) end if next cal = cal & "
SunMonTueWedThuFriSat
 
" 'END CALENDAR 'START NEWS sql = "SELECT id, [date], title, location, [time], body FROM calendar WHERE homepage = 1 ORDER BY [date] desc, [time] asc " set oRs = oConn.execute(sql) if not oRs.eof then aRs = oRs.getrows() set oRs = nothing for rr = 0 to ubound(aRs,2) headline = aRs(2,rr) output = output & "
  • " & headline & "
  • " & chr(10) next end if %> Kansas City Regional Home Care Association

    News and Calendar

      <%=output%>
    <%=cal%>