Viewing file: login_list.php (15.23 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//Include Common Files @1-5471E0F2
define("RelativePath", ".");
include(RelativePath . "/Common.php");
include(RelativePath . "/Template.php");
include(RelativePath . "/Sorter.php");
include(RelativePath . "/Navigator.php");
//End Include Common Files
//Include Page implementation @19-3DD2EFDC
include_once(RelativePath . "/Header.php");
//End Include Page implementation
class clsRecordloginSearch { //loginSearch Class @2-3C7C2FB7
//Variables @2-B2F7A83E
// Public variables
var $ComponentName;
var $HTMLFormAction;
var $PressedButton;
var $Errors;
var $ErrorBlock;
var $FormSubmitted;
var $FormEnctype;
var $Visible;
var $Recordset;
var $CCSEvents = "";
var $CCSEventResult;
var $InsertAllowed = false;
var $UpdateAllowed = false;
var $DeleteAllowed = false;
var $ReadAllowed = false;
var $EditMode = false;
var $ds;
var $ValidatingControls;
var $Controls;
// Class variables
//End Variables
//Class_Initialize Event @2-248E839A
function clsRecordloginSearch()
{
global $FileName;
$this->Visible = true;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record loginSearch/Error";
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "loginSearch";
$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->s_login = new clsControl(ccsTextBox, "s_login", "s_login", ccsMemo, "", CCGetRequestParam("s_login", $Method));
$this->Button_DoSearch = new clsButton("Button_DoSearch");
}
}
//End Class_Initialize Event
//Validate Method @2-1115CED3
function Validate()
{
$Validation = true;
$Where = "";
$Validation = ($this->s_login->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate");
$Validation = $Validation && ($this->s_login->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @2-375DFA3A
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->s_login->Errors->Count());
$errors = ($errors || $this->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @2-CCF70FCF
function Operation()
{
if(!$this->Visible)
return;
global $Redirect;
global $FileName;
if(!$this->FormSubmitted) {
return;
}
if($this->FormSubmitted) {
$this->PressedButton = "Button_DoSearch";
if(strlen(CCGetParam("Button_DoSearch", ""))) {
$this->PressedButton = "Button_DoSearch";
}
}
$Redirect = "login_list.php";
if($this->Validate()) {
if($this->PressedButton == "Button_DoSearch") {
if(!CCGetEvent($this->Button_DoSearch->CCSEvents, "OnClick")) {
$Redirect = "";
} else {
$Redirect = "login_list.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", Array("Button_DoSearch")));
}
}
} else {
$Redirect = "";
}
}
//End Operation Method
//Show Method @2-E338449F
function Show()
{
global $Tpl;
global $FileName;
$Error = "";
if(!$this->Visible)
return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect");
$RecordBlock = "Record " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $RecordBlock;
$this->EditMode = $this->EditMode && $this->ReadAllowed;
if(!$this->FormSubmitted)
{
}
if($this->FormSubmitted || $this->CheckErrors()) {
$Error .= $this->s_login->Errors->ToString();
$Error .= $this->Errors->ToString();
$Tpl->SetVar("Error", $Error);
$Tpl->Parse("Error", false);
}
$CCSForm = $this->EditMode ? $this->ComponentName . ":" . "Edit" : $this->ComponentName;
$this->HTMLFormAction = $FileName . "?" . CCAddParam(CCGetQueryString("QueryString", ""), "ccsForm", $CCSForm);
$Tpl->SetVar("Action", $this->HTMLFormAction);
$Tpl->SetVar("HTMLFormName", $this->ComponentName);
$Tpl->SetVar("HTMLFormEnctype", $this->FormEnctype);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");
if(!$this->Visible) {
$Tpl->block_path = $ParentPath;
return;
}
$this->s_login->Show();
$this->Button_DoSearch->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
}
//End Show Method
} //End loginSearch Class @2-FCB6E20C
class clsGridlogin { //login class @6-C868A64F
//Variables @6-002B41E2
// Public variables
var $ComponentName;
var $Visible;
var $Errors;
var $ErrorBlock;
var $ds; var $PageSize;
var $SorterName = "";
var $SorterDirection = "";
var $PageNumber;
var $CCSEvents = "";
var $CCSEventResult;
// Grid Controls
var $StaticControls; var $RowControls;
var $Sorter_idlogin;
var $Sorter_nivo;
var $Navigator;
//End Variables
//Class_Initialize Event @6-C7094F1D
function clsGridlogin()
{
global $FileName;
$this->ComponentName = "login";
$this->Visible = True;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid login";
$this->ds = new clsloginDataSource();
$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("<p>Form: Grid " . $this->ComponentName . "<br>Error: (CCS06) Invalid page size.</p>");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
$this->SorterName = CCGetParam("loginOrder", "");
$this->SorterDirection = CCGetParam("loginDir", "");
$this->idlogin = new clsControl(ccsLink, "idlogin", "idlogin", ccsInteger, "", CCGetRequestParam("idlogin", ccsGet));
$this->nivo = new clsControl(ccsLabel, "nivo", "nivo", ccsText, "", CCGetRequestParam("nivo", ccsGet));
$this->Sorter_idlogin = new clsSorter($this->ComponentName, "Sorter_idlogin", $FileName);
$this->Sorter_nivo = new clsSorter($this->ComponentName, "Sorter_nivo", $FileName);
$this->login_Insert = new clsControl(ccsLink, "login_Insert", "login_Insert", ccsText, "", CCGetRequestParam("login_Insert", ccsGet));
$this->login_Insert->Parameters = CCGetQueryString("QueryString", Array("idlogin", "ccsForm"));
$this->login_Insert->Page = "login_maint.php";
$this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpSimple);
}
//End Class_Initialize Event
//Initialize Method @6-03626367
function Initialize()
{
if(!$this->Visible) return;
$this->ds->PageSize = $this->PageSize;
$this->ds->AbsolutePage = $this->PageNumber;
$this->ds->SetOrder($this->SorterName, $this->SorterDirection);
}
//End Initialize Method
//Show Method @6-F7660EA3
function Show()
{
global $Tpl;
if(!$this->Visible) return;
$ShownRecords = 0;
$this->ds->Parameters["urls_login"] = CCGetFromGet("s_login", "");
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect");
$this->ds->Prepare();
$this->ds->Open();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$is_next_record = $this->ds->next_record();
if($is_next_record && $ShownRecords < $this->PageSize)
{
do {
$this->ds->SetValues();
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->idlogin->SetValue($this->ds->idlogin->GetValue());
$this->idlogin->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
$this->idlogin->Parameters = CCAddParam($this->idlogin->Parameters, "idlogin", $this->ds->f("idlogin"));
$this->idlogin->Page = "login_maint.php";
$this->nivo->SetValue($this->ds->nivo->GetValue());
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
$this->idlogin->Show();
$this->nivo->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
$ShownRecords++;
$is_next_record = $this->ds->next_record();
} while ($is_next_record && $ShownRecords < $this->PageSize);
}
else // Show NoRecords block if no records are found
{
$Tpl->parse("NoRecords", false);
}
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$this->Navigator->PageNumber = $this->ds->AbsolutePage;
$this->Navigator->TotalPages = $this->ds->PageCount();
$this->Sorter_idlogin->Show();
$this->Sorter_nivo->Show();
$this->login_Insert->Show();
$this->Navigator->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->ds->close();
}
//End Show Method
//GetErrors Method @6-85279FA8
function GetErrors()
{
$errors = "";
$errors .= $this->idlogin->Errors->ToString();
$errors .= $this->nivo->Errors->ToString();
$errors .= $this->Errors->ToString();
$errors .= $this->ds->Errors->ToString();
return $errors;
}
//End GetErrors Method
} //End login Class @6-FCB6E20C
class clsloginDataSource extends clsDBConnection1 { //loginDataSource Class @6-0FA025BE
//DataSource Variables @6-E5A955FC
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $CountSQL;
var $wp;
// Datasource fields
var $idlogin;
var $nivo;
//End DataSource Variables
//DataSourceClass_Initialize Event @6-153613A5
function clsloginDataSource()
{
$this->ErrorBlock = "Grid login";
$this->Initialize();
$this->idlogin = new clsField("idlogin", ccsInteger, "");
$this->nivo = new clsField("nivo", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @6-A518B073
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_idlogin" => array("idlogin", ""),
"Sorter_nivo" => array("nivo", "")));
}
//End SetOrder Method
//Prepare Method @6-C7A8A0EB
function Prepare()
{
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urls_login", ccsMemo, "", "", $this->Parameters["urls_login"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opContains, "login", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsMemo),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @6-758FE313
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "SELECT COUNT(*) " .
"FROM login";
$this->SQL = "SELECT idlogin, login, nivo " .
"FROM login";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect");
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect");
}
//End Open Method
//SetValues Method @6-522501E4
function SetValues()
{
$this->idlogin->SetDBValue(trim($this->f("idlogin")));
$this->nivo->SetDBValue($this->f("login"));
}
//End SetValues Method
} //End loginDataSource Class @6-FCB6E20C
//Initialize Page @1-29D6FA23
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = "login_list.php";
$Redirect = "";
$TemplateFileName = "login_list.html";
$BlockToParse = "main";
$TemplateEncoding = "";
$FileEncoding = "";
$PathToRoot = "./";
//End Initialize Page
//Authenticate User @1-DC94A87D
CCSecurityRedirect("1", "");
//End Authenticate User
//Initialize Objects @1-88753B76
$DBConnection1 = new clsDBConnection1();
// Controls
$Header = new clsHeader("");
$Header->BindEvents();
$Header->Initialize();
$loginSearch = new clsRecordloginSearch();
$login = new clsGridlogin();
$login->Initialize();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize");
if ($Charset)
header("Content-Type: text/html; charset=" . $Charset);
//End Initialize Objects
//Initialize HTML Template @1-51DB8464
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView");
$Tpl = new clsTemplate();
$Tpl->LoadTemplate(TemplatePath . $TemplateFileName, "main", $TemplateEncoding);
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow");
//End Initialize HTML Template
//Execute Components @1-32EAE560
$Header->Operations();
$loginSearch->Operation();
//End Execute Components
//Go to destination page @1-51C9A034
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
header("Location: " . $Redirect);
$Header->Class_Terminate();
unset($Header);
unset($loginSearch);
unset($login);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-02F2470B
$Header->Show("Header");
$loginSearch->Show();
$login->Show();
$Tpl->PParse("main", false);
//End Show Page
//Unload Page @1-C55794E9
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
$Header->Class_Terminate();
unset($Header);
unset($loginSearch);
unset($login);
unset($Tpl);
//End Unload Page
?>
|