function getLocaleInfo(id) { switch (id) { case "decimalSeparator": return ','; case "groupSeparator": return ' '; case "roundDigits": return 0; } return ""; } function getLocaleText(id){ switch (id) { case "countryDiffPrefix": return 'V prvom kroku ste zvolii krajinu doručenia: '; case "countryDiffPostfix": return 'Ak má byť adresa doručenia rôzna od afdresy fakturačnej, tak vyplňte adresu doručenia (Chcem aby tovar bol zadaný na inú adresu),'; case "requiredField": return 'Prosím vyplňte'; case "IncorrectStreetFormat": return 'Nezabudli ste vyplniť popisné číslo?'; case "IncorrectEmailFormat": return 'Nesprávny formát emailovej adresy'; case "IncorrectPhoneNumber": return 'Nesprávne telefónne číslo'; } return ""; } var arrayLocaleInfo = "sk|sk|SK|no;Nie;|2|,| |január;február;marec;apríl;máj;jún;júl;august;september;október;november;december|jan;feb;mar;apr;máj;jún;júl;aug;sep;okt;nov;dec|nedeľa;pondelok;utorok;streda;štvrtok;piatok;sobota|ne;po;ut;st;št;pi;so|d.m.yyyy|d. mmmm yyyy|H:nn|H:nn:ss|1||".split("|"); function getLocaleInfo2(id) { switch (id) { case "LanguageAndCountry": return arrayLocaleInfo[0]; case "language": return arrayLocaleInfo[1]; case "country": return arrayLocaleInfo[2]; case "booleanFormat": return arrayLocaleInfo[3]; case "decimalDigits": return arrayLocaleInfo[4]; case "decimalSeparator": return arrayLocaleInfo[5]; case "groupSeparator": return arrayLocaleInfo[6]; case "monthNames": return arrayLocaleInfo[7]; case "monthShortNames": return arrayLocaleInfo[8]; case "weekdayNames": return arrayLocaleInfo[9]; case "weekdayShortNames": return arrayLocaleInfo[10]; case "shortDate": return arrayLocaleInfo[11]; case "longDate": return arrayLocaleInfo[12]; case "shortTime": return arrayLocaleInfo[13]; case "longTime": return arrayLocaleInfo[14]; case "firstWeekDay": return arrayLocaleInfo[15]; case "AMDesignator": return arrayLocaleInfo[16]; case "PMDesignator": return arrayLocaleInfo[17]; } return ""; } //Include Common Files @1-1CEE07CB define("RelativePath", ".."); define("PathToCurrentPage", "/lib/"); define("FileName", "functions.php"); include_once(RelativePath . "/Common.php"); include_once(RelativePath . "/Template.php"); include_once(RelativePath . "/Sorter.php"); include_once(RelativePath . "/Navigator.php"); //End Include Common Files class clsGridshop_tax_categories { //shop_tax_categories class @2-7EB14002 //Variables @2-AC1EDBB9 // Public variables var $ComponentType = "Grid"; var $ComponentName; var $Visible; var $Errors; var $ErrorBlock; var $ds; var $DataSource; var $PageSize; var $IsEmpty; var $ForceIteration = false; var $HasRecord = false; var $SorterName = ""; var $SorterDirection = ""; var $PageNumber; var $RowNumber; var $ControlsVisible = array(); var $CCSEvents = ""; var $CCSEventResult; var $RelativePath = ""; var $Attributes; // Grid Controls var $StaticControls; var $RowControls; //End Variables //Class_Initialize Event @2-018DD720 function clsGridshop_tax_categories($RelativePath, & $Parent) { global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->ComponentName = "shop_tax_categories"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid shop_tax_categories"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clsshop_tax_categoriesDataSource($this); $this->ds = & $this->DataSource; $this->PageSize = CCGetParam($this->ComponentName . "PageSize", ""); if(!is_numeric($this->PageSize) || !strlen($this->PageSize)) $this->PageSize = 10; else $this->PageSize = intval($this->PageSize); if ($this->PageSize > 100) $this->PageSize = 100; if($this->PageSize == 0) $this->Errors->addError("

Form: Grid " . $this->ComponentName . "
Error: (CCS06) Invalid page size.

