<%@LANGUAGE="VBSCRIPT"%> <% Dim strToday IF Request.QueryString("d") <> "" THEN strDayChosen = Request.QueryString("d") strMonth = Request.QueryString("m") strYear = Request.QueryString("y") ELSE IF Request.Form("month") <> "" THEN strMonth = Request.Form("month") strYear = Request.Form("year") ELSE strMonth = Month(Now) If strMonth < 10 THEN strMonth = "0" & strMonth else strMonth = strMonth END IF strMonth = CStr(strMonth) strYear = CStr(Year(Now)) strDayChosen = Cstr(Day(Now)) END IF END IF strToday = Now() SET Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_phone_STRING Recordset1.Source = "SELECT * FROM chapelbar_calendar WHERE booking_month = '" & strMonth & "' AND booking_year = '" & strYear & "' AND live LIKE 'yes' ORDER BY booking_day ASC" Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockType = 3 Recordset1.Open() 'Response.write Recordset1.Source Recordset1_numRows = 0 SET Recordset2 = Server.CreateObject("ADODB.Recordset") Recordset2.ActiveConnection = MM_phone_STRING Recordset2.CursorType = 0 Recordset2.CursorLocation = 2 Recordset2.LockType = 3 'Recordset2.Open() 'Response.write Recordset1.Source Recordset1_numRows = 0 %> <% Dim Repeat1__numRows Repeat1__numRows = -1 Dim Repeat1__index Repeat1__index = 0 Recordset1_numRows = Recordset1_numRows + Repeat1__numRows %> <% Dim strNoDays If strMonth = "01" THEN strNoDays = 31 strMonthName = "January" END IF If strMonth = "02" AND strYear = "2004" THEN strNoDays = 29 strMonthName = "February" END IF If strMonth = "02" AND strYear <> "2004" THEN strNoDays = 28 strMonthName = "February" END IF If strMonth = "03" THEN strNoDays = 31 strMonthName = "March" END IF If strMonth = "04" THEN strNoDays = 30 strMonthName = "April" END IF If strMonth = "05" THEN strNoDays = 31 strMonthName = "May" END IF If strMonth = "06" THEN strNoDays = 30 strMonthName = "June" END IF If strMonth = "07" THEN strNoDays = 31 strMonthName = "July" END IF If strMonth = "08" THEN strNoDays = 31 strMonthName = "August" END IF If strMonth = "09" THEN strNoDays = 30 strMonthName = "September" END IF If strMonth = "10" THEN strNoDays = 31 strMonthName = "October" END IF If strMonth = "11" THEN strNoDays = 30 strMonthName = "November" END IF If strMonth = "12" THEN strNoDays = 31 strMonthName = "December" END IF %> Listings
Chapel Bar
<% 'get the day of the first day of the month StrStartDate = "01/" & strMonth & "/" & strYear StrStartDate = DateSerial(strYear,strMonth,01) VarStartDate = Weekday(StrStartDate) VarStartDate = Cstr(VarStartDate) VarDoCode = "0" Y = 0 %>
Month:
<% Z = 0 %> <% For X = 1 to 42 %> <% if Z mod 2 then %> <% strBG = "#ffffff" %> <% else %> <% strBG = "#F4F4F4" %> <% end if %> <% IF Cstr(X) = VarStartDate THEN VarDoCode = "1" %> <% IF VarDoCode = "1" AND (Y < strNoDays) THEN %> <% Y = Y + 1 %> <% If Y < 10 THEN strDay = "0" & Y DayLink = Y else strDay = Y DayLink = Y END IF %> <% strCellwidth = (960/strNoDays) strTest = strDay strTest = CStr(strTest) %> <% Recordset1.requery %> <% 'END IF %> <% StrThisDate = strTest & "/" & strMonth & "/" & strYear VarThisDate = Weekday(StrThisDate) VarTheDayName = Weekday(VarThisDate) VarTheDayName = WeekdayName(VarTheDayName,true) VarTheDayName = Cstr(VarTheDayName) %> <% If X = 7 or X = 14 or X = 21 or X = 28 or X = 35 THEN %> <% Z = 1 %> <% END IF %> <% ELSE %> <% If X = 7 or X = 14 or X = 21 or X = 28 or X = 35 THEN %> <% Z = 1 %> <% END IF %> <% END IF %> <% Z = Z + 1 %> <% Next %>
Listings for <%=StrMonthName%>, <%=strYear%>:
<% strDayChosen = strDay %> <%Recordset2.Source = "SELECT * FROM chapelbar_calendar WHERE booking_month = '" & strMonth & "' AND booking_year = '" & strYear & "' AND booking_day = '" & strDayChosen & "' AND live LIKE 'yes' ORDER BY booking_day ASC" %> <% Recordset2.Open %> <% IF NOT Recordset2.EOF THEN %> <% While NOT Recordset2.EOF %> <% Recordset2.MoveNext %> <% Wend %> <% ELSE %> <% END IF %> <% Recordset2.Close %>
<%= VarTheDayName & " " & strTest %>