Viewing file: izgled_list.php (19.13 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 @28-3DD2EFDC
include_once(RelativePath . "/Header.php");
//End Include Page implementation
class clsRecordizgledSearch { //izgledSearch Class @2-D0719A9E
//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-C3F2462F
function clsRecordizgledSearch()
{
global $FileName;
$this->Visible = true;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record izgledSearch/Error";
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "izgledSearch";
$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_font = new clsControl(ccsTextBox, "s_font", "s_font", ccsMemo, "", CCGetRequestParam("s_font", $Method));
$this->s_naslovboja = new clsControl(ccsTextBox, "s_naslovboja", "s_naslovboja", ccsMemo, "", CCGetRequestParam("s_naslovboja", $Method));
$this->s_tekstboja = new clsControl(ccsTextBox, "s_tekstboja", "s_tekstboja", ccsMemo, "", CCGetRequestParam("s_tekstboja", $Method));
$this->s_linkboja = new clsControl(ccsTextBox, "s_linkboja", "s_linkboja", ccsMemo, "", CCGetRequestParam("s_linkboja", $Method));
$this->Button_DoSearch = new clsButton("Button_DoSearch");
}
}
//End Class_Initialize Event
//Validate Method @2-AC49B904
function Validate()
{
$Validation = true;
$Where = "";
$Validation = ($this->s_font->Validate() && $Validation);
$Validation = ($this->s_naslovboja->Validate() && $Validation);
$Validation = ($this->s_tekstboja->Validate() && $Validation);
$Validation = ($this->s_linkboja->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate");
$Validation = $Validation && ($this->s_font->Errors->Count() == 0);
$Validation = $Validation && ($this->s_naslovboja->Errors->Count() == 0);
$Validation = $Validation && ($this->s_tekstboja->Errors->Count() == 0);
$Validation = $Validation && ($this->s_linkboja->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @2-470AAA5D
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->s_font->Errors->Count());
$errors = ($errors || $this->s_naslovboja->Errors->Count());
$errors = ($errors || $this->s_tekstboja->Errors->Count());
$errors = ($errors || $this->s_linkboja->Errors->Count());
$errors = ($errors || $this->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @2-7B32E014
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 = "izgled_list.php";
if($this->Validate()) {
if($this->PressedButton == "Button_DoSearch") {
if(!CCGetEvent($this->Button_DoSearch->CCSEvents, "OnClick")) {
$Redirect = "";
} else {
$Redirect = "izgled_list.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", Array("Button_DoSearch")));
}
}
} else {
$Redirect = "";
}
}
//End Operation Method
//Show Method @2-7F1CD0D2
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_font->Errors->ToString();
$Error .= $this->s_naslovboja->Errors->ToString();
$Error .= $this->s_tekstboja->Errors->ToString();
$Error .= $this->s_linkboja->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_font->Show();
$this->s_naslovboja->Show();
$this->s_tekstboja->Show();
$this->s_linkboja->Show();
$this->Button_DoSearch->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
}
//End Show Method
} //End izgledSearch Class @2-FCB6E20C
class clsGridizgled { //izgled class @9-048CDE5C
//Variables @9-DA8927E8
// 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_idizgled;
var $Sorter_naslovvel;
var $Sorter_tekstvel;
var $Navigator;
//End Variables
//Class_Initialize Event @9-16A2BDFF
function clsGridizgled()
{
global $FileName;
$this->ComponentName = "izgled";
$this->Visible = True;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid izgled";
$this->ds = new clsizgledDataSource();
$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("izgledOrder", "");
$this->SorterDirection = CCGetParam("izgledDir", "");
$this->idizgled = new clsControl(ccsLink, "idizgled", "idizgled", ccsInteger, "", CCGetRequestParam("idizgled", ccsGet));
$this->naslovvel = new clsControl(ccsLabel, "naslovvel", "naslovvel", ccsInteger, "", CCGetRequestParam("naslovvel", ccsGet));
$this->tekstvel = new clsControl(ccsLabel, "tekstvel", "tekstvel", ccsInteger, "", CCGetRequestParam("tekstvel", ccsGet));
$this->Sorter_idizgled = new clsSorter($this->ComponentName, "Sorter_idizgled", $FileName);
$this->Sorter_naslovvel = new clsSorter($this->ComponentName, "Sorter_naslovvel", $FileName);
$this->Sorter_tekstvel = new clsSorter($this->ComponentName, "Sorter_tekstvel", $FileName);
$this->izgled_Insert = new clsControl(ccsLink, "izgled_Insert", "izgled_Insert", ccsText, "", CCGetRequestParam("izgled_Insert", ccsGet));
$this->izgled_Insert->Parameters = CCGetQueryString("QueryString", Array("idizgled", "ccsForm"));
$this->izgled_Insert->Page = "izgled_maint.php";
$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-9367BCC6
function Show()
{
global $Tpl;
if(!$this->Visible) return;
$ShownRecords = 0;
$this->ds->Parameters["urls_font"] = CCGetFromGet("s_font", "");
$this->ds->Parameters["urls_naslovboja"] = CCGetFromGet("s_naslovboja", "");
$this->ds->Parameters["urls_tekstboja"] = CCGetFromGet("s_tekstboja", "");
$this->ds->Parameters["urls_linkboja"] = CCGetFromGet("s_linkboja", "");
$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->idizgled->SetValue($this->ds->idizgled->GetValue());
$this->idizgled->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
$this->idizgled->Parameters = CCAddParam($this->idizgled->Parameters, "idizgled", $this->ds->f("idizgled"));
$this->idizgled->Page = "izgled_maint.php";
$this->naslovvel->SetValue($this->ds->naslovvel->GetValue());
$this->tekstvel->SetValue($this->ds->tekstvel->GetValue());
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
$this->idizgled->Show();
$this->naslovvel->Show();
$this->tekstvel->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_idizgled->Show();
$this->Sorter_naslovvel->Show();
$this->Sorter_tekstvel->Show();
$this->izgled_Insert->Show();
$this->Navigator->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->ds->close();
}
//End Show Method
//GetErrors Method @9-539DE9E1
function GetErrors()
{
$errors = "";
$errors .= $this->idizgled->Errors->ToString();
$errors .= $this->naslovvel->Errors->ToString();
$errors .= $this->tekstvel->Errors->ToString();
$errors .= $this->Errors->ToString();
$errors .= $this->ds->Errors->ToString();
return $errors;
}
//End GetErrors Method
} //End izgled Class @9-FCB6E20C
class clsizgledDataSource extends clsDBConnection1 { //izgledDataSource Class @9-24BE8687
//DataSource Variables @9-4103EDA0
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $CountSQL;
var $wp;
// Datasource fields
var $idizgled;
var $naslovvel;
var $tekstvel;
//End DataSource Variables
//DataSourceClass_Initialize Event @9-79EA754A
function clsizgledDataSource()
{
$this->ErrorBlock = "Grid izgled";
$this->Initialize();
$this->idizgled = new clsField("idizgled", ccsInteger, "");
$this->naslovvel = new clsField("naslovvel", ccsInteger, "");
$this->tekstvel = new clsField("tekstvel", ccsInteger, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @9-9E4A4145
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_idizgled" => array("idizgled", ""),
"Sorter_naslovvel" => array("naslovvel", ""),
"Sorter_tekstvel" => array("tekstvel", "")));
}
//End SetOrder Method
//Prepare Method @9-BF28393C
function Prepare()
{
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urls_font", ccsMemo, "", "", $this->Parameters["urls_font"], "", false);
$this->wp->AddParameter("2", "urls_naslovboja", ccsMemo, "", "", $this->Parameters["urls_naslovboja"], "", false);
$this->wp->AddParameter("3", "urls_tekstboja", ccsMemo, "", "", $this->Parameters["urls_tekstboja"], "", false);
$this->wp->AddParameter("4", "urls_linkboja", ccsMemo, "", "", $this->Parameters["urls_linkboja"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opContains, "font", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsMemo),false);
$this->wp->Criterion[2] = $this->wp->Operation(opContains, "naslovboja", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsMemo),false);
$this->wp->Criterion[3] = $this->wp->Operation(opContains, "tekstboja", $this->wp->GetDBValue("3"), $this->ToSQL($this->wp->GetDBValue("3"), ccsMemo),false);
$this->wp->Criterion[4] = $this->wp->Operation(opContains, "linkboja", $this->wp->GetDBValue("4"), $this->ToSQL($this->wp->GetDBValue("4"), ccsMemo),false);
$this->Where = $this->wp->opAND(
false, $this->wp->opAND(
false, $this->wp->opAND(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]),
$this->wp->Criterion[3]),
$this->wp->Criterion[4]);
}
//End Prepare Method
//Open Method @9-031EDFA4
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "SELECT COUNT(*) " .
"FROM izgled";
$this->SQL = "SELECT idizgled, naslovvel, tekstvel " .
"FROM izgled";
$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-1812479C
function SetValues()
{
$this->idizgled->SetDBValue(trim($this->f("idizgled")));
$this->naslovvel->SetDBValue(trim($this->f("naslovvel")));
$this->tekstvel->SetDBValue(trim($this->f("tekstvel")));
}
//End SetValues Method
} //End izgledDataSource Class @9-FCB6E20C
//Include Page implementation @29-58DBA1E3
include_once(RelativePath . "/Footer.php");
//End Include Page implementation
//Initialize Page @1-F4A63DA2
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = "izgled_list.php";
$Redirect = "";
$TemplateFileName = "izgled_list.html";
$BlockToParse = "main";
$TemplateEncoding = "";
$FileEncoding = "";
$PathToRoot = "./";
//End Initialize Page
//Authenticate User @1-DC94A87D
CCSecurityRedirect("1", "");
//End Authenticate User
//Initialize Objects @1-F81824C5
$DBConnection1 = new clsDBConnection1();
// Controls
$Header = new clsHeader("");
$Header->BindEvents();
$Header->Initialize();
$izgledSearch = new clsRecordizgledSearch();
$izgled = new clsGridizgled();
$Footer = new clsFooter("");
$Footer->BindEvents();
$Footer->Initialize();
$izgled->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-AC5BADEB
$Header->Operations();
$izgledSearch->Operation();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-5CC2D274
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
header("Location: " . $Redirect);
$Header->Class_Terminate();
unset($Header);
unset($izgledSearch);
unset($izgled);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-12865395
$Header->Show("Header");
$izgledSearch->Show();
$izgled->Show();
$Footer->Show("Footer");
$Tpl->PParse("main", false);
//End Show Page
//Unload Page @1-D31EB6CC
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
$Header->Class_Terminate();
unset($Header);
unset($izgledSearch);
unset($izgled);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
//End Unload Page
?>
|