% Session.LCID=3081 Dim connection, rs, ps, tMonth(12), qMonth(12) edur = Request("edur") cat = request("cat") weekd = Date() info = request("info") fx = request("f1") if fx = "" then fx = "town" end if tMonth(1) = "Jan" tMonth(2) = "Feb" tMonth(3) = "Mar" tMonth(4) = "Apr" tMonth(5) = "May" tMonth(6) = "Jun" tMonth(7) = "Jul" tMonth(8) = "Aug" tMonth(9) = "Sep" tMonth(10) = "Oct" tMonth(11) = "Nov" tMonth(12) = "Dec" qMonth(1) = "31" qMonth(2) = "28" qMonth(3) = "31" qMonth(4) = "30" qMonth(5) = "31" qMonth(6) = "30" qMonth(7) = "31" qMonth(8) = "31" qMonth(9) = "30" qMonth(10) = "31" qMonth(11) = "30" qMonth(12) = "31" ydate = split(weekd,"/") sDate = yDate(0)&"-"&tMonth(yDate(1))&"-"&yDate(2) if edur = "" then edur="week" end if set connection=server.createobject("adodb.connection") connection.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=e:/macedonranges.org.au/wwwroot/databases/eventsdb.mdb" sMonth = DatePart("m", Date()) sYear = DatePart("yyyy", Date()) Mth = tMonth(sMonth) set ds = connection.execute("DELETE * FROM events WHERE enddate<#1-"&Mth&"-"&sYear&"#") if edur = "week" and info = "" then if Weekday(weekd) > 1 then inputdate = inputdate + 7 end if weekdays = inputdate weekdate = DateAdd("d",weekdays,weekd) weekdate = Cdate(weekdate) xDate = split(weekdate,"/") tDate = xDate(0)&"-"&tMonth(xDate(1))&"-"&xDate(2) end if if edur = "month" and info = "" then weekdate = Cdate(weekd) xDate = split(weekdate,"/") tDate = qMonth(xDate(1))&"-"&tMonth(xDate(1))&"-"&xDate(2) end if if edur = "monthplus" and info = "" then weekdate = Cdate(weekd) xDate = split(weekdate,"/") if xDate(1) <=11 then xDate(1) = xDate(1) + 1 else xDate(1) = 1 xDate(2) = xDate(2) + 1 end if tDate = qMonth(xDate(1))&"-"&tMonth(xDate(1))&"-"&xDate(2) sDate = "01-"&tMonth(xDate(1))&"-"&xDate(2) end if if edur = "annual" and info = "" then weekdate = Cdate(weekd) xDate = split(weekdate,"/") tDate = "31-Dec-"&xDate(2) end if if edur = "next" and info = "" then weekdate = Cdate(weekd) xDate = split(weekdate,"/") tDate = "31-Dec-"&(xDate(2)+1) sDate = "1-Jan-"&(xDate(2)+1) end if if cat = "Festival" then SQA = " eventtype='Festival' AND " end if if cat = "Market" then SQA = SQA & "eventtype='Market' AND " end if if cat = "Sport" then SQA = SQA & "eventtype='Sport' AND " end if if cat = "Entertainment" then SQA = SQA & "eventtype='Entertainment' AND " end if if cat = "Community" then SQA = SQA & "eventtype='Community' AND " end if if fx = "ALL" and info = "" then SQX = "SELECT * FROM events WHERE " & SQA &" events.StartDate>=#"&sDate&"# AND events.StartDate<=#"&tDate&"#" &_ " OR " & SQA & "events.EndDate>=#"&sDate&"# AND events.EndDate<=#"&tDate&"# " &_ " OR " & SQA & "events.StartDate>=#"&sDate&"# AND events.StartDate<=#"&tDate&"#" &_ " OR " & SQA & "events.EndDate>=#"&sDate&"# AND events.EndDate<=#"&tDate&"#" &_ " OR " & SQA & "events.StartDate<=#"&sDate&"# AND events.EndDate>=#"&tDate&"#" &_ " OR " & SQA & "events.StartDate<=#"&sDate&"# AND events.EndDate>=#"&tDate&"#" &_ " ORDER BY startdate, starttime" end if if fx ="town" and info = "" then SQX = "SELECT * FROM events WHERE " & SQA & "events.StartDate>=#"&sDate&"# AND events.StartDate<=#"&tDate&"# AND events.batagroup='MMTA'" &_ " OR " & SQA & "events.EndDate>=#"&sDate&"# AND events.EndDate<=#"&tDate&"# AND events.batagroup='MMTA'" &_ " OR " & SQA & "events.StartDate>=#"&sDate&"# AND events.StartDate<=#"&tDate&"# AND events.Swide=True" &_ " OR " & SQA & "events.EndDate>=#"&sDate&"# AND events.EndDate<=#"&tDate&"# AND events.Swide=True" &_ " OR " & SQA & "events.StartDate<=#"&sDate&"# AND events.EndDate>=#"&tDate&"# AND events.batagroup='MMTA'" &_ " OR " & SQA & "events.StartDate<=#"&sDate&"# AND events.EndDate>=#"&tDate&"# AND events.Swide=True" &_ " ORDER BY startdate, starttime" end if if info <> "" then SQX = "SELECT * FROM events WHERE eventid="&info end if set rs = connection.execute(SQX) set cs = connection.execute("SELECT * FROM ecat ORDER BY eventtype") %>
<%if info = "" then%> Events
|