Ignore:
Timestamp:
May 31, 2014, 1:07:01 AM (10 years ago)
Author:
chronos
Message:
  • Upraveno: Definice třídy Subject přesunuta do samostatného modulu Subject.
  • Přidáno: K Subjektům přidána definice Kontaktů a druhů kontaktů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Network/Network.php

    r657 r661  
    2424        '<strong>Seznam známých AP a obsazení kmitočtových pásem:</strong></div>'.
    2525        '<table class="WideTable">'.
    26         '<tr><th/><br/>SSID<br/><br/></th>'; 
     26        '<tr><th/><br/>SSID<br/><br/></th>';
    2727        $ChannelList = array();
    2828        if(!array_key_exists('range', $_GET)) $_GET['range'] = 'a';
    29         if($_GET['range'] == 'a')       
     29        if($_GET['range'] == 'a')
    3030        {
    3131          $Where = '(Frequency < 5000)';
    3232          for($Freq = 2402; $Freq <= 2482; $Freq = $Freq + 5) $ChannelList[] = $Freq;
    3333        }
    34         if($_GET['range'] == 'bc')       
     34        if($_GET['range'] == 'bc')
    3535        {
    3636          $Where = '(Frequency >= 5000) AND (Frequency <= 5350)';
    3737          for($Freq = 5150; $Freq <= 5350; $Freq = $Freq + 5) $ChannelList[] = $Freq;
    3838        }
    39         if($_GET['range'] == 'd')       
     39        if($_GET['range'] == 'd')
    4040        {
    4141          $Where = '(Frequency >= 5470)';
    4242          for($Freq = 5470; $Freq <= 5725; $Freq = $Freq + 5) $ChannelList[] = $Freq;
    4343        }
    44          
    45         foreach($ChannelList as $Frequency)       
     44
     45        foreach($ChannelList as $Frequency)
    4646        {
    4747          $Output .= '<th><div class="RotatedHeader">'.$Frequency.'<div></th>';
     
    5757            $HighFrequency = $DbRow['Frequency'] + $DbRow2['ChannelWidth'] / 2 + $DbRow2['ChannelWidthUpper'];
    5858            $Output .= '<tr><td>'.$DbRow2['SSID'].'</td>';
    59             foreach($ChannelList as $Frequency)       
     59            foreach($ChannelList as $Frequency)
    6060            {
    6161              if(($DbRow2['Frequency'] == $Frequency)) $Color = '#000000';
    6262                else if(($LowFrequency <= ($Frequency - 2.5)) and ($HighFrequency >= ($Frequency + 2.5))) $Color = '#808080';
    6363                else if(($LowFrequency == $Frequency) or ($HighFrequency == $Frequency)) $Color = '#c0c0c0';
    64                
     64
    6565                else $Color = '#ffffff';
    6666              $Output .= '<td style="background-color: '.$Color.';">&nbsp;</td>';
    6767            }
    6868
    69             $Output .= '</tr>'; 
    70           }         
     69            $Output .= '</tr>';
     70          }
    7171        }
    7272        $Output .= '</table>';
    7373    return($Output);
    74   } 
     74  }
    7575}
    76  
     76
    7777class PageNetwork extends Page
    7878{
     
    8787      $Output = $this->PageNotFound();
    8888    } else $Output = $this->ShowInformation();
    89     return($Output); 
    90   }
    91  
     89    return($Output);
     90  }
     91
    9292  function ShowInformation()
    9393  {
     
    111111    $this->Description = 'Networking related tools';
    112112    $this->Dependencies = array();
    113   } 
     113  }
    114114
    115115  function DoInstall()
    116116  {
    117117  }
    118  
     118
    119119  function DoUninstall()
    120   {     
    121   }
    122  
     120  {
     121  }
     122
    123123  function DoStart()
    124124  {
    125     $this->System->RegisterPage('network', 'PageNetwork');   
     125    $this->System->RegisterPage('network', 'PageNetwork');
    126126    $this->System->RegisterPage(array('network', 'administration'), 'PageNetworkAdministration');
    127127    $this->System->RegisterPage(array('network', 'availability'), 'PageAvailability');
     
    131131    $this->System->RegisterPage(array('network', 'hosts'), 'PageHostList');
    132132    $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
    177134    $this->System->FormManager->RegisterClass('NetworkDomainAlias', array(
    178135      'Title' => 'Alias domény',
     
    263220        'Configure' => array('Type' => 'Boolean', 'Caption' => 'Nastavovat', 'Default' => ''),
    264221      ),
    265     ));   
     222    ));
    266223    $this->System->FormManager->RegisterClass('NetworkLink', array(
    267224      'Title' => 'Síťové propojení',
     
    277234      'Table' => 'NetworkDeviceConfig',
    278235      'DefaultSortColumn' => 'Time',
     236      'DefaultSortOrder' => 1,
    279237      'Items' => array(
    280238        'Device' => array('Type' => 'TNetworkDevice', 'Caption' => 'Zařízení', 'Default' => ''),
     
    312270        'ChannelWidth' => array('Type' => 'Integer', 'Caption' => 'Šírka kanálu', 'Default' => '20', 'Suffix' => 'MHz'),
    313271        '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',
    316275          'SQL' => '(`TxPower` - `CableAttenuation` + `AntenaGain`)', 'ReadOnly' => true),
    317276        'LimitPower' => array('Type' => 'Integer', 'Caption' => 'Max. limit', 'Default' => '', 'Suffix' => 'dBm',
     
    354313      ),
    355314    ));
    356   } 
    357  
     315  }
     316
    358317  function DoStop()
    359   { 
    360   } 
     318  {
     319  }
    361320}
Note: See TracChangeset for help on using the changeset viewer.