<% Function LastDayOfMonth(sMonth, sYear) 'Returns the last day of the month/year passed in "mm/dd/yyyy" format dim tmpMonth, tmpYear tmpMonth = sMonth tmpYear = sYear LastDayOfMonth = dateadd("d", -1, Dateadd("m", 1, tmpMonth & "/1/" & tmpYear)) End Function if request.QueryString("today")="true" then session("cur")="" end if Sub DropDown(tbl, valField, Field) dim counterop,color set rsDrop = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT DISTINCT " & valField & ", " & Field & " FROM " & tbl & _ " ORDER BY " & field rsDrop.Open strSQL, cn Response.Write "" do until rsDrop.EOF counterop=counterop+1 if counterop mod 3=1 then color="one" elseif counterop mod 3=2 then color="two" elseif counterop mod 3=0 then color="three" end if Response.Write "" & vbcrlf rsDrop.MoveNext loop Response.Write "" rsDrop.Close set rsDrop=nothing end sub %> <% dim objRs, objCon, dtToday cat = Request.QueryString("cat") if cat = "" then cat =0 End If ' Format the ouput 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) ' Year(dt) & "-" & DNum(Month(dt)) & "-" & Dnum(Day(dt)) & " " & dnum(hour(dt)) & ":" & dnum(Minute(dt)) End Function ' Get the previous sundays date Function DtPrevSunday(ByVal dt) Do While WeekDay(dt) > vbSunday dt = DateAdd("d", -1, dt) Loop DtPrevSunday = dt End Function 'Todays Date dtToday = Date() Dim dtCurViewMonth ' First day of the currently viewed month Dim dtCurViewDay ' Current day of the currently viewed month Dim frmDate ' Date submitted by form ' if the GO button was used, build the date from the month and year If InStr(1, Request.Form, "subGO", 1) > 0 then if Request.Form("CURDATE_month") = "" then tmpMonth = month(now()) else tmpMonth = Request.Form("CURDATE_month") End If if Request.Form("CURDATE_year") = "" then tmpyear = year(now()) else tmpyear = Request.Form("CURDATE_year") End If tmpDate = "1 " & tmpMonth & " 1999" mnth = Month(tmpDate) frmDate = DateSerial(tmpyear, mnth, 1) Else frmDate = Request.Form("CURDATE") end if if Request("view_date") <> "" then frmDate= DateSerial(year(Request("view_date")), month(Request("view_date")), 1) end if ' if posted from the form ' if prev button was hit on the form If InStr(1, Request.Form, "subPrev", 1) > 0 Then dtCurViewMonth = DateAdd("m", -1, frmDate) cur=dtCurViewMonth ' if next button was hit on the form ElseIf InStr(1, Request.Form, "subNext", 1) > 0 Then dtCurViewMonth = DateAdd("m", 1, frmDate) cur=dtCurViewMonth ' anyother time Else ' date add in text box If InStr(1, Request.Form, "subGO", 1) > 0 then dtCurViewMonth = frmDate cur=dtCurViewMonth Else if Request("view_date") <> "" then dtCurviewMonth = frmDate else if session("cur")="" then dtCurViewMonth = DateSerial(Year(dtToday), Month(dtToday), 1) cur=dtCurViewMonth else dtCurViewMonth=session("cur") cur=dtCurViewMonth end if End If End If End If session("cur")=dtCurViewMonth Dim iDay, iWeek, sFontColor strSQL ="SELECT diary.id, diary.dte,diary.enddate, diary.contact, diary.remark,diary.etitle, diary.sub_category, Diary_Categorys.Category, Diary_Categorys.Colour, Diary_Categorys.BgColour" & _ " FROM Diary_Categorys RIGHT JOIN diary ON Diary_Categorys.Cat_ID = diary.Category WHERE diary.sub_category <>1 " if cat <> 0 then strSQL = strSQL & " where Diary_Categorys.Cat_ID = " & cat &"" End If strSQL = strSQL & "order by diary.dte,diary.enddate" set objRs = cn.Execute (StrSql) '//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// %>


Happenings @ SEDC Tourism &Hospitality

 

Click Event for further information

<%=MonthName(Month(dtCurViewMonth)) & " " & Year(dtCurViewMonth)%>
<% sBGCOLOR = "cell" If Month(dtCurViewDay) = Month(dtCurViewMonth) Then If dtCurViewDay = dtToday Then sBGCOLOR = "cellTodaylist" else sBGCOLOR = "celllist" End If if not objRs.eof then while not objRs.eof dayno=day(cdate(objRs("dte"))) if dayno=1 or dayno=31then p="st" elseif dayno=2 then p="nd" elseif dayno=3 then p="rd" else p="th" end if dayend=day(cdate(objRs("enddate"))) if dayend=1 or dayend=31 then p2="st" elseif dayend=2 then p2="nd" elseif dayend=3 then p2="rd" else p2="th" end if lnk = "" &_ objRs("etitle") & "" if cur >= DateSerial(Year(objRs("dte")), Month(objRs("dte")), 1) and cur <= DateSerial(Year(objRs("enddate")), Month(objRs("enddate")), 1)then i=i+1 %> <% end if objRs.movenext wend 'objRs.movefirst end if %>
Event
Date
Organizer
<%=day(cdate(objRs("dte")))%>  <%=monthname(month(objRs("dte")))%>  <%=year(objRs("enddate"))%> -
<%=day(cdate(objRs("enddate")))%> <%=monthname(month(objRs("enddate")))%> <%=year(objRs("enddate"))%>
<%=objRs("category")%>