Visible = true; $this->Errors = new clsErrors(); if($this->Visible) { $this->ComponentName = "Login"; $CCSForm = split(":", CCGetFromGet("ccsForm", ""), 2); if(sizeof($CCSForm) == 1) $CCSForm[1] = ""; list($FormName, $FormMethod) = $CCSForm; $this->EditMode = ($FormMethod == "Edit"); $this->FormSubmitted = ($FormName == $this->ComponentName); $Method = $this->FormSubmitted ? ccsPost : ccsGet; $this->login = new clsControl(ccsTextBox, "login", "login", ccsText, "", CCGetRequestParam("login", $Method)); $this->login->Required = true; $this->password = new clsControl(ccsTextBox, "password", "password", ccsText, "", CCGetRequestParam("password", $Method)); $this->password->Required = true; $this->DoLogin = new clsButton("DoLogin"); } } //End Class_Initialize Event //Validate Method @2-FCD4B6B1 function Validate() { $Validation = true; $Where = ""; $Validation = ($this->login->Validate() && $Validation); $Validation = ($this->password->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate"); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method //CheckErrors Method @2-CE95D583 function CheckErrors() { $errors = false; $errors = ($errors || $this->login->Errors->Count()); $errors = ($errors || $this->password->Errors->Count()); $errors = ($errors || $this->Errors->Count()); return $errors; } //End CheckErrors Method //Operation Method @2-F8610C53 function Operation() { if(!$this->Visible) return; global $Redirect; global $FileName; $this->EditMode = false; if(!$this->FormSubmitted) return; if($this->FormSubmitted) { $this->PressedButton = "DoLogin"; if(strlen(CCGetParam("DoLogin", ""))) { $this->PressedButton = "DoLogin"; } } $Redirect = "welcome.php"; if($this->Validate()) { if($this->PressedButton == "DoLogin") { if(!CCGetEvent($this->DoLogin->CCSEvents, "OnClick")) { $Redirect = ""; } } } else { $Redirect = ""; } } //End Operation Method //Show Method @2-7364BEA8 function Show() { global $Tpl; global $FileName; $Error = ""; if(!$this->Visible) return; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect"); $RecordBlock = "Record " . $this->ComponentName; $ParentPath = $Tpl->block_path; $Tpl->block_path = $ParentPath . "/" . $RecordBlock; if(!$this->FormSubmitted) { } if($this->FormSubmitted || $this->CheckErrors()) { $Error .= $this->login->Errors->ToString(); $Error .= $this->password->Errors->ToString(); $Error .= $this->Errors->ToString(); $Tpl->SetVar("Error", $Error); $Tpl->Parse("Error", false); } $CCSForm = $this->EditMode ? $this->ComponentName . ":" . "Edit" : $this->ComponentName; $this->HTMLFormAction = $FileName . "?" . CCAddParam(CCGetQueryString("QueryString", ""), "ccsForm", $CCSForm); $Tpl->SetVar("Action", $this->HTMLFormAction); $Tpl->SetVar("HTMLFormName", $this->ComponentName); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); if(!$this->Visible) { $Tpl->block_path = $ParentPath; return; } $this->login->Show(); $this->password->Show(); $this->DoLogin->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; } //End Show Method } //End Login Class @2-FCB6E20C Class clsRecordusersSearch { //usersSearch Class @15-4B2A360C //Variables @15-90DA4C9A // Public variables var $ComponentName; var $HTMLFormAction; var $PressedButton; var $Errors; var $FormSubmitted; var $Visible; var $Recordset; var $CCSEvents = ""; var $CCSEventResult; var $ds; var $EditMode; var $ValidatingControls; var $Controls; // Class variables //End Variables //Class_Initialize Event @15-88787733 function clsRecordusersSearch() { global $FileName; $this->Visible = true; $this->Errors = new clsErrors(); $this->ds = new clsusersSearchDataSource(); if($this->Visible) { $this->ComponentName = "usersSearch"; $CCSForm = split(":", CCGetFromGet("ccsForm", ""), 2); if(sizeof($CCSForm) == 1) $CCSForm[1] = ""; list($FormName, $FormMethod) = $CCSForm; $this->EditMode = ($FormMethod == "Edit"); $this->FormSubmitted = ($FormName == $this->ComponentName); $Method = $this->FormSubmitted ? ccsPost : ccsGet; $this->s_keyword = new clsControl(ccsTextBox, "s_keyword", "s_keyword", ccsText, "", CCGetRequestParam("s_keyword", $Method)); $this->DoSearch = new clsButton("DoSearch"); } } //End Class_Initialize Event //Initialize Method @15-5D060BAC function Initialize() { if(!$this->Visible) return; } //End Initialize Method //Validate Method @15-F230E30A function Validate() { $Validation = true; $Where = ""; $Validation = ($this->s_keyword->Validate() && $Validation); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate"); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method //CheckErrors Method @15-0E6CDFD1 function CheckErrors() { $errors = false; $errors = ($errors || $this->s_keyword->Errors->Count()); $errors = ($errors || $this->Errors->Count()); $errors = ($errors || $this->ds->Errors->Count()); return $errors; } //End CheckErrors Method //Operation Method @15-90CA8605 function Operation() { if(!$this->Visible) return; global $Redirect; global $FileName; $this->ds->Prepare(); $this->EditMode = true; if(!$this->FormSubmitted) return; if($this->FormSubmitted) { $this->PressedButton = "DoSearch"; if(strlen(CCGetParam("DoSearch", ""))) { $this->PressedButton = "DoSearch"; } } $Redirect = "login.php?" . CCGetQueryString("Form", Array("ccsForm", "DoSearch")); if($this->Validate()) { if($this->PressedButton == "DoSearch") { if(!CCGetEvent($this->DoSearch->CCSEvents, "OnClick")) { $Redirect = ""; } else { $Redirect = "login.php?" . CCMergeQueryStrings(CCGetQueryString("Form", Array("DoSearch"))); } } } else { $Redirect = ""; } } //End Operation Method //Show Method @15-01FCAA20 function Show() { global $Tpl; global $FileName; $Error = ""; if(!$this->Visible) return; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect"); $this->ds->open(); $RecordBlock = "Record " . $this->ComponentName; $ParentPath = $Tpl->block_path; $Tpl->block_path = $ParentPath . "/" . $RecordBlock; if($this->EditMode) { if($this->Errors->Count() == 0) { if($this->ds->Errors->Count() > 0) { echo "Error in Record usersSearch"; } else if($this->ds->next_record()) { $this->ds->SetValues(); if(!$this->FormSubmitted) { } } else { $this->EditMode = false; } } } if(!$this->FormSubmitted) { } if($this->FormSubmitted || $this->CheckErrors()) { $Error .= $this->s_keyword->Errors->ToString(); $Error .= $this->Errors->ToString(); $Error .= $this->ds->Errors->ToString(); $Tpl->SetVar("Error", $Error); $Tpl->Parse("Error", false); } $CCSForm = $this->EditMode ? $this->ComponentName . ":" . "Edit" : $this->ComponentName; $this->HTMLFormAction = $FileName . "?" . CCAddParam(CCGetQueryString("QueryString", ""), "ccsForm", $CCSForm); $Tpl->SetVar("Action", $this->HTMLFormAction); $Tpl->SetVar("HTMLFormName", $this->ComponentName); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); if(!$this->Visible) { $Tpl->block_path = $ParentPath; return; } $this->s_keyword->Show(); $this->DoSearch->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->ds->close(); } //End Show Method } //End usersSearch Class @15-FCB6E20C class clsusersSearchDataSource extends clsDBbeVisitorPortal { //usersSearchDataSource Class @15-DC243349 //DataSource Variables @15-F9838BF6 var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $wp; var $AllParametersSet; // Datasource fields var $s_keyword; //End DataSource Variables //Class_Initialize Event @15-C0682A8F function clsusersSearchDataSource() { $this->ErrorBlock = "Record usersSearch/Error"; $this->Initialize(); $this->s_keyword = new clsField("s_keyword", ccsText, ""); } //End Class_Initialize Event //Prepare Method @15-DFF3DD87 function Prepare() { } //End Prepare Method //Open Method @15-DC1AA46D function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect"); $this->SQL = "SELECT * " . "FROM users"; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect"); $this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order)); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect"); $this->MoveToPage($this->AbsolutePage); } //End Open Method //SetValues Method @15-BAF0975B function SetValues() { } //End SetValues Method } //End usersSearchDataSource Class @15-FCB6E20C //Include Page implementation @10-EFAB2CA0 include_once("./footer.php"); //End Include Page implementation //Initialize Page @1-780DB2EB // Variables $FileName = ""; $Redirect = ""; $Tpl = ""; $TemplateFileName = ""; $BlockToParse = ""; $ComponentName = ""; // Events; $CCSEvents = ""; $CCSEventResult = ""; $FileName = "login.php"; $Redirect = ""; $TemplateFileName = "login.html"; $BlockToParse = "main"; $PathToRoot = "./"; //End Initialize Page //Initialize Objects @1-279703CF $DBbeVisitorPortal = new clsDBbeVisitorPortal(); // Controls $header = new clsheader(); $header->BindEvents(); $header->TemplatePath = "./"; $header->Initialize(); $Login = new clsRecordLogin(); $ButtonRegister = new clsButton("ButtonRegister"); $usersSearch = new clsRecordusersSearch(); $footer = new clsfooter(); $footer->BindEvents(); $footer->TemplatePath = "./"; $footer->Initialize(); $usersSearch->Initialize(); // Events include("./login_events.php"); BindEvents(); $CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize"); //End Initialize Objects //Initialize HTML Template @1-A0111C9D $CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView"); $Tpl = new clsTemplate(); $Tpl->LoadTemplate(TemplatePath . $TemplateFileName, "main"); $CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow"); //End Initialize HTML Template //Execute Components @1-05DA6945 $header->Operations(); $Login->Operation(); $usersSearch->Operation(); $footer->Operations(); //End Execute Components //Go to destination page @1-BEB91355 if($Redirect) { $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload"); header("Location: " . $Redirect); exit; } //End Go to destination page //Show Page @1-0618BF63 $footer->Show("footer"); $usersSearch->Show(); $Login->Show(); $header->Show("header"); $ButtonRegister->Show(); $Tpl->PParse("main", false); //End Show Page //Unload Page @1-AB7622EF $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload"); unset($Tpl); //End Unload Page ?>