Viewing file: mmsslike_list.php (18.67 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 @18-3DD2EFDC
include_once(RelativePath . "/Header.php");
//End Include Page implementation
//Include Page implementation @34-9090FF7A
include_once(RelativePath . "/Header1.php");
//End Include Page implementation
class clsRecordmmsslikeSearch { //mmsslikeSearch Class @2-3A275CA1
//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-2077B638
function clsRecordmmsslikeSearch()
{
global $FileName;
$this->Visible = true;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record mmsslikeSearch/Error";
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "mmsslikeSearch";
$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_keyword = new clsControl(ccsTextBox, "s_keyword", "s_keyword", ccsText, "", CCGetRequestParam("s_keyword", $Method));
$this->Button_DoSearch = new clsButton("Button_DoSearch");
}
}
//End Class_Initialize Event
//Validate Method @2-C6CEFB72
function Validate()
{
$Validation = true;
$Where = "";
$Validation = ($this->s_keyword->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate");
$Validation = $Validation && ($this->s_keyword->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @2-D6729123
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->s_keyword->Errors->Count());
$errors = ($errors || $this->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @2-0338194D
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 = "mmsslike_list.php";
if($this->Validate()) {
if($this->PressedButton == "Button_DoSearch") {
if(!CCGetEvent($this->Button_DoSearch->CCSEvents, "OnClick")) {
$Redirect = "";
} else {
$Redirect = "mmsslike_list.php" . "?" . CCMergeQueryStrings(CCGetQueryString("Form", Array("Button_DoSearch")));
}
}
} else {
$Redirect = "";
}
}
//End Operation Method
//Show Method @2-69828424
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_keyword->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_keyword->Show();
$this->Button_DoSearch->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
}
//End Show Method
} //End mmsslikeSearch Class @2-FCB6E20C
class clsGridmmsslike { //mmsslike class @6-403EB4DF
//Variables @6-FE6D0ADD
// 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_idmmsslike;
var $Sorter1;
var $Sorter3;
var $Sorter2;
var $Navigator;
//End Variables
//Class_Initialize Event @6-AF2A5282
function clsGridmmsslike()
{
global $FileName;
$this->ComponentName = "mmsslike";
$this->Visible = True;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Grid mmsslike";
$this->ds = new clsmmsslikeDataSource();
$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("mmsslikeOrder", "");
$this->SorterDirection = CCGetParam("mmsslikeDir", "");
$this->idmmsslike = new clsControl(ccsLink, "idmmsslike", "idmmsslike", ccsInteger, "", CCGetRequestParam("idmmsslike", ccsGet));
$this->Image1 = new clsControl(ccsImage, "Image1", "Image1", ccsText, "", CCGetRequestParam("Image1", ccsGet));
$this->Label1 = new clsControl(ccsLabel, "Label1", "Label1", ccsText, "", CCGetRequestParam("Label1", ccsGet));
$this->Label3 = new clsControl(ccsLabel, "Label3", "Label3", ccsText, "", CCGetRequestParam("Label3", ccsGet));
$this->Label2 = new clsControl(ccsLabel, "Label2", "Label2", ccsText, "", CCGetRequestParam("Label2", ccsGet));
$this->Sorter_idmmsslike = new clsSorter($this->ComponentName, "Sorter_idmmsslike", $FileName);
$this->Sorter1 = new clsSorter($this->ComponentName, "Sorter1", $FileName);
$this->Sorter3 = new clsSorter($this->ComponentName, "Sorter3", $FileName);
$this->Sorter2 = new clsSorter($this->ComponentName, "Sorter2", $FileName);
$this->mmsslike_Insert = new clsControl(ccsLink, "mmsslike_Insert", "mmsslike_Insert", ccsText, "", CCGetRequestParam("mmsslike_Insert", ccsGet));
$this->mmsslike_Insert->Parameters = CCGetQueryString("QueryString", Array("idmmsslike", "ccsForm"));
$this->mmsslike_Insert->Page = "mmsslike_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-00A3FF38
function Show()
{
global $Tpl;
if(!$this->Visible) return;
$ShownRecords = 0;
$this->ds->Parameters["urls_keyword"] = CCGetFromGet("s_keyword", "");
$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->idmmsslike->SetValue($this->ds->idmmsslike->GetValue());
$this->idmmsslike->Parameters = CCGetQueryString("QueryString", Array("ccsForm"));
$this->idmmsslike->Parameters = CCAddParam($this->idmmsslike->Parameters, "idmmsslike", $this->ds->f("idmmsslike"));
$this->idmmsslike->Page = "mmsslike_maint.php";
$this->Image1->SetValue($this->ds->Image1->GetValue());
$this->Label1->SetValue($this->ds->Label1->GetValue());
$this->Label3->SetValue($this->ds->Label3->GetValue());
$this->Label2->SetValue($this->ds->Label2->GetValue());
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
$this->idmmsslike->Show();
$this->Image1->Show();
$this->Label1->Show();
$this->Label3->Show();
$this->Label2->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_idmmsslike->Show();
$this->Sorter1->Show();
$this->Sorter3->Show();
$this->Sorter2->Show();
$this->mmsslike_Insert->Show();
$this->Navigator->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->ds->close();
}
//End Show Method
//GetErrors Method @6-3A9C5012
function GetErrors()
{
$errors = "";
$errors .= $this->idmmsslike->Errors->ToString();
$errors .= $this->Image1->Errors->ToString();
$errors .= $this->Label1->Errors->ToString();
$errors .= $this->Label3->Errors->ToString();
$errors .= $this->Label2->Errors->ToString();
$errors .= $this->Errors->ToString();
$errors .= $this->ds->Errors->ToString();
return $errors;
}
//End GetErrors Method
} //End mmsslike Class @6-FCB6E20C
class clsmmsslikeDataSource extends clsDBConnection1 { //mmsslikeDataSource Class @6-9727365E
//DataSource Variables @6-C2DC3328
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $CountSQL;
var $wp;
// Datasource fields
var $idmmsslike;
var $Image1;
var $Label1;
var $Label3;
var $Label2;
//End DataSource Variables
//DataSourceClass_Initialize Event @6-C5C0E228
function clsmmsslikeDataSource()
{
$this->ErrorBlock = "Grid mmsslike";
$this->Initialize();
$this->idmmsslike = new clsField("idmmsslike", ccsInteger, "");
$this->Image1 = new clsField("Image1", ccsText, "");
$this->Label1 = new clsField("Label1", ccsText, "");
$this->Label3 = new clsField("Label3", ccsText, "");
$this->Label2 = new clsField("Label2", ccsText, "");
}
//End DataSourceClass_Initialize Event
//SetOrder Method @6-D267EE0D
function SetOrder($SorterName, $SorterDirection)
{
$this->Order = "";
$this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection,
array("Sorter_idmmsslike" => array("idmmsslike", ""),
"Sorter1" => array("nazivslike", ""),
"Sorter3" => array("naziv_telefona", ""),
"Sorter2" => array("kodslike", "")));
}
//End SetOrder Method
//Prepare Method @6-F7686F1F
function Prepare()
{
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urls_keyword", ccsMemo, "", "", $this->Parameters["urls_keyword"], "", false);
$this->wp->AddParameter("2", "urls_keyword", ccsMemo, "", "", $this->Parameters["urls_keyword"], "", false);
$this->wp->AddParameter("3", "urls_keyword", ccsMemo, "", "", $this->Parameters["urls_keyword"], "", false);
$this->wp->Criterion[1] = $this->wp->Operation(opContains, "nazivslike", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsMemo),false);
$this->wp->Criterion[2] = $this->wp->Operation(opContains, "imefajla", $this->wp->GetDBValue("2"), $this->ToSQL($this->wp->GetDBValue("2"), ccsMemo),false);
$this->wp->Criterion[3] = $this->wp->Operation(opContains, "kodslike", $this->wp->GetDBValue("3"), $this->ToSQL($this->wp->GetDBValue("3"), ccsMemo),false);
$this->Where = $this->wp->opOR(
false, $this->wp->opOR(
false,
$this->wp->Criterion[1],
$this->wp->Criterion[2]),
$this->wp->Criterion[3]);
}
//End Prepare Method
//Open Method @6-5CB8ABC1
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "SELECT COUNT(*) " .
"FROM mmsslike INNER JOIN telefoni ON " .
"mmsslike.idtelefona = telefoni.idtelefona";
$this->SQL = "SELECT * " .
"FROM mmsslike INNER JOIN telefoni ON " .
"mmsslike.idtelefona = telefoni.idtelefona";
$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-A933F5AE
function SetValues()
{
$this->idmmsslike->SetDBValue(trim($this->f("idmmsslike")));
$this->Image1->SetDBValue($this->f("imefajla"));
$this->Label1->SetDBValue($this->f("nazivslike"));
$this->Label3->SetDBValue($this->f("naziv_telefona"));
$this->Label2->SetDBValue($this->f("kodslike"));
}
//End SetValues Method
} //End mmsslikeDataSource Class @6-FCB6E20C
//Include Page implementation @19-58DBA1E3
include_once(RelativePath . "/Footer.php");
//End Include Page implementation
//Initialize Page @1-AC347BA4
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = "mmsslike_list.php";
$Redirect = "";
$TemplateFileName = "mmsslike_list.html";
$BlockToParse = "main";
$TemplateEncoding = "";
$FileEncoding = "";
$PathToRoot = "./";
//End Initialize Page
//Authenticate User @1-DC94A87D
CCSecurityRedirect("1", "");
//End Authenticate User
//Initialize Objects @1-EF512A30
$DBConnection1 = new clsDBConnection1();
// Controls
$Header = new clsHeader("");
$Header->BindEvents();
$Header->Initialize();
$Header1 = new clsHeader1("");
$Header1->BindEvents();
$Header1->Initialize();
$mmsslikeSearch = new clsRecordmmsslikeSearch();
$mmsslike = new clsGridmmsslike();
$Footer = new clsFooter("");
$Footer->BindEvents();
$Footer->Initialize();
$mmsslike->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-C0BB0679
$Header->Operations();
$Header1->Operations();
$mmsslikeSearch->Operation();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-3E85144D
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
header("Location: " . $Redirect);
$Header->Class_Terminate();
unset($Header);
$Header1->Class_Terminate();
unset($Header1);
unset($mmsslikeSearch);
unset($mmsslike);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-222ABD46
$Header->Show("Header");
$Header1->Show("Header1");
$mmsslikeSearch->Show();
$mmsslike->Show();
$Footer->Show("Footer");
$Tpl->PParse("main", false);
//End Show Page
//Unload Page @1-6F9D08C2
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
$DBConnection1->close();
$Header->Class_Terminate();
unset($Header);
$Header1->Class_Terminate();
unset($Header1);
unset($mmsslikeSearch);
unset($mmsslike);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
//End Unload Page
?>
|