ComponentName = "tb_news";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_news";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_newsDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("
Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->RowOpenTag = new clsPanel("RowOpenTag", $this);
$this->RowComponents = new clsPanel("RowComponents", $this);
$this->title = new clsControl(ccsLabel, "title", "title", ccsText, "", CCGetRequestParam("title", ccsGet, NULL), $this);
$this->picture = new clsControl(ccsImage, "picture", "picture", ccsText, "", CCGetRequestParam("picture", ccsGet, NULL), $this);
$this->caption = new clsControl(ccsLabel, "caption", "caption", ccsText, "", CCGetRequestParam("caption", ccsGet, NULL), $this);
$this->content = new clsControl(ccsLabel, "content", "content", ccsMemo, "", CCGetRequestParam("content", ccsGet, NULL), $this);
$this->linkcaption = new clsControl(ccsLink, "linkcaption", "linkcaption", ccsText, "", CCGetRequestParam("linkcaption", ccsGet, NULL), $this);
$this->linkcaption->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->RowCloseTag = new clsPanel("RowCloseTag", $this);
$this->RowComponents->AddComponent("title", $this->title);
$this->RowComponents->AddComponent("picture", $this->picture);
$this->RowComponents->AddComponent("caption", $this->caption);
$this->RowComponents->AddComponent("content", $this->content);
$this->RowComponents->AddComponent("linkcaption", $this->linkcaption);
}
//End Class_Initialize Event
//Initialize Method @7-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @7-6C872299
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["urlnews_id"] = CCGetFromGet("news_id", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->SetValue("numberOfColumns", 1);
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["RowOpenTag"] = $this->RowOpenTag->Visible;
$this->ControlsVisible["RowComponents"] = $this->RowComponents->Visible;
$this->ControlsVisible["title"] = $this->title->Visible;
$this->ControlsVisible["picture"] = $this->picture->Visible;
$this->ControlsVisible["caption"] = $this->caption->Visible;
$this->ControlsVisible["content"] = $this->content->Visible;
$this->ControlsVisible["linkcaption"] = $this->linkcaption->Visible;
$this->ControlsVisible["RowCloseTag"] = $this->RowCloseTag->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->title->SetValue($this->DataSource->title->GetValue());
$this->picture->SetValue($this->DataSource->picture->GetValue());
$this->caption->SetValue($this->DataSource->caption->GetValue());
$this->content->SetValue($this->DataSource->content->GetValue());
$this->linkcaption->SetValue($this->DataSource->linkcaption->GetValue());
$this->linkcaption->Page = $this->DataSource->f("linkurl");
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->RowOpenTag->Show();
$this->RowComponents->Show();
$this->RowCloseTag->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @7-0FE9A5E7
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->title->Errors->ToString());
$errors = ComposeStrings($errors, $this->picture->Errors->ToString());
$errors = ComposeStrings($errors, $this->caption->Errors->ToString());
$errors = ComposeStrings($errors, $this->content->Errors->ToString());
$errors = ComposeStrings($errors, $this->linkcaption->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_news Class @7-FCB6E20C
class clstb_newsDataSource extends clsDBeasy { //tb_newsDataSource Class @7-4F578B3D
//DataSource Variables @7-64356910
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $title;
public $picture;
public $caption;
public $content;
public $linkcaption;
//End DataSource Variables
//DataSourceClass_Initialize Event @7-C72A1153
function clstb_newsDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_news";
$this->Initialize();
$this->title = new clsField("title", ccsText, "");
$this->picture = new clsField("picture", ccsText, "");
$this->caption = new clsField("caption", ccsText, "");
$this->content = new clsField("content", ccsMemo, "");
$this->linkcaption = new clsField("linkcaption", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @7-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @7-E2322469
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urlnews_id", ccsInteger, "", "", $this->Parameters["urlnews_id"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "news_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @7-514200CA
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_news";
$this->SQL = "SELECT * \n\n" .
"FROM tb_news {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @7-A16B5B27
function SetValues()
{
$this->title->SetDBValue($this->f("title"));
$this->picture->SetDBValue($this->f("picture"));
$this->caption->SetDBValue($this->f("caption"));
$this->content->SetDBValue($this->f("content"));
$this->linkcaption->SetDBValue($this->f("linkcaption"));
}
//End SetValues Method
} //End tb_newsDataSource Class @7-FCB6E20C
class clsGridtb_subnews { //tb_subnews class @22-51BEF1BB
//Variables @22-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @22-3A671407
function clsGridtb_subnews($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_subnews";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_subnews";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_subnewsDataSource($this);
$this->ds = & $this->DataSource;
$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 > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->RowOpenTag = new clsPanel("RowOpenTag", $this);
$this->RowComponents = new clsPanel("RowComponents", $this);
$this->title1 = new clsControl(ccsLabel, "title1", "title1", ccsText, "", CCGetRequestParam("title1", ccsGet, NULL), $this);
$this->thumbnail = new clsControl(ccsImage, "thumbnail", "thumbnail", ccsText, "", CCGetRequestParam("thumbnail", ccsGet, NULL), $this);
$this->content = new clsControl(ccsLabel, "content", "content", ccsMemo, "", CCGetRequestParam("content", ccsGet, NULL), $this);
$this->linkcaption = new clsControl(ccsLink, "linkcaption", "linkcaption", ccsText, "", CCGetRequestParam("linkcaption", ccsGet, NULL), $this);
$this->linkcaption->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->RowCloseTag = new clsPanel("RowCloseTag", $this);
$this->RowComponents->AddComponent("title1", $this->title1);
$this->RowComponents->AddComponent("thumbnail", $this->thumbnail);
$this->RowComponents->AddComponent("content", $this->content);
$this->RowComponents->AddComponent("linkcaption", $this->linkcaption);
}
//End Class_Initialize Event
//Initialize Method @22-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @22-1A4B64E0
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["urlnews_id"] = CCGetFromGet("news_id", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->SetValue("numberOfColumns", 1);
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["RowOpenTag"] = $this->RowOpenTag->Visible;
$this->ControlsVisible["RowComponents"] = $this->RowComponents->Visible;
$this->ControlsVisible["title1"] = $this->title1->Visible;
$this->ControlsVisible["thumbnail"] = $this->thumbnail->Visible;
$this->ControlsVisible["content"] = $this->content->Visible;
$this->ControlsVisible["linkcaption"] = $this->linkcaption->Visible;
$this->ControlsVisible["RowCloseTag"] = $this->RowCloseTag->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->title1->SetValue($this->DataSource->title1->GetValue());
$this->thumbnail->SetValue($this->DataSource->thumbnail->GetValue());
$this->content->SetValue($this->DataSource->content->GetValue());
$this->linkcaption->SetValue($this->DataSource->linkcaption->GetValue());
$this->linkcaption->Page = $this->DataSource->f("linkurl");
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->RowOpenTag->Show();
$this->RowComponents->Show();
$this->RowCloseTag->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @22-D15CB9F9
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->title1->Errors->ToString());
$errors = ComposeStrings($errors, $this->thumbnail->Errors->ToString());
$errors = ComposeStrings($errors, $this->content->Errors->ToString());
$errors = ComposeStrings($errors, $this->linkcaption->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_subnews Class @22-FCB6E20C
class clstb_subnewsDataSource extends clsDBeasy { //tb_subnewsDataSource Class @22-FA7C6EDB
//DataSource Variables @22-3CCBE703
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $title1;
public $thumbnail;
public $content;
public $linkcaption;
//End DataSource Variables
//DataSourceClass_Initialize Event @22-9C3C7C25
function clstb_subnewsDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_subnews";
$this->Initialize();
$this->title1 = new clsField("title1", ccsText, "");
$this->thumbnail = new clsField("thumbnail", ccsText, "");
$this->content = new clsField("content", ccsMemo, "");
$this->linkcaption = new clsField("linkcaption", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @22-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @22-E2322469
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urlnews_id", ccsInteger, "", "", $this->Parameters["urlnews_id"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "news_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @22-72028434
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_subnews";
$this->SQL = "SELECT * \n\n" .
"FROM tb_subnews {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @22-A06E893B
function SetValues()
{
$this->title1->SetDBValue($this->f("title"));
$this->thumbnail->SetDBValue($this->f("thumbnail"));
$this->content->SetDBValue($this->f("content"));
$this->linkcaption->SetDBValue($this->f("linkcaption"));
}
//End SetValues Method
} //End tb_subnewsDataSource Class @22-FCB6E20C
class clsGridtb_news1 { //tb_news1 class @39-5F1C38B1
//Variables @39-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @39-E989C831
function clsGridtb_news1($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_news1";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_news1";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_news1DataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->RowOpenTag = new clsPanel("RowOpenTag", $this);
$this->RowComponents = new clsPanel("RowComponents", $this);
$this->source = new clsControl(ccsLabel, "source", "source", ccsText, "", CCGetRequestParam("source", ccsGet, NULL), $this);
$this->news_date = new clsControl(ccsLabel, "news_date", "news_date", ccsDate, array("mm", "/", "dd", "/", "yyyy"), CCGetRequestParam("news_date", ccsGet, NULL), $this);
$this->RowCloseTag = new clsPanel("RowCloseTag", $this);
$this->RowComponents->AddComponent("source", $this->source);
$this->RowComponents->AddComponent("news_date", $this->news_date);
}
//End Class_Initialize Event
//Initialize Method @39-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @39-F28750FA
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["urlnews_id"] = CCGetFromGet("news_id", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->SetValue("numberOfColumns", 1);
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["RowOpenTag"] = $this->RowOpenTag->Visible;
$this->ControlsVisible["RowComponents"] = $this->RowComponents->Visible;
$this->ControlsVisible["source"] = $this->source->Visible;
$this->ControlsVisible["news_date"] = $this->news_date->Visible;
$this->ControlsVisible["RowCloseTag"] = $this->RowCloseTag->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->source->SetValue($this->DataSource->source->GetValue());
$this->news_date->SetValue($this->DataSource->news_date->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->RowOpenTag->Show();
$this->RowComponents->Show();
$this->RowCloseTag->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @39-E6377DBE
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->source->Errors->ToString());
$errors = ComposeStrings($errors, $this->news_date->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_news1 Class @39-FCB6E20C
class clstb_news1DataSource extends clsDBeasy { //tb_news1DataSource Class @39-742C2F30
//DataSource Variables @39-A88FBBDD
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $source;
public $news_date;
//End DataSource Variables
//DataSourceClass_Initialize Event @39-269CA849
function clstb_news1DataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_news1";
$this->Initialize();
$this->source = new clsField("source", ccsText, "");
$this->news_date = new clsField("news_date", ccsDate, $this->DateFormat);
}
//End DataSourceClass_Initialize Event
//SetOrder Method @39-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @39-E2322469
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urlnews_id", ccsInteger, "", "", $this->Parameters["urlnews_id"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "news_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @39-514200CA
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_news";
$this->SQL = "SELECT * \n\n" .
"FROM tb_news {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @39-1FF91B91
function SetValues()
{
$this->source->SetDBValue($this->f("source"));
$this->news_date->SetDBValue(trim($this->f("news_date")));
}
//End SetValues Method
} //End tb_news1DataSource Class @39-FCB6E20C
//Include Page implementation @4-697796E3
include_once(RelativePath . "/inc/gen_sub.php");
//End Include Page implementation
//Include Page implementation @55-80DD80B4
include_once(RelativePath . "/inc/header.php");
//End Include Page implementation
//Include Page implementation @5-E5D4CE8B
include_once(RelativePath . "/inc/footer.php");
//End Include Page implementation
class clsGridbg { //bg class @56-2689D52B
//Variables @56-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @56-807C668D
function clsGridbg($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "bg";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid bg";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clsbgDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->snews = new clsControl(ccsHidden, "snews", "snews", ccsText, "", CCGetRequestParam("snews", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @56-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @56-10FEC224
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["snews"] = $this->snews->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->snews->SetValue($this->DataSource->snews->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->snews->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @56-6E5E02F9
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->snews->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End bg Class @56-FCB6E20C
class clsbgDataSource extends clsDBeasy { //bgDataSource Class @56-44C11189
//DataSource Variables @56-9E76664F
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $snews;
//End DataSource Variables
//DataSourceClass_Initialize Event @56-E95BD331
function clsbgDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid bg";
$this->Initialize();
$this->snews = new clsField("snews", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @56-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @56-14D6CD9D
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
}
//End Prepare Method
//Open Method @56-159108FA
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM db_bg";
$this->SQL = "SELECT * \n\n" .
"FROM db_bg {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @56-F2FC20F4
function SetValues()
{
$this->snews->SetDBValue($this->f("snews"));
}
//End SetValues Method
} //End bgDataSource Class @56-FCB6E20C
//Include Page implementation @38-3E5A21C3
include_once(RelativePath . "/inc/news_inc.php");
//End Include Page implementation
class clsGridusers { //users class @58-0CB76799
//Variables @58-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @58-8F30ABD9
function clsGridusers($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "users";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid users";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clsusersDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->group_id = new clsControl(ccsHidden, "group_id", "group_id", ccsInteger, "", CCGetRequestParam("group_id", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @58-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @58-C44FCE3F
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->DataSource->Parameters["sesUserLogin"] = CCGetSession("UserLogin", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["group_id"] = $this->group_id->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->group_id->SetValue($this->DataSource->group_id->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->group_id->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @58-21D9DDD8
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->group_id->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End users Class @58-FCB6E20C
class clsusersDataSource extends clsDBeasy { //usersDataSource Class @58-6A08F44A
//DataSource Variables @58-39BE6FA9
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $group_id;
//End DataSource Variables
//DataSourceClass_Initialize Event @58-737FCE65
function clsusersDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid users";
$this->Initialize();
$this->group_id = new clsField("group_id", ccsInteger, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @58-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @58-415563F6
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], 1, false);
$this->wp->AddParameter("2", "sesUserLogin", ccsText, "", "", $this->Parameters["sesUserLogin"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "login_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "username", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->Where = $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]);
}
//End Prepare Method
//Open Method @58-7C828179
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_users";
$this->SQL = "SELECT * \n\n" .
"FROM tb_users {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @58-AD96E205
function SetValues()
{
$this->group_id->SetDBValue(trim($this->f("group_id")));
}
//End SetValues Method
} //End usersDataSource Class @58-FCB6E20C
class clsGridtb_c_users { //tb_c_users class @64-C6A005B9
//Variables @64-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @64-6AA0D3EB
function clsGridtb_c_users($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_c_users";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_c_users";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_c_usersDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->title = new clsControl(ccsLabel, "title", "title", ccsText, "", CCGetRequestParam("title", ccsGet, NULL), $this);
$this->firstname = new clsControl(ccsLabel, "firstname", "firstname", ccsText, "", CCGetRequestParam("firstname", ccsGet, NULL), $this);
$this->lastname = new clsControl(ccsLabel, "lastname", "lastname", ccsText, "", CCGetRequestParam("lastname", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @64-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @64-4CE8DD34
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->DataSource->Parameters["sesUserLogin"] = CCGetSession("UserLogin", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["title"] = $this->title->Visible;
$this->ControlsVisible["firstname"] = $this->firstname->Visible;
$this->ControlsVisible["lastname"] = $this->lastname->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->title->SetValue($this->DataSource->title->GetValue());
$this->firstname->SetValue($this->DataSource->firstname->GetValue());
$this->lastname->SetValue($this->DataSource->lastname->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->title->Show();
$this->firstname->Show();
$this->lastname->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @64-BB1D8C3F
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->title->Errors->ToString());
$errors = ComposeStrings($errors, $this->firstname->Errors->ToString());
$errors = ComposeStrings($errors, $this->lastname->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_c_users Class @64-FCB6E20C
class clstb_c_usersDataSource extends clsDBeasy { //tb_c_usersDataSource Class @64-8BB191E6
//DataSource Variables @64-5761AFE8
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $title;
public $firstname;
public $lastname;
//End DataSource Variables
//DataSourceClass_Initialize Event @64-4DD5B477
function clstb_c_usersDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_c_users";
$this->Initialize();
$this->title = new clsField("title", ccsText, "");
$this->firstname = new clsField("firstname", ccsText, "");
$this->lastname = new clsField("lastname", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @64-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @64-1B623775
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->AddParameter("2", "sesUserLogin", ccsText, "", "", $this->Parameters["sesUserLogin"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "company_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "username", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->Where = $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]);
}
//End Prepare Method
//Open Method @64-029B5027
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_c_users";
$this->SQL = "SELECT * \n\n" .
"FROM tb_c_users {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @64-E8413630
function SetValues()
{
$this->title->SetDBValue($this->f("title"));
$this->firstname->SetDBValue($this->f("firstname"));
$this->lastname->SetDBValue($this->f("lastname"));
}
//End SetValues Method
} //End tb_c_usersDataSource Class @64-FCB6E20C
class clsGridtb_cmps { //tb_cmps class @71-B8B89B31
//Variables @71-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @71-26024AC7
function clsGridtb_cmps($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_cmps";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_cmps";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_cmpsDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->account = new clsControl(ccsLabel, "account", "account", ccsFloat, array(False, 2, Null, Null, False, "", "", 1, True, ""), CCGetRequestParam("account", ccsGet, NULL), $this);
$this->Link2 = new clsControl(ccsLink, "Link2", "Link2", ccsText, "", CCGetRequestParam("Link2", ccsGet, NULL), $this);
$this->Link2->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->Link2->Page = "cm.php";
$this->company_name = new clsControl(ccsLabel, "company_name", "company_name", ccsText, "", CCGetRequestParam("company_name", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @71-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @71-DE1528AA
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["account"] = $this->account->Visible;
$this->ControlsVisible["Link2"] = $this->Link2->Visible;
$this->ControlsVisible["company_name"] = $this->company_name->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->account->SetValue($this->DataSource->account->GetValue());
$this->company_name->SetValue($this->DataSource->company_name->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->account->Show();
$this->Link2->Show();
$this->company_name->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @71-3D34B683
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->account->Errors->ToString());
$errors = ComposeStrings($errors, $this->Link2->Errors->ToString());
$errors = ComposeStrings($errors, $this->company_name->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_cmps Class @71-FCB6E20C
class clstb_cmpsDataSource extends clsDBeasy { //tb_cmpsDataSource Class @71-C700919C
//DataSource Variables @71-D516B617
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $account;
public $company_name;
//End DataSource Variables
//DataSourceClass_Initialize Event @71-9C4A94D2
function clstb_cmpsDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_cmps";
$this->Initialize();
$this->account = new clsField("account", ccsFloat, "");
$this->company_name = new clsField("company_name", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @71-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @71-77B5EED2
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "company_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @71-7E2AB147
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_companies";
$this->SQL = "SELECT mainaccount, company_name \n\n" .
"FROM tb_companies {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @71-21FB612E
function SetValues()
{
$this->account->SetDBValue(trim($this->f("mainaccount")));
$this->company_name->SetDBValue($this->f("company_name"));
}
//End SetValues Method
} //End tb_cmpsDataSource Class @71-FCB6E20C
class clsGridtb_c_users4 { //tb_c_users4 class @79-D04FBFDE
//Variables @79-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @79-3BADB566
function clsGridtb_c_users4($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_c_users4";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_c_users4";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_c_users4DataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->account = new clsControl(ccsLabel, "account", "account", ccsFloat, array(False, 2, Null, Null, False, "", "", 1, True, ""), CCGetRequestParam("account", ccsGet, NULL), $this);
$this->cmlogout = new clsControl(ccsLink, "cmlogout", "cmlogout", ccsText, "", CCGetRequestParam("cmlogout", ccsGet, NULL), $this);
$this->cmlogout->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->cmlogout->Page = "logout.php";
$this->culink1 = new clsControl(ccsLink, "culink1", "culink1", ccsText, "", CCGetRequestParam("culink1", ccsGet, NULL), $this);
$this->culink1->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->culink1->Page = "cu.php";
}
//End Class_Initialize Event
//Initialize Method @79-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @79-87660EBC
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->DataSource->Parameters["sesUserLogin"] = CCGetSession("UserLogin", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["account"] = $this->account->Visible;
$this->ControlsVisible["cmlogout"] = $this->cmlogout->Visible;
$this->ControlsVisible["culink1"] = $this->culink1->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->account->SetValue($this->DataSource->account->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->account->Show();
$this->cmlogout->Show();
$this->culink1->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @79-711765E5
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->account->Errors->ToString());
$errors = ComposeStrings($errors, $this->cmlogout->Errors->ToString());
$errors = ComposeStrings($errors, $this->culink1->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_c_users4 Class @79-FCB6E20C
class clstb_c_users4DataSource extends clsDBeasy { //tb_c_users4DataSource Class @79-628BCB1F
//DataSource Variables @79-FE2D95B7
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $account;
//End DataSource Variables
//DataSourceClass_Initialize Event @79-9C64EF24
function clstb_c_users4DataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_c_users4";
$this->Initialize();
$this->account = new clsField("account", ccsFloat, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @79-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @79-1B623775
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->AddParameter("2", "sesUserLogin", ccsText, "", "", $this->Parameters["sesUserLogin"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "company_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "username", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->Where = $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]);
}
//End Prepare Method
//Open Method @79-A4DD3956
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_c_users";
$this->SQL = "SELECT account \n\n" .
"FROM tb_c_users {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @79-CFD21D2E
function SetValues()
{
$this->account->SetDBValue(trim($this->f("account")));
}
//End SetValues Method
} //End tb_c_users4DataSource Class @79-FCB6E20C
class clsGridtb_c_users1 { //tb_c_users1 class @114-AD384B9B
//Variables @114-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @114-42B56D66
function clsGridtb_c_users1($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_c_users1";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_c_users1";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_c_users1DataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->title = new clsControl(ccsLabel, "title", "title", ccsText, "", CCGetRequestParam("title", ccsGet, NULL), $this);
$this->firstname = new clsControl(ccsLabel, "firstname", "firstname", ccsText, "", CCGetRequestParam("firstname", ccsGet, NULL), $this);
$this->lastname = new clsControl(ccsLabel, "lastname", "lastname", ccsText, "", CCGetRequestParam("lastname", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @114-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @114-4CE8DD34
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->DataSource->Parameters["sesUserLogin"] = CCGetSession("UserLogin", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["title"] = $this->title->Visible;
$this->ControlsVisible["firstname"] = $this->firstname->Visible;
$this->ControlsVisible["lastname"] = $this->lastname->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->title->SetValue($this->DataSource->title->GetValue());
$this->firstname->SetValue($this->DataSource->firstname->GetValue());
$this->lastname->SetValue($this->DataSource->lastname->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->title->Show();
$this->firstname->Show();
$this->lastname->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @114-BB1D8C3F
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->title->Errors->ToString());
$errors = ComposeStrings($errors, $this->firstname->Errors->ToString());
$errors = ComposeStrings($errors, $this->lastname->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_c_users1 Class @114-FCB6E20C
class clstb_c_users1DataSource extends clsDBeasy { //tb_c_users1DataSource Class @114-65E9C276
//DataSource Variables @114-5761AFE8
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $title;
public $firstname;
public $lastname;
//End DataSource Variables
//DataSourceClass_Initialize Event @114-1F02BE72
function clstb_c_users1DataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_c_users1";
$this->Initialize();
$this->title = new clsField("title", ccsText, "");
$this->firstname = new clsField("firstname", ccsText, "");
$this->lastname = new clsField("lastname", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @114-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @114-1B623775
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->AddParameter("2", "sesUserLogin", ccsText, "", "", $this->Parameters["sesUserLogin"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "company_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "username", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->Where = $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]);
}
//End Prepare Method
//Open Method @114-029B5027
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_c_users";
$this->SQL = "SELECT * \n\n" .
"FROM tb_c_users {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @114-E8413630
function SetValues()
{
$this->title->SetDBValue($this->f("title"));
$this->firstname->SetDBValue($this->f("firstname"));
$this->lastname->SetDBValue($this->f("lastname"));
}
//End SetValues Method
} //End tb_c_users1DataSource Class @114-FCB6E20C
class clsGridtb_c_users2 { //tb_c_users2 class @121-86151858
//Variables @121-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @121-0203F6DC
function clsGridtb_c_users2($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_c_users2";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_c_users2";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_c_users2DataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->culogout = new clsControl(ccsLink, "culogout", "culogout", ccsText, "", CCGetRequestParam("culogout", ccsGet, NULL), $this);
$this->culogout->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->culogout->Page = "logout.php";
$this->culink = new clsControl(ccsLink, "culink", "culink", ccsText, "", CCGetRequestParam("culink", ccsGet, NULL), $this);
$this->culink->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->culink->Page = "cu.php";
}
//End Class_Initialize Event
//Initialize Method @121-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @121-D4D530A7
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->DataSource->Parameters["sesUserLogin"] = CCGetSession("UserLogin", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["culogout"] = $this->culogout->Visible;
$this->ControlsVisible["culink"] = $this->culink->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->culogout->Show();
$this->culink->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @121-23CDAF70
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->culogout->Errors->ToString());
$errors = ComposeStrings($errors, $this->culink->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_c_users2 Class @121-FCB6E20C
class clstb_c_users2DataSource extends clsDBeasy { //tb_c_users2DataSource Class @121-6737C551
//DataSource Variables @121-404AA26D
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
//End DataSource Variables
//DataSourceClass_Initialize Event @121-24180DC7
function clstb_c_users2DataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_c_users2";
$this->Initialize();
}
//End DataSourceClass_Initialize Event
//SetOrder Method @121-24FF35BF
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
}
//End SetOrder Method
//Prepare Method @121-1B623775
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->AddParameter("2", "sesUserLogin", ccsText, "", "", $this->Parameters["sesUserLogin"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "company_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "username", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->Where = $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]);
}
//End Prepare Method
//Open Method @121-A4DD3956
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_c_users";
$this->SQL = "SELECT account \n\n" .
"FROM tb_c_users {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @121-BAF0975B
function SetValues()
{
}
//End SetValues Method
} //End tb_c_users2DataSource Class @121-FCB6E20C
class clsGridtb_r_users { //tb_r_users class @148-76B1340C
//Variables @148-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @148-0F0F7C96
function clsGridtb_r_users($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_r_users";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_r_users";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_r_usersDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->title = new clsControl(ccsLabel, "title", "title", ccsText, "", CCGetRequestParam("title", ccsGet, NULL), $this);
$this->firstname = new clsControl(ccsLabel, "firstname", "firstname", ccsText, "", CCGetRequestParam("firstname", ccsGet, NULL), $this);
$this->lastname = new clsControl(ccsLabel, "lastname", "lastname", ccsText, "", CCGetRequestParam("lastname", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @148-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @148-4CE8DD34
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->DataSource->Parameters["sesUserLogin"] = CCGetSession("UserLogin", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["title"] = $this->title->Visible;
$this->ControlsVisible["firstname"] = $this->firstname->Visible;
$this->ControlsVisible["lastname"] = $this->lastname->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->title->SetValue($this->DataSource->title->GetValue());
$this->firstname->SetValue($this->DataSource->firstname->GetValue());
$this->lastname->SetValue($this->DataSource->lastname->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->title->Show();
$this->firstname->Show();
$this->lastname->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @148-BB1D8C3F
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->title->Errors->ToString());
$errors = ComposeStrings($errors, $this->firstname->Errors->ToString());
$errors = ComposeStrings($errors, $this->lastname->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_r_users Class @148-FCB6E20C
class clstb_r_usersDataSource extends clsDBeasy { //tb_r_usersDataSource Class @148-8A85D973
//DataSource Variables @148-5761AFE8
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $title;
public $firstname;
public $lastname;
//End DataSource Variables
//DataSourceClass_Initialize Event @148-704395FA
function clstb_r_usersDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_r_users";
$this->Initialize();
$this->title = new clsField("title", ccsText, "");
$this->firstname = new clsField("firstname", ccsText, "");
$this->lastname = new clsField("lastname", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @148-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @148-0EB4312A
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->AddParameter("2", "sesUserLogin", ccsText, "", "", $this->Parameters["sesUserLogin"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "retailer_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "username", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->Where = $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]);
}
//End Prepare Method
//Open Method @148-3D005679
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_r_users";
$this->SQL = "SELECT * \n\n" .
"FROM tb_r_users {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @148-E8413630
function SetValues()
{
$this->title->SetDBValue($this->f("title"));
$this->firstname->SetDBValue($this->f("firstname"));
$this->lastname->SetDBValue($this->f("lastname"));
}
//End SetValues Method
} //End tb_r_usersDataSource Class @148-FCB6E20C
class clsGridtb_ru { //tb_ru class @155-53A7B54D
//Variables @155-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @155-DEAEBB34
function clsGridtb_ru($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_ru";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_ru";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_ruDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->culogout = new clsControl(ccsLink, "culogout", "culogout", ccsText, "", CCGetRequestParam("culogout", ccsGet, NULL), $this);
$this->culogout->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->culogout->Page = "logout.php";
$this->culink = new clsControl(ccsLink, "culink", "culink", ccsText, "", CCGetRequestParam("culink", ccsGet, NULL), $this);
$this->culink->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->culink->Page = "ru.php";
}
//End Class_Initialize Event
//Initialize Method @155-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @155-D4D530A7
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->DataSource->Parameters["sesUserLogin"] = CCGetSession("UserLogin", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["culogout"] = $this->culogout->Visible;
$this->ControlsVisible["culink"] = $this->culink->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->culogout->Show();
$this->culink->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @155-23CDAF70
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->culogout->Errors->ToString());
$errors = ComposeStrings($errors, $this->culink->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_ru Class @155-FCB6E20C
class clstb_ruDataSource extends clsDBeasy { //tb_ruDataSource Class @155-AF740678
//DataSource Variables @155-404AA26D
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
//End DataSource Variables
//DataSourceClass_Initialize Event @155-AD4E7ED8
function clstb_ruDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_ru";
$this->Initialize();
}
//End DataSourceClass_Initialize Event
//SetOrder Method @155-24FF35BF
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
}
//End SetOrder Method
//Prepare Method @155-0EB4312A
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->AddParameter("2", "sesUserLogin", ccsText, "", "", $this->Parameters["sesUserLogin"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "retailer_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "username", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->Where = $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]);
}
//End Prepare Method
//Open Method @155-3D005679
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_r_users";
$this->SQL = "SELECT * \n\n" .
"FROM tb_r_users {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @155-BAF0975B
function SetValues()
{
}
//End SetValues Method
} //End tb_ruDataSource Class @155-FCB6E20C
class clsGridtb_r_users1 { //tb_r_users1 class @180-16831DA9
//Variables @180-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @180-C1B2622F
function clsGridtb_r_users1($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_r_users1";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_r_users1";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_r_users1DataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->title = new clsControl(ccsLabel, "title", "title", ccsText, "", CCGetRequestParam("title", ccsGet, NULL), $this);
$this->firstname = new clsControl(ccsLabel, "firstname", "firstname", ccsText, "", CCGetRequestParam("firstname", ccsGet, NULL), $this);
$this->lastname = new clsControl(ccsLabel, "lastname", "lastname", ccsText, "", CCGetRequestParam("lastname", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @180-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @180-4CE8DD34
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->DataSource->Parameters["sesUserLogin"] = CCGetSession("UserLogin", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["title"] = $this->title->Visible;
$this->ControlsVisible["firstname"] = $this->firstname->Visible;
$this->ControlsVisible["lastname"] = $this->lastname->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->title->SetValue($this->DataSource->title->GetValue());
$this->firstname->SetValue($this->DataSource->firstname->GetValue());
$this->lastname->SetValue($this->DataSource->lastname->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->title->Show();
$this->firstname->Show();
$this->lastname->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @180-BB1D8C3F
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->title->Errors->ToString());
$errors = ComposeStrings($errors, $this->firstname->Errors->ToString());
$errors = ComposeStrings($errors, $this->lastname->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_r_users1 Class @180-FCB6E20C
class clstb_r_users1DataSource extends clsDBeasy { //tb_r_users1DataSource Class @180-E58D91F5
//DataSource Variables @180-5761AFE8
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $title;
public $firstname;
public $lastname;
//End DataSource Variables
//DataSourceClass_Initialize Event @180-B808EBCB
function clstb_r_users1DataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_r_users1";
$this->Initialize();
$this->title = new clsField("title", ccsText, "");
$this->firstname = new clsField("firstname", ccsText, "");
$this->lastname = new clsField("lastname", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @180-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @180-0EB4312A
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->AddParameter("2", "sesUserLogin", ccsText, "", "", $this->Parameters["sesUserLogin"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "retailer_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "username", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->Where = $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]);
}
//End Prepare Method
//Open Method @180-3D005679
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_r_users";
$this->SQL = "SELECT * \n\n" .
"FROM tb_r_users {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @180-E8413630
function SetValues()
{
$this->title->SetDBValue($this->f("title"));
$this->firstname->SetDBValue($this->f("firstname"));
$this->lastname->SetDBValue($this->f("lastname"));
}
//End SetValues Method
} //End tb_r_users1DataSource Class @180-FCB6E20C
class clsGridtb_rm { //tb_rm class @187-D1BC2D14
//Variables @187-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @187-A14A0797
function clsGridtb_rm($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_rm";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_rm";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_rmDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->account = new clsControl(ccsLabel, "account", "account", ccsFloat, array(False, 2, Null, Null, False, "", "", 1, True, ""), CCGetRequestParam("account", ccsGet, NULL), $this);
$this->retailer = new clsControl(ccsLabel, "retailer", "retailer", ccsText, "", CCGetRequestParam("retailer", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @187-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @187-EFB08D9F
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["account"] = $this->account->Visible;
$this->ControlsVisible["retailer"] = $this->retailer->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->account->SetValue($this->DataSource->account->GetValue());
$this->retailer->SetValue($this->DataSource->retailer->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->account->Show();
$this->retailer->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @187-31484CAA
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->account->Errors->ToString());
$errors = ComposeStrings($errors, $this->retailer->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_rm Class @187-FCB6E20C
class clstb_rmDataSource extends clsDBeasy { //tb_rmDataSource Class @187-B9843F40
//DataSource Variables @187-AC02A6AA
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $account;
public $retailer;
//End DataSource Variables
//DataSourceClass_Initialize Event @187-EF3EF967
function clstb_rmDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_rm";
$this->Initialize();
$this->account = new clsField("account", ccsFloat, "");
$this->retailer = new clsField("retailer", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @187-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @187-E1BB5CF2
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "retailer_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @187-88DC3452
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_retailers";
$this->SQL = "SELECT retailer, mainaccount \n\n" .
"FROM tb_retailers {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @187-13076841
function SetValues()
{
$this->account->SetDBValue(trim($this->f("mainaccount")));
$this->retailer->SetDBValue($this->f("retailer"));
}
//End SetValues Method
} //End tb_rmDataSource Class @187-FCB6E20C
class clsGridtb_sd_users { //tb_sd_users class @216-852889BA
//Variables @216-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @216-3F5E0D91
function clsGridtb_sd_users($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_sd_users";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_sd_users";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_sd_usersDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->title = new clsControl(ccsLabel, "title", "title", ccsText, "", CCGetRequestParam("title", ccsGet, NULL), $this);
$this->firstname = new clsControl(ccsLabel, "firstname", "firstname", ccsText, "", CCGetRequestParam("firstname", ccsGet, NULL), $this);
$this->lastname = new clsControl(ccsLabel, "lastname", "lastname", ccsText, "", CCGetRequestParam("lastname", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @216-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @216-4CE8DD34
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->DataSource->Parameters["sesUserLogin"] = CCGetSession("UserLogin", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["title"] = $this->title->Visible;
$this->ControlsVisible["firstname"] = $this->firstname->Visible;
$this->ControlsVisible["lastname"] = $this->lastname->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->title->SetValue($this->DataSource->title->GetValue());
$this->firstname->SetValue($this->DataSource->firstname->GetValue());
$this->lastname->SetValue($this->DataSource->lastname->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->title->Show();
$this->firstname->Show();
$this->lastname->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @216-BB1D8C3F
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->title->Errors->ToString());
$errors = ComposeStrings($errors, $this->firstname->Errors->ToString());
$errors = ComposeStrings($errors, $this->lastname->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_sd_users Class @216-FCB6E20C
class clstb_sd_usersDataSource extends clsDBeasy { //tb_sd_usersDataSource Class @216-F67768C4
//DataSource Variables @216-5761AFE8
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $title;
public $firstname;
public $lastname;
//End DataSource Variables
//DataSourceClass_Initialize Event @216-69584AB7
function clstb_sd_usersDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_sd_users";
$this->Initialize();
$this->title = new clsField("title", ccsText, "");
$this->firstname = new clsField("firstname", ccsText, "");
$this->lastname = new clsField("lastname", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @216-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @216-31FC509F
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->AddParameter("2", "sesUserLogin", ccsText, "", "", $this->Parameters["sesUserLogin"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "wholesaler_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "username", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->Where = $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]);
}
//End Prepare Method
//Open Method @216-4D52E8B5
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_sd_users";
$this->SQL = "SELECT * \n\n" .
"FROM tb_sd_users {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @216-E8413630
function SetValues()
{
$this->title->SetDBValue($this->f("title"));
$this->firstname->SetDBValue($this->f("firstname"));
$this->lastname->SetDBValue($this->f("lastname"));
}
//End SetValues Method
} //End tb_sd_usersDataSource Class @216-FCB6E20C
class clsGridtb_sd { //tb_sd class @223-01BCFC6A
//Variables @223-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @223-8C7A1603
function clsGridtb_sd($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_sd";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_sd";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_sdDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->account = new clsControl(ccsLabel, "account", "account", ccsFloat, array(False, 2, Null, Null, False, "", "", 1, True, ""), CCGetRequestParam("account", ccsGet, NULL), $this);
$this->wholesaler = new clsControl(ccsLabel, "wholesaler", "wholesaler", ccsText, "", CCGetRequestParam("wholesaler", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @223-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @223-EC7DC691
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["account"] = $this->account->Visible;
$this->ControlsVisible["wholesaler"] = $this->wholesaler->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->account->SetValue($this->DataSource->account->GetValue());
$this->wholesaler->SetValue($this->DataSource->wholesaler->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->account->Show();
$this->wholesaler->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @223-2C4D1CFA
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->account->Errors->ToString());
$errors = ComposeStrings($errors, $this->wholesaler->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_sd Class @223-FCB6E20C
class clstb_sdDataSource extends clsDBeasy { //tb_sdDataSource Class @223-D699F391
//DataSource Variables @223-A1FBAF70
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $account;
public $wholesaler;
//End DataSource Variables
//DataSourceClass_Initialize Event @223-1902BA06
function clstb_sdDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_sd";
$this->Initialize();
$this->account = new clsField("account", ccsFloat, "");
$this->wholesaler = new clsField("wholesaler", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @223-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @223-AF256FC2
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "wholesaler_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @223-2C01839F
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_subdealers";
$this->SQL = "SELECT wholesaler, mainaccount \n\n" .
"FROM tb_subdealers {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @223-E66645E5
function SetValues()
{
$this->account->SetDBValue(trim($this->f("mainaccount")));
$this->wholesaler->SetDBValue($this->f("wholesaler"));
}
//End SetValues Method
} //End tb_sdDataSource Class @223-FCB6E20C
class clsRecordLogin { //Login Class @260-58926B8F
//Variables @260-9E315808
// Public variables
public $ComponentType = "Record";
public $ComponentName;
public $Parent;
public $HTMLFormAction;
public $PressedButton;
public $Errors;
public $ErrorBlock;
public $FormSubmitted;
public $FormEnctype;
public $Visible;
public $IsEmpty;
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $InsertAllowed = false;
public $UpdateAllowed = false;
public $DeleteAllowed = false;
public $ReadAllowed = false;
public $EditMode = false;
public $ds;
public $DataSource;
public $ValidatingControls;
public $Controls;
public $Attributes;
// Class variables
//End Variables
//Class_Initialize Event @260-7A72E167
function clsRecordLogin($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->Visible = true;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record Login/Error";
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "Login";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$CCSForm = split(":", CCGetFromGet("ccsForm", ""), 2);
if(sizeof($CCSForm) == 1)
$CCSForm[1] = "";
list($FormName, $FormMethod) = $CCSForm;
$this->FormEnctype = "application/x-www-form-urlencoded";
$this->FormSubmitted = ($FormName == $this->ComponentName);
$Method = $this->FormSubmitted ? ccsPost : ccsGet;
$this->login = new clsControl(ccsTextBox, "login", "login", ccsText, "", CCGetRequestParam("login", $Method, NULL), $this);
$this->login->Required = true;
$this->password = new clsControl(ccsTextBox, "password", "password", ccsText, "", CCGetRequestParam("password", $Method, NULL), $this);
$this->password->Required = true;
$this->Button_DoLogin = new clsButton("Button_DoLogin", $Method, $this);
$this->autoLogin = new clsControl(ccsHidden, "autoLogin", "autoLogin", ccsBoolean, $CCSLocales->GetFormatInfo("BooleanFormat"), CCGetRequestParam("autoLogin", $Method, NULL), $this);
}
}
//End Class_Initialize Event
//Validate Method @260-E943E0FF
function Validate()
{
global $CCSLocales;
$Validation = true;
$Where = "";
$Validation = ($this->login->Validate() && $Validation);
$Validation = ($this->password->Validate() && $Validation);
$Validation = ($this->autoLogin->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this);
$Validation = $Validation && ($this->login->Errors->Count() == 0);
$Validation = $Validation && ($this->password->Errors->Count() == 0);
$Validation = $Validation && ($this->autoLogin->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @260-91657E88
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->login->Errors->Count());
$errors = ($errors || $this->password->Errors->Count());
$errors = ($errors || $this->autoLogin->Errors->Count());
$errors = ($errors || $this->Errors->Count());
return $errors;
}
//End CheckErrors Method
//MasterDetail @260-ED598703
function SetPrimaryKeys($keyArray)
{
$this->PrimaryKeys = $keyArray;
}
function GetPrimaryKeys()
{
return $this->PrimaryKeys;
}
function GetPrimaryKey($keyName)
{
return $this->PrimaryKeys[$keyName];
}
//End MasterDetail
//Operation Method @260-5AC4CFBE
function Operation()
{
if(!$this->Visible)
return;
global $Redirect;
global $FileName;
if(!$this->FormSubmitted) {
return;
}
if($this->FormSubmitted) {
$this->PressedButton = "Button_DoLogin";
if($this->Button_DoLogin->Pressed) {
$this->PressedButton = "Button_DoLogin";
}
}
$Redirect = $FileName;
if($this->Validate()) {
if($this->PressedButton == "Button_DoLogin") {
if(!CCGetEvent($this->Button_DoLogin->CCSEvents, "OnClick", $this->Button_DoLogin)) {
$Redirect = "";
}
}
} else {
$Redirect = "";
}
}
//End Operation Method
//Show Method @260-A23B838B
function Show()
{
global $CCSUseAmp;
global $Tpl;
global $FileName;
global $CCSLocales;
$Error = "";
if(!$this->Visible)
return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$RecordBlock = "Record " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $RecordBlock;
$this->EditMode = $this->EditMode && $this->ReadAllowed;
if($this->FormSubmitted || $this->CheckErrors()) {
$Error = "";
$Error = ComposeStrings($Error, $this->login->Errors->ToString());
$Error = ComposeStrings($Error, $this->password->Errors->ToString());
$Error = ComposeStrings($Error, $this->autoLogin->Errors->ToString());
$Error = ComposeStrings($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", !$CCSUseAmp ? $this->HTMLFormAction : str_replace("&", "&", $this->HTMLFormAction));
$Tpl->SetVar("HTMLFormName", $this->ComponentName);
$Tpl->SetVar("HTMLFormEnctype", $this->FormEnctype);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
$this->Attributes->Show();
if(!$this->Visible) {
$Tpl->block_path = $ParentPath;
return;
}
$this->login->Show();
$this->password->Show();
$this->Button_DoLogin->Show();
$this->autoLogin->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
}
//End Show Method
} //End Login Class @260-FCB6E20C
class clsGridtb_ag_users { //tb_ag_users class @276-8991E4AE
//Variables @276-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @276-05F77F25
function clsGridtb_ag_users($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_ag_users";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_ag_users";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_ag_usersDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->title = new clsControl(ccsLabel, "title", "title", ccsText, "", CCGetRequestParam("title", ccsGet, NULL), $this);
$this->firstname = new clsControl(ccsLabel, "firstname", "firstname", ccsText, "", CCGetRequestParam("firstname", ccsGet, NULL), $this);
$this->lastname = new clsControl(ccsLabel, "lastname", "lastname", ccsText, "", CCGetRequestParam("lastname", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @276-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @276-4CE8DD34
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->DataSource->Parameters["sesUserLogin"] = CCGetSession("UserLogin", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["title"] = $this->title->Visible;
$this->ControlsVisible["firstname"] = $this->firstname->Visible;
$this->ControlsVisible["lastname"] = $this->lastname->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->title->SetValue($this->DataSource->title->GetValue());
$this->firstname->SetValue($this->DataSource->firstname->GetValue());
$this->lastname->SetValue($this->DataSource->lastname->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->title->Show();
$this->firstname->Show();
$this->lastname->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @276-BB1D8C3F
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->title->Errors->ToString());
$errors = ComposeStrings($errors, $this->firstname->Errors->ToString());
$errors = ComposeStrings($errors, $this->lastname->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_ag_users Class @276-FCB6E20C
class clstb_ag_usersDataSource extends clsDBeasy { //tb_ag_usersDataSource Class @276-9046F604
//DataSource Variables @276-5761AFE8
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $title;
public $firstname;
public $lastname;
//End DataSource Variables
//DataSourceClass_Initialize Event @276-6C2063A6
function clstb_ag_usersDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_ag_users";
$this->Initialize();
$this->title = new clsField("title", ccsText, "");
$this->firstname = new clsField("firstname", ccsText, "");
$this->lastname = new clsField("lastname", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @276-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @276-843E52DC
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->AddParameter("2", "sesUserLogin", ccsText, "", "", $this->Parameters["sesUserLogin"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "agent_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "username", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->Where = $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]);
}
//End Prepare Method
//Open Method @276-3EA92605
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_agents";
$this->SQL = "SELECT * \n\n" .
"FROM tb_agents {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @276-E8413630
function SetValues()
{
$this->title->SetDBValue($this->f("title"));
$this->firstname->SetDBValue($this->f("firstname"));
$this->lastname->SetDBValue($this->f("lastname"));
}
//End SetValues Method
} //End tb_ag_usersDataSource Class @276-FCB6E20C
class clsGridtb_sa { //tb_sa class @283-7CCB082F
//Variables @283-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @283-97314385
function clsGridtb_sa($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_sa";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_sa";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_saDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->account = new clsControl(ccsLabel, "account", "account", ccsFloat, array(False, 2, Null, Null, False, "", "", 1, True, ""), CCGetRequestParam("account", ccsGet, NULL), $this);
$this->sallink = new clsControl(ccsLink, "sallink", "sallink", ccsText, "", CCGetRequestParam("sallink", ccsGet, NULL), $this);
$this->sallink->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->sallink->Page = "sa.php";
$this->culogout = new clsControl(ccsLink, "culogout", "culogout", ccsText, "", CCGetRequestParam("culogout", ccsGet, NULL), $this);
$this->culogout->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->culogout->Page = "logout.php";
}
//End Class_Initialize Event
//Initialize Method @283-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @283-B37A5E8B
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["account"] = $this->account->Visible;
$this->ControlsVisible["sallink"] = $this->sallink->Visible;
$this->ControlsVisible["culogout"] = $this->culogout->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->account->SetValue($this->DataSource->account->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->account->Show();
$this->sallink->Show();
$this->culogout->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @283-08F53FFA
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->account->Errors->ToString());
$errors = ComposeStrings($errors, $this->sallink->Errors->ToString());
$errors = ComposeStrings($errors, $this->culogout->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_sa Class @283-FCB6E20C
class clstb_saDataSource extends clsDBeasy { //tb_saDataSource Class @283-D1FBFAF8
//DataSource Variables @283-FE2D95B7
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $account;
//End DataSource Variables
//DataSourceClass_Initialize Event @283-0FAD6BDE
function clstb_saDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_sa";
$this->Initialize();
$this->account = new clsField("account", ccsFloat, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @283-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @283-2A230758
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "agent_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @283-3911007D
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_agents";
$this->SQL = "SELECT account \n\n" .
"FROM tb_agents {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @283-CFD21D2E
function SetValues()
{
$this->account->SetDBValue(trim($this->f("account")));
}
//End SetValues Method
} //End tb_saDataSource Class @283-FCB6E20C
class clsGridtb_d_users { //tb_d_users class @308-CC650CA0
//Variables @308-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @308-312EB04E
function clsGridtb_d_users($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_d_users";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_d_users";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_d_usersDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->title = new clsControl(ccsLabel, "title", "title", ccsText, "", CCGetRequestParam("title", ccsGet, NULL), $this);
$this->firstname = new clsControl(ccsLabel, "firstname", "firstname", ccsText, "", CCGetRequestParam("firstname", ccsGet, NULL), $this);
$this->lastname = new clsControl(ccsLabel, "lastname", "lastname", ccsText, "", CCGetRequestParam("lastname", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @308-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @308-4CE8DD34
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->DataSource->Parameters["sesUserLogin"] = CCGetSession("UserLogin", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["title"] = $this->title->Visible;
$this->ControlsVisible["firstname"] = $this->firstname->Visible;
$this->ControlsVisible["lastname"] = $this->lastname->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->title->SetValue($this->DataSource->title->GetValue());
$this->firstname->SetValue($this->DataSource->firstname->GetValue());
$this->lastname->SetValue($this->DataSource->lastname->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->title->Show();
$this->firstname->Show();
$this->lastname->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @308-BB1D8C3F
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->title->Errors->ToString());
$errors = ComposeStrings($errors, $this->firstname->Errors->ToString());
$errors = ComposeStrings($errors, $this->lastname->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_d_users Class @308-FCB6E20C
class clstb_d_usersDataSource extends clsDBeasy { //tb_d_usersDataSource Class @308-743E2664
//DataSource Variables @308-5761AFE8
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $title;
public $firstname;
public $lastname;
//End DataSource Variables
//DataSourceClass_Initialize Event @308-7E80EF46
function clstb_d_usersDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_d_users";
$this->Initialize();
$this->title = new clsField("title", ccsText, "");
$this->firstname = new clsField("firstname", ccsText, "");
$this->lastname = new clsField("lastname", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @308-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @308-982F7E0A
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->AddParameter("2", "sesUserLogin", ccsText, "", "", $this->Parameters["sesUserLogin"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "dealer_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->wp->Criterion[2] = $this->wp->Operation(opEqual, "username", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->Where = $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]);
}
//End Prepare Method
//Open Method @308-588E5D88
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_dealer_users";
$this->SQL = "SELECT * \n\n" .
"FROM tb_dealer_users {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @308-E8413630
function SetValues()
{
$this->title->SetDBValue($this->f("title"));
$this->firstname->SetDBValue($this->f("firstname"));
$this->lastname->SetDBValue($this->f("lastname"));
}
//End SetValues Method
} //End tb_d_usersDataSource Class @308-FCB6E20C
class clsGridtb_dl { //tb_dl class @315-D00CC397
//Variables @315-6E51DF5A
// Public variables
public $ComponentType = "Grid";
public $ComponentName;
public $Visible;
public $Errors;
public $ErrorBlock;
public $ds;
public $DataSource;
public $PageSize;
public $IsEmpty;
public $ForceIteration = false;
public $HasRecord = false;
public $SorterName = "";
public $SorterDirection = "";
public $PageNumber;
public $RowNumber;
public $ControlsVisible = array();
public $CCSEvents = "";
public $CCSEventResult;
public $RelativePath = "";
public $Attributes;
// Grid Controls
public $StaticControls;
public $RowControls;
//End Variables
//Class_Initialize Event @315-D7F8EE1D
function clsGridtb_dl($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "tb_dl";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid tb_dl";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clstb_dlDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 1;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 100)
$this->PageSize = 100;
if($this->PageSize == 0)
$this->Errors->addError("Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.
");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->account = new clsControl(ccsLabel, "account", "account", ccsFloat, array(False, 2, Null, Null, False, "", "", 1, True, ""), CCGetRequestParam("account", ccsGet, NULL), $this);
$this->Dealer = new clsControl(ccsLabel, "Dealer", "Dealer", ccsText, "", CCGetRequestParam("Dealer", ccsGet, NULL), $this);
}
//End Class_Initialize Event
//Initialize Method @315-90E704C5
function Initialize()
{
if(!$this->Visible) return;
$this->DataSource->PageSize = & $this->PageSize;
$this->DataSource->AbsolutePage = & $this->PageNumber;
$this->DataSource->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @315-013D2EFF
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$this->HasRecord = $this->DataSource->has_next_record();
$this->IsEmpty = ! $this->HasRecord;
$this->Attributes->Show();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
if (!$this->IsEmpty) {
$this->ControlsVisible["account"] = $this->account->Visible;
$this->ControlsVisible["Dealer"] = $this->Dealer->Visible;
while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) {
$this->RowNumber++;
if ($this->HasRecord) {
$this->DataSource->next_record();
$this->DataSource->SetValues();
}
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->account->SetValue($this->DataSource->account->GetValue());
$this->Dealer->SetValue($this->DataSource->Dealer->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->account->Show();
$this->Dealer->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @315-1B70A611
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->account->Errors->ToString());
$errors = ComposeStrings($errors, $this->Dealer->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End tb_dl Class @315-FCB6E20C
class clstb_dlDataSource extends clsDBeasy { //tb_dlDataSource Class @315-AF989FC1
//DataSource Variables @315-F1488860
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $account;
public $Dealer;
//End DataSource Variables
//DataSourceClass_Initialize Event @315-A0054C9F
function clstb_dlDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid tb_dl";
$this->Initialize();
$this->account = new clsField("account", ccsFloat, "");
$this->Dealer = new clsField("Dealer", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @315-9E1383D1
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
"");
}
//End SetOrder Method
//Prepare Method @315-406C22F0
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "sesUserID", ccsInteger, "", "", $this->Parameters["sesUserID"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "dealer_id", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @315-4AEAF468
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM tb_dealers";
$this->SQL = "SELECT Dealer, mainaccount \n\n" .
"FROM tb_dealers {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
if ($this->CountSQL)
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
else
$this->RecordsCount = "CCS not counted";
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @315-60291B95
function SetValues()
{
$this->account->SetDBValue(trim($this->f("mainaccount")));
$this->Dealer->SetDBValue($this->f("Dealer"));
}
//End SetValues Method
} //End tb_dlDataSource Class @315-FCB6E20C
//Initialize Page @1-2DAC0F91
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
$Attributes = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = FileName;
$Redirect = "";
$TemplateFileName = "read.html";
$BlockToParse = "main";
$TemplateEncoding = "UTF-8";
$ContentType = "text/html";
$PathToRoot = "./";
$Charset = $Charset ? $Charset : "utf-8";
//End Initialize Page
//Include events file @1-13110CB9
include_once("./read_events.php");
//End Include events file
//Before Initialize @1-E870CEBC
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage);
//End Before Initialize
//Initialize Objects @1-2B231CD2
$DBeasy = new clsDBeasy();
$MainPage->Connections["easy"] = & $DBeasy;
$Attributes = new clsAttributes("page:");
$MainPage->Attributes = & $Attributes;
// Controls
$gen_ad = new clsgen_ad("inc/", "gen_ad", $MainPage);
$gen_ad->Initialize();
$tb_news = new clsGridtb_news("", $MainPage);
$tb_subnews = new clsGridtb_subnews("", $MainPage);
$tb_news1 = new clsGridtb_news1("", $MainPage);
$gen_sub = new clsgen_sub("inc/", "gen_sub", $MainPage);
$gen_sub->Initialize();
$header = new clsheader("inc/", "header", $MainPage);
$header->Initialize();
$footer = new clsfooter("inc/", "footer", $MainPage);
$footer->Initialize();
$bg = new clsGridbg("", $MainPage);
$shownews = new clsPanel("shownews", $MainPage);
$news_inc = new clsnews_inc("inc/", "news_inc", $MainPage);
$news_inc->Initialize();
$users = new clsGridusers("", $MainPage);
$showcm = new clsPanel("showcm", $MainPage);
$tb_c_users = new clsGridtb_c_users("", $MainPage);
$tb_cmps = new clsGridtb_cmps("", $MainPage);
$tb_c_users4 = new clsGridtb_c_users4("", $MainPage);
$showcu = new clsPanel("showcu", $MainPage);
$tb_c_users1 = new clsGridtb_c_users1("", $MainPage);
$tb_c_users2 = new clsGridtb_c_users2("", $MainPage);
$showru = new clsPanel("showru", $MainPage);
$tb_r_users = new clsGridtb_r_users("", $MainPage);
$tb_ru = new clsGridtb_ru("", $MainPage);
$showrm = new clsPanel("showrm", $MainPage);
$tb_r_users1 = new clsGridtb_r_users1("", $MainPage);
$tb_rm = new clsGridtb_rm("", $MainPage);
$rmlink = new clsControl(ccsLink, "rmlink", "rmlink", ccsText, "", CCGetRequestParam("rmlink", ccsGet, NULL), $MainPage);
$rmlink->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$rmlink->Page = "ra.php";
$culogout3 = new clsControl(ccsLink, "culogout3", "culogout3", ccsText, "", CCGetRequestParam("culogout3", ccsGet, NULL), $MainPage);
$culogout3->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$culogout3->Page = "logout.php";
$showsd = new clsPanel("showsd", $MainPage);
$tb_sd_users = new clsGridtb_sd_users("", $MainPage);
$tb_sd = new clsGridtb_sd("", $MainPage);
$sdlink = new clsControl(ccsLink, "sdlink", "sdlink", ccsText, "", CCGetRequestParam("sdlink", ccsGet, NULL), $MainPage);
$sdlink->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$sdlink->Page = "sd.php";
$culogout2 = new clsControl(ccsLink, "culogout2", "culogout2", ccsText, "", CCGetRequestParam("culogout2", ccsGet, NULL), $MainPage);
$culogout2->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$culogout2->Page = "logout.php";
$showadmin = new clsPanel("showadmin", $MainPage);
$Link1 = new clsControl(ccsLink, "Link1", "Link1", ccsText, "", CCGetRequestParam("Link1", ccsGet, NULL), $MainPage);
$Link1->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$Link1->Page = "mtn/index.php";
$culogout4 = new clsControl(ccsLink, "culogout4", "culogout4", ccsText, "", CCGetRequestParam("culogout4", ccsGet, NULL), $MainPage);
$culogout4->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$culogout4->Page = "logout.php";
$showlogin = new clsPanel("showlogin", $MainPage);
$Login = new clsRecordLogin("", $MainPage);
$showsa = new clsPanel("showsa", $MainPage);
$tb_ag_users = new clsGridtb_ag_users("", $MainPage);
$tb_sa = new clsGridtb_sa("", $MainPage);
$showdl = new clsPanel("showdl", $MainPage);
$tb_d_users = new clsGridtb_d_users("", $MainPage);
$tb_dl = new clsGridtb_dl("", $MainPage);
$dllink = new clsControl(ccsLink, "dllink", "dllink", ccsText, "", CCGetRequestParam("dllink", ccsGet, NULL), $MainPage);
$dllink->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$dllink->Page = "dl.php";
$culogout1 = new clsControl(ccsLink, "culogout1", "culogout1", ccsText, "", CCGetRequestParam("culogout1", ccsGet, NULL), $MainPage);
$culogout1->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$culogout1->Page = "logout.php";
$showsp = new clsPanel("showsp", $MainPage);
$spllink = new clsControl(ccsLink, "spllink", "spllink", ccsText, "", CCGetRequestParam("spllink", ccsGet, NULL), $MainPage);
$spllink->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$spllink->Page = "sp.php";
$culogout = new clsControl(ccsLink, "culogout", "culogout", ccsText, "", CCGetRequestParam("culogout", ccsGet, NULL), $MainPage);
$culogout->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$culogout->Page = "logout.php";
$MainPage->gen_ad = & $gen_ad;
$MainPage->tb_news = & $tb_news;
$MainPage->tb_subnews = & $tb_subnews;
$MainPage->tb_news1 = & $tb_news1;
$MainPage->gen_sub = & $gen_sub;
$MainPage->header = & $header;
$MainPage->footer = & $footer;
$MainPage->bg = & $bg;
$MainPage->shownews = & $shownews;
$MainPage->news_inc = & $news_inc;
$MainPage->users = & $users;
$MainPage->showcm = & $showcm;
$MainPage->tb_c_users = & $tb_c_users;
$MainPage->tb_cmps = & $tb_cmps;
$MainPage->tb_c_users4 = & $tb_c_users4;
$MainPage->showcu = & $showcu;
$MainPage->tb_c_users1 = & $tb_c_users1;
$MainPage->tb_c_users2 = & $tb_c_users2;
$MainPage->showru = & $showru;
$MainPage->tb_r_users = & $tb_r_users;
$MainPage->tb_ru = & $tb_ru;
$MainPage->showrm = & $showrm;
$MainPage->tb_r_users1 = & $tb_r_users1;
$MainPage->tb_rm = & $tb_rm;
$MainPage->rmlink = & $rmlink;
$MainPage->culogout3 = & $culogout3;
$MainPage->showsd = & $showsd;
$MainPage->tb_sd_users = & $tb_sd_users;
$MainPage->tb_sd = & $tb_sd;
$MainPage->sdlink = & $sdlink;
$MainPage->culogout2 = & $culogout2;
$MainPage->showadmin = & $showadmin;
$MainPage->Link1 = & $Link1;
$MainPage->culogout4 = & $culogout4;
$MainPage->showlogin = & $showlogin;
$MainPage->Login = & $Login;
$MainPage->showsa = & $showsa;
$MainPage->tb_ag_users = & $tb_ag_users;
$MainPage->tb_sa = & $tb_sa;
$MainPage->showdl = & $showdl;
$MainPage->tb_d_users = & $tb_d_users;
$MainPage->tb_dl = & $tb_dl;
$MainPage->dllink = & $dllink;
$MainPage->culogout1 = & $culogout1;
$MainPage->showsp = & $showsp;
$MainPage->spllink = & $spllink;
$MainPage->culogout = & $culogout;
$shownews->Visible = false;
$shownews->AddComponent("news_inc", $news_inc);
$showcm->Visible = false;
$showcm->AddComponent("tb_c_users", $tb_c_users);
$showcm->AddComponent("tb_cmps", $tb_cmps);
$showcm->AddComponent("tb_c_users4", $tb_c_users4);
$showcu->Visible = false;
$showcu->AddComponent("tb_c_users1", $tb_c_users1);
$showcu->AddComponent("tb_c_users2", $tb_c_users2);
$showru->Visible = false;
$showru->AddComponent("tb_r_users", $tb_r_users);
$showru->AddComponent("tb_ru", $tb_ru);
$showrm->Visible = false;
$showrm->AddComponent("tb_r_users1", $tb_r_users1);
$showrm->AddComponent("tb_rm", $tb_rm);
$showrm->AddComponent("rmlink", $rmlink);
$showrm->AddComponent("culogout3", $culogout3);
$showsd->Visible = false;
$showsd->AddComponent("tb_sd_users", $tb_sd_users);
$showsd->AddComponent("tb_sd", $tb_sd);
$showsd->AddComponent("sdlink", $sdlink);
$showsd->AddComponent("culogout2", $culogout2);
$showadmin->Visible = false;
$showadmin->AddComponent("Link1", $Link1);
$showadmin->AddComponent("culogout4", $culogout4);
$showlogin->Visible = false;
$showlogin->AddComponent("Login", $Login);
$showsa->Visible = false;
$showsa->AddComponent("tb_ag_users", $tb_ag_users);
$showsa->AddComponent("tb_sa", $tb_sa);
$showdl->Visible = false;
$showdl->AddComponent("tb_d_users", $tb_d_users);
$showdl->AddComponent("tb_dl", $tb_dl);
$showdl->AddComponent("dllink", $dllink);
$showdl->AddComponent("culogout1", $culogout1);
$showsp->Visible = false;
$showsp->AddComponent("spllink", $spllink);
$showsp->AddComponent("culogout", $culogout);
$tb_news->Initialize();
$tb_subnews->Initialize();
$tb_news1->Initialize();
$bg->Initialize();
$users->Initialize();
$tb_c_users->Initialize();
$tb_cmps->Initialize();
$tb_c_users4->Initialize();
$tb_c_users1->Initialize();
$tb_c_users2->Initialize();
$tb_r_users->Initialize();
$tb_ru->Initialize();
$tb_r_users1->Initialize();
$tb_rm->Initialize();
$tb_sd_users->Initialize();
$tb_sd->Initialize();
$tb_ag_users->Initialize();
$tb_sa->Initialize();
$tb_d_users->Initialize();
$tb_dl->Initialize();
BindEvents();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage);
if ($Charset) {
header("Content-Type: " . $ContentType . "; charset=" . $Charset);
} else {
header("Content-Type: " . $ContentType);
}
//End Initialize Objects
//Initialize HTML Template @1-51EC165D
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage);
$Tpl = new clsTemplate($FileEncoding, $TemplateEncoding);
$Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "UTF-8");
$Tpl->block_path = "/$BlockToParse";
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage);
$Attributes->SetValue("pathToRoot", "");
$Attributes->Show();
//End Initialize HTML Template
//Execute Components @1-DFBC20DF
$gen_ad->Operations();
$gen_sub->Operations();
$header->Operations();
$footer->Operations();
$news_inc->Operations();
$Login->Operation();
//End Execute Components
//Go to destination page @1-6BCC8038
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBeasy->close();
header("Location: " . $Redirect);
$gen_ad->Class_Terminate();
unset($gen_ad);
unset($tb_news);
unset($tb_subnews);
unset($tb_news1);
$gen_sub->Class_Terminate();
unset($gen_sub);
$header->Class_Terminate();
unset($header);
$footer->Class_Terminate();
unset($footer);
unset($bg);
$news_inc->Class_Terminate();
unset($news_inc);
unset($users);
unset($tb_c_users);
unset($tb_cmps);
unset($tb_c_users4);
unset($tb_c_users1);
unset($tb_c_users2);
unset($tb_r_users);
unset($tb_ru);
unset($tb_r_users1);
unset($tb_rm);
unset($tb_sd_users);
unset($tb_sd);
unset($Login);
unset($tb_ag_users);
unset($tb_sa);
unset($tb_d_users);
unset($tb_dl);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-0C9EAA00
$gen_ad->Show();
$tb_news->Show();
$tb_subnews->Show();
$tb_news1->Show();
$gen_sub->Show();
$header->Show();
$footer->Show();
$bg->Show();
$users->Show();
$shownews->Show();
$showcm->Show();
$showcu->Show();
$showru->Show();
$showrm->Show();
$showsd->Show();
$showadmin->Show();
$showlogin->Show();
$showsa->Show();
$showdl->Show();
$showsp->Show();
$Tpl->block_path = "";
$Tpl->Parse($BlockToParse, false);
if (!isset($main_block)) $main_block = $Tpl->GetVar($BlockToParse);
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage);
if ($CCSEventResult) echo $main_block;
//End Show Page
//Unload Page @1-B8BEB9D0
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBeasy->close();
$gen_ad->Class_Terminate();
unset($gen_ad);
unset($tb_news);
unset($tb_subnews);
unset($tb_news1);
$gen_sub->Class_Terminate();
unset($gen_sub);
$header->Class_Terminate();
unset($header);
$footer->Class_Terminate();
unset($footer);
unset($bg);
$news_inc->Class_Terminate();
unset($news_inc);
unset($users);
unset($tb_c_users);
unset($tb_cmps);
unset($tb_c_users4);
unset($tb_c_users1);
unset($tb_c_users2);
unset($tb_r_users);
unset($tb_ru);
unset($tb_r_users1);
unset($tb_rm);
unset($tb_sd_users);
unset($tb_sd);
unset($Login);
unset($tb_ag_users);
unset($tb_sa);
unset($tb_d_users);
unset($tb_dl);
unset($Tpl);
//End Unload Page
?>