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 .= ''.
'Jméno | '.$DanceItem['Name'].' |
'.
'Skupina | '.$DanceItem['DanceGroupName'].' |
';
$Output .= '
';
} else $Output .= 'Položka nenalezena';
$Output .= '
Taneční figury
';
$Output .= '';
$Output .= 'Český název | Anglický název | Detail |
';
$DbResult = $this->Database->select('DanceFigure', '*', '(`Dance`='.$id.')');
while ($DanceFigure = $DbResult->fetch_assoc())
{
$Output .= ''.
''.$DanceFigure['NameCz'].' | '.
''.$DanceFigure['NameEn'].' | '.
'Ukázat | ';
'
';
}
$Output .= '
';
$Output .= '
Výuková videa
';
$Output .= '';
$Output .= 'Název | Skupina | Odkaz |
';
$DbResult = $this->Database->select('Resource', '*, (SELECT Name FROM ResourceGroup WHERE ResourceGroup.Id=Resource.Group) AS GroupName', '(`Dance`='.$id.')');
while ($DbRow = $DbResult->fetch_assoc())
{
$Output .= ''.
''.$DbRow['Name'].' | '.
''.$DbRow['GroupName'].' | '.
''.$DbRow['URL'].' | '.
'
';
}
$Output .= '
';
/*
$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 .= 'Název | Skupina | Detail |
';
$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 .= ''.
''.$Dance['Name'].' | '.
''.$Dance['GroupName'].' | '.
'Ukázat | ';
$Output .= '
';
}
$Output .= '
';
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 .= ''.
'České jméno | '.$DbRow['NameCz'].' |
'.
'Anglické jméno | '.$DbRow['NameEn'].' |
'.
'Tanec | '.$DbRow['DanceName'].' |
';
$Output .= '
';
} else $Output .= 'Položka nenalezena';
/*$Output .= '
Videa
';
$Output .= '';
$Output .= 'Skupina videí | | Detail |
';
$DbResult = $this->Database->select('DanceFigure', '*', '(`Dance`='.$id.')');
while ($DanceFigure = $DbResult->fetch_assoc())
{
$Output .= ''.
''.$DanceFigure['NameCz'].' | '.
''.$DanceFigure['NameEn'].' | '.
'Ukázat | ';
'
';
}
$Output .= '
';
*/
/*
$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 .= 'Název | Skupina | Tanec | Detail |
';
$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 .= ''.
''.$DbRow['NameCz'].' | '.
''.$DbRow['NameEn'].' | '.
''.$DbRow['DanceName'].' | '.
'Ukázat | ';
$Output .= '
';
}
$Output .= '
';
return $Output;
}
}