Visible = true; $this->Errors = new clsErrors(); $this->ErrorBlock = "Record usersSearch/Error"; $this->ReadAllowed = false; $this->InsertAllowed = false; $this->UpdateAllowed = false; $this->DeleteAllowed = false; 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->FormEnctype = "application/x-www-form-urlencoded"; $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->Button_DoSearch = new clsButton("Button_DoSearch"); } } //End Class_Initialize Event //Validate Method @132-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 @132-D6729123 function CheckErrors() { $errors = false; $errors = ($errors || $this->s_keyword->Errors->Count()); $errors = ($errors || $this->Errors->Count()); return $errors; } //End CheckErrors Method //Operation Method @132-CD94B217 function Operation() { if(!$this->Visible) return; global $Redirect; global $FileName; $this->EditMode = false; if(!$this->FormSubmitted) return; if($this->FormSubmitted) { $this->PressedButton = "Button_DoSearch"; if(strlen(CCGetParam("Button_DoSearch", ""))) { $this->PressedButton = "Button_DoSearch"; } } $Redirect = "index.htm"; if($this->Validate()) { if($this->PressedButton == "Button_DoSearch") { if(!CCGetEvent($this->Button_DoSearch->CCSEvents, "OnClick")) { $Redirect = ""; } else { $Redirect = "index.htm" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", Array("Button_DoSearch"))); } } } else { $Redirect = ""; } } //End Operation Method //Show Method @132-7C48BB57 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->s_keyword->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); $Tpl->SetVar("HTMLFormEnctype", $this->FormEnctype); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); if(!$this->Visible) { $Tpl->block_path = $ParentPath; return; } $this->s_keyword->Show(); $this->Button_DoSearch->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; } //End Show Method } //End usersSearch Class @132-FCB6E20C class clsGridusers { //users class @6-0CB76799 //Variables @6-27CAC950 // Public variables var $ComponentName; var $Visible; var $Errors; var $ErrorBlock; var $ds; var $PageSize; var $SorterName = ""; var $SorterDirection = ""; var $PageNumber; var $CCSEvents = ""; var $CCSEventResult; // Grid Controls var $StaticControls; var $RowControls; var $user_id; var $users_user_login; var $users_first_name; var $users_last_name; var $users_state_id; var $Club; var $users_Navigator; //End Variables //Class_Initialize Event @6-F8B00122 function clsGridusers() { global $FileName; $this->ComponentName = "users"; $this->Visible = True; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid users"; $this->ds = new clsusersDataSource(); $this->PageSize = CCGetParam($this->ComponentName . "PageSize", ""); if(!is_numeric($this->PageSize) || !strlen($this->PageSize)) $this->PageSize = 100; else if ($this->PageSize > 400) $this->PageSize = 400; else $this->PageSize = intval($this->PageSize); if($this->PageSize == 0) $this->Errors->addError("

Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.

