<%@ CodePage=65001 %> <% 'Include Common Files @1-D6EDE132 %> <% 'End Include Common Files 'Initialize Page @1-1E75AD2F ' Variables Dim PathToRoot, ScriptPath, TemplateFilePath Dim FileName Dim Redirect Dim Tpl, HTMLTemplate Dim TemplateFileName Dim ComponentName Dim PathToCurrentPage ' Events Dim CCSEvents Dim CCSEventResult ' Connections Dim DBcalendar ' Page controls Dim header Dim infopanel Dim cal_month Dim footer Dim ChildControls Session.CodePage = CCSLocales.Locale.CodePage Response.Charset = CCSLocales.Locale.Charset Redirect = "" TemplateFileName = "index.html" Set CCSEvents = CreateObject("Scripting.Dictionary") PathToCurrentPage = "./" FileName = "index.asp" PathToRoot = "./" ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName)) TemplateFilePath = ScriptPath 'End Initialize Page 'Initialize Objects @1-5B119700 Set DBcalendar = New clsDBcalendar DBcalendar.Open ' Controls Set header = New clsheader header.Initialize "header", "" Set infopanel = New clsinfopanel infopanel.Initialize "infopanel", "" Set cal_month = New clsCalendarcal_month Set footer = New clsfooter footer.Initialize "footer", "" cal_month.Initialize DBcalendar ' Events %> <% BindEvents CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing) 'End Initialize Objects 'Execute Components @1-18DC04F7 header.Operations infopanel.Operations footer.Operations 'End Execute Components 'Go to destination page @1-6D35F4FD If NOT ( Redirect = "" ) Then UnloadPage Response.Redirect Redirect End If 'End Go to destination page 'Initialize HTML Template @1-3DCAECB5 CCSEventResult = CCRaiseEvent(CCSEvents, "OnInitializeView", Nothing) Set HTMLTemplate = new clsTemplate HTMLTemplate.Encoding = "utf-8" Set HTMLTemplate.Cache = TemplatesRepository HTMLTemplate.LoadTemplate TemplateFilePath & TemplateFileName Set Tpl = HTMLTemplate.Block("main") CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Nothing) 'End Initialize HTML Template 'Show Page @1-C32FA9AB Set ChildControls = CCCreateCollection(Tpl, Null, ccsParseOverwrite, _ Array(header, infopanel, cal_month, footer)) ChildControls.Show Dim MainHTML HTMLTemplate.Parse "main", False MainHTML = HTMLTemplate.GetHTML("main") CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeOutput", Nothing) If CCSEventResult Then Response.Write MainHTML 'End Show Page 'Function PagePathToRoot @1-FE5E6FF2 Function PagePathToRoot PagePathToRoot = "./" End Function 'End Function PagePathToRoot 'Unload Page @1-CB210C62 UnloadPage Set Tpl = Nothing Set HTMLTemplate = Nothing 'End Unload Page 'UnloadPage Sub @1-DAF04863 Sub UnloadPage() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUnload", Nothing) If DBcalendar.State = adStateOpen Then _ DBcalendar.Close Set DBcalendar = Nothing Set CCSEvents = Nothing Set header = Nothing Set infopanel = Nothing Set cal_month = Nothing Set footer = Nothing End Sub 'End UnloadPage Sub 'cal_month clsEvent @5-4D26812C Class clsEventcal_month Public Time Public category_image Public EventTime Public EventTimeEnd Public EventDescription Public EventDescriptionPage Public EventDescriptionParameters End Class 'End cal_month clsEvent Class clsCalendarcal_month 'cal_month Class @5-9BCB7EFF 'cal_month Variables @5-8F7BBDF5 ' Public variables Public ComponentName, CCSEvents Public Visible, Errors Public DataSource Public Command Public TemplateBlock Public CalendarEvents Public NowDate ' Calendar variables Public CurrentYear Public CurrentMonth Public CurrentDay Public CurrentDate Public CurrentProcessingDate Public CalendarStyles Public CurrentStyle Public CalendarType Private FirstWeekDay Private CalendarScope Private IsCurrentMonth Private MonthsInRow Private NowYear, NowMonth, NowDay Dim MonthBlock, WeekBlock, DayBlock, OtherDayBlock, EventRowBlock, WeekDaysBlock, YearControls , EmptyDayBlock, EmptyDayControls,MonthsRowSeparatorBlock, MonthRowSeparatorBlock Public Recordset Private CCSEventResult ' Calendar Controls Public StaticControls, WeekControls, DayControls, EventRowControls, WeekDaysControls Dim MonthDate Dim DayOfWeek Dim DayNumber Dim add_event Dim category_image Dim EventTime Dim EventTimeEnd Dim EventDescription Dim go_week Dim Navigator Dim CalendarTypes Dim YearIcon Dim MonthIcon Dim WeekIcon 'End cal_month Variables 'cal_month Class_Initialize Event @5-1695B22B Private Sub Class_Initialize() ComponentName = "cal_month" Visible = True Set CCSEvents = CreateObject("Scripting.Dictionary") Set Errors = New clsErrors Set CalendarEvents = New clsCCCalendarEvents FirstWeekDay = CCSLocales.Locale.FirstWeekDay MonthsInRow = 1 CalendarType = calMonth NowDate = Now() If CCGetFromGet("ccsForm", "") = ComponentName Then _ Redirect = FileName & "?" & CCGetQueryString("All", Array("ccsForm")) Set DataSource = New clscal_monthDataSource Set Command = New clsCommand Set MonthDate = CCCreateControl(ccsLabel, "MonthDate", Empty, ccsDate, Array("mmmm", " ", "yyyy"), CCGetRequestParam("MonthDate", ccsGet)) Set DayOfWeek = CCCreateControl(ccsLabel, "DayOfWeek", Empty, ccsDate, Array("dddd"), CCGetRequestParam("DayOfWeek", ccsGet)) Set DayNumber = CCCreateControl(ccsLink, "DayNumber", Empty, ccsDate, Array("d"), CCGetRequestParam("DayNumber", ccsGet)) Set add_event = CCCreateControl(ccsLink, "add_event", Empty, ccsText, Empty, CCGetRequestParam("add_event", ccsGet)) Set category_image = CCCreateControl(ccsImage, "category_image", Empty, ccsText, Empty, CCGetRequestParam("category_image", ccsGet)) Set EventTime = CCCreateControl(ccsLabel, "EventTime", Empty, ccsDate, Array("ShortTime"), CCGetRequestParam("EventTime", ccsGet)) Set EventTimeEnd = CCCreateControl(ccsLabel, "EventTimeEnd", Empty, ccsDate, Array("ShortTime"), CCGetRequestParam("EventTimeEnd", ccsGet)) Set EventDescription = CCCreateControl(ccsLink, "EventDescription", Empty, ccsText, Empty, CCGetRequestParam("EventDescription", ccsGet)) Set go_week = CCCreateControl(ccsLink, "go_week", Empty, ccsText, Empty, CCGetRequestParam("go_week", ccsGet)) Set Navigator = CCCreateCalendarNavigator("Navigator", FileName, 10, Me) Set CalendarTypes = CCCreatePanel("CalendarTypes") Set YearIcon = CCCreateControl(ccsLink, "YearIcon", Empty, ccsText, Empty, CCGetRequestParam("YearIcon", ccsGet)) Set MonthIcon = CCCreateControl(ccsLink, "MonthIcon", Empty, ccsText, Empty, CCGetRequestParam("MonthIcon", ccsGet)) Set WeekIcon = CCCreateControl(ccsLink, "WeekIcon", Empty, ccsText, Empty, CCGetRequestParam("WeekIcon", ccsGet)) CalendarTypes.AddComponents(Array(YearIcon,MonthIcon,WeekIcon)) Set CalendarStyles = Server.CreateObject("Scripting.Dictionary") CalendarStyles.Add "WeekdayName", "class=""CalendarWeekdayName""" CalendarStyles.Add "WeekendName", "class=""CalendarWeekendName""" CalendarStyles.Add "Day", "class=""CalendarDay""" CalendarStyles.Add "Weekend", "class=""CalendarWeekend""" CalendarStyles.Add "Today", "class=""CalendarToday""" CalendarStyles.Add "WeekendToday", "class=""CalendarWeekendToday""" CalendarStyles.Add "OtherMonthDay", "class=""CalendarOtherMonthDay""" CalendarStyles.Add "OtherMonthToday", "class=""CalendarOtherMonthToday""" CalendarStyles.Add "OtherMonthWeekend", "class=""CalendarOtherMonthWeekend""" CalendarStyles.Add "OtherMonthWeekendToday", "class=""CalendarOtherMonthWeekendToday""" End Sub 'End cal_month Class_Initialize Event 'cal_month Initialize Method @5-05754AED Sub Initialize(objConnection) If NOT Visible Then Exit Sub Set DataSource.Connection = objConnection End Sub 'End cal_month Initialize Method 'cal_month Class_Terminate Event @5-ACF62436 Private Sub Class_Terminate() Set DataSource = Nothing Set Command = Nothing Set Errors = Nothing Set CalendarStyles = Nothing End Sub 'End cal_month Class_Terminate Event 'cal_month Show Method @5-6C5C887C Sub Show(Tpl) If NOT Visible Then Exit Sub Dim RecordCounter, ShownRecords Dim CurrentFirstWeekDay, FirstDayMonth, DaysCurrentMonth, MonthCellStart, CellCount, I, L, DayEvents, DateField, Evnt, Diff Dim MonthControls, MonthRowSeparatorBlock, M Dim MonthFirst, MonthLast, MonthsCount, FirstProcessingDate, DaysInCurrentRow GetCurrentDate With DataSource .Parameters("sescategory") = Session("category") End With DaysCurrentMonth = DatePart("d", DateSerial (CurrentYear, CurrentMonth+1, 0)) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeSelect", Me) Set Recordset = DataSource.Open(Command) Set TemplateBlock = Tpl.Block("Calendar " & ComponentName) Set MonthBlock = TemplateBlock.Block("Month") Set WeekBlock = MonthBlock.Block("Week") Set WeekDaysBlock = MonthBlock.Block("WeekDays") Set MonthRowSeparatorBlock = TemplateBlock.Block("MonthsRowSeparator") Set DayBlock = WeekBlock.Block("Day") Set EventRowBlock = DayBlock.Block("EventRow") Set EmptyDayBlock = WeekBlock.Block("EmptyDay") Set YearControls = CCCreateCollection(TemplateBlock, Null, ccsParseAccumulate, _ Array(MonthDate, Navigator, CalendarTypes)) Set WeekControls = CCCreateCollection(WeekBlock, Null, ccsParseAccumulate, _ Array(go_week)) Set DayControls = CCCreateCollection(DayBlock, Null, ccsParseAccumulate, _ Array(DayNumber, add_event)) Set EventRowControls = CCCreateCollection(EventRowBlock, EventRowBlock, ccsParseAccumulate, _ Array(category_image, EventTime, EventTimeEnd, EventDescription)) Set WeekDaysControls = CCCreateCollection(WeekDaysBlock, Null, ccsParseAccumulate, _ Array(DayOfWeek)) MonthFirst = CurrentMonth MonthLast = CurrentMonth FirstProcessingDate = DateSerial(CurrentYear, MonthFirst, 1) While NOT Recordset.EOF DateField = Recordset.Recordset("event_date").Value If VarType(DateField) = vbString Then DateField = CCSConverter.StringToType(ccsDate, DateField, Array("yyyy", "-", "mm", "-", "dd")) Diff = DateDiff("d", FirstProcessingDate, DateField) If Diff >= 0 And Diff <= DaysCurrentMonth Then Set Evnt = New clsEventcal_month Evnt.Time = Recordset.Recordset("event_time").Value If VarType(Evnt.Time) = vbString Then Evnt.Time = CCSConverter.StringToType(ccsDate, Evnt.Time, Array("HH", ":", "nn", ":", "ss")) category_image.Value = Recordset.Fields("category_image") EventTime.Value = Recordset.Fields("EventTime") EventTimeEnd.Value = Recordset.Fields("EventTimeEnd") EventDescription.Value = Recordset.Fields("EventDescription") EventDescription.Link = "" EventDescription.Parameters = CCAddParam(EventDescription.Parameters, "event_id", Recordset.Fields("EventDescription_param1")) EventDescription.Page = "event_view.asp" Evnt.category_image=category_image.Value Evnt.EventTime=EventTime.Value Evnt.EventTimeEnd=EventTimeEnd.Value Evnt.EventDescription=EventDescription.Value Evnt.EventDescriptionPage = EventDescription.Page Evnt.EventDescriptionParameters = EventDescription.Parameters AddEvent DateField, Evnt End If Recordset.MoveNext Wend CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If NOT Visible Then Exit Sub Errors.AddErrors DataSource.Errors If Errors.Count > 0 Then TemplateBlock.HTML = CCFormatError("Calendar " & ComponentName, Errors) Else For M = MonthFirst To MonthLast ShowMonth FirstProcessingDate, Empty MonthBlock.Parse ccsParseAccumulate WeekBlock.Clear() WeekDaysBlock.Clear() FirstProcessingDate = DateAdd("m", 1, FirstProcessingDate) Next CurrentProcessingDate = CurrentDate CalendarType = calMonth TemplateBlock.Variable("MonthsInRow") = MonthsInRow MonthDate.Value = CurrentProcessingDate YearIcon.Link = "" YearIcon.Page = "year.asp" MonthIcon.Parameters = CCGetQueryString("QueryString", Array("ccsForm")) MonthIcon.Page = "index.asp" WeekIcon.Link = "" WeekIcon.Page = "week.asp" YearControls.Show End If TemplateBlock.Parse ccsParseOverwrite End Sub 'End cal_month Show Method 'cal_month ShowMonth Method @5-45C6CC48 Sub ShowMonth(FirstDayMonth, CellCount) Dim I, II, CurrentFirstWeekDay, DaysCurrentMonth, MonthCellStart, ProcessDay, CurrentDay, DayEvents, L, cMonth, cYear, FirstProcDay cMonth = DatePart("m", FirstDayMonth) cYear = CurrentYear MonthCellStart = WeekDay(FirstDayMonth, 1) - 1 - FirstWeekDay If MonthCellStart < 0 Then MonthCellStart = MonthCellStart + 7 DaysCurrentMonth = DatePart("d", DateSerial (cYear, cMonth+1, 0)) If IsEmpty(CellCount) Then _ CellCount = 7 * (6-Int((42 - (MonthCellStart + DaysCurrentMonth))/7)) CurrentProcessingDate = DateAdd("d",-MonthCellStart-1,FirstDayMonth) FirstProcDay = DateAdd("d", 1, CurrentProcessingDate) CalendarScope = calMonth CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowMonth", Me) For I=1 To CellCount CurrentProcessingDate = DateAdd("d", 1, CurrentProcessingDate) If (I-1) Mod 7 = 0 And I < CellCount Then CalendarScope = calWeek go_week.Link = "" go_week.Parameters = CCAddParam(go_week.Parameters, "day", CCSConverter.TypeToString(ccsDate, CurrentProcessingDate, Array("yyyy", "-", "mm", "-", "dd"))) go_week.Page = "week.asp" CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowWeek", Me) End If IsCurrentMonth = I > MonthCellStart And I <= MonthCellStart + DaysCurrentMonth CalendarScope = calDay CurrentStyle = GetCurrentStyle(Empty) If IsCurrentMonth Then CurrentDay = I - MonthCellStart DayNumber.Value = CurrentProcessingDate DayNumber.Link = "" DayNumber.Parameters = CCAddParam(DayNumber.Parameters, "day", CCSConverter.TypeToString(ccsDate, CurrentProcessingDate, Array("yyyy", "-", "mm", "-", "dd"))) DayNumber.Page = "day.asp" add_event.Link = "" add_event.Parameters = CCAddParam(add_event.Parameters, "event_date", CCSConverter.TypeToString(ccsDate, CurrentProcessingDate, Array("mm", "/", "dd", "/", "yyyy"))) add_event.Page = "events.asp" Else End If CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowDay", Me) DayBlock.Variable("Style") = CurrentStyle Set DayEvents = CalendarEvents.GetEvents(DatePart("y",CurrentProcessingDate)) If DayEvents Is Nothing Then ElseIf IsCurrentMonth Then For L=0 To DayEvents.Count-1 category_image.Value = DayEvents.Items(L).category_image EventTime.Value = DayEvents.Items(L).EventTime EventTimeEnd.Value = DayEvents.Items(L).EventTimeEnd EventDescription.Value = DayEvents.Items(L).EventDescription EventDescription.Page = DayEvents.Items(L).EventDescriptionPage EventDescription.Parameters = DayEvents.Items(L).EventDescriptionParameters CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowEvent", Me) EventRowControls.Show Next End If If IsCurrentMonth Then DayControls.Show Else EmptyDayBlock.Variable("Style") = CurrentStyle EmptyDayBlock.ParseTo ccsParseAccumulate, DayBlock End If EventRowBlock.Clear() If I Mod 7 = 0 Then WeekControls.Show DayBlock.Clear EmptyDayBlock.Clear End If Next CurrentProcessingDate = FirstProcDay CalendarScope = calWeek For I = FirstWeekDay To FirstWeekDay + 6 II = IIF(I < 7, I, I-7) WeekDaysBlock.Variable("Style") = GetCurrentStyle(II) DayOfWeek.Value = CurrentProcessingDate WeekDaysControls.Show CurrentProcessingDate = DateAdd("d", 1, CurrentProcessingDate) Next CalendarScope = calMonth End Sub 'End cal_month ShowMonth Method 'cal_month PrevProcessingDate Property @5-B7E274B2 Public Property Get PrevProcessingDate Dim Res Select Case CalendarScope Case calYear Res = DateAdd("yyyy", -1, CurrentProcessingDate) Case cal3Month Res = DateAdd("m", -3, CurrentProcessingDate) Case calMonth Res = DateAdd("m", -1, CurrentProcessingDate) Case calDay Res = DateAdd("d", -1, CurrentProcessingDate) Case Else Res = CurrentProcessingDate End Select PrevProcessingDate = Res End Property 'End cal_month PrevProcessingDate Property 'cal_month NextProcessingDate Property @5-1BEF0772 Public Property Get NextProcessingDate Dim Res Select Case CalendarScope Case calYear Res = DateAdd("yyyy", 1, CurrentProcessingDate) Case cal3Month Res = DateAdd("m", 3, CurrentProcessingDate) Case calMonth Res = DateAdd("m", 1, CurrentProcessingDate) Case calDay Res = DateAdd("d", 1, CurrentProcessingDate) Case Else Res = CurrentProcessingDate End Select NextProcessingDate = Res End Property 'End cal_month NextProcessingDate Property 'cal_month GetCurrentDate Method @5-658CBA39 Private Sub GetCurrentDate Dim Ar, I, Par, TempYear, TempMonth, TempDay Par = CCGetParam(ComponentName & "Date", "") NowMonth = DatePart("m",NowDate) NowYear = DatePart("yyyy",NowDate) NowDay = DatePart("d",NowDate) CurrentMonth = NowMonth CurrentYear = NowYear If Par <> "" Then Ar = Split(Par & "---", "-") TempYear = IIF(Len(Ar(0)) > 0, Ar(0), NowYear) TempMonth = IIF(Len(Ar(1)) > 0, Ar(1), NowMonth) TempDay = IIF(Len(Ar(2)) > 0, Ar(2), NowDay) Else TempYear = CCGetParam(ComponentName & "Year", NowYear) TempMonth = CCGetParam(ComponentName & "Month", NowMonth) TempDay = 1 End If If IsNumeric(TempYear) Then TempYear = CInt(TempYear) If TempYear > 999 And TempYear < 9999 Then CurrentYear = TempYear End If If IsNumeric(TempMonth) Then TempMonth = CInt(TempMonth) If TempMonth > 0 And TempMonth <= 12 Then CurrentMonth = TempMonth End If If IsNumeric(TempDay) Then TempDay =CInt(TempDay) If TempDay > 0 And TempDay <= 31 Then CurrentDay = TempDay End If If VarType(CurrentYear)=vbString Then CurrentYear = CInt(CurrentYear) If VarType(CurrentMonth)=vbString Then CurrentMonth = CInt(CurrentMonth) If VarType(CurrentDay)=vbString Then CurrentDay = CInt(CurrentDay) Dim DaysMonth : DaysMonth = DatePart("d", DateSerial (CurrentYear, CurrentMonth + 1, 0)) IF CurrentDay > DaysMonth Then CurrentDay = DaysMonth CurrentDate = DateSerial(CurrentYear, CurrentMonth, CurrentDay) End Sub 'End cal_month GetCurrentDate Method 'cal_month GetCurrentStyle Method @5-CC9B41BA Private Function GetCurrentStyle(D) Dim isWeekEnd, IsToday Dim res : Res = "" Select Case CalendarScope Case calDay IsWeekEnd=Weekday(CurrentProcessingDate, 1) = 1 or Weekday(CurrentProcessingDate, 1)=7 If IsCurrentMonth And DateDiff("d",CurrentProcessingDate, NowDate) = 0 Then Res = "Today" If IsWeekEnd Then Res = "Weekend" & Res Else If Res = "" Then Res = "Day" End If If Not IsCurrentMonth Then Res = "OtherMonth" & Res End If Case calWeek If D = 0 Or D = 6 Then Res = "WeekendName" Else Res = "WeekdayName" End If End Select If CalendarStyles.Exists(Res) Then GetCurrentStyle = CalendarStyles(Res) Else GetCurrentStyle = "" End If End Function 'End cal_month GetCurrentStyle Method 'cal_month AddEvent Method @5-54F7236F Public Sub AddEvent(EventDate, Evnt) CalendarEvents.Add DatePart("y",EventDate), Evnt End Sub 'End cal_month AddEvent Method 'cal_month GetEvents Function @5-91FB858D Public Function GetEvents(EventDate) Set GetEvents = CalendarEvents.GetEvents(DatePart("y", EventDate)) End Function 'End cal_month GetEvents Function End Class 'End cal_month Class @5-A61BA892 Class clscal_monthDataSource 'cal_monthDataSource Class @5-5C1C3E02 'DataSource Variables @5-99D12EF3 Public Errors, Connection, Parameters, CCSEvents Public Recordset Public SQL, CountSQL, Order, Where, Orders, StaticOrder Public PageSize Public PageCount Public AbsolutePage Public Fields Dim WhereParameters Public AllParamsSet Public CmdExecution Private CurrentOperation Private CCSEventResult ' Datasource fields Public category_image Public EventTime Public EventTimeEnd Public EventDescription Public EventDescription_param1 'End DataSource Variables 'DataSource Class_Initialize Event @5-9F936D14 Private Sub Class_Initialize() Set CCSEvents = CreateObject("Scripting.Dictionary") Set Fields = New clsFields Set Recordset = New clsDataSource Set Recordset.DataSource = Me Set Errors = New clsErrors Set Connection = Nothing AllParamsSet = True Set category_image = CCCreateField("category_image", "category_image", ccsText, Empty, Recordset) Set EventTime = CCCreateField("EventTime", "event_time", ccsDate, Array("HH", ":", "nn", ":", "ss"), Recordset) Set EventTimeEnd = CCCreateField("EventTimeEnd", "event_time_end", ccsDate, Array("HH", ":", "nn", ":", "ss"), Recordset) Set EventDescription = CCCreateField("EventDescription", "event_title", ccsText, Empty, Recordset) Set EventDescription_param1 = CCCreateField("EventDescription_param1", "event_id", ccsText, Empty, Recordset) Fields.AddFields Array(category_image, EventTime, EventTimeEnd, EventDescription, EventDescription_param1) Set Parameters = Server.CreateObject("Scripting.Dictionary") Set WhereParameters = Nothing SQL = "SELECT category_image, event_id, event_title, event_date, event_time, event_time_end " & vbLf & _ "FROM events LEFT JOIN categories ON " & vbLf & _ "events.category_id = categories.category_id {SQL_Where} {SQL_OrderBy}" CountSQL = "SELECT COUNT(*) " & vbLf & _ "FROM events LEFT JOIN categories ON " & vbLf & _ "events.category_id = categories.category_id" Where = "" Order = "event_time, event_time_end" StaticOrder = "" End Sub 'End DataSource Class_Initialize Event 'BuildTableWhere Method @5-7BAD822B Public Sub BuildTableWhere() Dim WhereParams If Not WhereParameters Is Nothing Then _ Exit Sub Set WhereParameters = new clsSQLParameters With WhereParameters Set .Connection = Connection Set .ParameterSources = Parameters Set .DataSource = Me .AddParameter 1, "sescategory", ccsInteger, Empty, Empty, Empty, False .Criterion(1) = .Operation(opEqual, False, "events.category_id", .getParamByID(1)) .AssembledWhere = .Criterion(1) WhereParams = .AssembledWhere If Len(Where) > 0 Then If Len(WhereParams) > 0 Then _ Where = Where & " AND " & WhereParams Else If Len(WhereParams) > 0 Then _ Where = WhereParams End If End With End Sub 'End BuildTableWhere Method 'Open Method @5-E4B6ADB2 Function Open(Cmd) Errors.Clear If Connection Is Nothing Then Set Open = New clsEmptyDataSource Exit Function End If Set Cmd.Connection = Connection Cmd.CommandOperation = cmdOpen Cmd.PageSize = PageSize Cmd.ActivePage = AbsolutePage Cmd.CommandType = dsTable CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildSelect", Me) Cmd.SQL = SQL Cmd.CountSQL = CountSQL BuildTableWhere Cmd.Where = Where Cmd.OrderBy = Order If(Len(StaticOrder)>0) Then If Len(Order)>0 Then Cmd.OrderBy = ", "+Cmd.OrderBy Cmd.OrderBy = StaticOrder + Cmd.OrderBy End If CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteSelect", Me) If Errors.Count = 0 And CCSEventResult Then _ Set Recordset = Cmd.Exec(Errors) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteSelect", Me) Set Recordset.FieldsCollection = Fields Set Open = Recordset End Function 'End Open Method 'DataSource Class_Terminate Event @5-41B4B08D Private Sub Class_Terminate() If Recordset.State = adStateOpen Then _ Recordset.Close Set Recordset = Nothing Set Parameters = Nothing Set Errors = Nothing End Sub 'End DataSource Class_Terminate Event End Class 'End cal_monthDataSource Class @5-A61BA892 'Include Page Implementation @2-FC0E1961 %> <% 'End Include Page Implementation 'Include Page Implementation @4-CC6D2B29 %> <% 'End Include Page Implementation 'Include Page Implementation @3-C41F6186 %> <% 'End Include Page Implementation %>