ComponentName = "user";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid user";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$this->DataSource = new clsuserDataSource($this);
$this->ds = & $this->DataSource;
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 20;
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->SorterName = CCGetParam("userOrder", "");
$this->SorterDirection = CCGetParam("userDir", "");
$this->Name = new clsControl(ccsLink, "Name", "Name", ccsText, "", CCGetRequestParam("Name", ccsGet, NULL), $this);
$this->Name->Page = "user_maint.php";
$this->Level1 = new clsControl(ccsLabel, "Level1", "Level1", ccsText, "", CCGetRequestParam("Level1", ccsGet, NULL), $this);
$this->Email = new clsControl(ccsLink, "Email", "Email", ccsText, "", CCGetRequestParam("Email", ccsGet, NULL), $this);
$this->Email->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->Email->Page = "";
$this->Darab = new clsControl(ccsLabel, "Darab", "Darab", ccsText, "", CCGetRequestParam("Darab", ccsGet, NULL), $this);
$this->Sorter_Name = new clsSorter($this->ComponentName, "Sorter_Name", $FileName, $this);
$this->Sorter_Level = new clsSorter($this->ComponentName, "Sorter_Level", $FileName, $this);
$this->ImageLink1 = new clsControl(ccsImageLink, "ImageLink1", "ImageLink1", ccsText, "", CCGetRequestParam("ImageLink1", ccsGet, NULL), $this);
$this->ImageLink1->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->ImageLink1->Page = "Menu.php";
$this->user_Insert = new clsControl(ccsLink, "user_Insert", "user_Insert", ccsText, "", CCGetRequestParam("user_Insert", ccsGet, NULL), $this);
$this->user_Insert->Parameters = CCGetQueryString("QueryString", array("ID", "ccsForm"));
$this->user_Insert->Page = "user_maint.php";
$this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpSimple, $this);
$this->Navigator->PageSizes = array("1", "5", "10", "25", "50");
}
//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-1BF0F89A
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$this->RowNumber = 0;
$this->DataSource->Parameters["urls_Name"] = CCGetFromGet("s_Name", NULL);
$this->DataSource->Parameters["urls_Login"] = CCGetFromGet("s_Login", NULL);
$this->DataSource->Parameters["urls_Email"] = CCGetFromGet("s_Email", 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["Name"] = $this->Name->Visible;
$this->ControlsVisible["Level1"] = $this->Level1->Visible;
$this->ControlsVisible["Email"] = $this->Email->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->Name->SetValue($this->DataSource->Name->GetValue());
$this->Name->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->Name->Parameters = CCAddParam($this->Name->Parameters, "ID", $this->DataSource->f("ID"));
$this->Level1->SetValue($this->DataSource->Level1->GetValue());
$this->Email->SetValue($this->DataSource->Email->GetValue());
$this->Attributes->SetValue("rowNumber", $this->RowNumber);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->Attributes->Show();
$this->Name->Show();
$this->Level1->Show();
$this->Email->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
}
}
else { // Show NoRecords block if no records are found
$this->Attributes->Show();
$Tpl->parse("NoRecords", false);
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$this->Navigator->PageNumber = $this->DataSource->AbsolutePage;
$this->Navigator->PageSize = $this->PageSize;
if ($this->DataSource->RecordsCount == "CCS not counted")
$this->Navigator->TotalPages = $this->DataSource->AbsolutePage + ($this->DataSource->next_record() ? 1 : 0);
else
$this->Navigator->TotalPages = $this->DataSource->PageCount();
if ($this->Navigator->TotalPages <= 1) {
$this->Navigator->Visible = false;
}
$this->Darab->Show();
$this->Sorter_Name->Show();
$this->Sorter_Level->Show();
$this->ImageLink1->Show();
$this->user_Insert->Show();
$this->Navigator->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @7-C839870B
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->Name->Errors->ToString());
$errors = ComposeStrings($errors, $this->Level1->Errors->ToString());
$errors = ComposeStrings($errors, $this->Email->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End user Class @7-FCB6E20C
class clsuserDataSource extends clsDBConnection1 { //userDataSource Class @7-93B04756
//DataSource Variables @7-3E75638B
public $Parent = "";
public $CCSEvents = "";
public $CCSEventResult;
public $ErrorBlock;
public $CmdExecution;
public $CountSQL;
public $wp;
// Datasource fields
public $Name;
public $Level1;
public $Email;
//End DataSource Variables
//DataSourceClass_Initialize Event @7-2DFF59A1
function clsuserDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid user";
$this->Initialize();
$this->Name = new clsField("Name", ccsText, "");
$this->Level1 = new clsField("Level1", ccsText, "");
$this->Email = new clsField("Email", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @7-66C22054
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_Name" => array("Name", ""),
"Sorter_Level" => array("Level", "")));
}
//End SetOrder Method
//Prepare Method @7-87C9BD2E
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urls_Name", ccsText, "", "", $this->Parameters["urls_Name"], "", false);
$this->wp->AddParameter("2", "urls_Login", ccsText, "", "", $this->Parameters["urls_Login"], "", false);
$this->wp->AddParameter("3", "urls_Email", ccsText, "", "", $this->Parameters["urls_Email"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opContains, "Name", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsText),false);
$this->wp->Criterion[2] = $this->wp->Operation(opContains, "Login", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->wp->Criterion[3] = $this->wp->Operation(opContains, "Email", $this->wp->GetDBValue("3"), $this->ToSQL($this->wp->GetDBValue("3"), ccsText),false);
$this->Where = $this->wp->opAND(
false, $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]),
$this->wp->Criterion[3]);
}
//End Prepare Method
//Open Method @7-26C1A813
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*)\n\n" .
"FROM user";
$this->SQL = "SELECT ID, Name, Login, Level, Email, Telefon \n\n" .
"FROM user {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-2B378C73
function SetValues()
{
$this->Name->SetDBValue($this->f("Name"));
$this->Level1->SetDBValue($this->f("Level"));
$this->Email->SetDBValue($this->f("Email"));
}
//End SetValues Method
} //End userDataSource Class @7-FCB6E20C
class clsRecorduserSearch1 { //userSearch1 Class @36-C562E2C1
//Variables @36-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 @36-61FE3951
function clsRecorduserSearch1($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->Visible = true;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record userSearch1/Error";
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "userSearch1";
$this->Attributes = new clsAttributes($this->ComponentName . ":");
$CCSForm = explode(":", 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->s_Name = new clsControl(ccsTextBox, "s_Name", "s_Name", ccsText, "", CCGetRequestParam("s_Name", $Method, NULL), $this);
$this->Button_DoSearch = new clsButton("Button_DoSearch", $Method, $this);
}
}
//End Class_Initialize Event
//Validate Method @36-5BDD4249
function Validate()
{
global $CCSLocales;
$Validation = true;
$Where = "";
$Validation = ($this->s_Name->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this);
$Validation = $Validation && ($this->s_Name->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @36-DD619881
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->s_Name->Errors->Count());
$errors = ($errors || $this->Errors->Count());
return $errors;
}
//End CheckErrors Method
//MasterDetail @36-ED598703
function SetPrimaryKeys($keyArray)
{
$this->PrimaryKeys = $keyArray;
}
function GetPrimaryKeys()
{
return $this->PrimaryKeys;
}
function GetPrimaryKey($keyName)
{
return $this->PrimaryKeys[$keyName];
}
//End MasterDetail
//Operation Method @36-B7EFDDDF
function Operation()
{
if(!$this->Visible)
return;
global $Redirect;
global $FileName;
if(!$this->FormSubmitted) {
return;
}
if($this->FormSubmitted) {
$this->PressedButton = "Button_DoSearch";
if($this->Button_DoSearch->Pressed) {
$this->PressedButton = "Button_DoSearch";
}
}
$Redirect = "user_list.php";
if($this->Validate()) {
if($this->PressedButton == "Button_DoSearch") {
$Redirect = "user_list.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", array("Button_DoSearch", "Button_DoSearch_x", "Button_DoSearch_y")));
if(!CCGetEvent($this->Button_DoSearch->CCSEvents, "OnClick", $this->Button_DoSearch)) {
$Redirect = "";
}
}
} else {
$Redirect = "";
}
}
//End Operation Method
//Show Method @36-8550DD5B
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) {
}
if($this->FormSubmitted || $this->CheckErrors()) {
$Error = "";
$Error = ComposeStrings($Error, $this->s_Name->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->s_Name->Show();
$this->Button_DoSearch->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
}
//End Show Method
} //End userSearch1 Class @36-FCB6E20C
//Initialize Page @1-5FBF80F4
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
$Attributes = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = FileName;
$Redirect = "";
$TemplateFileName = "user_list.html";
$BlockToParse = "main";
$TemplateEncoding = "UTF-8";
$ContentType = "text/html";
$PathToRoot = "./";
$Charset = $Charset ? $Charset : "utf-8";
//End Initialize Page
//Include events file @1-9F57077D
include_once("./user_list_events.php");
//End Include events file
//Before Initialize @1-E870CEBC
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage);
//End Before Initialize
//Initialize Objects @1-DF8DF8A1
$DBConnection1 = new clsDBConnection1();
$MainPage->Connections["Connection1"] = & $DBConnection1;
$Attributes = new clsAttributes("page:");
$MainPage->Attributes = & $Attributes;
// Controls
$user = new clsGriduser("", $MainPage);
$userSearch1 = new clsRecorduserSearch1("", $MainPage);
$MainPage->user = & $user;
$MainPage->userSearch1 = & $userSearch1;
$user->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-A06E9207
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage);
$Tpl = new clsTemplate($FileEncoding, $TemplateEncoding);
$Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "UTF-8", "replace");
$Tpl->block_path = "/$BlockToParse";
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage);
$Attributes->SetValue("pathToRoot", "");
$Attributes->Show();
//End Initialize HTML Template
//Execute Components @1-F4EACE86
$userSearch1->Operation();
//End Execute Components
//Go to destination page @1-EACA680A
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBConnection1->close();
header("Location: " . $Redirect);
unset($user);
unset($userSearch1);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-49BEA51B
$user->Show();
$userSearch1->Show();
$Tpl->block_path = "";
$Tpl->Parse($BlockToParse, false);
if (!isset($main_block)) $main_block = $Tpl->GetVar($BlockToParse);
$main_block = CCConvertEncoding($main_block, $FileEncoding, $CCSLocales->GetFormatInfo("Encoding"));
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage);
if ($CCSEventResult) echo $main_block;
//End Show Page
//Unload Page @1-7BCD13B4
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBConnection1->close();
unset($user);
unset($userSearch1);
unset($Tpl);
//End Unload Page
?>