Name = 'Dance'; $this->Version = '1.0'; $this->Creator = 'Chronos'; $this->License = 'GNU/GPL'; $this->Description = 'List of dances'; $this->Dependencies = array(); $this->RSSChannels = array(); } function Start(): void { $this->System->RegisterPage(['tance'], 'PageDanceList'); $this->System->RegisterPage(['tanec'], 'PageDance'); $this->System->RegisterPage(['figura'], 'PageDanceFigure'); $this->System->RegisterPage(['figury'], 'PageDanceFigureList'); Core::Cast($this->System)->RegisterMenuItem('/tance', 'Tance'); Core::Cast($this->System)->RegisterMenuItem('/figury', 'Figury'); } } class PageDance extends Page { function __construct($System) { parent::__construct($System); $this->Title = 'Tanec'; } function Show(): string { $Output = ''; if (count($this->System->PathItems) > 1) { $id = $this->System->PathItems[1] * 1; } else return 'Položka nenalezena'; $Output .= '
Tanec
'; $DbResult = $this->Database->select('Dance', '*, (SELECT DanceGroup.Name FROM DanceGroup WHERE DanceGroup.Id=Dance.Group) AS DanceGroupName', 'Id='.$id); if ($DbResult->num_rows > 0) { $DanceItem = $DbResult->fetch_assoc(); $Output .= ''. ''. ''; $Output .= '
Jméno'.$DanceItem['Name'].'
Skupina'.$DanceItem['DanceGroupName'].'
'; } else $Output .= 'Položka nenalezena'; $Output .= '
Taneční figury
'; $Output .= ''; $Output .= ''; $DbResult = $this->Database->select('DanceFigure', '*', '(`Dance`='.$id.')'); while ($DanceFigure = $DbResult->fetch_assoc()) { $Output .= ''. ''. ''. ''; ''; } $Output .= '
Český názevAnglický názevDetail
'.$DanceFigure['NameCz'].''.$DanceFigure['NameEn'].'Ukázat
'; $Output .= '
Výuková videa
'; $Output .= ''; $Output .= ''; $DbResult = $this->Database->select('Resource', '*, (SELECT Name FROM ResourceGroup WHERE ResourceGroup.Id=Resource.Group) AS GroupName', '(`Dance`='.$id.')'); while ($DbRow = $DbResult->fetch_assoc()) { $Output .= ''. ''. ''. ''. ''; } $Output .= '
NázevSkupinaOdkaz
'.$DbRow['Name'].''.$DbRow['GroupName'].''.$DbRow['URL'].'
'; /* $DbResult2 = $this->Database->select('ResourceGroup', '*'); while ($ResourceGroup = $DbResult2->fetch_assoc()) { $Output .= ''.$ResourceGroup['Name'].''; } $DbResult2 = $this->Database->select('ResourceGroup', '*'); while ($ResourceGroup = $DbResult2->fetch_assoc()) { $Output .= ''; while ($Resource = $DbResult3->fetch_assoc()) { $Output .= ''.$Resource['Name'].' '; } $Output .= ''; }*/ return $Output; } } class PageDanceList extends Page { function __construct($System) { parent::__construct($System); $this->Title = 'Tance'; } function Show(): string { $Output = '
Tance
'; $Output .= ''; $Output .= ''; $DbResult = $this->Database->select('Dance', '*, (SELECT Name FROM DanceGroup WHERE DanceGroup.Id=Dance.Group) AS GroupName', '1 ORDER BY `Name`'); while ($Dance = $DbResult->fetch_assoc()) { $Output .= ''. ''. ''. ''; $Output .= ''; } $Output .= '
NázevSkupinaDetail
'.$Dance['Name'].''.$Dance['GroupName'].'Ukázat
'; return $Output; } } class PageDanceFigure extends Page { function __construct($System) { parent::__construct($System); $this->Title = 'Figura'; $this->Description = 'Taneční figura'; } function Show(): string { $Output = ''; if (count($this->System->PathItems) > 1) { $id = $this->System->PathItems[1] * 1; } else return 'Položka nenalezena'; $Output .= '
Taneční figura
'; $DbResult = $this->Database->select('DanceFigure', '*, (SELECT Dance.Name FROM Dance WHERE Dance.Id=DanceFigure.Dance) AS DanceName', 'Id='.$id); if ($DbResult->num_rows > 0) { $DbRow = $DbResult->fetch_assoc(); $Output .= ''. ''. ''. ''; $Output .= '
České jméno'.$DbRow['NameCz'].'
Anglické jméno'.$DbRow['NameEn'].'
Tanec'.$DbRow['DanceName'].'
'; } else $Output .= 'Položka nenalezena'; /*$Output .= '
Videa
'; $Output .= ''; $Output .= ''; $DbResult = $this->Database->select('DanceFigure', '*', '(`Dance`='.$id.')'); while ($DanceFigure = $DbResult->fetch_assoc()) { $Output .= ''. ''. ''. ''; ''; } $Output .= '
Skupina videíDetail
'.$DanceFigure['NameCz'].''.$DanceFigure['NameEn'].'Ukázat
'; */ /* $DbResult2 = $this->Database->select('ResourceGroup', '*'); while ($ResourceGroup = $DbResult2->fetch_assoc()) { $Output .= ''.$ResourceGroup['Name'].''; } $DbResult2 = $this->Database->select('ResourceGroup', '*'); while ($ResourceGroup = $DbResult2->fetch_assoc()) { $Output .= ''; while ($Resource = $DbResult3->fetch_assoc()) { $Output .= ''.$Resource['Name'].' '; } $Output .= ''; }*/ return $Output; } } class PageDanceFigureList extends Page { function __construct($System) { parent::__construct($System); $this->Title = 'Figury'; $this->Description = 'Taneční figury'; } function Show(): string { $Output = '
Taneční figury
'; $Output .= ''; $Output .= ''; $DbResult = $this->Database->select('DanceFigure', '*, (SELECT Dance.Name FROM Dance WHERE Dance.Id=DanceFigure.Dance) AS DanceName', '1 ORDER BY `NameCz`'); while ($DbRow = $DbResult->fetch_assoc()) { $Output .= ''. ''. ''. ''. ''; $Output .= ''; } $Output .= '
NázevSkupinaTanecDetail
'.$DbRow['NameCz'].''.$DbRow['NameEn'].''.$DbRow['DanceName'].'Ukázat
'; return $Output; } }