"); $this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1)); $this->SorterName = CCGetParam("usersOrder", ""); #Edu $this->SorterName = CCGetParam("usersOrder", "users_state_id"); $this->SorterDirection = CCGetParam("usersDir", ""); $this->id = new clsControl(ccsLabel, "id", "id", ccsText, "", CCGetRequestParam("id", ccsGet)); $this->user_login = new clsControl(ccsLink, "user_login", "user_login", ccsText, "", CCGetRequestParam("user_login", ccsGet)); $this->first_name = new clsControl(ccsLabel, "first_name", "first_name", ccsText, "", CCGetRequestParam("first_name", ccsGet)); $this->last_name = new clsControl(ccsLabel, "last_name", "last_name", ccsText, "", CCGetRequestParam("last_name", ccsGet)); $this->state_id = new clsControl(ccsLabel, "state_id", "state_id", ccsText, "", CCGetRequestParam("state_id", ccsGet)); $this->Club_list = new clsControl(ccsLabel, "Club_list", "Club_list", ccsText, "", CCGetRequestParam("Club_list", ccsGet)); $this->user_id = new clsSorter($this->ComponentName, "user_id", $FileName); $this->users_user_login = new clsSorter($this->ComponentName, "users_user_login", $FileName); $this->users_first_name = new clsSorter($this->ComponentName, "users_first_name", $FileName); $this->users_last_name = new clsSorter($this->ComponentName, "users_last_name", $FileName); $this->users_state_id = new clsSorter($this->ComponentName, "users_state_id", $FileName); $this->Club = new clsSorter($this->ComponentName, "Club", $FileName); $this->users_Navigator = new clsNavigator($this->ComponentName, "users_Navigator", $FileName, 10, tpSimple); } //End Class_Initialize Event //Initialize Method @6-03626367 function Initialize() { if(!$this->Visible) return; $this->ds->PageSize = $this->PageSize; $this->ds->AbsolutePage = $this->PageNumber; $this->ds->SetOrder($this->SorterName, $this->SorterDirection); } //End Initialize Method //Show Method @6-AEED2B18 function Show() { global $Tpl; if(!$this->Visible) return; $ShownRecords = 0; $this->ds->Parameters["urluser_login"] = CCGetFromGet("user_login", ""); $this->ds->Parameters["urls_state_id"] = CCGetFromGet("s_state_id", ""); $this->ds->Parameters["urls_state_name"] = CCGetFromGet("s_state_name", ""); $this->ds->Parameters["urls_states_state_id"] = CCGetFromGet("s_states_state_id", ""); $this->ds->Parameters["urls_users_state_id"] = CCGetFromGet("s_users_state_id", ""); $this->ds->Parameters["urls_keyword"] = CCGetFromGet("s_keyword", ""); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect"); $this->ds->Prepare(); $this->ds->Open(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); if(!$this->Visible) return; $GridBlock = "Grid " . $this->ComponentName; $ParentPath = $Tpl->block_path; $Tpl->block_path = $ParentPath . "/" . $GridBlock; $is_next_record = $this->ds->next_record(); if($is_next_record && $ShownRecords < $this->PageSize) { do { $this->ds->SetValues(); $Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row"; $this->id->SetValue($this->ds->id->GetValue()); $this->user_login->SetValue($this->ds->user_login->GetValue()); $this->user_login->SetLink(""); $this->user_login->Parameters = CCAddParam($this->user_login->Parameters, "user_id", $this->ds->f("user_id")); $this->user_login->Page = "verregistro.htm"; $this->first_name->SetValue($this->ds->first_name->GetValue()); $this->last_name->SetValue($this->ds->last_name->GetValue()); $this->state_id->SetValue($this->ds->state_id->GetValue()); $this->Club_list->SetValue($this->ds->Club_list->GetValue()); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow"); $this->id->Show(); $this->user_login->Show(); $this->first_name->Show(); $this->last_name->Show(); $this->state_id->Show(); $this->Club_list->Show(); $Tpl->block_path = $ParentPath . "/" . $GridBlock; $Tpl->parse("Row", true); $ShownRecords++; $is_next_record = $this->ds->next_record(); } while ($is_next_record && $ShownRecords < $this->PageSize); } else // Show NoRecords block if no records are found { $Tpl->parse("NoRecords", false); } $errors = $this->GetErrors(); if(strlen($errors)) { $Tpl->replaceblock("", $errors); $Tpl->block_path = $ParentPath; return; } $this->users_Navigator->PageNumber = $this->ds->AbsolutePage; $this->users_Navigator->TotalPages = $this->ds->PageCount(); $this->user_id->Show(); $this->users_user_login->Show(); $this->users_first_name->Show(); $this->users_last_name->Show(); $this->users_state_id->Show(); $this->Club->Show(); $this->users_Navigator->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->ds->close(); } //End Show Method //GetErrors Method @6-3352F506 function GetErrors() { $errors = ""; $errors .= $this->id->Errors->ToString(); $errors .= $this->user_login->Errors->ToString(); $errors .= $this->first_name->Errors->ToString(); $errors .= $this->last_name->Errors->ToString(); $errors .= $this->state_id->Errors->ToString(); $errors .= $this->Club_list->Errors->ToString(); $errors .= $this->Errors->ToString(); $errors .= $this->ds->Errors->ToString(); return $errors; } //End GetErrors Method } //End users Class @6-FCB6E20C class clsusersDataSource extends clsDBinternet { //usersDataSource Class @6-98485C1D //DataSource Variables @6-4ED625F8 var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CountSQL; var $wp; // Datasource fields var $id; var $user_login; var $first_name; var $last_name; var $state_id; var $Club_list; //End DataSource Variables //Class_Initialize Event @6-63FD9C18 function clsusersDataSource() { $this->ErrorBlock = "Grid users"; $this->Initialize(); $this->id = new clsField("id", ccsText, ""); $this->user_login = new clsField("user_login", ccsText, ""); $this->first_name = new clsField("first_name", ccsText, ""); $this->last_name = new clsField("last_name", ccsText, ""); $this->state_id = new clsField("state_id", ccsText, ""); $this->Club_list = new clsField("Club_list", ccsText, ""); } //End Class_Initialize Event //SetOrder Method @6-5F800DDE function SetOrder($SorterName, $SorterDirection) { # $this->Order = "user_login"; #Edu $this->Order = "state_name"; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, array("user_id" => array("user_id, user_login", "user_id desc, user_login desc"), "users_user_login" => array("user_login, user_id", "user_login desc, user_id"), "users_first_name" => array("first_name, user_id", "first_name desc, user_id"), "users_last_name" => array("last_name, user_id", "last_name desc, user_id"), "users_state_id" => array("state_name, user_id", "state_name desc, user_id"), "Club" => array("phone_work", "phone_work desc, user_id"))); } //End SetOrder Method //Prepare Method @6-1F2AE76E function Prepare() { $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urluser_login", ccsText, "", "", $this->Parameters["urluser_login"], "", false); $this->wp->AddParameter("2", "urluser_login", ccsText, "", "", $this->Parameters["urluser_login"], "", false); $this->wp->AddParameter("3", "urluser_login", ccsText, "", "", $this->Parameters["urluser_login"], "", false); $this->wp->AddParameter("4", "urls_state_id", ccsInteger, "", "", $this->Parameters["urls_state_id"], "", false); $this->wp->AddParameter("5", "urls_state_name", ccsText, "", "", $this->Parameters["urls_state_name"], "", false); $this->wp->AddParameter("6", "urls_states_state_id", ccsInteger, "", "", $this->Parameters["urls_states_state_id"], "", false); $this->wp->AddParameter("7", "urls_users_state_id", ccsInteger, "", "", $this->Parameters["urls_users_state_id"], "", false); $this->wp->AddParameter("8", "urls_keyword", ccsText, "", "", $this->Parameters["urls_keyword"], "", false); $this->wp->Criterion[1] = $this->wp->Operation(opContains, "user_login", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsText),false); $this->wp->Criterion[2] = $this->wp->Operation(opContains, "first_name", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false); $this->wp->Criterion[3] = $this->wp->Operation(opContains, "last_name", $this->wp->GetDBValue("3"), $this->ToSQL($this->wp->GetDBValue("3"), ccsText),false); $this->wp->Criterion[4] = $this->wp->Operation(opEqual, "state_id", $this->wp->GetDBValue("4"), $this->ToSQL($this->wp->GetDBValue("4"), ccsInteger),false); $this->wp->Criterion[5] = $this->wp->Operation(opContains, "state_name", $this->wp->GetDBValue("5"), $this->ToSQL($this->wp->GetDBValue("5"), ccsText),false); $this->wp->Criterion[6] = $this->wp->Operation(opEqual, "states.state_id", $this->wp->GetDBValue("6"), $this->ToSQL($this->wp->GetDBValue("6"), ccsInteger),false); $this->wp->Criterion[7] = $this->wp->Operation(opEqual, "users.state_id", $this->wp->GetDBValue("7"), $this->ToSQL($this->wp->GetDBValue("7"), ccsInteger),false); $this->wp->Criterion[8] = $this->wp->Operation(opContains, "state_name", $this->wp->GetDBValue("8"), $this->ToSQL($this->wp->GetDBValue("8"), ccsText),false); $this->Where = $this->wp->opAND(false, $this->wp->opAND(false, $this->wp->opAND(false, $this->wp->opAND(false, $this->wp->opAND(false, $this->wp->opOR(true, $this->wp->opOR(false, $this->wp->Criterion[1], $this->wp->Criterion[2]), $this->wp->Criterion[3]), $this->wp->Criterion[4]), $this->wp->Criterion[5]), $this->wp->Criterion[6]), $this->wp->Criterion[7]), $this->wp->Criterion[8]); } //End Prepare Method //Open Method @6-1CFFD53A function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect"); $this->CountSQL = "SELECT COUNT(*) " . "FROM (users LEFT JOIN countries ON " . "users.country_id = countries.country_id) INNER JOIN states ON " . "states.state_id = users.state_id"; $this->SQL = "SELECT * " . "FROM (users LEFT JOIN countries ON " . "users.country_id = countries.country_id) INNER JOIN states ON " . "states.state_id = users.state_id"; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect"); $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this); $this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order)); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect"); $this->MoveToPage($this->AbsolutePage); } //End Open Method //SetValues Method @6-7D231FC9 function SetValues() { $this->id->SetDBValue($this->f("user_id")); $this->user_login->SetDBValue($this->f("user_login")); $this->first_name->SetDBValue($this->f("first_name")); $this->last_name->SetDBValue($this->f("last_name")); $this->state_id->SetDBValue($this->f("state_name")); $this->Club_list->SetDBValue($this->f("phone_work")); } //End SetValues Method } //End usersDataSource Class @6-FCB6E20C //Include Page implementation @16-B4331262 include_once("./Footer.htm"); //End Include Page implementation //Initialize Page @1-9BD5B7FB // Variables $FileName = ""; $Redirect = ""; $Tpl = ""; $TemplateFileName = ""; $BlockToParse = ""; $ComponentName = ""; // Events; $CCSEvents = ""; $CCSEventResult = ""; $FileName = "index.htm"; $Redirect = ""; $TemplateFileName = "index.html"; $BlockToParse = "main"; $PathToRoot = "./"; //End Initialize Page //Initialize Objects @1-4C27598F $DBinternet = new clsDBinternet(); // Controls $Header = new clsHeader(); $Header->BindEvents(); $Header->TemplatePath = "./"; $Header->Initialize(); $usersSearch = new clsRecordusersSearch(); $users = new clsGridusers(); $Footer = new clsFooter(); $Footer->BindEvents(); $Footer->TemplatePath = "./"; $Footer->Initialize(); $users->Initialize(); $CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize"); if($Charset) { header("Content-Type: text/html; charset=" . $Charset); } //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-25003A86 $Header->Operations(); $usersSearch->Operation(); $Footer->Operations(); //End Execute Components //Go to destination page @1-61A4F1DF if($Redirect) { $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload"); $DBinternet->close(); header("Location: " . $Redirect); exit; } //End Go to destination page //Show Page @1-DDC07BE0 $Header->Show("Header"); $usersSearch->Show(); $users->Show(); $Footer->Show("Footer"); $Tpl->Parse("main", false); $main_block = $Tpl->GetVar("main"); //$generated_with = "
Generated with CodeCharge Studio
"; $generated_with = ""; if(preg_match("/<\/body>/i", $main_block)) { $main_block = preg_replace("/<\/body>/i", $generated_with . "", $main_block); } else if(preg_match("/<\/html>/i", $main_block) && !preg_match("/<\/frameset>/i", $main_block)) { $main_block = preg_replace("/<\/html>/i", $generated_with . "", $main_block); } else if(!preg_match("/<\/frameset>/i", $main_block)) { $main_block .= $generated_with; } echo $main_block; //End Show Page //Unload Page @1-3B5A3A9A $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload"); $DBinternet->close(); unset($Tpl); //End Unload Page ?>