ComponentName = "Path_faq"; $this->Visible = True; $this->Errors = new clsErrors(); $this->ds = new clsPath_faqDataSource(); $this->PathBeginLink = new clsControl(ccsLink, "PathBeginLink", "PathBeginLink", ccsText, "", CCGetRequestParam("PathBeginLink", ccsGet)); $this->PathBeginLink->Parameters = CCGetQueryString("QueryString", Array("id", "ccsForm")); $this->PathBeginLink->Page = "faq.php"; $this->PathCategory = new clsControl(ccsLink, "PathCategory", "PathCategory", ccsText, "", CCGetRequestParam("PathCategory", ccsGet)); $this->CurrentCategory = new clsControl(ccsLabel, "CurrentCategory", "CurrentCategory", ccsText, "", CCGetRequestParam("CurrentCategory", ccsGet)); } //End Class_Initialize Event //Initialize Method @2-5D060BAC function Initialize() { if(!$this->Visible) return; } //End Initialize Method //Show Method @2-143E0711 function Show() { global $Tpl; if(!$this->Visible) return; $this->ds->Parameters["urlid"] = CCGetFromGet("id", ""); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect"); $this->ds->Prepare(); $this->ds->Open(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); if(!$this->Visible) return; $PathBlock = "Path " . $this->ComponentName; $ParentPath = $Tpl->block_path; $Tpl->block_path = $ParentPath . "/" . $PathBlock; $is_next_record = $this->ds->next_record(); if($is_next_record) { $this->ds->SetValues(); $this->CurrentCategory->SetValue($this->ds->CurrentCategory->GetValue()); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowCategory"); $this->CurrentCategory->Show(); $Tpl->parse("CurrentCategory", true); $category_parent_id = $this->ds->f("parent"); $this->ds->Parameters["urlid"] = $category_parent_id; $this->ds->Prepare(); $this->ds->Open(); while($this->ds->next_record() && $category_parent_id) { $this->ds->SetValues(); $this->PathCategory->SetValue($this->ds->PathCategory->GetValue()); $this->PathCategory->Parameters = CCGetQueryString("QueryString", Array("ccsForm")); $this->PathCategory->Parameters = CCAddParam($this->PathCategory->Parameters, "id", $this->ds->f("id")); $this->PathCategory->Page = "faq.php"; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowCategory"); $this->PathCategory->Show(); $Tpl->rparse("PathComponent", true); $category_parent_id = $this->ds->f("parent"); $this->ds->Parameters["urlid"] = $category_parent_id; $this->ds->Prepare(); $this->ds->Open(); } } else { } $errors = $this->GetErrors(); if(strlen($errors)) { $Tpl->replaceblock("", $errors); $Tpl->block_path = $ParentPath; return; } $this->PathBeginLink->SetValue($this->ds->PathBeginLink->GetValue()); $this->PathBeginLink->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; } //End Show Method //GetErrors Method @2-7C1421A0 function GetErrors() { $errors = ""; $errors .= $this->PathBeginLink->Errors->ToString(); $errors .= $this->PathCategory->Errors->ToString(); $errors .= $this->CurrentCategory->Errors->ToString(); $errors .= $this->Errors->ToString(); $errors .= $this->ds->Errors->ToString(); return $errors; } //End GetErrors Method } //End Path_faq Class @2-FCB6E20C class clsPath_faqDataSource extends clsDBbeVisitorPortal { //Path_faqDataSource Class @2-CCBCF8B6 //DataSource Variables @2-11FA8393 var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CountSQL; var $wp; // Datasource fields var $PathBeginLink; var $PathCategory; var $CurrentCategory; //End DataSource Variables //Class_Initialize Event @2-0C9F4720 function clsPath_faqDataSource() { $this->ErrorBlock = "Path Path_faq"; $this->Initialize(); $this->PathBeginLink = new clsField("PathBeginLink", ccsText, ""); $this->PathCategory = new clsField("PathCategory", ccsText, ""); $this->CurrentCategory = new clsField("CurrentCategory", ccsText, ""); } //End Class_Initialize Event //SetOrder Method @2-9E1383D1 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, ""); } //End SetOrder Method //Prepare Method @2-CF442587 function Prepare() { $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlid", ccsInteger, "", "", $this->Parameters["urlid"], 0); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger)); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method //Open Method @2-9065FB59 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect"); $this->CountSQL = "SELECT COUNT(*) " . "FROM faq"; $this->SQL = "SELECT * " . "FROM faq"; $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 @2-B1F6C562 function SetValues() { $this->PathBeginLink->SetDBValue($this->f("caption")); $this->PathCategory->SetDBValue($this->f("caption")); $this->CurrentCategory->SetDBValue($this->f("caption")); } //End SetValues Method } //End Path_faqDataSource Class @2-FCB6E20C class clsDirectoryfaq { //faq class @8-F12537F8 //Variables @8-33750D3E // Public variables var $ComponentName; var $Visible; var $Errors; var $ds; var $SorterName = ""; var $SorterDirection = ""; var $ColumnsNumber = 1; var $SubcategoriesNumber = ""; var $CCSEvents = ""; var $CCSEventResult; //End Variables //Class_Initialize Event @8-210D601B function clsDirectoryfaq() { global $FileName; $this->ComponentName = "faq"; $this->Visible = True; $this->Errors = new clsErrors(); $this->ds = new clsfaqDataSource(); $this->CategoryLink = new clsControl(ccsLink, "CategoryLink", "CategoryLink", ccsText, "", CCGetRequestParam("CategoryLink", ccsGet)); $this->SubcategoryLink = new clsControl(ccsLink, "SubcategoryLink", "SubcategoryLink", ccsText, "", CCGetRequestParam("SubcategoryLink", ccsGet)); $this->SubcategoriesTailLink = new clsControl(ccsLink, "SubcategoriesTailLink", "SubcategoriesTailLink", ccsText, "", CCGetRequestParam("SubcategoriesTailLink", ccsGet)); } //End Class_Initialize Event //Initialize Method @8-1DADC1B7 function Initialize() { if(!$this->Visible) return; $this->ds->SetOrder($this->SorterName, $this->SorterDirection); } //End Initialize Method //Show Method @8-8AD73F15 function Show() { global $Tpl; if(!$this->Visible) return; $this->ds->Parameters["urlid"] = CCGetFromGet("id", ""); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect"); $this->ds->Prepare(); $this->ds->Open(); $CategoriesNumber = 0; if($this->ds->next_record()) { $grouping_name = $this->ds->f("cat_id"); do { if($grouping_name != $this->ds->f("cat_id")) $CategoriesNumber++; $grouping_name = $this->ds->f("cat_id"); } while ($this->ds->next_record()); $CategoriesNumber++; } $this->ds->Open(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow"); if(!$this->Visible) return; $DirectoryBlock = "Directory " . $this->ComponentName; $ParentPath = $Tpl->block_path; $Tpl->block_path = $ParentPath . "/" . $DirectoryBlock; $ColumnNumber = 0; $CategoryNumber = 0; $SubcategoryNumber = 0; $is_next_record = $this->ds->next_record(); if($is_next_record) { do { $SubcategoryNumber++; $grouping_name = $this->ds->f("cat_id"); $this->ds->SetValues(); $this->CategoryLink->SetValue($this->ds->CategoryLink->GetValue()); $this->CategoryLink->Parameters = CCGetQueryString("QueryString", Array("ccsForm")); $this->CategoryLink->Parameters = CCAddParam($this->CategoryLink->Parameters, "id", $this->ds->f("cat_id")); $this->CategoryLink->Page = "faq.php"; $this->SubcategoryLink->SetValue($this->ds->SubcategoryLink->GetValue()); $this->SubcategoryLink->Parameters = CCGetQueryString("QueryString", Array("ccsForm")); $this->SubcategoryLink->Parameters = CCAddParam($this->SubcategoryLink->Parameters, "id", $this->ds->f("sub_id")); $this->SubcategoryLink->Page = "faq.php"; $this->SubcategoriesTailLink->SetValue($this->ds->SubcategoriesTailLink->GetValue()); $this->SubcategoriesTailLink->Parameters = CCGetQueryString("QueryString", Array("ccsForm")); $this->SubcategoriesTailLink->Parameters = CCAddParam($this->SubcategoriesTailLink->Parameters, "id", $this->ds->f("cat_id")); $this->SubcategoriesTailLink->Page = "faq.php"; if(!strlen($this->SubcategoriesNumber) || $this->SubcategoriesNumber >= $SubcategoryNumber) { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowSubcategory"); $this->SubcategoryLink->Show(); $Tpl->parse("Category/Subcategory", true); } else if(strlen($this->SubcategoriesNumber) && ($this->SubcategoriesNumber + 1) == $SubcategoryNumber) { $this->SubcategoriesTailLink->Show(); $Tpl->parseto("Category/SubcategoriesTail", true, "Category/Subcategory"); } $is_next_record = $this->ds->next_record(); $parse_category = (($is_next_record && $grouping_name != $this->ds->f("cat_id")) || !$is_next_record); // Parse Separator if($parse_category) { $CategoryNumber++; $SubcategoryNumber = 0; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowCategory"); $this->CategoryLink->Show(); $Tpl->parse("Category", true); $Tpl->setblockvar("Category/Subcategory", ""); if($CategoryNumber >= ($CategoriesNumber / ($this->ColumnsNumber - $ColumnNumber)) && $is_next_record) { $CategoriesNumber -= $CategoryNumber; $ColumnNumber++; $CategoryNumber = 0; $Tpl->parseto("ColumnSeparator", true, "Category"); } else if($is_next_record) { $Tpl->parseto("CategorySeparator", true, "Category"); } } else { if(!strlen($this->SubcategoriesNumber) || $this->SubcategoriesNumber >= $SubcategoryNumber) $Tpl->parseto("Category/SubcategorySeparator", true, "Category/Subcategory"); } } while ($is_next_record); } else // Show NoCategories block if no categories are found { $Tpl->parse("NoCategories", false); } $errors = $this->GetErrors(); if(strlen($errors)) { $Tpl->replaceblock("", $errors); $Tpl->block_path = $ParentPath; return; } $Tpl->parse(); $Tpl->block_path = $ParentPath; } //End Show Method //GetErrors Method @8-B119FC84 function GetErrors() { $errors = ""; $errors .= $this->CategoryLink->Errors->ToString(); $errors .= $this->SubcategoryLink->Errors->ToString(); $errors .= $this->SubcategoriesTailLink->Errors->ToString(); $errors .= $this->Errors->ToString(); $errors .= $this->ds->Errors->ToString(); return $errors; } //End GetErrors Method } //End faq Class @8-FCB6E20C class clsfaqDataSource extends clsDBbeVisitorPortal { //faqDataSource Class @8-F1A48112 //DataSource Variables @8-7FE26005 var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CountSQL; var $wp; // Datasource fields var $CategoryLink; var $SubcategoryLink; var $SubcategoriesTailLink; //End DataSource Variables //Class_Initialize Event @8-4801443D function clsfaqDataSource() { $this->ErrorBlock = "Directory faq"; $this->Initialize(); $this->CategoryLink = new clsField("CategoryLink", ccsText, ""); $this->SubcategoryLink = new clsField("SubcategoryLink", ccsText, ""); $this->SubcategoriesTailLink = new clsField("SubcategoriesTailLink", ccsText, ""); } //End Class_Initialize Event //SetOrder Method @8-9E1383D1 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, ""); } //End SetOrder Method //Prepare Method @8-BAA90F3F function Prepare() { $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlid", ccsInteger, "", "", $this->Parameters["urlid"], 0); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "cat.parent", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger)); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method //Open Method @8-C11F947E function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect"); $this->CountSQL = "SELECT COUNT(*) " . "FROM faq sub RIGHT JOIN faq cat ON sub.parent = cat.id"; $this->SQL = "SELECT cat.id AS cat_id, cat.caption AS cat_caption, sub.id AS sub_id, sub.caption AS sub_caption " . "FROM faq sub RIGHT JOIN faq cat ON sub.parent = cat.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 @8-0FA2EA22 function SetValues() { $this->CategoryLink->SetDBValue($this->f("cat_caption")); $this->SubcategoryLink->SetDBValue($this->f("sub_caption")); $this->SubcategoriesTailLink->SetDBValue($this->f("cat_caption")); } //End SetValues Method } //End faqDataSource Class @8-FCB6E20C Class clsRecordfaq1 { //faq1 Class @23-BF733497 //Variables @23-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 @23-A27E2511 function clsRecordfaq1() { global $FileName; $this->Visible = true; $this->Errors = new clsErrors(); $this->ds = new clsfaq1DataSource(); if($this->Visible) { $this->ComponentName = "faq1"; $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->message = new clsControl(ccsLabel, "message", "Message", ccsMemo, "", CCGetRequestParam("message", $Method)); } } //End Class_Initialize Event //Initialize Method @23-F98A764E function Initialize() { if(!$this->Visible) return; $this->ds->Parameters["urlid"] = CCGetFromGet("id", ""); } //End Initialize Method //Validate Method @23-7E1FC38C function Validate() { $Validation = true; $Where = ""; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate"); return (($this->Errors->Count() == 0) && $Validation); } //End Validate Method //CheckErrors Method @23-9F79A326 function CheckErrors() { $errors = false; $errors = ($errors || $this->message->Errors->Count()); $errors = ($errors || $this->Errors->Count()); $errors = ($errors || $this->ds->Errors->Count()); return $errors; } //End CheckErrors Method //Operation Method @23-F074C4B2 function Operation() { if(!$this->Visible) return; global $Redirect; global $FileName; $this->ds->Prepare(); $this->EditMode = $this->ds->AllParametersSet; if(!$this->FormSubmitted) return; $Redirect = "faq.php?" . CCGetQueryString("QueryString", Array("ccsForm")); } //End Operation Method //Show Method @23-200CC71F 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 faq1"; } else if($this->ds->next_record()) { $this->ds->SetValues(); $this->message->SetValue($this->ds->message->GetValue()); if(!$this->FormSubmitted) { } } else { $this->EditMode = false; } } } if($this->FormSubmitted || $this->CheckErrors()) { $Error .= $this->message->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->message->Show(); $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->ds->close(); } //End Show Method } //End faq1 Class @23-FCB6E20C class clsfaq1DataSource extends clsDBbeVisitorPortal { //faq1DataSource Class @23-BA242C17 //DataSource Variables @23-9D48FD05 var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $wp; var $AllParametersSet; // Datasource fields var $message; //End DataSource Variables //Class_Initialize Event @23-280228DE function clsfaq1DataSource() { $this->ErrorBlock = "Record faq1/Error"; $this->Initialize(); $this->message = new clsField("message", ccsMemo, ""); } //End Class_Initialize Event //Prepare Method @23-31D2066F function Prepare() { $this->wp = new clsSQLParameters($this->ErrorBlock); $this->wp->AddParameter("1", "urlid", ccsInteger, "", "", $this->Parameters["urlid"], ""); $this->AllParametersSet = $this->wp->AllParamsSet(); $this->wp->Criterion[1] = $this->wp->Operation(opEqual, "id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger)); $this->Where = $this->wp->Criterion[1]; } //End Prepare Method //Open Method @23-5E76CB68 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect"); $this->SQL = "SELECT * " . "FROM faq"; $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 @23-4F2EE4CA function SetValues() { $this->message->SetDBValue($this->f("message")); } //End SetValues Method } //End faq1DataSource Class @23-FCB6E20C //Include Page implementation @29-EFAB2CA0 include_once("./footer.php"); //End Include Page implementation //Initialize Page @1-1BC3931D // Variables $FileName = ""; $Redirect = ""; $Tpl = ""; $TemplateFileName = ""; $BlockToParse = ""; $ComponentName = ""; // Events; $CCSEvents = ""; $CCSEventResult = ""; $FileName = "faq.php"; $Redirect = ""; $TemplateFileName = "faq.html"; $BlockToParse = "main"; $PathToRoot = "./"; //End Initialize Page //Initialize Objects @1-544D7727 $DBbeVisitorPortal = new clsDBbeVisitorPortal(); // Controls $header = new clsheader(); $header->BindEvents(); $header->TemplatePath = "./"; $header->Initialize(); $Path_faq = new clsPathPath_faq(); $faq = new clsDirectoryfaq(); $faq1 = new clsRecordfaq1(); $footer = new clsfooter(); $footer->BindEvents(); $footer->TemplatePath = "./"; $footer->Initialize(); $Path_faq->Initialize(); $faq->Initialize(); $faq1->Initialize(); // Events include("./faq_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-9C8EB055 $header->Operations(); $faq1->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-3345F4C8 $footer->Show("footer"); $faq1->Show(); $header->Show("header"); $faq->Show(); $Path_faq->Show(); $Tpl->PParse("main", false); //End Show Page //Unload Page @1-AB7622EF $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload"); unset($Tpl); //End Unload Page ?>