Viewing file: informacij_list1.php (16.95 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 @34-39DC296A
include_once("./Header.php");
//End Include Page implementation
Class clsRecordinformacijeSearch { //informacijeSearch Class @2-CF4FFF11
//Variables @2-CB19EB75
// 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 $ds;
var $EditMode;
var $ValidatingControls;
var $Controls;
// Class variables
//End Variables
//Class_Initialize Event @2-E85519B8
function clsRecordinformacijeSearch()
{
global $FileName;
$this->Visible = true;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record informacijeSearch/Error";
$this->ReadAllowed = false;
$this->InsertAllowed = false;
$this->UpdateAllowed = false;
$this->DeleteAllowed = false;
if($this->Visible)
{
$this->ComponentName = "informacijeSearch";
$CCSForm = split(":", CCGetFromGet("ccsForm", ""), 2);
if(sizeof($CCSForm) == 1)
$CCSForm[1] = "";
list($FormName, $FormMethod) = $CCSForm;
$this->EditMode = ($FormMethod == "Edit");
$this->FormEnctype = "application/x-www-form-urlencoded";
$this->FormSubmitted = ($FormName == $this->ComponentName);
$Method = $this->FormSubmitted ? ccsPost : ccsGet;
$this->s_naslov = new clsControl(ccsTextBox, "s_naslov", "s_naslov", ccsMemo, "", CCGetRequestParam("s_naslov", $Method));
$this->s_tekst = new clsControl(ccsTextBox, "s_tekst", "s_tekst", ccsMemo, "", CCGetRequestParam("s_tekst", $Method));
$this->Button_DoSearch = new clsButton("Button_DoSearch");
}
}
//End Class_Initialize Event
//Validate Method @2-731BFD9A
function Validate()
{
$Validation = true;
$Where = "";
$Validation = ($this->s_naslov->Validate() && $Validation);
$Validation = ($this->s_tekst->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate");
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @2-41FEC587
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->s_naslov->Errors->Count());
$errors = ($errors || $this->s_tekst->Errors->Count());
$errors = ($errors || $this->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @2-F7BF5A6F
function Operation()
{
if(!$this->Visible)
return;
global $Redirect;
global $FileName;
$this->EditMode = false;
if(!$this->FormSubmitted)
return;
if($this->FormSubmitted) {
$this->PressedButton = "Button_DoSearch";
if(strlen(CCGetParam("Button_DoSearch", ""))) {
$this->PressedButton = "Button_DoSearch";
}
}
$Redirect = "informacij_list.php";
if($this->Validate()) {
if($this->PressedButton == "Button_DoSearch") {
if(!CCGetEvent($this->Button_DoSearch->CCSEvents, "OnClick")) {
$Redirect = "";
} else {
$Redirect = "informacij_list.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", Array("Button_DoSearch")));
}
}
} else {
$Redirect = "";
}
}
//End Operation Method
//Show Method @2-304CCA79
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;
if(!$this->FormSubmitted)
{
}
if($this->FormSubmitted || $this->CheckErrors()) {
$Error .= $this->s_naslov->Errors->ToString();
$Error .= $this->s_tekst->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_naslov->Show();
$this->s_tekst->Show();
$this->Button_DoSearch->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
}
//End Show Method
} //End informacijeSearch Class @2-FCB6E20C
class clsGridinformacije { //informacije class @9-FA634C87
//Variables @9-691F3C05
// 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_idvijesti;
var $Sorter_datum;
var $rubrika;
var $Sorter_rubrika;
var $Navigator;
//End Variables
//Class_Initialize Event @9-07EAB6F0
function clsGridinformacije()
{
global $FileName;
$this->ComponentName = "informacije";
$this->Visible = True;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid informacije";
$this->ds = new clsinformacijeDataSource();
$this->PageSize = CCGetParam($this->ComponentName . "PageSize", "");
if(!is_numeric($this->PageSize) || !strlen($this->PageSize))
$this->PageSize = 20;
else if ($this->PageSize > 100)
$this->PageSize = 100;
else
$this->PageSize = intval($this->PageSize);
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("informacijeOrder", "");
$this->SorterDirection = CCGetParam("informacijeDir", "");
$this->idvijesti = new clsControl(ccsLink, "idvijesti", "idvijesti", ccsInteger, "", CCGetRequestParam("idvijesti", ccsGet));
$this->datum = new clsControl(ccsLabel, "datum", "datum", ccsDate, Array("dd", "/", "mm", "/", "yyyy"), CCGetRequestParam("datum", ccsGet));
$this->rubrikaime = new clsControl(ccsLabel, "rubrikaime", "rubrikaime", ccsText, "", CCGetRequestParam("rubrikaime", ccsGet));
$this->Link1 = new clsControl(ccsLink, "Link1", "Link1", ccsText, "", CCGetRequestParam("Link1", ccsGet));
$this->Sorter_idvijesti = new clsSorter($this->ComponentName, "Sorter_idvijesti", $FileName);
$this->Sorter_datum = new clsSorter($this->ComponentName, "Sorter_datum", $FileName);
$this->rubrika = new clsSorter($this->ComponentName, "rubrika", $FileName);
$this->Sorter_rubrika = new clsSorter($this->ComponentName, "Sorter_rubrika", $FileName);
$this->informacije_Insert = new clsControl(ccsLink, "informacije_Insert", "informacije_Insert", ccsText, "", CCGetRequestParam("informacije_Insert", ccsGet));
$this->informacije_Insert->Parameters = CCGetQueryString("QueryString", Array("idvijesti", "ccsForm"));
$this->informacije_Insert->Page = "informacij_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-EFD91601
function Show()
{
global $Tpl;
if(!$this->Visible) return;
$ShownRecords = 0;
$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->idvijesti->SetValue($this->ds->idvijesti->GetValue());
$this->idvijesti->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
$this->idvijesti->Parameters = CCAddParam($this->idvijesti->Parameters, "idvijesti", $this->ds->f("idvijesti"));
$this->idvijesti->Page = "informacij_maint.php";
$this->datum->SetValue($this->ds->datum->GetValue());
$this->rubrikaime->SetValue($this->ds->rubrikaime->GetValue());
$this->Link1->SetValue($this->ds->Link1->GetValue());
$this->Link1->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
$this->Link1->Parameters = CCAddParam($this->Link1->Parameters, "idvijesti", $this->ds->f("idvijesti"));
$this->Link1->Page = "informacij_maint.php";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
$this->idvijesti->Show();
$this->datum->Show();
$this->rubrikaime->Show();
$this->Link1->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_idvijesti->Show();
$this->Sorter_datum->Show();
$this->rubrika->Show();
$this->Sorter_rubrika->Show();
$this->informacije_Insert->Show();
$this->Navigator->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->ds->close();
}
//End Show Method
//GetErrors Method @9-75B46773
function GetErrors()
{
$errors = "";
$errors .= $this->idvijesti->Errors->ToString();
$errors .= $this->datum->Errors->ToString();
$errors .= $this->rubrikaime->Errors->ToString();
$errors .= $this->Link1->Errors->ToString();
$errors .= $this->Errors->ToString();
$errors .= $this->ds->Errors->ToString();
return $errors;
}
//End GetErrors Method
} //End informacije Class @9-FCB6E20C
class clsinformacijeDataSource extends clsDBConnection1 { //informacijeDataSource Class @9-A134AC2A
//DataSource Variables @9-8209D2A6
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CountSQL;
var $wp;
// Datasource fields
var $idvijesti;
var $datum;
var $rubrikaime;
var $Link1;
//End DataSource Variables
//DataSourceClass_Initialize Event @9-67D6E230
function clsinformacijeDataSource()
{
$this->ErrorBlock = "Grid informacije";
$this->Initialize();
$this->idvijesti = new clsField("idvijesti", ccsInteger, "");
$this->datum = new clsField("datum", ccsDate, Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"));
$this->rubrikaime = new clsField("rubrikaime", ccsText, "");
$this->Link1 = new clsField("Link1", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @9-EF5640A3
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_idvijesti" => array("idvijesti", ""),
"Sorter_datum" => array("datum", ""),
"rubrika" => array("rubrika", ""),
"Sorter_rubrika" => array("rubrika", "")));
}
//End SetOrder Method
//Prepare Method @9-DFF3DD87
function Prepare()
{
}
//End Prepare Method
//Open Method @9-1EC938E0
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "SELECT COUNT(*) " .
"FROM informacije, rubrike";
$this->SQL = "SELECT informacije.*, nazivrubr " .
"FROM informacije, rubrike";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect");
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
$this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect");
$this->MoveToPage($this->AbsolutePage);
}
//End Open Method
//SetValues Method @9-80837045
function SetValues()
{
$this->idvijesti->SetDBValue(trim($this->f("idvijesti")));
$this->datum->SetDBValue(trim($this->f("datum")));
$this->rubrikaime->SetDBValue($this->f("nazivrubr"));
$this->Link1->SetDBValue($this->f("naslov"));
}
//End SetValues Method
} //End informacijeDataSource Class @9-FCB6E20C
//Include Page implementation @35-5CD56755
include_once("./Footer.php");
//End Include Page implementation
//Initialize Page @1-218A3154
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = "informacij_list1.php";
$Redirect = "";
$TemplateFileName = "informacij_list1.html";
$BlockToParse = "main";
$PathToRoot = "./";
//End Initialize Page
//Authenticate User @1-DC94A87D
CCSecurityRedirect("1", "");
//End Authenticate User
//Initialize Objects @1-2DB4BB55
$DBConnection1 = new clsDBConnection1();
// Controls
$Header = new clsHeader();
$Header->BindEvents();
$Header->TemplatePath = "./";
$Header->Initialize();
$informacijeSearch = new clsRecordinformacijeSearch();
$informacije = new clsGridinformacije();
$Footer = new clsFooter();
$Footer->BindEvents();
$Footer->TemplatePath = "./";
$Footer->Initialize();
$informacije->Initialize();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize");
//End Initialize Objects
//Initialize HTML Template @1-A0111C9D
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView");
$Tpl = new clsTemplate();
$Tpl->LoadTemplate(TemplatePath . $TemplateFileName, "main");
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow");
//End Initialize HTML Template
//Execute Components @1-05E12D7F
$Header->Operations();
$informacijeSearch->Operation();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-6F9FD7CC
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
header("Location: " . $Redirect);
exit;
}
//End Go to destination page
//Show Page @1-E51D3EBF
$Header->Show("Header");
$informacijeSearch->Show();
$informacije->Show();
$Footer->Show("Footer");
$Tpl->PParse("main", false);
//End Show Page
//Unload Page @1-A4D34ABE
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
unset($Tpl);
//End Unload Page
?>
|