Changeset 873 for trunk/Modules/Network/Network.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Network/Network.php
r871 r873 25 25 '<tr><th/><br/>SSID<br/><br/></th>'; 26 26 $ChannelList = array(); 27 if (!array_key_exists('range', $_GET)) $_GET['range'] = 'a';28 if ($_GET['range'] == 'a')27 if (!array_key_exists('range', $_GET)) $_GET['range'] = 'a'; 28 if ($_GET['range'] == 'a') 29 29 { 30 30 $Where = '(Frequency < 5000)'; 31 for ($Freq = 2402; $Freq <= 2482; $Freq = $Freq + 5) $ChannelList[] = $Freq;31 for ($Freq = 2402; $Freq <= 2482; $Freq = $Freq + 5) $ChannelList[] = $Freq; 32 32 } 33 if ($_GET['range'] == 'bc')33 if ($_GET['range'] == 'bc') 34 34 { 35 35 $Where = '(Frequency >= 5000) AND (Frequency <= 5350)'; 36 for ($Freq = 5150; $Freq <= 5350; $Freq = $Freq + 5) $ChannelList[] = $Freq;36 for ($Freq = 5150; $Freq <= 5350; $Freq = $Freq + 5) $ChannelList[] = $Freq; 37 37 } 38 if ($_GET['range'] == 'd')38 if ($_GET['range'] == 'd') 39 39 { 40 40 $Where = '(Frequency >= 5470)'; 41 for ($Freq = 5470; $Freq <= 5725; $Freq = $Freq + 5) $ChannelList[] = $Freq;41 for ($Freq = 5470; $Freq <= 5725; $Freq = $Freq + 5) $ChannelList[] = $Freq; 42 42 } 43 43 44 foreach ($ChannelList as $Frequency)44 foreach ($ChannelList as $Frequency) 45 45 { 46 46 $Output .= '<th><div class="RotatedHeader">'.$Frequency.'<div></th>'; … … 48 48 $Output .= '</tr>'; 49 49 $DbResult = $this->Database->query('SELECT `Frequency` FROM `NetworkInterfaceWireless` WHERE '.$Where.' AND (`Mode`=0) GROUP BY `Frequency`'); 50 while ($DbRow = $DbResult->fetch_assoc())50 while ($DbRow = $DbResult->fetch_assoc()) 51 51 { 52 52 $DbResult2 = $this->Database->query('SELECT * FROM `NetworkInterfaceWireless` WHERE (`Frequency`='.$DbRow['Frequency'].') AND '.$Where); 53 while ($DbRow2 = $DbResult2->fetch_assoc())53 while ($DbRow2 = $DbResult2->fetch_assoc()) 54 54 { 55 55 $LowFrequency = $DbRow['Frequency'] - $DbRow2['ChannelWidth'] / 2 - $DbRow2['ChannelWidthLower']; 56 56 $HighFrequency = $DbRow['Frequency'] + $DbRow2['ChannelWidth'] / 2 + $DbRow2['ChannelWidthUpper']; 57 57 $Output .= '<tr><td>'.$DbRow2['SSID'].'</td>'; 58 foreach ($ChannelList as $Frequency)58 foreach ($ChannelList as $Frequency) 59 59 { 60 if (($DbRow2['Frequency'] == $Frequency)) $Color = '#000000';61 else if (($LowFrequency <= ($Frequency - 2.5)) and ($HighFrequency >= ($Frequency + 2.5))) $Color = '#808080';62 else if (($LowFrequency == $Frequency) or ($HighFrequency == $Frequency)) $Color = '#c0c0c0';60 if (($DbRow2['Frequency'] == $Frequency)) $Color = '#000000'; 61 else if (($LowFrequency <= ($Frequency - 2.5)) and ($HighFrequency >= ($Frequency + 2.5))) $Color = '#808080'; 62 else if (($LowFrequency == $Frequency) or ($HighFrequency == $Frequency)) $Color = '#c0c0c0'; 63 63 else $Color = '#ffffff'; 64 64 $Output .= '<td style="background-color: '.$Color.';"> </td>'; … … 69 69 } 70 70 $Output .= '</table>'; 71 return ($Output);71 return ($Output); 72 72 } 73 73 } … … 81 81 function Show() 82 82 { 83 if (count($this->System->PathItems) > 1)83 if (count($this->System->PathItems) > 1) 84 84 { 85 85 $Output = $this->PageNotFound(); 86 86 } else $Output = $this->ShowInformation(); 87 return ($Output);87 return ($Output); 88 88 } 89 89 90 90 function ShowInformation() 91 91 { 92 if (!$this->System->User->CheckPermission('Network', 'ShowInfo'))93 return ('Nemáte oprávnění');92 if (!$this->System->User->CheckPermission('Network', 'ShowInfo')) 93 return ('Nemáte oprávnění'); 94 94 95 95 $Output = '<a href="'.$this->System->Link('/network/frequency-plan/').'">Frekvenční plán</a><br />'; 96 96 $Output .= '<a href="'.$this->System->Link('/network/subnet/').'">Výpis registrovaných podsítí</a><br />'; 97 97 $Output .= '<a href="'.$this->System->Link('/network/hosts/').'">Registrované zařízení</a><br />'; 98 return ($Output);98 return ($Output); 99 99 } 100 100 } … … 862 862 '(`NetworkInterface`.`LocalIP` != "") AND (`NetworkInterface`.`Enabled`=1)'. 863 863 'ORDER BY `Name` ASC'); 864 if ($DbResult3->num_rows > 0)864 if ($DbResult3->num_rows > 0) 865 865 { 866 866 $Output .= $Title.'<br/>'; 867 867 $Output .= '<table>'. 868 868 '<tr><th align="center">Jméno</th><th align="center">Stav</th><th align="center">Čas</th><th align="center">Trvání</th></tr>'."\n"; 869 while ($Item = $DbResult3->fetch_assoc())869 while ($Item = $DbResult3->fetch_assoc()) 870 870 { 871 871 $Duration = $Time - MysqlDateTimeToTime($Item['LastOnline']); … … 874 874 sprintf('%02d', floor($Duration % 60)); 875 875 $Days = floor($Duration / (60 * 60 * 24)); 876 if ($Days > 0) $DurationText = $Days.' dnů '.$DurationText;876 if ($Days > 0) $DurationText = $Days.' dnů '.$DurationText; 877 877 878 878 $Output .= '<tr><td>'.$Item['Name'].'</td><td>'.$OnlineText[$Item['Online']]. … … 895 895 $Output .= $StillOffline['Report']; 896 896 $Offline = $this->OnlineList('Offline', 0, -1, 0); 897 return (array('Report' => $Output, 'Count' => $Offline['Count'], 'ShortTitle' => 'Odezva'));897 return (array('Report' => $Output, 'Count' => $Offline['Count'], 'ShortTitle' => 'Odezva')); 898 898 } 899 899 … … 918 918 $Output .= '<table>'. 919 919 '<tr><th align="center">Jméno</th><th align="center">Stav</th><th align="center">Čas</th><th align="center">Trvání</th></tr>'."\n"; 920 while ($Item = $DbResult3->fetch_assoc())920 while ($Item = $DbResult3->fetch_assoc()) 921 921 { 922 922 $Duration = $Time - MysqlDateTimeToTime($Item['LastOnline']); … … 925 925 sprintf('%02d', floor($Duration % 60)); 926 926 $Days = floor($Duration / (60 * 60 * 24)); 927 if ($Days > 0) $DurationText = $Days.' dnů '.$DurationText;927 if ($Days > 0) $DurationText = $Days.' dnů '.$DurationText; 928 928 929 929 $Output .= '<tr><td>'.$Item['Name'].'</td><td>'.$OnlineText[$Item['Online']]. … … 947 947 $Output .= $StillOffline['Report']; 948 948 $Offline = $this->PortCheckList('Offline', 0, -1, 0); 949 return (array('Report' => $Output, 'Count' => $Offline['Count'], 'ShortTitle' => 'Port'));949 return (array('Report' => $Output, 'Count' => $Offline['Count'], 'ShortTitle' => 'Port')); 950 950 } 951 951 }
Note:
See TracChangeset
for help on using the changeset viewer.