Title = 'Registrované počítače'; $this->ParentClass = 'PageNetwork'; } function Show(): string { if (ModuleUser::Cast($this->System->GetModule('User'))->User->User['Id'] == '') return $this->SystemMessage('Nepovolený přístup', 'Nemáte oprávnění pro tuto operaci'); $Output = '
'; $Output .= ''; $DbResult = $this->Database->query('SELECT NetworkDevice.*, NetworkDeviceType.Name AS HostType FROM NetworkDevice '. 'LEFT JOIN NetworkDeviceType ON NetworkDeviceType.Id = NetworkDevice.Type '. 'WHERE NetworkDevice.Used = 1 AND NetworkDevice.Member = (SELECT Customer FROM UserCustomerRel WHERE User='.ModuleUser::Cast($this->System->GetModule('User'))->User->User['Id'].') ORDER BY NetworkDevice.Name'); while ($Device = $DbResult->fetch_assoc()) { if ($Device['Online'] == 1) $Style = 'color: blue;'; else $Style = ''; $Output .= ''; $DbResult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']); while ($Interface = $DbResult2->fetch_assoc()) { if ($Interface['Online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = ''; $InterfaceName = $Device['Name']; if ($Interface['Name'] != '') $InterfaceName .= '-'.$Interface['Name']; $Output .= ''; } } $Output .= '
Jméno počítačeMístní adresaVeřejná adresaFyzická adresaTypNaposledy online
'.$Device['Name'].''.$Device['HostType'].''.HumanDate($Device['LastOnline']).'
  '. $InterfaceName.''.NotBlank($Interface['LocalIP']).''. NotBlank($Interface['ExternalIP']).''. NotBlank($Interface['MAC']).'  
'; return $Output; } }