Changeset 210 for trunk/hostlist.php


Ignore:
Timestamp:
May 6, 2009, 10:17:15 PM (16 years ago)
Author:
george
Message:
  • Přidáno: Nastavení GPS polohy zařízení.
  • Opraveno: Názvy rozhraní. Zobrazení seznamu počítačů.
  • Smazáno: Stará složka mapy s nabídkou map.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hostlist.php

    r208 r210  
    1515    {
    1616      if($Device['Online'] == 1) $Style = 'color: blue;'; else $Style = '';
    17       $Output .= '<tr><td colspan="2" style="text-align: left; font-weight: bold; '.$Style.'">'.$Device['Name'].'</td><td>'.$Device['HostType'].'</td><td style="text-align: right;">'.HumanDate($Device['LastOnline']).'</td><td style="text-align: right;">'.$Device['UserName'].'</td></tr>';
    18       $DbResult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']);
    19       while($Interface = $DbResult2->fetch_assoc())
     17      $DbResult2 = $this->Database->query('SELECT COUNT(*) FROM NetworkInterface WHERE Device = '.$Device['Id']);
     18      $DbRow = $DbResult2->fetch_row();
     19      if($DbRow[0] == 1)
    2020      {
     21        $DbResult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']);
     22        $Interface = $DbResult2->fetch_assoc();
    2123        if($Interface['LocalIP'] == '') $Interface['LocalIP'] = '&nbsp;';
    2224        if($Interface['Online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';
    23         $Output .= '<tr><td style="text-align: left; '.$Style.'">&nbsp;&nbsp;'.$Device['Name'].'-'.$Interface['Name'].'</td><td>'.$Interface['LocalIP'].'</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
    24       }     
    25     }
     25        $InterfaceName = $Device['Name'];
     26        if($Interface['Name'] != '') $InterfaceName .= '-'.$Interface['Name'];
     27        $Output .= '<tr><td style="text-align: left; '.$Style.'">'.$InterfaceName.'</td><td>'.$Interface['LocalIP'].'</td><td>'.$Device['HostType'].'</td><td style="text-align: right;">'.HumanDate($Device['LastOnline']).'</td><td style="text-align: right;">'.$Device['UserName'].'</td></tr>';
     28      } else
     29      {
     30        $Output .= '<tr><td colspan="2" style="text-align: left; font-weight: bold; '.$Style.'">'.$Device['Name'].'</td><td>'.$Device['HostType'].'</td><td style="text-align: right;">'.HumanDate($Device['LastOnline']).'</td><td style="text-align: right;">'.$Device['UserName'].'</td></tr>';
     31        $DbResult2 = $this->Database->query('SELECT * FROM NetworkInterface WHERE Device = '.$Device['Id']);
     32        while($Interface = $DbResult2->fetch_assoc())
     33        {
     34          if($Interface['LocalIP'] == '') $Interface['LocalIP'] = '&nbsp;';
     35          if($Interface['Online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';
     36          $InterfaceName = $Device['Name'];
     37          if($Interface['Name'] != '') $InterfaceName .= '-'.$Interface['Name'];
     38          $Output .= '<tr><td style="text-align: left; '.$Style.'">&nbsp;&nbsp;'.$InterfaceName.'</td><td>'.$Interface['LocalIP'].'</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
     39        }     
     40      }
     41    }
    2642    $Output .= '</table></div>';
    2743    return($Output);
Note: See TracChangeset for help on using the changeset viewer.