Viewing file: statistika_list2.php (19.96 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 @37-3DD2EFDC
include_once(RelativePath . "/Header.php");
//End Include Page implementation
class clsRecordstatistikaSearch { //statistikaSearch Class @2-A104BE37
//Variables @2-6AE99A64
// 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;
//End Variables
//Class_Initialize Event @2-CA5D1102
function clsRecordstatistikaSearch()
{
global $FileName;
$this->Visible = true;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record statistikaSearch/Error";
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "statistikaSearch";
$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;
}
}
//End Class_Initialize Event
//Validate Method @2-7E1FC38C
function Validate()
{
$Validation = true;
$Where = "";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate");
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @2-E8CE9E37
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @2-79160FFE
function Operation()
{
if(!$this->Visible)
return;
global $Redirect;
global $FileName;
if(!$this->FormSubmitted) {
return;
}
$Redirect = "statistika_list2.php";
}
//End Operation Method
//Show Method @2-7E6D5C7A
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 || $this->CheckErrors()) {
$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;
}
$Tpl->parse();
$Tpl->block_path = $ParentPath;
}
//End Show Method
} //End statistikaSearch Class @2-FCB6E20C
class clsGridstatistika { //statistika class @9-DBB93A16
//Variables @9-9B7157A8
// 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_id;
var $Sorter_request;
var $Sorter_host;
var $Sorter_address;
var $Sorter_date;
var $Navigator;
//End Variables
//Class_Initialize Event @9-EEE5FDE4
function clsGridstatistika()
{
global $FileName;
$this->ComponentName = "statistika";
$this->Visible = True;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid statistika";
$this->ds = new clsstatistikaDataSource();
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 300;
else
$this->PageSize = intval($this->PageSize);
if ($this->PageSize > 300)
$this->PageSize = 300;
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("statistikaOrder", "");
$this->SorterDirection = CCGetParam("statistikaDir", "");
$this->id = new clsControl(ccsLink, "id", "id", ccsInteger, "", CCGetRequestParam("id", ccsGet));
$this->request = new clsControl(ccsLabel, "request", "request", ccsText, "", CCGetRequestParam("request", ccsGet));
$this->host = new clsControl(ccsLabel, "host", "host", ccsText, "", CCGetRequestParam("host", ccsGet));
$this->address = new clsControl(ccsLabel, "address", "address", ccsText, "", CCGetRequestParam("address", ccsGet));
$this->date = new clsControl(ccsLabel, "date", "date", ccsDate, Array("GeneralDate"), CCGetRequestParam("date", ccsGet));
$this->Sorter_id = new clsSorter($this->ComponentName, "Sorter_id", $FileName);
$this->Sorter_request = new clsSorter($this->ComponentName, "Sorter_request", $FileName);
$this->Sorter_host = new clsSorter($this->ComponentName, "Sorter_host", $FileName);
$this->Sorter_address = new clsSorter($this->ComponentName, "Sorter_address", $FileName);
$this->Sorter_date = new clsSorter($this->ComponentName, "Sorter_date", $FileName);
$this->Navigator = new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpSimple);
}
//End Class_Initialize Event
//Initialize Method @9-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 @9-A219DBB1
function Show()
{
global $Tpl;
if(!$this->Visible) return;
$ShownRecords = 0;
$this->ds->Parameters["urls_request"] = CCGetFromGet("s_request", "");
$this->ds->Parameters["urls_host"] = CCGetFromGet("s_host", "");
$this->ds->Parameters["urls_address"] = CCGetFromGet("s_address", "");
$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->id->SetValue($this->ds->id->GetValue());
$this->id->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
$this->id->Parameters = CCAddParam($this->id->Parameters, "id", $this->ds->f("id"));
$this->id->Page = "statistika_maint.php";
$this->request->SetValue($this->ds->request->GetValue());
$this->host->SetValue($this->ds->host->GetValue());
$this->address->SetValue($this->ds->address->GetValue());
$this->date->SetValue($this->ds->date->GetValue());
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
$this->id->Show();
$this->request->Show();
$this->host->Show();
$this->address->Show();
$this->date->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_id->Show();
$this->Sorter_request->Show();
$this->Sorter_host->Show();
$this->Sorter_address->Show();
$this->Sorter_date->Show();
$this->Navigator->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->ds->close();
}
//End Show Method
//GetErrors Method @9-0DD65A12
function GetErrors()
{
$errors = "";
$errors .= $this->id->Errors->ToString();
$errors .= $this->request->Errors->ToString();
$errors .= $this->host->Errors->ToString();
$errors .= $this->address->Errors->ToString();
$errors .= $this->date->Errors->ToString();
$errors .= $this->Errors->ToString();
$errors .= $this->ds->Errors->ToString();
return $errors;
}
//End GetErrors Method
} //End statistika Class @9-FCB6E20C
class clsstatistikaDataSource extends clsDBConnection1 { //statistikaDataSource Class @9-E6ADE34E
//DataSource Variables @9-CD9A9951
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $CountSQL;
var $wp;
// Datasource fields
var $id;
var $request;
var $host;
var $address;
var $date;
//End DataSource Variables
//DataSourceClass_Initialize Event @9-FEB3AF2B
function clsstatistikaDataSource()
{
$this->ErrorBlock = "Grid statistika";
$this->Initialize();
$this->id = new clsField("id", ccsInteger, "");
$this->request = new clsField("request", ccsText, "");
$this->host = new clsField("host", ccsText, "");
$this->address = new clsField("address", ccsText, "");
$this->date = new clsField("date", ccsDate, Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"));
}
//End DataSourceClass_Initialize Event
//SetOrder Method @9-AE7460D0
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "id desc";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_id" => array("id", ""),
"Sorter_request" => array("request", ""),
"Sorter_host" => array("host", ""),
"Sorter_address" => array("address", ""),
"Sorter_date" => array("date", "")));
}
//End SetOrder Method
//Prepare Method @9-EFF49365
function Prepare()
{
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urls_request", ccsText, "", "", $this->Parameters["urls_request"], "", false);
$this->wp->AddParameter("2", "urls_host", ccsText, "", "", $this->Parameters["urls_host"], "", false);
$this->wp->AddParameter("3", "urls_address", ccsText, "", "", $this->Parameters["urls_address"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opContains, "request", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsText),false);
$this->wp->Criterion[2] = $this->wp->Operation(opContains, "host", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsText),false);
$this->wp->Criterion[3] = $this->wp->Operation(opContains, "address", $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 @9-84B0C7C9
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "SELECT COUNT(*) " .
"FROM statistika";
$this->SQL = "SELECT id, request, host, address, `date` " .
"FROM statistika";
$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 @9-6788716E
function SetValues()
{
$this->id->SetDBValue(trim($this->f("id")));
$this->request->SetDBValue($this->f("request"));
$this->host->SetDBValue($this->f("host"));
$this->address->SetDBValue($this->f("address"));
$this->date->SetDBValue(trim($this->f("date")));
}
//End SetValues Method
} //End statistikaDataSource Class @9-FCB6E20C
class clsGridstatistika1 { //statistika1 class @48-EB4CECDD
//Variables @48-A4DFD2E2
// 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_id;
//End Variables
//Class_Initialize Event @48-DF16FFB4
function clsGridstatistika1()
{
global $FileName;
$this->ComponentName = "statistika1";
$this->Visible = True;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid statistika1";
$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("<p>Form: Grid " . $this->ComponentName . "<br>Error: (CCS06) Invalid page size.</p>");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
$this->SorterName = CCGetParam("statistika1Order", "");
$this->SorterDirection = CCGetParam("statistika1Dir", "");
$this->id = new clsControl(ccsLabel, "id", "id", ccsInteger, "", CCGetRequestParam("id", ccsGet));
$this->Sorter_id = new clsSorter($this->ComponentName, "Sorter_id", $FileName);
}
//End Class_Initialize Event
//Initialize Method @48-5D060BAC
function Initialize()
{
if(!$this->Visible) return;
}
//End Initialize Method
//Show Method @48-B8ACE357
function Show()
{
global $Tpl;
if(!$this->Visible) return;
$ShownRecords = 0;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect");
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");
if(!$this->Visible) return;
$GridBlock = "Grid " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("NoRecords", false);
$errors = $this->GetErrors();
if(strlen($errors))
{
$Tpl->replaceblock("", $errors);
$Tpl->block_path = $ParentPath;
return;
}
$this->Sorter_id->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
}
//End Show Method
//GetErrors Method @48-F1E000B5
function GetErrors()
{
$errors = "";
$errors .= $this->id->Errors->ToString();
$errors .= $this->Errors->ToString();
return $errors;
}
//End GetErrors Method
} //End statistika1 Class @48-FCB6E20C
//Include Page implementation @38-58DBA1E3
include_once(RelativePath . "/Footer.php");
//End Include Page implementation
//Initialize Page @1-0035F23E
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = "statistika_list2.php";
$Redirect = "";
$TemplateFileName = "statistika_list2.html";
$BlockToParse = "main";
$TemplateEncoding = "";
$FileEncoding = "";
$PathToRoot = "./";
//End Initialize Page
//Authenticate User @1-DC94A87D
CCSecurityRedirect("1", "");
//End Authenticate User
//Initialize Objects @1-54DB6B8B
$DBConnection1 = new clsDBConnection1();
// Controls
$Header = new clsHeader("");
$Header->BindEvents();
$Header->Initialize();
$statistikaSearch = new clsRecordstatistikaSearch();
$statistika = new clsGridstatistika();
$statistika1 = new clsGridstatistika1();
$Footer = new clsFooter("");
$Footer->BindEvents();
$Footer->Initialize();
$statistika->Initialize();
// Events
include("./statistika_list2_events.php");
BindEvents();
$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-DBA7D96A
$Header->Operations();
$statistikaSearch->Operation();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-1B7F1B27
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
header("Location: " . $Redirect);
$Header->Class_Terminate();
unset($Header);
unset($statistikaSearch);
unset($statistika);
unset($statistika1);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-CA3513AF
$Header->Show("Header");
$statistikaSearch->Show();
$statistika->Show();
$statistika1->Show();
$Footer->Show("Footer");
$Tpl->PParse("main", false);
//End Show Page
//Unload Page @1-507FF8E7
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
$Header->Class_Terminate();
unset($Header);
unset($statistikaSearch);
unset($statistika);
unset($statistika1);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
//End Unload Page
?>
|