Name = 'Admin'; $this->Version = '1.0'; $this->Creator = 'Chronos'; $this->License = 'GNU/GPL'; $this->Description = 'Admin interface'; $this->Dependencies = array(); } function DoStart(): void { $this->System->RegisterPage(['admin'], 'PageAdmin'); } } class PageAdmin extends Page { function __construct(System $System) { parent::__construct($System); } function Show(): string { if (array_key_exists('Operation', $_GET)) $Operation = $_GET['Operation']; else $Operation = ''; switch ($Operation) { case 'Add': $Output = $this->ShowAdd(); break; case 'Delete': $Output = $this->ShowDelete(); break; case 'Edit': $Output = $this->ShowEdit(); break; case 'RebuildCache': $Output = $this->ShowRebuildCache(); break; default: $Output = $this->ShowNone(); } return $Output; } function ShowNone(): string { $Table = array( 'Header' => array('Název veličiny', 'Operace'), 'Rows' => array(), ); $Result = $this->Database->select('Measure', '*', '1 ORDER BY Description'); while ($Measure = $Result->fetch_array()) { array_push($Table['Rows'], array($Measure['Description'], MakeLink('?Operation=Edit&MeasureId='.$Measure['Id'], 'Editovat').' '.MakeLink('?Operation=Delete&MeasureId='.$Measure['Id'], 'Odstranit').' '.MakeLink('?Operation=RebuildCache&MeasureId='.$Measure['Id'], 'Přestavět cache'))); } $Output = '