Viewing file: valute_list.php (17.94 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
//Include Page implementation @35-9090FF7A
include_once(RelativePath . "/Header1.php");
//End Include Page implementation
class clsRecordvaluteSearch { //valuteSearch Class @2-B107DB49
//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-B5708376
function clsRecordvaluteSearch()
{
global $FileName;
$this->Visible = true;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record valuteSearch/Error";
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "valuteSearch";
$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_naziv_valute = new clsControl(ccsTextBox, "s_naziv_valute", "s_naziv_valute", ccsMemo, "", CCGetRequestParam("s_naziv_valute", $Method));
$this->Button_DoSearch = new clsButton("Button_DoSearch");
}
}
//End Class_Initialize Event
//Validate Method @2-AB9F9924
function Validate()
{
$Validation = true;
$Where = "";
$Validation = ($this->s_naziv_valute->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate");
$Validation = $Validation && ($this->s_naziv_valute->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @2-52193FD8
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->s_naziv_valute->Errors->Count());
$errors = ($errors || $this->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @2-E01DE36F
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 = "valute_list.php";
if($this->Validate()) {
if($this->PressedButton == "Button_DoSearch") {
if(!CCGetEvent($this->Button_DoSearch->CCSEvents, "OnClick")) {
$Redirect = "";
} else {
$Redirect = "valute_list.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", Array("Button_DoSearch")));
}
}
} else {
$Redirect = "";
}
}
//End Operation Method
//Show Method @2-2A8E1670
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_naziv_valute->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_naziv_valute->Show();
$this->Button_DoSearch->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
}
//End Show Method
} //End valuteSearch Class @2-FCB6E20C
class clsGridvalute { //valute class @6-A2351121
//Variables @6-DF58642A
// 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_valute;
var $Datum;
var $Sorter1;
var $Sorter_vrijednost_valute;
var $Navigator;
//End Variables
//Class_Initialize Event @6-604E5C46
function clsGridvalute()
{
global $FileName;
$this->ComponentName = "valute";
$this->Visible = True;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid valute";
$this->ds = new clsvaluteDataSource();
$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("valuteOrder", "");
$this->SorterDirection = CCGetParam("valuteDir", "");
$this->id_valute = new clsControl(ccsLink, "id_valute", "id_valute", ccsInteger, "", CCGetRequestParam("id_valute", ccsGet));
$this->Label1 = new clsControl(ccsLabel, "Label1", "Label1", ccsDate, Array("GeneralDate"), CCGetRequestParam("Label1", ccsGet));
$this->Link1 = new clsControl(ccsLink, "Link1", "Link1", ccsText, "", CCGetRequestParam("Link1", ccsGet));
$this->vrijednost_valute = new clsControl(ccsLabel, "vrijednost_valute", "vrijednost_valute", ccsFloat, "", CCGetRequestParam("vrijednost_valute", ccsGet));
$this->Sorter_id_valute = new clsSorter($this->ComponentName, "Sorter_id_valute", $FileName);
$this->Datum = new clsSorter($this->ComponentName, "Datum", $FileName);
$this->Sorter1 = new clsSorter($this->ComponentName, "Sorter1", $FileName);
$this->Sorter_vrijednost_valute = new clsSorter($this->ComponentName, "Sorter_vrijednost_valute", $FileName);
$this->valute_Insert = new clsControl(ccsLink, "valute_Insert", "valute_Insert", ccsText, "", CCGetRequestParam("valute_Insert", ccsGet));
$this->valute_Insert->Parameters = CCGetQueryString("QueryString", Array("id_valute", "ccsForm"));
$this->valute_Insert->Page = "valute_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-9782CA26
function Show()
{
global $Tpl;
if(!$this->Visible) return;
$ShownRecords = 0;
$this->ds->Parameters["urls_naziv_valute"] = CCGetFromGet("s_naziv_valute", "");
$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_valute->SetValue($this->ds->id_valute->GetValue());
$this->id_valute->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
$this->id_valute->Parameters = CCAddParam($this->id_valute->Parameters, "id_valute", $this->ds->f("id_valute"));
$this->id_valute->Page = "valute_maint.php";
$this->Label1->SetValue($this->ds->Label1->GetValue());
$this->Link1->SetValue($this->ds->Link1->GetValue());
$this->Link1->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
$this->Link1->Parameters = CCAddParam($this->Link1->Parameters, "id_valute", $this->ds->f("id_valute"));
$this->Link1->Page = "valute_maint.php";
$this->vrijednost_valute->SetValue($this->ds->vrijednost_valute->GetValue());
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
$this->id_valute->Show();
$this->Label1->Show();
$this->Link1->Show();
$this->vrijednost_valute->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_valute->Show();
$this->Datum->Show();
$this->Sorter1->Show();
$this->Sorter_vrijednost_valute->Show();
$this->valute_Insert->Show();
$this->Navigator->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->ds->close();
}
//End Show Method
//GetErrors Method @6-E2662B55
function GetErrors()
{
$errors = "";
$errors .= $this->id_valute->Errors->ToString();
$errors .= $this->Label1->Errors->ToString();
$errors .= $this->Link1->Errors->ToString();
$errors .= $this->vrijednost_valute->Errors->ToString();
$errors .= $this->Errors->ToString();
$errors .= $this->ds->Errors->ToString();
return $errors;
}
//End GetErrors Method
} //End valute Class @6-FCB6E20C
class clsvaluteDataSource extends clsDBConnection1 { //valuteDataSource Class @6-D6ADAE9B
//DataSource Variables @6-2A88AEF2
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $CountSQL;
var $wp;
// Datasource fields
var $id_valute;
var $Label1;
var $Link1;
var $vrijednost_valute;
//End DataSource Variables
//DataSourceClass_Initialize Event @6-4F9163CE
function clsvaluteDataSource()
{
$this->ErrorBlock = "Grid valute";
$this->Initialize();
$this->id_valute = new clsField("id_valute", ccsInteger, "");
$this->Label1 = new clsField("Label1", ccsDate, Array("dd", "/", "mm", "/", "yyyy", " ", "HH", ":", "nn", ":", "ss"));
$this->Link1 = new clsField("Link1", ccsText, "");
$this->vrijednost_valute = new clsField("vrijednost_valute", ccsFloat, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @6-6BD85FA3
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_id_valute" => array("id_valute", ""),
"Datum" => array("datum", ""),
"Sorter1" => array("naziv_valute", ""),
"Sorter_vrijednost_valute" => array("vrijednost_valute", "")));
}
//End SetOrder Method
//Prepare Method @6-5B6D1C03
function Prepare()
{
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urls_naziv_valute", ccsMemo, "", "", $this->Parameters["urls_naziv_valute"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opContains, "naziv_valute", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsMemo),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @6-856ABA70
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "SELECT COUNT(*) " .
"FROM valute";
$this->SQL = "SELECT id_valute, naziv_valute, vrijednost_valute, datum " .
"FROM valute";
$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-5F17B2B7
function SetValues()
{
$this->id_valute->SetDBValue(trim($this->f("id_valute")));
$this->Label1->SetDBValue(trim($this->f("datum")));
$this->Link1->SetDBValue($this->f("naziv_valute"));
$this->vrijednost_valute->SetDBValue(trim($this->f("vrijednost_valute")));
}
//End SetValues Method
} //End valuteDataSource Class @6-FCB6E20C
//Include Page implementation @20-58DBA1E3
include_once(RelativePath . "/Footer.php");
//End Include Page implementation
//Initialize Page @1-5D8D20CB
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = "valute_list.php";
$Redirect = "";
$TemplateFileName = "valute_list.html";
$BlockToParse = "main";
$TemplateEncoding = "";
$FileEncoding = "";
$PathToRoot = "./";
//End Initialize Page
//Authenticate User @1-DC94A87D
CCSecurityRedirect("1", "");
//End Authenticate User
//Initialize Objects @1-A714716B
$DBConnection1 = new clsDBConnection1();
// Controls
$Header = new clsHeader("");
$Header->BindEvents();
$Header->Initialize();
$Header1 = new clsHeader1("");
$Header1->BindEvents();
$Header1->Initialize();
$valuteSearch = new clsRecordvaluteSearch();
$valute = new clsGridvalute();
$Footer = new clsFooter("");
$Footer->BindEvents();
$Footer->Initialize();
$valute->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-1BF19F55
$Header->Operations();
$Header1->Operations();
$valuteSearch->Operation();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-70B9A920
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
header("Location: " . $Redirect);
$Header->Class_Terminate();
unset($Header);
$Header1->Class_Terminate();
unset($Header1);
unset($valuteSearch);
unset($valute);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-A52E939A
$Header->Show("Header");
$Header1->Show("Header1");
$valuteSearch->Show();
$valute->Show();
$Footer->Show("Footer");
$Tpl->PParse("main", false);
//End Show Page
//Unload Page @1-1062488C
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
$Header->Class_Terminate();
unset($Header);
$Header1->Class_Terminate();
unset($Header1);
unset($valuteSearch);
unset($valute);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
//End Unload Page
?>
|