Visible = true;
$this->Errors = new clsErrors();
if($this->Visible)
{
$this->ComponentName = "fb_contentsSearch";
$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
//Validate Method @5-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 @5-D6729123
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->s_keyword->Errors->Count());
$errors = ($errors || $this->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @5-CC701D41
function Operation()
{
if(!$this->Visible)
return;
global $Redirect;
global $FileName;
$this->EditMode = false;
if(!$this->FormSubmitted)
return;
if($this->FormSubmitted) {
$this->PressedButton = "DoSearch";
if(strlen(CCGetParam("DoSearch", ""))) {
$this->PressedButton = "DoSearch";
}
}
$Redirect = "testimonials.php?" . CCGetQueryString("Form", Array("ccsForm", "DoSearch"));
if($this->Validate()) {
if($this->PressedButton == "DoSearch") {
if(!CCGetEvent($this->DoSearch->CCSEvents, "OnClick")) {
$Redirect = "";
} else {
$Redirect = "testimonials.php?" . CCMergeQueryStrings(CCGetQueryString("Form", Array("DoSearch")));
}
}
} else {
$Redirect = "";
}
}
//End Operation Method
//Show Method @5-818B04F7
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);
$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;
}
//End Show Method
} //End fb_contentsSearch Class @5-FCB6E20C
class clsGridfb_contents { //fb_contents class @4-6DC5402C
//Variables @4-10869FDF
// Public variables
var $ComponentName;
var $Visible; var $Errors;
var $ds; var $PageSize;
var $SorterName = "";
var $SorterDirection = "";
var $PageNumber;
var $CCSEvents = "";
var $CCSEventResult;
// Grid Controls
var $StaticControls; var $RowControls;
var $AltRowControls;
var $IsAltRow;
var $Navigator;
//End Variables
//Class_Initialize Event @4-E0AF06B7
function clsGridfb_contents()
{
global $FileName;
$this->ComponentName = "fb_contents";
$this->Visible = True;
$this->IsAltRow = false;
$this->Errors = new clsErrors();
$this->ds = new clsfb_contentsDataSource();
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 10;
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->id = new clsControl(ccsHidden, "id", "id", ccsInteger, "", CCGetRequestParam("id", ccsGet));
$this->display = new clsControl(ccsHidden, "display", "display", ccsInteger, "", CCGetRequestParam("display", ccsGet));
$this->date = new clsControl(ccsHidden, "date", "date", ccsDate, Array("yyyy", "/", "mm", "/", "dd"), CCGetRequestParam("date", ccsGet));
$this->comments = new clsControl(ccsLabel, "comments", "comments", ccsMemo, "", CCGetRequestParam("comments", ccsGet));
$this->fullname = new clsControl(ccsLabel, "fullname", "fullname", ccsText, "", CCGetRequestParam("fullname", ccsGet));
$this->title = new clsControl(ccsLabel, "title", "title", ccsText, "", CCGetRequestParam("title", ccsGet));
$this->company = new clsControl(ccsLabel, "company", "company", ccsText, "", CCGetRequestParam("company", ccsGet));
$this->weburl = new clsControl(ccsLabel, "weburl", "weburl", ccsText, "", CCGetRequestParam("weburl", ccsGet));
$this->rating = new clsControl(ccsImage, "rating", "rating", ccsInteger, "", CCGetRequestParam("rating", ccsGet));
$this->Alt_id = new clsControl(ccsHidden, "Alt_id", "Alt_id", ccsInteger, "", CCGetRequestParam("Alt_id", ccsGet));
$this->Alt_display = new clsControl(ccsHidden, "Alt_display", "Alt_display", ccsInteger, "", CCGetRequestParam("Alt_display", ccsGet));
$this->Alt_date = new clsControl(ccsHidden, "Alt_date", "Alt_date", ccsDate, Array("yyyy", "/", "mm", "/", "dd"), CCGetRequestParam("Alt_date", ccsGet));
$this->Alt_comments = new clsControl(ccsLabel, "Alt_comments", "Alt_comments", ccsMemo, "", CCGetRequestParam("Alt_comments", ccsGet));
$this->Alt_fullname = new clsControl(ccsLabel, "Alt_fullname", "Alt_fullname", ccsText, "", CCGetRequestParam("Alt_fullname", ccsGet));
$this->Alt_title = new clsControl(ccsLabel, "Alt_title", "Alt_title", ccsText, "", CCGetRequestParam("Alt_title", ccsGet));
$this->Alt_company = new clsControl(ccsLabel, "Alt_company", "Alt_company", ccsText, "", CCGetRequestParam("Alt_company", ccsGet));
$this->Alt_weburl = new clsControl(ccsLabel, "Alt_weburl", "Alt_weburl", ccsText, "", CCGetRequestParam("Alt_weburl", ccsGet));
$this->Alt_rating = new clsControl(ccsImage, "Alt_rating", "Alt_rating", ccsInteger, "", CCGetRequestParam("Alt_rating", ccsGet));
$this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpSimple);
}
//End Class_Initialize Event
//Initialize Method @4-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 @4-9C9FC4BF
function Show()
{
global $Tpl;
if(!$this->Visible) return;
$ShownRecords = 0;
$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();
if(!$this->IsAltRow)
{
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->id->SetValue($this->ds->id->GetValue());
$this->display->SetValue($this->ds->display->GetValue());
$this->date->SetValue($this->ds->date->GetValue());
$this->comments->SetValue($this->ds->comments->GetValue());
$this->fullname->SetValue($this->ds->fullname->GetValue());
$this->title->SetValue($this->ds->title->GetValue());
$this->company->SetValue($this->ds->company->GetValue());
$this->weburl->SetValue($this->ds->weburl->GetValue());
$this->rating->SetValue($this->ds->rating->GetValue());
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
$this->id->Show();
$this->display->Show();
$this->date->Show();
$this->comments->Show();
$this->fullname->Show();
$this->title->Show();
$this->company->Show();
$this->weburl->Show();
$this->rating->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
else
{
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/AltRow";
$this->Alt_id->SetValue($this->ds->Alt_id->GetValue());
$this->Alt_display->SetValue($this->ds->Alt_display->GetValue());
$this->Alt_date->SetValue($this->ds->Alt_date->GetValue());
$this->Alt_comments->SetValue($this->ds->Alt_comments->GetValue());
$this->Alt_fullname->SetValue($this->ds->Alt_fullname->GetValue());
$this->Alt_title->SetValue($this->ds->Alt_title->GetValue());
$this->Alt_company->SetValue($this->ds->Alt_company->GetValue());
$this->Alt_weburl->SetValue($this->ds->Alt_weburl->GetValue());
$this->Alt_rating->SetValue($this->ds->Alt_rating->GetValue());
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
$this->Alt_id->Show();
$this->Alt_display->Show();
$this->Alt_date->Show();
$this->Alt_comments->Show();
$this->Alt_fullname->Show();
$this->Alt_title->Show();
$this->Alt_company->Show();
$this->Alt_weburl->Show();
$this->Alt_rating->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parseto("AltRow", true, "Row");
}
$this->IsAltRow = (!$this->IsAltRow);
$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->Navigator->PageNumber = $this->ds->AbsolutePage;
$this->Navigator->TotalPages = $this->ds->PageCount();
$this->Navigator->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->ds->close();
}
//End Show Method
//GetErrors Method @4-C3DF1C34
function GetErrors()
{
$errors = "";
$errors .= $this->id->Errors->ToString();
$errors .= $this->display->Errors->ToString();
$errors .= $this->date->Errors->ToString();
$errors .= $this->comments->Errors->ToString();
$errors .= $this->fullname->Errors->ToString();
$errors .= $this->title->Errors->ToString();
$errors .= $this->company->Errors->ToString();
$errors .= $this->weburl->Errors->ToString();
$errors .= $this->rating->Errors->ToString();
$errors .= $this->Alt_id->Errors->ToString();
$errors .= $this->Alt_display->Errors->ToString();
$errors .= $this->Alt_date->Errors->ToString();
$errors .= $this->Alt_comments->Errors->ToString();
$errors .= $this->Alt_fullname->Errors->ToString();
$errors .= $this->Alt_title->Errors->ToString();
$errors .= $this->Alt_company->Errors->ToString();
$errors .= $this->Alt_weburl->Errors->ToString();
$errors .= $this->Alt_rating->Errors->ToString();
$errors .= $this->Errors->ToString();
$errors .= $this->ds->Errors->ToString();
return $errors;
}
//End GetErrors Method
} //End fb_contents Class @4-FCB6E20C
class clsfb_contentsDataSource extends clsDBbeVisitorPortal { //fb_contentsDataSource Class @4-2A128988
//DataSource Variables @4-6A6EE6EA
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CountSQL;
var $wp;
// Datasource fields
var $id;
var $display;
var $date;
var $comments;
var $fullname;
var $title;
var $company;
var $weburl;
var $rating;
var $Alt_id;
var $Alt_display;
var $Alt_date;
var $Alt_comments;
var $Alt_fullname;
var $Alt_title;
var $Alt_company;
var $Alt_weburl;
var $Alt_rating;
//End DataSource Variables
//Class_Initialize Event @4-21A19317
function clsfb_contentsDataSource()
{
$this->ErrorBlock = "Grid fb_contents";
$this->Initialize();
$this->id = new clsField("id", ccsInteger, "");
$this->display = new clsField("display", ccsInteger, "");
$this->date = new clsField("date", ccsDate, Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"));
$this->comments = new clsField("comments", ccsMemo, "");
$this->fullname = new clsField("fullname", ccsText, "");
$this->title = new clsField("title", ccsText, "");
$this->company = new clsField("company", ccsText, "");
$this->weburl = new clsField("weburl", ccsText, "");
$this->rating = new clsField("rating", ccsInteger, "");
$this->Alt_id = new clsField("Alt_id", ccsInteger, "");
$this->Alt_display = new clsField("Alt_display", ccsInteger, "");
$this->Alt_date = new clsField("Alt_date", ccsDate, Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"));
$this->Alt_comments = new clsField("Alt_comments", ccsMemo, "");
$this->Alt_fullname = new clsField("Alt_fullname", ccsText, "");
$this->Alt_title = new clsField("Alt_title", ccsText, "");
$this->Alt_company = new clsField("Alt_company", ccsText, "");
$this->Alt_weburl = new clsField("Alt_weburl", ccsText, "");
$this->Alt_rating = new clsField("Alt_rating", ccsInteger, "");
}
//End Class_Initialize Event
//SetOrder Method @4-8BB403C3
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "rating desc, date desc";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @4-33D9E138
function Prepare()
{
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urls_keyword", ccsText, "", "", $this->Parameters["urls_keyword"], "");
$this->wp->AddParameter("2", "urls_keyword", ccsText, "", "", $this->Parameters["urls_keyword"], "");
$this->wp->AddParameter("3", "urls_keyword", ccsText, "", "", $this->Parameters["urls_keyword"], "");
$this->wp->AddParameter("4", "urls_keyword", ccsMemo, "", "", $this->Parameters["urls_keyword"], "");
$this->wp->Criterion[1] = $this->wp->Operation(opContains, "fullname", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsText));
$this->wp->Criterion[2] = $this->wp->Operation(opContains, "company", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText));
$this->wp->Criterion[3] = $this->wp->Operation(opContains, "weburl", $this->wp->GetDBValue("3"), $this->ToSQL($this->wp->GetDBValue("3"), ccsText));
$this->wp->Criterion[4] = $this->wp->Operation(opContains, "comments", $this->wp->GetDBValue("4"), $this->ToSQL($this->wp->GetDBValue("4"), ccsMemo));
$this->wp->Criterion[5] = "display = 1";
$this->Where = $this->wp->opAND(false, $this->wp->opOR(true, $this->wp->opOR(false, $this->wp->opOR(false, $this->wp->Criterion[1], $this->wp->Criterion[2]), $this->wp->Criterion[3]), $this->wp->Criterion[4]), $this->wp->Criterion[5]);
}
//End Prepare Method
//Open Method @4-4B4B749B
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "SELECT COUNT(*) " .
"FROM fb_contents";
$this->SQL = "SELECT * " .
"FROM fb_contents";
$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 @4-4BA1560A
function SetValues()
{
$this->id->SetDBValue(trim($this->f("id")));
$this->display->SetDBValue(trim($this->f("display")));
$this->date->SetDBValue(trim($this->f("date")));
$this->comments->SetDBValue($this->f("comments"));
$this->fullname->SetDBValue($this->f("fullname"));
$this->title->SetDBValue($this->f("title"));
$this->company->SetDBValue($this->f("company"));
$this->weburl->SetDBValue($this->f("weburl"));
$this->rating->SetDBValue(trim($this->f("rating")));
$this->Alt_id->SetDBValue(trim($this->f("id")));
$this->Alt_display->SetDBValue(trim($this->f("display")));
$this->Alt_date->SetDBValue(trim($this->f("date")));
$this->Alt_comments->SetDBValue($this->f("comments"));
$this->Alt_fullname->SetDBValue($this->f("fullname"));
$this->Alt_title->SetDBValue($this->f("title"));
$this->Alt_company->SetDBValue($this->f("company"));
$this->Alt_weburl->SetDBValue($this->f("weburl"));
$this->Alt_rating->SetDBValue(trim($this->f("rating")));
}
//End SetValues Method
} //End fb_contentsDataSource Class @4-FCB6E20C
//Include Page implementation @3-EFAB2CA0
include_once("./footer.php");
//End Include Page implementation
//Initialize Page @1-F01B328E
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = "testimonials.php";
$Redirect = "";
$TemplateFileName = "testimonials.html";
$BlockToParse = "main";
$PathToRoot = "./";
//End Initialize Page
//Initialize Objects @1-E86A9350
$DBbeVisitorPortal = new clsDBbeVisitorPortal();
// Controls
$header = new clsheader();
$header->BindEvents();
$header->TemplatePath = "./";
$header->Initialize();
$fb_contentsSearch = new clsRecordfb_contentsSearch();
$fb_contents = new clsGridfb_contents();
$footer = new clsfooter();
$footer->BindEvents();
$footer->TemplatePath = "./";
$footer->Initialize();
$fb_contents->Initialize();
// Events
include("./testimonials_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-FB8D5FED
$header->Operations();
$fb_contentsSearch->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-5052CAA1
$footer->Show("footer");
$fb_contents->Show();
$fb_contentsSearch->Show();
$header->Show("header");
$Tpl->PParse("main", false);
//End Show Page
//Unload Page @1-AB7622EF
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
unset($Tpl);
//End Unload Page
?>