Viewing file: e_mail_adr_list.php (20.58 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//Include Common Files @1-7899CF02
define("RelativePath", ".");
define("PathToCurrentPage", "/");
define("FileName", "e_mail_adr_list.php");
include(RelativePath . "/Common.php");
include(RelativePath . "/Template.php");
include(RelativePath . "/Sorter.php");
include(RelativePath . "/Navigator.php");
//End Include Common Files
//Include Page implementation @25-3DD2EFDC
include_once(RelativePath . "/Header.php");
//End Include Page implementation
class clsRecorde_mail_adrese_korisnikaSearch { //e_mail_adrese_korisnikaSearch Class @2-FB0868D4
//Variables @2-F607D3A5
// Public variables
var $ComponentType = "Record";
var $ComponentName;
var $Parent;
var $HTMLFormAction;
var $PressedButton;
var $Errors;
var $ErrorBlock;
var $FormSubmitted;
var $FormEnctype;
var $Visible;
var $Recordset;
var $CCSEvents = "";
var $CCSEventResult;
var $RelativePath = "";
var $InsertAllowed = false;
var $UpdateAllowed = false;
var $DeleteAllowed = false;
var $ReadAllowed = false;
var $EditMode = false;
var $ds;
var $DataSource;
var $ValidatingControls;
var $Controls;
// Class variables
//End Variables
//Class_Initialize Event @2-0BF98F94
function clsRecorde_mail_adrese_korisnikaSearch($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->Visible = true;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record e_mail_adrese_korisnikaSearch/Error";
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "e_mail_adrese_korisnikaSearch";
$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_e_mail_korisnika = & new clsControl(ccsTextBox, "s_e_mail_korisnika", "s_e_mail_korisnika", ccsText, "", CCGetRequestParam("s_e_mail_korisnika", $Method), $this);
$this->Button_DoSearch = & new clsButton("Button_DoSearch", $Method, $this);
}
}
//End Class_Initialize Event
//Validate Method @2-7571224A
function Validate()
{
global $CCSLocales;
$Validation = true;
$Where = "";
$Validation = ($this->s_e_mail_korisnika->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this);
$Validation = $Validation && ($this->s_e_mail_korisnika->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @2-17DA65F3
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->s_e_mail_korisnika->Errors->Count());
$errors = ($errors || $this->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @2-4EE30B70
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 = "e_mail_adr_list.php";
if($this->Validate()) {
if($this->PressedButton == "Button_DoSearch") {
$Redirect = "e_mail_adr_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 @2-0C390ADC
function Show()
{
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_e_mail_korisnika->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", $this->HTMLFormAction);
$Tpl->SetVar("HTMLFormName", $this->ComponentName);
$Tpl->SetVar("HTMLFormEnctype", $this->FormEnctype);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) {
$Tpl->block_path = $ParentPath;
return;
}
$this->s_e_mail_korisnika->Show();
$this->Button_DoSearch->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
}
//End Show Method
} //End e_mail_adrese_korisnikaSearch Class @2-FCB6E20C
class clsGride_mail_adrese_korisnika { //e_mail_adrese_korisnika class @6-8AD3A85B
//Variables @6-83101D9E
// Public variables
var $ComponentType = "Grid";
var $ComponentName;
var $Visible;
var $Errors;
var $ErrorBlock;
var $ds;
var $DataSource;
var $PageSize;
var $SorterName = "";
var $SorterDirection = "";
var $PageNumber;
var $CCSEvents = "";
var $CCSEventResult;
var $RelativePath = "";
// Grid Controls
var $StaticControls;
var $RowControls;
var $Sorter_id_email_adr;
var $Sorter_id_korisnika;
var $Sorter_e_mail_korisnika;
var $Sorter_id_izdanja;
//End Variables
//Class_Initialize Event @6-DA07F3FD
function clsGride_mail_adrese_korisnika($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->ComponentName = "e_mail_adrese_korisnika";
$this->Visible = True;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid e_mail_adrese_korisnika";
$this->DataSource = new clse_mail_adrese_korisnikaDataSource($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("<p>Form: Grid " . $this->ComponentName . "<br>Error: (CCS06) Invalid page size.</p>");
$this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1));
if ($this->PageNumber <= 0) $this->PageNumber = 1;
$this->SorterName = CCGetParam("e_mail_adrese_korisnikaOrder", "");
$this->SorterDirection = CCGetParam("e_mail_adrese_korisnikaDir", "");
$this->id_email_adr = & new clsControl(ccsLink, "id_email_adr", "id_email_adr", ccsInteger, "", CCGetRequestParam("id_email_adr", ccsGet), $this);
$this->id_email_adr->Page = "e_mail_adr_maint.php";
$this->id_korisnika = & new clsControl(ccsLabel, "id_korisnika", "id_korisnika", ccsInteger, "", CCGetRequestParam("id_korisnika", ccsGet), $this);
$this->e_mail_korisnika = & new clsControl(ccsLabel, "e_mail_korisnika", "e_mail_korisnika", ccsText, "", CCGetRequestParam("e_mail_korisnika", ccsGet), $this);
$this->id_izdanja = & new clsControl(ccsLabel, "id_izdanja", "id_izdanja", ccsInteger, "", CCGetRequestParam("id_izdanja", ccsGet), $this);
$this->Sorter_id_email_adr = & new clsSorter($this->ComponentName, "Sorter_id_email_adr", $FileName, $this);
$this->Sorter_id_korisnika = & new clsSorter($this->ComponentName, "Sorter_id_korisnika", $FileName, $this);
$this->Sorter_e_mail_korisnika = & new clsSorter($this->ComponentName, "Sorter_e_mail_korisnika", $FileName, $this);
$this->Sorter_id_izdanja = & new clsSorter($this->ComponentName, "Sorter_id_izdanja", $FileName, $this);
$this->e_mail_adrese_korisnika_Insert = & new clsControl(ccsLink, "e_mail_adrese_korisnika_Insert", "e_mail_adrese_korisnika_Insert", ccsText, "", CCGetRequestParam("e_mail_adrese_korisnika_Insert", ccsGet), $this);
$this->e_mail_adrese_korisnika_Insert->Parameters = CCGetQueryString("QueryString", array("id_email_adr", "ccsForm"));
$this->e_mail_adrese_korisnika_Insert->Page = "e_mail_adr_maint.php";
$this->Navigator = & new clsNavigator($this->ComponentName, "Navigator", $FileName, 10, tpSimple, $this);
}
//End Class_Initialize Event
//Initialize Method @6-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 @6-AA9E17C7
function Show()
{
global $Tpl;
global $CCSLocales;
if(!$this->Visible) return;
$ShownRecords = 0;
$this->DataSource->Parameters["urls_e_mail_korisnika"] = CCGetFromGet("s_e_mail_korisnika", "");
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$this->DataSource->Prepare();
$this->DataSource->Open();
$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(($ShownRecords < $this->PageSize) && $this->DataSource->next_record())
{
do {
$this->DataSource->SetValues();
$Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
$this->id_email_adr->SetValue($this->DataSource->id_email_adr->GetValue());
$this->id_email_adr->Parameters = CCGetQueryString("QueryString", array("ccsForm"));
$this->id_email_adr->Parameters = CCAddParam($this->id_email_adr->Parameters, "id_email_adr", $this->DataSource->f("id_email_adr"));
$this->id_korisnika->SetValue($this->DataSource->id_korisnika->GetValue());
$this->e_mail_korisnika->SetValue($this->DataSource->e_mail_korisnika->GetValue());
$this->id_izdanja->SetValue($this->DataSource->id_izdanja->GetValue());
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
$this->id_email_adr->Show();
$this->id_korisnika->Show();
$this->e_mail_korisnika->Show();
$this->id_izdanja->Show();
$Tpl->block_path = $ParentPath . "/" . $GridBlock;
$Tpl->parse("Row", true);
$ShownRecords++;
} while (($ShownRecords < $this->PageSize) && $this->DataSource->next_record());
}
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->DataSource->AbsolutePage;
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();
$this->Sorter_id_email_adr->Show();
$this->Sorter_id_korisnika->Show();
$this->Sorter_e_mail_korisnika->Show();
$this->Sorter_id_izdanja->Show();
$this->e_mail_adrese_korisnika_Insert->Show();
$this->Navigator->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
//GetErrors Method @6-525C05BF
function GetErrors()
{
$errors = "";
$errors = ComposeStrings($errors, $this->id_email_adr->Errors->ToString());
$errors = ComposeStrings($errors, $this->id_korisnika->Errors->ToString());
$errors = ComposeStrings($errors, $this->e_mail_korisnika->Errors->ToString());
$errors = ComposeStrings($errors, $this->id_izdanja->Errors->ToString());
$errors = ComposeStrings($errors, $this->Errors->ToString());
$errors = ComposeStrings($errors, $this->DataSource->Errors->ToString());
return $errors;
}
//End GetErrors Method
} //End e_mail_adrese_korisnika Class @6-FCB6E20C
class clse_mail_adrese_korisnikaDataSource extends clsDBConnection1 { //e_mail_adrese_korisnikaDataSource Class @6-5E68E873
//DataSource Variables @6-CB02F7AB
var $Parent = "";
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $CountSQL;
var $wp;
// Datasource fields
var $id_email_adr;
var $id_korisnika;
var $e_mail_korisnika;
var $id_izdanja;
//End DataSource Variables
//DataSourceClass_Initialize Event @6-46C94FD3
function clse_mail_adrese_korisnikaDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Grid e_mail_adrese_korisnika";
$this->Initialize();
$this->id_email_adr = new clsField("id_email_adr", ccsInteger, "");
$this->id_korisnika = new clsField("id_korisnika", ccsInteger, "");
$this->e_mail_korisnika = new clsField("e_mail_korisnika", ccsText, "");
$this->id_izdanja = new clsField("id_izdanja", ccsInteger, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @6-75853C9F
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_id_email_adr" => array("id_email_adr", ""),
"Sorter_id_korisnika" => array("id_korisnika", ""),
"Sorter_e_mail_korisnika" => array("e_mail_korisnika", ""),
"Sorter_id_izdanja" => array("id_izdanja", "")));
}
//End SetOrder Method
//Prepare Method @6-311C076E
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urls_e_mail_korisnika", ccsText, "", "", $this->Parameters["urls_e_mail_korisnika"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opContains, "e_mail_korisnika", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsText),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @6-63C9E822
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->CountSQL = "SELECT COUNT(*) " .
"FROM e_mail_adrese_korisnika";
$this->SQL = "SELECT id_email_adr, id_korisnika, e_mail_korisnika, id_izdanja " .
"FROM e_mail_adrese_korisnika {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 @6-9E1732E2
function SetValues()
{
$this->id_email_adr->SetDBValue(trim($this->f("id_email_adr")));
$this->id_korisnika->SetDBValue(trim($this->f("id_korisnika")));
$this->e_mail_korisnika->SetDBValue($this->f("e_mail_korisnika"));
$this->id_izdanja->SetDBValue(trim($this->f("id_izdanja")));
}
//End SetValues Method
} //End e_mail_adrese_korisnikaDataSource Class @6-FCB6E20C
//Include Page implementation @26-58DBA1E3
include_once(RelativePath . "/Footer.php");
//End Include Page implementation
//Initialize Page @1-FE0000A5
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = FileName;
$Redirect = "";
$TemplateFileName = "e_mail_adr_list.html";
$BlockToParse = "main";
$TemplateEncoding = "CP1252";
$PathToRoot = "./";
//End Initialize Page
//Authenticate User @1-DC94A87D
CCSecurityRedirect("1", "");
//End Authenticate User
//Initialize Objects @1-77DDE60A
$DBConnection1 = new clsDBConnection1();
$MainPage->Connections["Connection1"] = & $DBConnection1;
// Controls
$Header = & new clsHeader("", "Header", $MainPage);
$Header->Initialize();
$e_mail_adrese_korisnikaSearch = & new clsRecorde_mail_adrese_korisnikaSearch("", $MainPage);
$e_mail_adrese_korisnika = & new clsGride_mail_adrese_korisnika("", $MainPage);
$Footer = & new clsFooter("", "Footer", $MainPage);
$Footer->Initialize();
$MainPage->Header = & $Header;
$MainPage->e_mail_adrese_korisnikaSearch = & $e_mail_adrese_korisnikaSearch;
$MainPage->e_mail_adrese_korisnika = & $e_mail_adrese_korisnika;
$MainPage->Footer = & $Footer;
$e_mail_adrese_korisnika->Initialize();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage);
if ($Charset)
header("Content-Type: text/html; charset=" . $Charset);
//End Initialize Objects
//Initialize HTML Template @1-8F4531F3
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage);
$Tpl = new clsTemplate($FileEncoding, $TemplateEncoding);
$Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "CP1252");
$Tpl->block_path = "/$BlockToParse";
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage);
//End Initialize HTML Template
//Execute Components @1-D07E2BCE
$Header->Operations();
$e_mail_adrese_korisnikaSearch->Operation();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-67BAFB2E
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBConnection1->close();
header("Location: " . $Redirect);
$Header->Class_Terminate();
unset($Header);
unset($e_mail_adrese_korisnikaSearch);
unset($e_mail_adrese_korisnika);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-8ECDD51C
$Header->Show();
$e_mail_adrese_korisnikaSearch->Show();
$e_mail_adrese_korisnika->Show();
$Footer->Show();
$Tpl->block_path = "";
$Tpl->Parse($BlockToParse, false);
$main_block = $Tpl->GetVar($BlockToParse);
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage);
if ($CCSEventResult) echo $main_block;
//End Show Page
//Unload Page @1-9D43FB45
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBConnection1->close();
$Header->Class_Terminate();
unset($Header);
unset($e_mail_adrese_korisnikaSearch);
unset($e_mail_adrese_korisnika);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
//End Unload Page
?>
|