Changeset 661 for trunk/Modules/Network/Network.php
- Timestamp:
- May 31, 2014, 1:07:01 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Network/Network.php
r657 r661 24 24 '<strong>Seznam známých AP a obsazení kmitočtových pásem:</strong></div>'. 25 25 '<table class="WideTable">'. 26 '<tr><th/><br/>SSID<br/><br/></th>'; 26 '<tr><th/><br/>SSID<br/><br/></th>'; 27 27 $ChannelList = array(); 28 28 if(!array_key_exists('range', $_GET)) $_GET['range'] = 'a'; 29 if($_GET['range'] == 'a') 29 if($_GET['range'] == 'a') 30 30 { 31 31 $Where = '(Frequency < 5000)'; 32 32 for($Freq = 2402; $Freq <= 2482; $Freq = $Freq + 5) $ChannelList[] = $Freq; 33 33 } 34 if($_GET['range'] == 'bc') 34 if($_GET['range'] == 'bc') 35 35 { 36 36 $Where = '(Frequency >= 5000) AND (Frequency <= 5350)'; 37 37 for($Freq = 5150; $Freq <= 5350; $Freq = $Freq + 5) $ChannelList[] = $Freq; 38 38 } 39 if($_GET['range'] == 'd') 39 if($_GET['range'] == 'd') 40 40 { 41 41 $Where = '(Frequency >= 5470)'; 42 42 for($Freq = 5470; $Freq <= 5725; $Freq = $Freq + 5) $ChannelList[] = $Freq; 43 43 } 44 45 foreach($ChannelList as $Frequency) 44 45 foreach($ChannelList as $Frequency) 46 46 { 47 47 $Output .= '<th><div class="RotatedHeader">'.$Frequency.'<div></th>'; … … 57 57 $HighFrequency = $DbRow['Frequency'] + $DbRow2['ChannelWidth'] / 2 + $DbRow2['ChannelWidthUpper']; 58 58 $Output .= '<tr><td>'.$DbRow2['SSID'].'</td>'; 59 foreach($ChannelList as $Frequency) 59 foreach($ChannelList as $Frequency) 60 60 { 61 61 if(($DbRow2['Frequency'] == $Frequency)) $Color = '#000000'; 62 62 else if(($LowFrequency <= ($Frequency - 2.5)) and ($HighFrequency >= ($Frequency + 2.5))) $Color = '#808080'; 63 63 else if(($LowFrequency == $Frequency) or ($HighFrequency == $Frequency)) $Color = '#c0c0c0'; 64 64 65 65 else $Color = '#ffffff'; 66 66 $Output .= '<td style="background-color: '.$Color.';"> </td>'; 67 67 } 68 68 69 $Output .= '</tr>'; 70 } 69 $Output .= '</tr>'; 70 } 71 71 } 72 72 $Output .= '</table>'; 73 73 return($Output); 74 } 74 } 75 75 } 76 76 77 77 class PageNetwork extends Page 78 78 { … … 87 87 $Output = $this->PageNotFound(); 88 88 } else $Output = $this->ShowInformation(); 89 return($Output); 90 } 91 89 return($Output); 90 } 91 92 92 function ShowInformation() 93 93 { … … 111 111 $this->Description = 'Networking related tools'; 112 112 $this->Dependencies = array(); 113 } 113 } 114 114 115 115 function DoInstall() 116 116 { 117 117 } 118 118 119 119 function DoUninstall() 120 { 121 } 122 120 { 121 } 122 123 123 function DoStart() 124 124 { 125 $this->System->RegisterPage('network', 'PageNetwork'); 125 $this->System->RegisterPage('network', 'PageNetwork'); 126 126 $this->System->RegisterPage(array('network', 'administration'), 'PageNetworkAdministration'); 127 127 $this->System->RegisterPage(array('network', 'availability'), 'PageAvailability'); … … 131 131 $this->System->RegisterPage(array('network', 'hosts'), 'PageHostList'); 132 132 $this->System->RegisterPage(array('network', 'frequency-plan'), 'PageFrequencyPlan'); 133 134 $this->System->FormManager->RegisterClass('Subject', array( 135 'Title' => 'Subjekty', 136 'Table' => 'Subject', 137 'DefaultSortColumn' => 'Name', 138 'Items' => array( 139 'Id' => array('Type' => 'Integer', 'Caption' => 'Identifikace', 'Default' => '', 'ReadOnly' => true), 140 'Name' => array('Type' => 'String', 'Caption' => 'Celé jméno', 'Default' => ''), 141 'AddressStreet' => array('Type' => 'String', 'Caption' => 'Ulice', 'Default' => ''), 142 'AddressTown' => array('Type' => 'String', 'Caption' => 'Město', 'Default' => ''), 143 'AddressPSC' => array('Type' => 'String', 'Caption' => 'PSČ', 'Default' => ''), 144 'AddressCountry' => array('Type' => 'TCountry', 'Caption' => 'Země', 'Default' => ''), 145 'IC' => array('Type' => 'String', 'Caption' => 'IČ', 'Default' => ''), 146 'DIC' => array('Type' => 'String', 'Caption' => 'DIČ', 'Default' => ''), 147 'MapPosition' => array('Type' => 'TMapPosition', 'Caption' => 'Pozice na mapě', 'Default' => '', 'Null' => true), 148 'WWW' => array('Type' => 'Hyperlink', 'Caption' => 'WWW', 'Default' => ''), 149 'Note' => array('Type' => 'String', 'Caption' => 'Poznámka', 'Default' => ''), 150 'Customer' => array('Type' => 'TMemberListSubject', 'Caption' => 'Členové', 'Default' => ''), 151 'Operations' => array('Type' => 'TFinanceOperationListSubject', 'Caption' => 'Platby', 'Default' => ''), 152 'Invoices' => array('Type' => 'TFinanceInvoiceListSubject', 'Caption' => 'Faktury', 'Default' => ''), 153 'Payment' => array('Type' => 'Float', 'Caption' => 'Placení', 'Default' => '', 154 'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => '(SELECT SUM(`FinanceOperation`.`Value`) FROM `FinanceOperation` '. 155 'WHERE `FinanceOperation`.`Subject`=#Id) - (SELECT SUM(`FinanceInvoice`.`Value`) FROM `FinanceInvoice` '. 156 'WHERE `FinanceInvoice`.`Subject`=#Id)'), 157 ), 158 )); 159 $this->System->FormManager->RegisterClass('SubjectReport', array( 160 'Title' => 'Přehled subjektů', 161 'Table' => 'SubjectReport', 162 'DefaultSortColumn' => 'Id', 163 'SQL' => '(SELECT Id FROM Subject)', 164 'Items' => array( 165 'Id' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => '', 'ReadOnly' => true), 166 'Income' => array('Type' => 'Integer', 'Caption' => 'Příjmy', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 167 'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Subject` = TX.`Id`) '. 168 'AND (`FinanceOperation`.`Value` > 0))'), 169 'Spending' => array('Type' => 'Integer', 'Caption' => 'Výdaje', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 170 'SQL' => '(SELECT -ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Subject` = TX.`Id`) '. 171 'AND (`FinanceOperation`.`Value` < 0))'), 172 'OperationBalance' => array('Type' => 'Integer', 'Caption' => 'Zisk', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 173 'SQL' => '(SELECT ROUND(SUM(`FinanceOperation`.`Value`)) FROM `FinanceOperation` WHERE (`FinanceOperation`.`Subject` = TX.`Id`) '. 174 ')'), 175 ), 176 )); 133 177 134 $this->System->FormManager->RegisterClass('NetworkDomainAlias', array( 178 135 'Title' => 'Alias domény', … … 263 220 'Configure' => array('Type' => 'Boolean', 'Caption' => 'Nastavovat', 'Default' => ''), 264 221 ), 265 )); 222 )); 266 223 $this->System->FormManager->RegisterClass('NetworkLink', array( 267 224 'Title' => 'Síťové propojení', … … 277 234 'Table' => 'NetworkDeviceConfig', 278 235 'DefaultSortColumn' => 'Time', 236 'DefaultSortOrder' => 1, 279 237 'Items' => array( 280 238 'Device' => array('Type' => 'TNetworkDevice', 'Caption' => 'Zařízení', 'Default' => ''), … … 312 270 'ChannelWidth' => array('Type' => 'Integer', 'Caption' => 'Šírka kanálu', 'Default' => '20', 'Suffix' => 'MHz'), 313 271 'ChannelWidthUpper' => array('Type' => 'Integer', 'Caption' => 'Šírka kanálu horního', 'Default' => '0', 'Suffix' => 'MHz'), 314 'Mode' => array('Type' => 'TWirelessMode', 'Caption' => 'Režim', 'Default' => '0', 'Suffix' => ''), 315 'TotalPower' => array('Type' => 'Integer', 'Caption' => 'Celkový výkon', 'Default' => '20', 'Suffix' => 'dBm', 272 'Mode' => array('Type' 273 => 'TWirelessMode', 'Caption' => 'Režim', 'Default' => '0', 'Suffix' => ''), 274 'TotalPower' => array('Type' => 'Integer', 'Caption' => 'Celkový výkon', 'Default' => '20', 'Suffix' => 'dBm', 316 275 'SQL' => '(`TxPower` - `CableAttenuation` + `AntenaGain`)', 'ReadOnly' => true), 317 276 'LimitPower' => array('Type' => 'Integer', 'Caption' => 'Max. limit', 'Default' => '', 'Suffix' => 'dBm', … … 354 313 ), 355 314 )); 356 } 357 315 } 316 358 317 function DoStop() 359 { 360 } 318 { 319 } 361 320 }
Note:
See TracChangeset
for help on using the changeset viewer.