<%@ CodePage=1252 %> <% 'Include Common Files @1-519E4AFE %> <% 'End Include Common Files 'Initialize Page @1-B8575394 ' Variables Dim PathToRoot, ScriptPath, TemplateFilePath Dim FileName Dim Redirect Dim Tpl, HTMLTemplate Dim TemplateFileName Dim ComponentName Dim PathToCurrentPage Dim Attributes ' Events Dim CCSEvents Dim CCSEventResult ' Connections Dim DBConnection1 ' Page controls Dim Header Dim loginSearch Dim login Dim ChildControls Response.ContentType = CCSContentType Redirect = "" TemplateFileName = "ExpertsList.html" Set CCSEvents = CreateObject("Scripting.Dictionary") PathToCurrentPage = "./" FileName = "ExpertsList.asp" PathToRoot = "./" ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName)) TemplateFilePath = ScriptPath 'End Initialize Page 'Initialize Objects @1-483D7AAE Set DBConnection1 = New clsDBConnection1 DBConnection1.Open Set Attributes = New clsAttributes ' Controls Set Header = New clsHeader Set Header.Attributes = Attributes Header.Initialize "Header", "" Set loginSearch = new clsRecordloginSearch Set login = New clsGridlogin login.Initialize DBConnection1 CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing) 'End Initialize Objects 'Execute Components @1-AA86DCCE Header.Operations loginSearch.Operation '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-2E9DB4BC CCSEventResult = CCRaiseEvent(CCSEvents, "OnInitializeView", Nothing) Set HTMLTemplate = new clsTemplate Set HTMLTemplate.Cache = TemplatesRepository HTMLTemplate.LoadTemplate TemplateFilePath & TemplateFileName HTMLTemplate.SetVar "@CCS_PathToRoot", PathToRoot Set Tpl = HTMLTemplate.Block("main") CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Nothing) 'End Initialize HTML Template 'Show Page @1-96868F43 Attributes.Show HTMLTemplate, "page:" Set ChildControls = CCCreateCollection(Tpl, Null, ccsParseOverwrite, _ Array(Header, loginSearch, login)) 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 'Unload Page @1-CB210C62 UnloadPage Set Tpl = Nothing Set HTMLTemplate = Nothing 'End Unload Page 'UnloadPage Sub @1-3EDDDBBB Sub UnloadPage() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUnload", Nothing) If DBConnection1.State = adStateOpen Then _ DBConnection1.Close Set DBConnection1 = Nothing Set CCSEvents = Nothing Set Attributes = Nothing Set Header = Nothing Set loginSearch = Nothing Set login = Nothing End Sub 'End UnloadPage Sub Class clsRecordloginSearch 'loginSearch Class @2-C08F58A5 'loginSearch Variables @2-00FF574C ' Public variables Public ComponentName Public HTMLFormAction Public PressedButton Public Errors Public FormSubmitted Public EditMode Public Visible Public Recordset Public TemplateBlock Public Attributes Public CCSEvents Private CCSEventResult Public InsertAllowed Public UpdateAllowed Public DeleteAllowed Public ReadAllowed Public DataSource Public Command Public ValidatingControls Public Controls ' Class variables Dim Button_DoSearch Dim s_ContactPerson Dim s_cid Dim s_CompanyName Dim s_CompanyCity 'End loginSearch Variables 'loginSearch Class_Initialize Event @2-DE79D20F Private Sub Class_Initialize() Visible = True Set Errors = New clsErrors Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes InsertAllowed = False UpdateAllowed = False DeleteAllowed = False ReadAllowed = True Dim Method Dim OperationMode OperationMode = Split(CCGetFromGet("ccsForm", Empty), ":") If UBound(OperationMode) > -1 Then FormSubmitted = (OperationMode(0) = "loginSearch") End If If UBound(OperationMode) > 0 Then EditMode = (OperationMode(1) = "Edit") End If ComponentName = "loginSearch" Method = IIf(FormSubmitted, ccsPost, ccsGet) Set Button_DoSearch = CCCreateButton("Button_DoSearch", Method) Set s_ContactPerson = CCCreateControl(ccsTextBox, "s_ContactPerson", Empty, ccsText, Empty, CCGetRequestParam("s_ContactPerson", Method)) Set s_cid = CCCreateControl(ccsTextBox, "s_cid", Empty, ccsText, Empty, CCGetRequestParam("s_cid", Method)) Set s_CompanyName = CCCreateControl(ccsTextBox, "s_CompanyName", Empty, ccsText, Empty, CCGetRequestParam("s_CompanyName", Method)) Set s_CompanyCity = CCCreateControl(ccsTextBox, "s_CompanyCity", Empty, ccsText, Empty, CCGetRequestParam("s_CompanyCity", Method)) Set ValidatingControls = new clsControls ValidatingControls.addControls Array(s_ContactPerson, s_cid, s_CompanyName, s_CompanyCity) End Sub 'End loginSearch Class_Initialize Event 'loginSearch Class_Terminate Event @2-0C5D276C Private Sub Class_Terminate() Set Errors = Nothing Set Attributes = Nothing End Sub 'End loginSearch Class_Terminate Event 'loginSearch Validate Method @2-B9D513CF Function Validate() Dim Validation ValidatingControls.Validate CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me) Validate = ValidatingControls.isValid() And (Errors.Count = 0) End Function 'End loginSearch Validate Method 'loginSearch Operation Method @2-71660339 Sub Operation() If NOT ( Visible AND FormSubmitted ) Then Exit Sub If FormSubmitted Then PressedButton = "Button_DoSearch" If Button_DoSearch.Pressed Then PressedButton = "Button_DoSearch" End If End If Redirect = "ExpertsList.asp" If Validate() Then If PressedButton = "Button_DoSearch" Then If NOT Button_DoSearch.OnClick() Then Redirect = "" Else Redirect = "ExpertsList.asp?" & CCGetQueryString("Form", Array(PressedButton, "ccsForm", "Button_DoSearch.x", "Button_DoSearch.y", "Button_DoSearch")) End If End If Else Redirect = "" End If End Sub 'End loginSearch Operation Method 'loginSearch Show Method @2-96A576B2 Sub Show(Tpl) If NOT Visible Then Exit Sub EditMode = False HTMLFormAction = FileName & "?" & CCAddParam(Request.ServerVariables("QUERY_STRING"), "ccsForm", "loginSearch" & IIf(EditMode, ":Edit", "")) Set TemplateBlock = Tpl.Block("Record " & ComponentName) If TemplateBlock is Nothing Then Exit Sub TemplateBlock.Variable("HTMLFormName") = ComponentName TemplateBlock.Variable("HTMLFormEnctype") ="application/x-www-form-urlencoded" Set Controls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _ Array(Button_DoSearch, s_ContactPerson, s_cid, s_CompanyName, s_CompanyCity)) If Not FormSubmitted Then End If If FormSubmitted Then Errors.AddErrors s_ContactPerson.Errors Errors.AddErrors s_cid.Errors Errors.AddErrors s_CompanyName.Errors Errors.AddErrors s_CompanyCity.Errors With TemplateBlock.Block("Error") .Variable("Error") = Errors.ToString() .Parse False End With End If TemplateBlock.Variable("Action") = IIF(CCSUseAmps, Replace(HTMLFormAction, "&", CCSAmps), HTMLFormAction) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If Visible Then Attributes.Show TemplateBlock, "loginSearch" & ":" Controls.Show End If End Sub 'End loginSearch Show Method End Class 'End loginSearch Class @2-A61BA892 Class clsGridlogin 'login Class @8-9E3E8D95 'login Variables @8-5B761F28 ' Private variables Private VarPageSize ' Public variables Public ComponentName, CCSEvents Public Visible, Errors Public DataSource Public PageNumber Public Command Public TemplateBlock Public IsDSEmpty Public ForceIteration Public Attributes Private ShownRecords Public ActiveSorter, SortingDirection Public Recordset Private CCSEventResult ' Grid Controls Public StaticControls, RowControls Dim Sorter_ContactPerson Dim Sorter_cid Dim Sorter_CompanyName Dim Sorter_CompanyCity Dim Sorter_lid Dim Sorter_website Dim ContactPerson Dim country_name Dim CompanyName Dim CompanyCity Dim emAdd Dim Url Dim Navigator 'End login Variables 'login Class_Initialize Event @8-6BD3FEB2 Private Sub Class_Initialize() ComponentName = "login" Visible = True Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes Set Errors = New clsErrors Set DataSource = New clsloginDataSource Set Command = New clsCommand PageSize = CCGetParam(ComponentName & "PageSize", Empty) If IsNumeric(PageSize) And Len(PageSize) > 0 Then If PageSize <= 0 Then Errors.AddError(CCSLocales.GetText("CCS_GridPageSizeError", Empty)) If PageSize > 100 Then PageSize = 100 End If If NOT IsNumeric(PageSize) OR IsEmpty(PageSize) Then _ PageSize = 20 _ Else _ PageSize = CInt(PageSize) PageNumber = CCGetParam(ComponentName & "Page", 1) If Not IsNumeric(PageNumber) And Len(PageNumber) > 0 Then Errors.AddError(CCSLocales.GetText("CCS_GridPageNumberError", Empty)) PageNumber = 1 ElseIf Len(PageNumber) > 0 Then If PageNumber > 0 Then PageNumber = CInt(PageNumber) Else Errors.AddError(CCSLocales.GetText("CCS_GridPageNumberError", Empty)) PageNumber = 1 End If Else PageNumber = 1 End If ActiveSorter = CCGetParam("loginOrder", Empty) SortingDirection = CCGetParam("loginDir", Empty) If NOT(SortingDirection = "ASC" OR SortingDirection = "DESC") Then _ SortingDirection = Empty Set Sorter_ContactPerson = CCCreateSorter("Sorter_ContactPerson", Me, FileName) Set Sorter_cid = CCCreateSorter("Sorter_cid", Me, FileName) Set Sorter_CompanyName = CCCreateSorter("Sorter_CompanyName", Me, FileName) Set Sorter_CompanyCity = CCCreateSorter("Sorter_CompanyCity", Me, FileName) Set Sorter_lid = CCCreateSorter("Sorter_lid", Me, FileName) Set Sorter_website = CCCreateSorter("Sorter_website", Me, FileName) Set ContactPerson = CCCreateControl(ccsLabel, "ContactPerson", Empty, ccsText, Empty, CCGetRequestParam("ContactPerson", ccsGet)) Set country_name = CCCreateControl(ccsLabel, "country_name", Empty, ccsText, Empty, CCGetRequestParam("country_name", ccsGet)) Set CompanyName = CCCreateControl(ccsLabel, "CompanyName", Empty, ccsText, Empty, CCGetRequestParam("CompanyName", ccsGet)) Set CompanyCity = CCCreateControl(ccsLabel, "CompanyCity", Empty, ccsText, Empty, CCGetRequestParam("CompanyCity", ccsGet)) Set emAdd = CCCreateControl(ccsLink, "emAdd", Empty, ccsText, Empty, CCGetRequestParam("emAdd", ccsGet)) Set Url = CCCreateControl(ccsLink, "Url", Empty, ccsText, Empty, CCGetRequestParam("Url", ccsGet)) Set Navigator = CCCreateNavigator(ComponentName, "Navigator", FileName, 10, tpSimple) IsDSEmpty = True End Sub 'End login Class_Initialize Event 'login Initialize Method @8-2AEA3975 Sub Initialize(objConnection) If NOT Visible Then Exit Sub Set DataSource.Connection = objConnection DataSource.PageSize = PageSize DataSource.SetOrder ActiveSorter, SortingDirection DataSource.AbsolutePage = PageNumber End Sub 'End login Initialize Method 'login Class_Terminate Event @8-B97CC660 Private Sub Class_Terminate() Set CCSEvents = Nothing Set DataSource = Nothing Set Command = Nothing Set Errors = Nothing Set Attributes = Nothing End Sub 'End login Class_Terminate Event 'login Show Method @8-F61CA9C1 Sub Show(Tpl) Dim HasNext If NOT Visible Then Exit Sub Dim RowBlock With DataSource .Parameters("urls_ContactPerson") = CCGetRequestParam("s_ContactPerson", ccsGET) .Parameters("urls_CompanyName") = CCGetRequestParam("s_CompanyName", ccsGET) .Parameters("urls_CompanyCity") = CCGetRequestParam("s_CompanyCity", ccsGET) .Parameters("urls_cid") = CCGetRequestParam("s_cid", ccsGET) .Parameters("expr37") = 3 .Parameters("expr53") = 8 End With CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeSelect", Me) Set Recordset = DataSource.Open(Command) If DataSource.Errors.Count = 0 Then IsDSEmpty = Recordset.EOF Set TemplateBlock = Tpl.Block("Grid " & ComponentName) If TemplateBlock is Nothing Then Exit Sub Set RowBlock = TemplateBlock.Block("Row") Set StaticControls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _ Array(Sorter_ContactPerson, Sorter_cid, Sorter_CompanyName, Sorter_CompanyCity, Sorter_lid, Sorter_website, Navigator)) Navigator.SetDataSource Recordset Set RowControls = CCCreateCollection(RowBlock, Null, ccsParseAccumulate, _ Array(ContactPerson, country_name, CompanyName, CompanyCity, emAdd, Url)) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If NOT Visible Then Exit Sub RowControls.PreserveControlsVisible Errors.AddErrors DataSource.Errors If Errors.Count > 0 Then TemplateBlock.HTML = CCFormatError("Grid " & ComponentName, Errors) Else ' Show NoRecords block if no records are found If Recordset.EOF Then Attributes.Show TemplateBlock, "login:" TemplateBlock.Block("NoRecords").Parse ccsParseOverwrite End If HasNext = HasNextRow() ForceIteration = False Do While ForceIteration Or HasNext Attributes("rowNumber") = ShownRecords + 1 If HasNext Then ContactPerson.Value = Recordset.Fields("ContactPerson") country_name.Value = Recordset.Fields("country_name") CompanyName.Value = Recordset.Fields("CompanyName") CompanyCity.Value = Recordset.Fields("CompanyCity") emAdd.Value = Recordset.Fields("emAdd") emAdd.Parameters = CCGetQueryString("QueryString", Array("ccsForm")) emAdd.Page = Recordset.Fields("emadd") Url.Value = Recordset.Fields("Url") Url.Parameters = CCGetQueryString("QueryString", Array("ccsForm")) Url.Page = Recordset.Fields("url") End If CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowRow", Me) Attributes.Show TemplateBlock.Block("Row"), "login:" RowControls.Show If HasNext Then Recordset.MoveNext ShownRecords = ShownRecords + 1 HasNext = HasNextRow() Loop Attributes.Show TemplateBlock, "login:" StaticControls.Show End If End Sub 'End login Show Method 'login PageSize Property Let @8-54E46DD6 Public Property Let PageSize(NewValue) VarPageSize = NewValue DataSource.PageSize = NewValue End Property 'End login PageSize Property Let 'login PageSize Property Get @8-9AA1D1E9 Public Property Get PageSize() PageSize = VarPageSize End Property 'End login PageSize Property Get 'login RowNumber Property Get @8-F32EE2C6 Public Property Get RowNumber() RowNumber = ShownRecords + 1 End Property 'End login RowNumber Property Get 'login HasNextRow Function @8-9BECE27A Public Function HasNextRow() HasNextRow = NOT Recordset.EOF AND ShownRecords < PageSize End Function 'End login HasNextRow Function End Class 'End login Class @8-A61BA892 Class clsloginDataSource 'loginDataSource Class @8-D58F2688 'DataSource Variables @8-EFAE8AB8 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 Public InsertOmitIfEmpty Public UpdateOmitIfEmpty Private CurrentOperation Private CCSEventResult ' Datasource fields Public ContactPerson Public country_name Public CompanyName Public CompanyCity Public emAdd Public Url 'End DataSource Variables 'DataSource Class_Initialize Event @8-FF820B46 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 ContactPerson = CCCreateField("ContactPerson", "ContactPerson", ccsText, Empty, Recordset) Set country_name = CCCreateField("country_name", "country_name", ccsText, Empty, Recordset) Set CompanyName = CCCreateField("CompanyName", "CompanyName", ccsText, Empty, Recordset) Set CompanyCity = CCCreateField("CompanyCity", "CompanyCity", ccsText, Empty, Recordset) Set emAdd = CCCreateField("emAdd", "em", ccsText, Empty, Recordset) Set Url = CCCreateField("Url", "urlTxt", ccsText, Empty, Recordset) Fields.AddFields Array(ContactPerson, country_name, CompanyName, CompanyCity, emAdd, Url) Set Parameters = Server.CreateObject("Scripting.Dictionary") Set WhereParameters = Nothing Orders = Array( _ Array("Sorter_ContactPerson", "ContactPerson", ""), _ Array("Sorter_cid", "cid", ""), _ Array("Sorter_CompanyName", "CompanyName", ""), _ Array("Sorter_CompanyCity", "CompanyCity", ""), _ Array("Sorter_lid", "lid", ""), _ Array("Sorter_website", "website", "")) SQL = " " & vbLf & _ "SELECT TOP {SqlParam_endRecord} ContactPerson, cid, CompanyName, CompanyCity, lid, website, CASE WHEN website is not NULL THEN 'http://'+website ELSE 'http://www.google.hu/search?hl=hu&q='+companyName+'&meta=' END AS url, " & vbLf & _ "CASE WHEN lid is not NULL THEN 'em' ELSE '' END AS em, CASE WHEN lid is not NULL THEN 'mailto:'+lid ELSE '-' END AS emadd, " & vbLf & _ "CASE WHEN website is not NULL THEN 'url' ELSE 'Google' END AS urlTxt, country_name " & vbLf & _ "FROM EventRegn INNER JOIN (login LEFT JOIN countries ON " & vbLf & _ "login.cid = countries.country_id) ON " & vbLf & _ "EventRegn.user_login_er = login.uid {SQL_Where} {SQL_OrderBy}" CountSQL = "SELECT COUNT(*) " & vbLf & _ "FROM EventRegn INNER JOIN (login LEFT JOIN countries ON " & vbLf & _ "login.cid = countries.country_id) ON " & vbLf & _ "EventRegn.user_login_er = login.uid" Where = "" Order = "ContactPerson" StaticOrder = "" End Sub 'End DataSource Class_Initialize Event 'SetOrder Method @8-68FC9576 Sub SetOrder(Column, Direction) Order = Recordset.GetOrder(Order, Column, Direction, Orders) End Sub 'End SetOrder Method 'BuildTableWhere Method @8-0022CC1A 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, "urls_ContactPerson", ccsText, Empty, Empty, Empty, False .AddParameter 2, "urls_CompanyName", ccsText, Empty, Empty, Empty, False .AddParameter 3, "urls_CompanyCity", ccsText, Empty, Empty, Empty, False .AddParameter 4, "urls_cid", ccsText, Empty, Empty, Empty, False .AddParameter 5, "expr37", ccsInteger, Empty, Empty, Empty, False .AddParameter 6, "expr53", ccsInteger, Empty, Empty, Empty, False .Criterion(1) = .Operation(opContains, False, "login.[ContactPerson]", .getParamByID(1)) .Criterion(2) = .Operation(opContains, False, "login.[CompanyName]", .getParamByID(2)) .Criterion(3) = .Operation(opContains, False, "login.[CompanyCity]", .getParamByID(3)) .Criterion(4) = .Operation(opContains, False, "countries.country_name", .getParamByID(4)) .Criterion(5) = .Operation(opEqual, False, "[EventRegn].user_login_er3", .getParamByID(5)) .Criterion(6) = .Operation(opEqual, False, "[EventRegn].event_id_er", .getParamByID(6)) .AssembledWhere = .opAND(False, .opAND(False, .opAND(False, .opAND(False, .opAND(False, .Criterion(1), .Criterion(2)), .Criterion(3)), .Criterion(4)), .Criterion(5)), .Criterion(6)) 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 @8-40984FC5 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 Cmd.Options("TOP") = True 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 @8-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 loginDataSource Class @8-A61BA892 'Include Page Implementation @38-709E3F8F %> <% 'End Include Page Implementation %>