<%@ Language="VBScript"%> <% response.Clear %> <% Sub getRS (rs,sql,conStr) set connection = Server.CreateObject("ADODB.Connection") set rs = Server.CreateObject("ADODB.Recordset") connection.Open conStr rs.open sql,connection End Sub Sub cleanRS (RS) RS.Close End Sub Sub cbackitem(cwhat) cwhat=replace(cwhat,"“",chr(34)) ' " cwhat=replace(cwhat,"‘",chr(39)) ' ' cwhat=replace(cwhat,"&",chr(38)) ' & response.write cwhat end sub sub TextBoxSH (id) response.write "style='border: 1px solid #FFFFFF' " _ & "onmouseover="&chr(34) & id&".style.border = '1px solid #000000' "&chr(34) _ & "onmouseout="&chr(34) & id&".style.border = '1px solid #FFFFFF' "&chr(34) end sub %> <% 'Vars - iMonth = to set month on cal ' iYear = to set the year on the cal ' xCel = the cel with 'must pass a month and year to the calendar iMonth=request("iMonth") iYear=request("iYear") xCel=request("xCel") if iMonth="" then iMonth=Month(date()) if iYear="" then iYear=Year(date()) if xCel="" then xCel=5 if iMonth=0 then iMonth=12 iYear=iyear - 1 end if if iMonth=13 then iMonth=1 iYear=iyear + 1 end if iDate=cDate(iMonth&"/1/"&iYear) LastDay=day(dateadd ("d", -1 , dateadd("m",1,iDate))) iStart=weekday (iDate) 'load the list of schedule dates in to a string conStr= "DBQ=" & Server.Mappath("./db/act.mdb") & "; Driver={Microsoft Access Driver (*.mdb)};" sqlStr = "select * from events where month([Start date])="&iMonth getRS rs,sqlStr,conStr do while not rs.eof fDates = fDates + ","&day(rs("Start date"))&"," rs.movenext loop %>
Events are on dates shown in red:

<%=MonthName(month(iDate))%>  <%=iYear%>

<<

<% i = 1 - iStart for y = 1 to 6 %> <% for x = 1 to 7 i = i + 1 %> <% next %> <% next %>
<% if i > 0 and i =< LastDay then temp = ","&i&"," if instr(fDates,temp) then response.write ""&i&"" else response.write i end if end if %>

>>


Home Page