Ignore:
Timestamp:
Apr 6, 2020, 11:17:40 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code format.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigRouterOS/Generators/Netwatch.php

    r835 r873  
    1313
    1414    $DbResult3 = $this->Database->query('SELECT DISTINCT (`DHCP`) FROM `NetworkSubnet` WHERE `Configure` = 1'); // WHERE `Member` = 0');
    15     while($Router = $DbResult3->fetch_assoc())
     15    while ($Router = $DbResult3->fetch_assoc())
    1616    {
    1717      echo($Router['DHCP']."\n");
     
    1919      $Items = array();
    2020      $DbResult = $this->Database->query('SELECT * FROM `NetworkSubnet` WHERE (`Configure` = 1) AND (`DHCP`="'.$Router['DHCP'].'")');
    21       while($Subnet = $DbResult->fetch_assoc())
     21      while ($Subnet = $DbResult->fetch_assoc())
    2222      {
    2323        $I = explode('.', $Subnet['AddressRange']);
     
    2626            ' LEFT JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` WHERE CompareNetworkPrefix(INET_ATON(`LocalIP`), INET_ATON("'.$Subnet['AddressRange'].'"), '.$Subnet['Mask'].')'.
    2727            ' AND (`NetworkDevice`.`Used` = 1) ORDER BY `NetworkInterface`.`LocalIP`');
    28         while($Interface = $DbResult2->fetch_assoc())
     28        while ($Interface = $DbResult2->fetch_assoc())
    2929        {
    3030          $Name = $Interface['DeviceName'];
    31           if($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
     31          if ($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];
    3232          echo($Name.', ');
    3333          $Items[] = array('host' => $Interface['LocalIP'], 'interval' => '00:00:10', 'comment' => $Name);
Note: See TracChangeset for help on using the changeset viewer.