Viewing file: vrijeme_list.php (18.53 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 @22-3DD2EFDC
include_once(RelativePath . "/Header.php");
//End Include Page implementation
//Include Page implementation @60-9090FF7A
include_once(RelativePath . "/Header1.php");
//End Include Page implementation
class clsRecordvrijemeSearch { //vrijemeSearch Class @2-746F874E
//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-DB1EFAB1
function clsRecordvrijemeSearch()
{
global $FileName;
$this->Visible = true;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record vrijemeSearch/Error";
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "vrijemeSearch";
$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_prognoza = new clsControl(ccsTextBox, "s_prognoza", "s_prognoza", ccsMemo, "", CCGetRequestParam("s_prognoza", $Method));
$this->Button_DoSearch = new clsButton("Button_DoSearch");
}
}
//End Class_Initialize Event
//Validate Method @2-CF5E92C7
function Validate()
{
$Validation = true;
$Where = "";
$Validation = ($this->s_prognoza->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate");
$Validation = $Validation && ($this->s_prognoza->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @2-848A012E
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->s_prognoza->Errors->Count());
$errors = ($errors || $this->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @2-6E99A451
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 = "vrijeme_list.php";
if($this->Validate()) {
if($this->PressedButton == "Button_DoSearch") {
if(!CCGetEvent($this->Button_DoSearch->CCSEvents, "OnClick")) {
$Redirect = "";
} else {
$Redirect = "vrijeme_list.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", Array("Button_DoSearch")));
}
}
} else {
$Redirect = "";
}
}
//End Operation Method
//Show Method @2-662411A5
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_prognoza->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_prognoza->Show();
$this->Button_DoSearch->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
}
//End Show Method
} //End vrijemeSearch Class @2-FCB6E20C
class clsGridvrijeme { //vrijeme class @6-8FA22B58
//Variables @6-871E3E08
// 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_vrijeme_id;
var $Sorter_grad_id;
var $Sorter1;
var $Sorter_temperature;
var $Navigator;
//End Variables
//Class_Initialize Event @6-80D33BA2
function clsGridvrijeme()
{
global $FileName;
$this->ComponentName = "vrijeme";
$this->Visible = True;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid vrijeme";
$this->ds = new clsvrijemeDataSource();
$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("vrijemeOrder", "");
$this->SorterDirection = CCGetParam("vrijemeDir", "");
$this->vrijeme_id = new clsControl(ccsLink, "vrijeme_id", "vrijeme_id", ccsInteger, "", CCGetRequestParam("vrijeme_id", ccsGet));
$this->Image1 = new clsControl(ccsImage, "Image1", "Image1", ccsText, "", CCGetRequestParam("Image1", ccsGet));
$this->grad_id = new clsControl(ccsLink, "grad_id", "grad_id", ccsText, "", CCGetRequestParam("grad_id", ccsGet));
$this->Label1 = new clsControl(ccsLabel, "Label1", "Label1", ccsText, "", CCGetRequestParam("Label1", ccsGet));
$this->temperature = new clsControl(ccsLabel, "temperature", "temperature", ccsFloat, "", CCGetRequestParam("temperature", ccsGet));
$this->Sorter_vrijeme_id = new clsSorter($this->ComponentName, "Sorter_vrijeme_id", $FileName);
$this->Sorter_grad_id = new clsSorter($this->ComponentName, "Sorter_grad_id", $FileName);
$this->Sorter1 = new clsSorter($this->ComponentName, "Sorter1", $FileName);
$this->Sorter_temperature = new clsSorter($this->ComponentName, "Sorter_temperature", $FileName);
$this->vrijeme_Insert = new clsControl(ccsLink, "vrijeme_Insert", "vrijeme_Insert", ccsText, "", CCGetRequestParam("vrijeme_Insert", ccsGet));
$this->vrijeme_Insert->Parameters = CCGetQueryString("QueryString", Array("vrijeme_id", "ccsForm"));
$this->vrijeme_Insert->Page = "vrijeme_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-A703E05D
function Show()
{
global $Tpl;
if(!$this->Visible) return;
$ShownRecords = 0;
$this->ds->Parameters["urls_prognoza"] = CCGetFromGet("s_prognoza", "");
$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->vrijeme_id->SetValue($this->ds->vrijeme_id->GetValue());
$this->vrijeme_id->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
$this->vrijeme_id->Parameters = CCAddParam($this->vrijeme_id->Parameters, "vrijeme_id", $this->ds->f("vrijeme_id"));
$this->vrijeme_id->Page = "vrijeme_maint.php";
$this->Image1->SetValue($this->ds->Image1->GetValue());
$this->grad_id->SetValue($this->ds->grad_id->GetValue());
$this->grad_id->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
$this->grad_id->Parameters = CCAddParam($this->grad_id->Parameters, "vrijeme_id", $this->ds->f("vrijeme_id"));
$this->grad_id->Page = "vrijeme_maint.php";
$this->Label1->SetValue($this->ds->Label1->GetValue());
$this->temperature->SetValue($this->ds->temperature->GetValue());
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
$this->vrijeme_id->Show();
$this->Image1->Show();
$this->grad_id->Show();
$this->Label1->Show();
$this->temperature->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_vrijeme_id->Show();
$this->Sorter_grad_id->Show();
$this->Sorter1->Show();
$this->Sorter_temperature->Show();
$this->vrijeme_Insert->Show();
$this->Navigator->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->ds->close();
}
//End Show Method
//GetErrors Method @6-A003245F
function GetErrors()
{
$errors = "";
$errors .= $this->vrijeme_id->Errors->ToString();
$errors .= $this->Image1->Errors->ToString();
$errors .= $this->grad_id->Errors->ToString();
$errors .= $this->Label1->Errors->ToString();
$errors .= $this->temperature->Errors->ToString();
$errors .= $this->Errors->ToString();
$errors .= $this->ds->Errors->ToString();
return $errors;
}
//End GetErrors Method
} //End vrijeme Class @6-FCB6E20C
class clsvrijemeDataSource extends clsDBConnection1 { //vrijemeDataSource Class @6-4ED10050
//DataSource Variables @6-D74716BF
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $CountSQL;
var $wp;
// Datasource fields
var $vrijeme_id;
var $Image1;
var $grad_id;
var $Label1;
var $temperature;
//End DataSource Variables
//DataSourceClass_Initialize Event @6-02EF62F3
function clsvrijemeDataSource()
{
$this->ErrorBlock = "Grid vrijeme";
$this->Initialize();
$this->vrijeme_id = new clsField("vrijeme_id", ccsInteger, "");
$this->Image1 = new clsField("Image1", ccsText, "");
$this->grad_id = new clsField("grad_id", ccsText, "");
$this->Label1 = new clsField("Label1", ccsText, "");
$this->temperature = new clsField("temperature", ccsFloat, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @6-6D3CE47A
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_vrijeme_id" => array("vrijeme_id", ""),
"Sorter_grad_id" => array("grad_id", ""),
"Sorter1" => array("prognoza", ""),
"Sorter_temperature" => array("temperature", "")));
}
//End SetOrder Method
//Prepare Method @6-13B49E5E
function Prepare()
{
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urls_prognoza", ccsMemo, "", "", $this->Parameters["urls_prognoza"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opContains, "prognoza", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsMemo),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @6-A05DC3CA
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "SELECT COUNT(*) " .
"FROM (vrijeme LEFT JOIN grad ON " .
"vrijeme.grad_id = grad.sity_id) LEFT JOIN slike ON " .
"vrijeme.slikavrijeme = slike.idslike";
$this->SQL = "SELECT vrijeme_id, grad_id, temperature, prognoza, slikavrijeme, grad.*, imefajla " .
"FROM (vrijeme LEFT JOIN grad ON " .
"vrijeme.grad_id = grad.sity_id) LEFT JOIN slike ON " .
"vrijeme.slikavrijeme = slike.idslike";
$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-62B59DEF
function SetValues()
{
$this->vrijeme_id->SetDBValue(trim($this->f("vrijeme_id")));
$this->Image1->SetDBValue($this->f("imefajla"));
$this->grad_id->SetDBValue($this->f("name"));
$this->Label1->SetDBValue($this->f("prognoza"));
$this->temperature->SetDBValue(trim($this->f("temperature")));
}
//End SetValues Method
} //End vrijemeDataSource Class @6-FCB6E20C
//Include Page implementation @23-58DBA1E3
include_once(RelativePath . "/Footer.php");
//End Include Page implementation
//Initialize Page @1-5A0625D1
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = "vrijeme_list.php";
$Redirect = "";
$TemplateFileName = "vrijeme_list.html";
$BlockToParse = "main";
$TemplateEncoding = "";
$FileEncoding = "";
$PathToRoot = "./";
//End Initialize Page
//Authenticate User @1-DC94A87D
CCSecurityRedirect("1", "");
//End Authenticate User
//Initialize Objects @1-84B38AF3
$DBConnection1 = new clsDBConnection1();
// Controls
$Header = new clsHeader("");
$Header->BindEvents();
$Header->Initialize();
$Header1 = new clsHeader1("");
$Header1->BindEvents();
$Header1->Initialize();
$vrijemeSearch = new clsRecordvrijemeSearch();
$vrijeme = new clsGridvrijeme();
$Footer = new clsFooter("");
$Footer->BindEvents();
$Footer->Initialize();
$vrijeme->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-0AA36C9E
$Header->Operations();
$Header1->Operations();
$vrijemeSearch->Operation();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-5C68CA84
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
header("Location: " . $Redirect);
$Header->Class_Terminate();
unset($Header);
$Header1->Class_Terminate();
unset($Header1);
unset($vrijemeSearch);
unset($vrijeme);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-98FCF4E1
$Header->Show("Header");
$Header1->Show("Header1");
$vrijemeSearch->Show();
$vrijeme->Show();
$Footer->Show("Footer");
$Tpl->PParse("main", false);
//End Show Page
//Unload Page @1-FB87A28F
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
$Header->Class_Terminate();
unset($Header);
$Header1->Class_Terminate();
unset($Header1);
unset($vrijemeSearch);
unset($vrijeme);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
//End Unload Page
?>
|