ComponentName = "regions"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid regions"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clsregionsDataSource($this); $this->ds = & $this->DataSource; $this->PageSize = 99999; 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->region_url = & new clsControl(ccsLabel, "region_url", "region_url", ccsText, "", CCGetRequestParam("region_url", 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-DEAB0078 function Show() { global $Tpl; 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->SetValue("RowNumber", ""); $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["region_url"] = $this->region_url->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->region_url->SetValue($this->DataSource->region_url->GetValue()); $this->Attributes->SetValue("rowNumber", $this->RowNumber); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->region_url->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-E4063CA3 function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->region_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method } //End regions Class @2-FCB6E20C class clsregionsDataSource extends clsDBbgulfdb { //regionsDataSource Class @2-9756D871 //DataSource Variables @2-CD08FB51 var $Parent = ""; var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CmdExecution; var $CountSQL; var $wp; // Datasource fields var $region_url; //End DataSource Variables //DataSourceClass_Initialize Event @2-F91BA23E function clsregionsDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid regions"; $this->Initialize(); $this->region_url = new clsField("region_url", ccsText, ""); } //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-91C69160 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*) FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . " GROUP BY ref_region.url"; $this->SQL = "SELECT ref_region.url region_url\n" . " FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . " GROUP BY ref_region.url"; $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-85D65339 function SetValues() { $this->region_url->SetDBValue($this->f("region_url")); } //End SetValues Method } //End regionsDataSource Class @2-FCB6E20C class clsGridareas { //areas class @6-B7F0138D //Variables @6-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 @6-FA60BACA function clsGridareas($RelativePath, & $Parent) { global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->ComponentName = "areas"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid areas"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clsareasDataSource($this); $this->ds = & $this->DataSource; $this->PageSize = 99999; 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->region_url = & new clsControl(ccsLabel, "region_url", "region_url", ccsText, "", CCGetRequestParam("region_url", ccsGet, NULL), $this); $this->area_url = & new clsControl(ccsLabel, "area_url", "area_url", ccsText, "", CCGetRequestParam("area_url", ccsGet, NULL), $this); } //End Class_Initialize Event //Initialize Method @6-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 @6-966CF6E4 function Show() { global $Tpl; 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->SetValue("RowNumber", ""); $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["region_url"] = $this->region_url->Visible; $this->ControlsVisible["area_url"] = $this->area_url->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->region_url->SetValue($this->DataSource->region_url->GetValue()); $this->area_url->SetValue($this->DataSource->area_url->GetValue()); $this->Attributes->SetValue("rowNumber", $this->RowNumber); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->region_url->Show(); $this->area_url->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 @6-769B5546 function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->region_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->area_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method } //End areas Class @6-FCB6E20C class clsareasDataSource extends clsDBbgulfdb { //areasDataSource Class @6-A11ED78F //DataSource Variables @6-E634882C var $Parent = ""; var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CmdExecution; var $CountSQL; var $wp; // Datasource fields var $region_url; var $area_url; //End DataSource Variables //DataSourceClass_Initialize Event @6-302B1D46 function clsareasDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid areas"; $this->Initialize(); $this->region_url = new clsField("region_url", ccsText, ""); $this->area_url = new clsField("area_url", ccsText, ""); } //End DataSourceClass_Initialize Event //SetOrder Method @6-9E1383D1 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, ""); } //End SetOrder Method //Prepare Method @6-14D6CD9D function Prepare() { global $CCSLocales; global $DefaultDateFormat; } //End Prepare Method //Open Method @6-44414D5B function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*) FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . " GROUP BY ref_region.url, a.url"; $this->SQL = "SELECT ref_region.url region_url,\n" . " a.url area_url\n" . " FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . " GROUP BY ref_region.url, a.url"; $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 @6-C445C5AD function SetValues() { $this->region_url->SetDBValue($this->f("region_url")); $this->area_url->SetDBValue($this->f("area_url")); } //End SetValues Method } //End areasDataSource Class @6-FCB6E20C class clsGridprojects { //projects class @10-55C24418 //Variables @10-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 @10-24E82097 function clsGridprojects($RelativePath, & $Parent) { global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->ComponentName = "projects"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid projects"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clsprojectsDataSource($this); $this->ds = & $this->DataSource; $this->PageSize = 99999; 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->region_url = & new clsControl(ccsLabel, "region_url", "region_url", ccsText, "", CCGetRequestParam("region_url", ccsGet, NULL), $this); $this->area_url = & new clsControl(ccsLabel, "area_url", "area_url", ccsText, "", CCGetRequestParam("area_url", ccsGet, NULL), $this); $this->project_url = & new clsControl(ccsLabel, "project_url", "project_url", ccsText, "", CCGetRequestParam("project_url", ccsGet, NULL), $this); } //End Class_Initialize Event //Initialize Method @10-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 @10-F750644B function Show() { global $Tpl; 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->SetValue("RowNumber", ""); $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["region_url"] = $this->region_url->Visible; $this->ControlsVisible["area_url"] = $this->area_url->Visible; $this->ControlsVisible["project_url"] = $this->project_url->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->region_url->SetValue($this->DataSource->region_url->GetValue()); $this->area_url->SetValue($this->DataSource->area_url->GetValue()); $this->project_url->SetValue($this->DataSource->project_url->GetValue()); $this->Attributes->SetValue("rowNumber", $this->RowNumber); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->region_url->Show(); $this->area_url->Show(); $this->project_url->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 @10-297E2406 function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->region_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->area_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->project_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method } //End projects Class @10-FCB6E20C class clsprojectsDataSource extends clsDBbgulfdb { //projectsDataSource Class @10-70F40BE1 //DataSource Variables @10-7E8DD6EE var $Parent = ""; var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CmdExecution; var $CountSQL; var $wp; // Datasource fields var $region_url; var $area_url; var $project_url; //End DataSource Variables //DataSourceClass_Initialize Event @10-2DFE0093 function clsprojectsDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid projects"; $this->Initialize(); $this->region_url = new clsField("region_url", ccsText, ""); $this->area_url = new clsField("area_url", ccsText, ""); $this->project_url = new clsField("project_url", ccsText, ""); } //End DataSourceClass_Initialize Event //SetOrder Method @10-9E1383D1 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, ""); } //End SetOrder Method //Prepare Method @10-14D6CD9D function Prepare() { global $CCSLocales; global $DefaultDateFormat; } //End Prepare Method //Open Method @10-E47950F0 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*) FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . " GROUP BY ref_region.url, a.url, p.url"; $this->SQL = "SELECT ref_region.url region_url,\n" . " a.url area_url,\n" . " p.url project_url\n" . " FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . " GROUP BY ref_region.url, a.url, p.url"; $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 @10-007C0C9F function SetValues() { $this->region_url->SetDBValue($this->f("region_url")); $this->area_url->SetDBValue($this->f("area_url")); $this->project_url->SetDBValue($this->f("project_url")); } //End SetValues Method } //End projectsDataSource Class @10-FCB6E20C class clsGridregions_type { //regions_type class @15-CCB63DF4 //Variables @15-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 @15-9BD95485 function clsGridregions_type($RelativePath, & $Parent) { global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->ComponentName = "regions_type"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid regions_type"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clsregions_typeDataSource($this); $this->ds = & $this->DataSource; $this->PageSize = 99999; 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->region_url = & new clsControl(ccsLabel, "region_url", "region_url", ccsText, "", CCGetRequestParam("region_url", ccsGet, NULL), $this); $this->type_url = & new clsControl(ccsLabel, "type_url", "type_url", ccsText, "", CCGetRequestParam("type_url", ccsGet, NULL), $this); } //End Class_Initialize Event //Initialize Method @15-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 @15-A6A3E97F function Show() { global $Tpl; 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->SetValue("RowNumber", ""); $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["region_url"] = $this->region_url->Visible; $this->ControlsVisible["type_url"] = $this->type_url->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->region_url->SetValue($this->DataSource->region_url->GetValue()); $this->type_url->SetValue($this->DataSource->type_url->GetValue()); $this->Attributes->SetValue("rowNumber", $this->RowNumber); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->region_url->Show(); $this->type_url->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 @15-AA8C755A function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->region_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->type_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method } //End regions_type Class @15-FCB6E20C class clsregions_typeDataSource extends clsDBbgulfdb { //regions_typeDataSource Class @15-85C09A60 //DataSource Variables @15-F37E623B var $Parent = ""; var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CmdExecution; var $CountSQL; var $wp; // Datasource fields var $region_url; var $type_url; //End DataSource Variables //DataSourceClass_Initialize Event @15-4D3CA7C3 function clsregions_typeDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid regions_type"; $this->Initialize(); $this->region_url = new clsField("region_url", ccsText, ""); $this->type_url = new clsField("type_url", ccsText, ""); } //End DataSourceClass_Initialize Event //SetOrder Method @15-9E1383D1 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, ""); } //End SetOrder Method //Prepare Method @15-14D6CD9D function Prepare() { global $CCSLocales; global $DefaultDateFormat; } //End Prepare Method //Open Method @15-22BB3160 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*) FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . " GROUP BY ref_region.url, ref_type.url"; $this->SQL = "SELECT ref_region.url region_url,\n" . " ref_type.url type_url \n" . " FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . " GROUP BY ref_region.url, ref_type.url"; $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 @15-56D3F57B function SetValues() { $this->region_url->SetDBValue($this->f("region_url")); $this->type_url->SetDBValue($this->f("type_url")); } //End SetValues Method } //End regions_typeDataSource Class @15-FCB6E20C class clsGridareas_type { //areas_type class @19-DE4C81DF //Variables @19-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 @19-0DAF2FD0 function clsGridareas_type($RelativePath, & $Parent) { global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->ComponentName = "areas_type"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid areas_type"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clsareas_typeDataSource($this); $this->ds = & $this->DataSource; $this->PageSize = 99999; 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->region_url = & new clsControl(ccsLabel, "region_url", "region_url", ccsText, "", CCGetRequestParam("region_url", ccsGet, NULL), $this); $this->area_url = & new clsControl(ccsLabel, "area_url", "area_url", ccsText, "", CCGetRequestParam("area_url", ccsGet, NULL), $this); $this->type_url = & new clsControl(ccsLabel, "type_url", "type_url", ccsText, "", CCGetRequestParam("type_url", ccsGet, NULL), $this); } //End Class_Initialize Event //Initialize Method @19-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 @19-647113CC function Show() { global $Tpl; 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->SetValue("RowNumber", ""); $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["region_url"] = $this->region_url->Visible; $this->ControlsVisible["area_url"] = $this->area_url->Visible; $this->ControlsVisible["type_url"] = $this->type_url->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->region_url->SetValue($this->DataSource->region_url->GetValue()); $this->area_url->SetValue($this->DataSource->area_url->GetValue()); $this->type_url->SetValue($this->DataSource->type_url->GetValue()); $this->Attributes->SetValue("rowNumber", $this->RowNumber); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->region_url->Show(); $this->area_url->Show(); $this->type_url->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 @19-6919B464 function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->region_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->area_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->type_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method } //End areas_type Class @19-FCB6E20C class clsareas_typeDataSource extends clsDBbgulfdb { //areas_typeDataSource Class @19-DD322907 //DataSource Variables @19-C8BF0C39 var $Parent = ""; var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CmdExecution; var $CountSQL; var $wp; // Datasource fields var $region_url; var $area_url; var $type_url; //End DataSource Variables //DataSourceClass_Initialize Event @19-EF24D305 function clsareas_typeDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid areas_type"; $this->Initialize(); $this->region_url = new clsField("region_url", ccsText, ""); $this->area_url = new clsField("area_url", ccsText, ""); $this->type_url = new clsField("type_url", ccsText, ""); } //End DataSourceClass_Initialize Event //SetOrder Method @19-9E1383D1 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, ""); } //End SetOrder Method //Prepare Method @19-14D6CD9D function Prepare() { global $CCSLocales; global $DefaultDateFormat; } //End Prepare Method //Open Method @19-E8157934 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*) FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . " GROUP BY ref_region.url, a.url, ref_type.url"; $this->SQL = "SELECT ref_region.url region_url,\n" . " a.url area_url,\n" . " ref_type.url type_url\n" . " FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . " GROUP BY ref_region.url, a.url, ref_type.url"; $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 @19-A32C27F6 function SetValues() { $this->region_url->SetDBValue($this->f("region_url")); $this->area_url->SetDBValue($this->f("area_url")); $this->type_url->SetDBValue($this->f("type_url")); } //End SetValues Method } //End areas_typeDataSource Class @19-FCB6E20C class clsGridprojects_type { //projects_type class @24-DAD7BE34 //Variables @24-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 @24-C3D613C5 function clsGridprojects_type($RelativePath, & $Parent) { global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->ComponentName = "projects_type"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid projects_type"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clsprojects_typeDataSource($this); $this->ds = & $this->DataSource; $this->PageSize = 99999; 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->region_url = & new clsControl(ccsLabel, "region_url", "region_url", ccsText, "", CCGetRequestParam("region_url", ccsGet, NULL), $this); $this->area_url = & new clsControl(ccsLabel, "area_url", "area_url", ccsText, "", CCGetRequestParam("area_url", ccsGet, NULL), $this); $this->project_url = & new clsControl(ccsLabel, "project_url", "project_url", ccsText, "", CCGetRequestParam("project_url", ccsGet, NULL), $this); $this->type_url = & new clsControl(ccsLabel, "type_url", "type_url", ccsText, "", CCGetRequestParam("type_url", ccsGet, NULL), $this); } //End Class_Initialize Event //Initialize Method @24-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 @24-6A86BCF8 function Show() { global $Tpl; 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->SetValue("RowNumber", ""); $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["region_url"] = $this->region_url->Visible; $this->ControlsVisible["area_url"] = $this->area_url->Visible; $this->ControlsVisible["project_url"] = $this->project_url->Visible; $this->ControlsVisible["type_url"] = $this->type_url->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->region_url->SetValue($this->DataSource->region_url->GetValue()); $this->area_url->SetValue($this->DataSource->area_url->GetValue()); $this->project_url->SetValue($this->DataSource->project_url->GetValue()); $this->type_url->SetValue($this->DataSource->type_url->GetValue()); $this->Attributes->SetValue("rowNumber", $this->RowNumber); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->region_url->Show(); $this->area_url->Show(); $this->project_url->Show(); $this->type_url->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 @24-333AADB1 function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->region_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->area_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->project_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->type_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method } //End projects_type Class @24-FCB6E20C class clsprojects_typeDataSource extends clsDBbgulfdb { //projects_typeDataSource Class @24-ABE44722 //DataSource Variables @24-96F40CC7 var $Parent = ""; var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CmdExecution; var $CountSQL; var $wp; // Datasource fields var $region_url; var $area_url; var $project_url; var $type_url; //End DataSource Variables //DataSourceClass_Initialize Event @24-F3626FB8 function clsprojects_typeDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid projects_type"; $this->Initialize(); $this->region_url = new clsField("region_url", ccsText, ""); $this->area_url = new clsField("area_url", ccsText, ""); $this->project_url = new clsField("project_url", ccsText, ""); $this->type_url = new clsField("type_url", ccsText, ""); } //End DataSourceClass_Initialize Event //SetOrder Method @24-9E1383D1 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, ""); } //End SetOrder Method //Prepare Method @24-14D6CD9D function Prepare() { global $CCSLocales; global $DefaultDateFormat; } //End Prepare Method //Open Method @24-E5AAEE33 function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*) FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . " GROUP BY ref_region.url, a.url, p.url, ref_type.url"; $this->SQL = "SELECT ref_region.url region_url,\n" . " a.url area_url,\n" . " p.url project_url,\n" . " ref_type.url type_url\n" . " FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . " GROUP BY ref_region.url, a.url, p.url, ref_type.url"; $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 @24-A8540535 function SetValues() { $this->region_url->SetDBValue($this->f("region_url")); $this->area_url->SetDBValue($this->f("area_url")); $this->project_url->SetDBValue($this->f("project_url")); $this->type_url->SetDBValue($this->f("type_url")); } //End SetValues Method } //End projects_typeDataSource Class @24-FCB6E20C class clsGridunits { //units class @30-DA9CF7A0 //Variables @30-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 @30-2899773E function clsGridunits($RelativePath, & $Parent) { global $FileName; global $CCSLocales; global $DefaultDateFormat; $this->ComponentName = "units"; $this->Visible = True; $this->Parent = & $Parent; $this->RelativePath = $RelativePath; $this->Errors = new clsErrors(); $this->ErrorBlock = "Grid units"; $this->Attributes = new clsAttributes($this->ComponentName . ":"); $this->DataSource = new clsunitsDataSource($this); $this->ds = & $this->DataSource; $this->PageSize = 99999; 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->region_url = & new clsControl(ccsLabel, "region_url", "region_url", ccsText, "", CCGetRequestParam("region_url", ccsGet, NULL), $this); $this->area_url = & new clsControl(ccsLabel, "area_url", "area_url", ccsText, "", CCGetRequestParam("area_url", ccsGet, NULL), $this); $this->project_url = & new clsControl(ccsLabel, "project_url", "project_url", ccsText, "", CCGetRequestParam("project_url", ccsGet, NULL), $this); $this->type_url = & new clsControl(ccsLabel, "type_url", "type_url", ccsText, "", CCGetRequestParam("type_url", ccsGet, NULL), $this); $this->unit_id = & new clsControl(ccsLabel, "unit_id", "unit_id", ccsText, "", CCGetRequestParam("unit_id", ccsGet, NULL), $this); } //End Class_Initialize Event //Initialize Method @30-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 @30-24F825EE function Show() { global $Tpl; 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->SetValue("RowNumber", ""); $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["region_url"] = $this->region_url->Visible; $this->ControlsVisible["area_url"] = $this->area_url->Visible; $this->ControlsVisible["project_url"] = $this->project_url->Visible; $this->ControlsVisible["type_url"] = $this->type_url->Visible; $this->ControlsVisible["unit_id"] = $this->unit_id->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->region_url->SetValue($this->DataSource->region_url->GetValue()); $this->area_url->SetValue($this->DataSource->area_url->GetValue()); $this->project_url->SetValue($this->DataSource->project_url->GetValue()); $this->type_url->SetValue($this->DataSource->type_url->GetValue()); $this->unit_id->SetValue($this->DataSource->unit_id->GetValue()); $this->Attributes->SetValue("rowNumber", $this->RowNumber); $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this); $this->Attributes->Show(); $this->region_url->Show(); $this->area_url->Show(); $this->project_url->Show(); $this->type_url->Show(); $this->unit_id->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 @30-9BE2D0E7 function GetErrors() { $errors = ""; $errors = ComposeStrings($errors, $this->region_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->area_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->project_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->type_url->Errors->ToString()); $errors = ComposeStrings($errors, $this->unit_id->Errors->ToString()); $errors = ComposeStrings($errors, $this->Errors->ToString()); $errors = ComposeStrings($errors, $this->DataSource->Errors->ToString()); return $errors; } //End GetErrors Method } //End units Class @30-FCB6E20C class clsunitsDataSource extends clsDBbgulfdb { //unitsDataSource Class @30-0484A190 //DataSource Variables @30-FA35818B var $Parent = ""; var $CCSEvents = ""; var $CCSEventResult; var $ErrorBlock; var $CmdExecution; var $CountSQL; var $wp; // Datasource fields var $region_url; var $area_url; var $project_url; var $type_url; var $unit_id; //End DataSource Variables //DataSourceClass_Initialize Event @30-F79A01A7 function clsunitsDataSource(& $Parent) { $this->Parent = & $Parent; $this->ErrorBlock = "Grid units"; $this->Initialize(); $this->region_url = new clsField("region_url", ccsText, ""); $this->area_url = new clsField("area_url", ccsText, ""); $this->project_url = new clsField("project_url", ccsText, ""); $this->type_url = new clsField("type_url", ccsText, ""); $this->unit_id = new clsField("unit_id", ccsText, ""); } //End DataSourceClass_Initialize Event //SetOrder Method @30-9E1383D1 function SetOrder($SorterName, $SorterDirection) { $this->Order = ""; $this->Order = CCGetOrder($this->Order, $SorterName, $SorterDirection, ""); } //End SetOrder Method //Prepare Method @30-14D6CD9D function Prepare() { global $CCSLocales; global $DefaultDateFormat; } //End Prepare Method //Open Method @30-10903D7C function Open() { $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent); $this->CountSQL = "SELECT COUNT(*) FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id"; $this->SQL = "SELECT ref_region.url region_url,\n" . " a.url area_url,\n" . " p.url project_url,\n" . " ref_type.url type_url,\n" . " u.unit_id\n" . " FROM unit u\n" . " INNER JOIN project p\n" . " ON u.ref_project_id = p.project_id\n" . " INNER JOIN area a\n" . " ON p.ref_area_id = a.area_id\n" . " INNER JOIN ref ref_region\n" . " ON ref_region.ref_id = a.ref_region_id\n" . " INNER JOIN ref ref_type\n" . " ON ref_type.ref_id = u.ref_unit_type_id\n" . ""; $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 @30-0482D4F6 function SetValues() { $this->region_url->SetDBValue($this->f("region_url")); $this->area_url->SetDBValue($this->f("area_url")); $this->project_url->SetDBValue($this->f("project_url")); $this->type_url->SetDBValue($this->f("type_url")); $this->unit_id->SetDBValue($this->f("unit_id")); } //End SetValues Method } //End unitsDataSource Class @30-FCB6E20C //Initialize Page @1-9B112049 // Variables $FileName = ""; $Redirect = ""; $Tpl = ""; $TemplateFileName = ""; $BlockToParse = ""; $ComponentName = ""; $Attributes = ""; // Events; $CCSEvents = ""; $CCSEventResult = ""; $FileName = FileName; $Redirect = ""; $TemplateFileName = "sitemap.html"; $BlockToParse = "main"; $TemplateEncoding = "Windows-1252"; $ContentType = "text/html"; $PathToRoot = "./"; //End Initialize Page //Include events file @1-65C1D5A9 include_once("./sitemap_events.php"); //End Include events file //Before Initialize @1-E870CEBC $CCSEventResult = CCGetEvent($CCSEvents, "BeforeInitialize", $MainPage); //End Before Initialize //Initialize Objects @1-0585242E $DBbgulfdb = new clsDBbgulfdb(); $MainPage->Connections["bgulfdb"] = & $DBbgulfdb; $Attributes = new clsAttributes("page:"); $MainPage->Attributes = & $Attributes; // Controls $regions = & new clsGridregions("", $MainPage); $areas = & new clsGridareas("", $MainPage); $projects = & new clsGridprojects("", $MainPage); $regions_type = & new clsGridregions_type("", $MainPage); $areas_type = & new clsGridareas_type("", $MainPage); $projects_type = & new clsGridprojects_type("", $MainPage); $units = & new clsGridunits("", $MainPage); $main = & new clsPanel("main", $MainPage); $MainPage->regions = & $regions; $MainPage->areas = & $areas; $MainPage->projects = & $projects; $MainPage->regions_type = & $regions_type; $MainPage->areas_type = & $areas_type; $MainPage->projects_type = & $projects_type; $MainPage->units = & $units; $MainPage->main = & $main; $regions->Initialize(); $areas->Initialize(); $projects->Initialize(); $regions_type->Initialize(); $areas_type->Initialize(); $projects_type->Initialize(); $units->Initialize(); 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-0B12B3DE $CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage); $Tpl = new clsTemplate($FileEncoding, $TemplateEncoding); $Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "Windows-1252"); $Tpl->block_path = "/$BlockToParse"; $Attributes->SetValue("prefix", 'http://www.bavaria-gulf.com/'); $CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage); $Attributes->SetValue("pathToRoot", ""); $Attributes->Show(); //End Initialize HTML Template //Go to destination page @1-D99629EE if($Redirect) { $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage); $DBbgulfdb->close(); header("Location: " . $Redirect); unset($regions); unset($areas); unset($projects); unset($regions_type); unset($areas_type); unset($projects_type); unset($units); unset($Tpl); exit; } //End Go to destination page //Show Page @1-6BACB93B $regions->Show(); $areas->Show(); $projects->Show(); $regions_type->Show(); $areas_type->Show(); $projects_type->Show(); $units->Show(); $main->Show(); $Tpl->block_path = ""; $Tpl->Parse($BlockToParse, false); if (!isset($main_block)) $main_block = $Tpl->GetVar($BlockToParse); $main_block = CCConvertEncoding($main_block, $FileEncoding, $TemplateEncoding); $CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage); if ($CCSEventResult) echo $main_block; //End Show Page //Unload Page @1-BC9B4BB4 $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage); $DBbgulfdb->close(); unset($regions); unset($areas); unset($projects); unset($regions_type); unset($areas_type); unset($projects_type); unset($units); unset($Tpl); //End Unload Page ?>