"); $this->PageNumber = intval(CCGetParam($this->ComponentName . "Page", 1)); if ($this->PageNumber <= 0) $this->PageNumber = 1; $this->tax_categories_id = & new clsControl(ccsLabel, "tax_categories_id", "tax_categories_id", ccsInteger, "", CCGetRequestParam("tax_categories_id", ccsGet, NULL), $this); $this->tax_rate = & new clsControl(ccsLabel, "tax_rate", "tax_rate", ccsFloat, "", CCGetRequestParam("tax_rate", ccsGet, NULL), $this); } //End Class_Initialize Event //Initialize Method @2-90E704C5 function Initialize() { if(!$this->Visible) return; $this->DataSource->PageSize = & $this->PageSize; $this->DataSource->AbsolutePage = & $this->PageNumber; $this->DataSource->SetOrder($this->SorterName, $this->SorterDirection); } //End Initialize Method //Show Method @2-5DB9AEB7 function Show() { $Tpl = CCGetTemplate($this); global $CCSLocales; if(!$this->Visible) return; $this->RowNumber = 0; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this); $this->DataSource->Prepare(); $this->DataSource->Open(); $this->HasRecord = $this->DataSource->has_next_record(); $this->IsEmpty = ! $this->HasRecord; $this->Attributes->Show(); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this); if(!$this->Visible) return; $GridBlock = "Grid " . $this->ComponentName; $ParentPath = $Tpl->block_path; $Tpl->block_path = $ParentPath . "/" . $GridBlock; if (!$this->IsEmpty) { $this->ControlsVisible["tax_categories_id"] = $this->tax_categories_id->Visible; $this->ControlsVisible["tax_rate"] = $this->tax_rate->Visible; while ($this->ForceIteration || (($this->RowNumber < $this->PageSize) && ($this->HasRecord = $this->DataSource->has_next_record()))) { $this->RowNumber++; if ($this->HasRecord) { $this->DataSource->next_record(); $this->DataSource->SetValues(); } $Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row"; $this->tax_categories_id->SetValue($this->DataSource->tax_categories_id->GetValue()); $this->tax_rate->SetValue($this->DataSource->tax_rate->GetValue()); $this->Attributes->SetValue("rowNumber", $this->RowNumber); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->tax_categories_id->Show(); $this->tax_rate->Show(); $Tpl->block_path = $ParentPath . "/" . $GridBlock; $Tpl->parse("Row", true); } } $errors = $this->GetErrors(); if(strlen($errors)) { $Tpl->replaceblock("", $errors); $Tpl->block_path = $ParentPath; return; } $Tpl->parse(); $Tpl->block_path = $ParentPath; $this->DataSource->close(); } //End Show Method //GetErrors Method @2-78FD7702 function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->tax_categories_id->Errors->ToString()); $errors = ComposeStrings($errors, $this->tax_rate->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method } //End shop_tax_categories Class @2-FCB6E20C class clsshop_tax_categoriesDataSource extends clsDBInternetDB { //shop_tax_categoriesDataSource Class @2-6FB277DE //DataSource Variables @2-E0F7697E var $Parent = ""; var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CmdExecution; var $CountSQL; var $wp; // Datasource fields var $tax_categories_id; var $tax_rate; //End DataSource Variables //DataSourceClass_Initialize Event @2-5C83D0A0 function clsshop_tax_categoriesDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid shop_tax_categories"; $this->Initialize(); $this->tax_categories_id = new clsField("tax_categories_id", ccsInteger, ""); $this->tax_rate = new clsField("tax_rate", ccsFloat, ""); } //End DataSourceClass_Initialize Event //SetOrder Method @2-9E1383D1 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, ""); } //End SetOrder Method //Prepare Method @2-14D6CD9D function Prepare() { global $CCSLocales; global $DefaultDateFormat; } //End Prepare Method //Open Method @2-FFD6D1D3 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*)\n\n" . "FROM shop_tax_categories"; $this->SQL = "SELECT * \n\n" . "FROM shop_tax_categories {SQL_Where} {SQL_OrderBy}"; $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent); if ($this->CountSQL) $this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this); else $this->RecordsCount = "CCS not counted"; $this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order))); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent); } //End Open Method //SetValues Method @2-10781CC7 function SetValues() { $this->tax_categories_id->SetDBValue(trim($this->f("tax_categories_id"))); $this->tax_rate->SetDBValue(trim($this->f("tax_rate"))); } //End SetValues Method } //End shop_tax_categoriesDataSource Class @2-FCB6E20C //Initialize Page @1-D823A94E // Variables $FileName = ""; $Redirect = ""; $Tpl = ""; $TemplateFileName = ""; $BlockToParse = ""; $ComponentName = ""; $Attributes = ""; // Events; $CCSEvents = ""; $CCSEventResult = ""; $TemplateSource = ""; $FileName = FileName; $Redirect = ""; $TemplateFileName = "functions.html"; $BlockToParse = "main"; $TemplateEncoding = "UTF-8"; $ContentType = "text/html"; $PathToRoot = "../"; $PathToRootOpt = "../"; $Scripts = "|"; //End Initialize Page //Include events file @1-FAADB170 include_once("./functions_events.php"); //End Include events file //Before Initialize @1-E870CEBC $CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage); //End Before Initialize //Initialize Objects @1-EBA7BA4F $DBInternetDB = new clsDBInternetDB(); $MainPage->Connections["InternetDB"] = & $DBInternetDB; $Attributes = new clsAttributes("page:"); $Attributes->SetValue("pathToRoot", $PathToRoot); $MainPage->Attributes = & $Attributes; // Controls $shop_tax_categories = & new clsGridshop_tax_categories("", $MainPage); $groupSeparator = & new clsControl(ccsLabel, "groupSeparator", "groupSeparator", ccsText, "", CCGetRequestParam("groupSeparator", ccsGet, NULL), $MainPage); $decimalSeparator = & new clsControl(ccsLabel, "decimalSeparator", "decimalSeparator", ccsText, "", CCGetRequestParam("decimalSeparator", ccsGet, NULL), $MainPage); $roundDigits = & new clsControl(ccsLabel, "roundDigits", "roundDigits", ccsText, "", CCGetRequestParam("roundDigits", ccsGet, NULL), $MainPage); $MainPage->shop_tax_categories = & $shop_tax_categories; $MainPage->groupSeparator = & $groupSeparator; $MainPage->decimalSeparator = & $decimalSeparator; $MainPage->roundDigits = & $roundDigits; $shop_tax_categories->Initialize(); $ScriptIncludes = ""; $SList = explode("|", $Scripts); foreach ($SList as $Script) { if ($Script != "") $ScriptIncludes = $ScriptIncludes . "\n"; } $Attributes->SetValue("scriptIncludes", $ScriptIncludes); BindEvents(); $CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage); if ($Charset) { header("Content-Type: " . $ContentType . "; charset=" . $Charset); } else { header("Content-Type: " . $ContentType); } //End Initialize Objects //Initialize HTML Template @1-6AE7B07D $CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage); $Tpl = new clsTemplate($FileEncoding, $TemplateEncoding); if (strlen($TemplateSource)) { $Tpl->LoadTemplateFromStr($TemplateSource, $BlockToParse, "UTF-8"); } else { $Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "UTF-8"); } $Tpl->SetVar("CCS_PathToRoot", $PathToRoot); $Tpl->block_path = "/$BlockToParse"; $CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage); $Attributes->SetValue("pathToRoot", "../"); $Attributes->Show(); //End Initialize HTML Template //Go to destination page @1-6454DC9A if($Redirect) { $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage); $DBInternetDB->close(); header("Location: " . $Redirect); unset($shop_tax_categories); unset($Tpl); exit; } //End Go to destination page //Show Page @1-5320FD9D $shop_tax_categories->Show(); $groupSeparator->Show(); $decimalSeparator->Show(); $roundDigits->Show(); $Tpl->block_path = ""; $Tpl->Parse($BlockToParse, false); if (!isset($main_block)) $main_block = $Tpl->GetVar($BlockToParse); $CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage); if ($CCSEventResult) echo $main_block; //End Show Page //Unload Page @1-96C38039 $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage); $DBInternetDB->close(); unset($shop_tax_categories); unset($Tpl); //End Unload Page