Ignore:
Timestamp:
May 31, 2009, 9:10:43 PM (16 years ago)
Author:
hajdam
Message:

Oprava chybného ID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/is/topologie-gen.php

    r222 r223  
    7070    $this->border[0]=0;
    7171    $mark = array();
     72    $markskip = 0;
    7273
    7374    do {
     
    7576        $query = 'SELECT dev.id AS id FROM NetworkDevice dev WHERE dev.name = "'.$TopHostName.'" LIMIT 0,1';
    7677      } else {
    77         $query = 'SELECT trg.id AS id FROM NetworkDevice dev, NetworkInterface ifc, NetworkLink lnk, NetworkInterface trg WHERE ifc.device = dev.id AND lnk.interface2 = ifc.id AND lnk.interface1 = trg.id AND dev.used=1 AND ';
     78        $query = 'SELECT trg.device AS id FROM NetworkDevice dev, NetworkInterface ifc, NetworkLink lnk, NetworkInterface trg WHERE ifc.device = dev.id AND lnk.interface2 = ifc.id AND lnk.interface1 = trg.id AND dev.used=1 AND ';
    7879        $query .= ' dev.id = '.$parentNode->index.' ORDER BY id';
    79         $query .= ' LIMIT '.count($parentNode->children).',1';
     80        $query .= ' LIMIT '.(count($parentNode->children)+$markskip).',1';
    8081      }
    8182      $DbResult = $Database->query($query);
    8283      $item = $DbResult->fetch_array();
    8384      if ($item) {
    84 //        echo $item['id'].'<br/>';
     85//        echo $item['id'].','.$parentNode->index.','.$level.'<br/>';
    8586//        flush();
    8687        if (!isset($mark[$item['id']])) {
     
    99100          $level++;
    100101          $this->border[$level] = 0;
     102          $markskip = 0;
     103        } else {
     104          $markskip++;
    101105        }
    102106      } else {
     
    104108        $parentNode = $currentNode->parentItem;
    105109        $level--;
     110        $markskip = 0;
    106111      }
    107112    } while($level >= 1);
Note: See TracChangeset for help on using the changeset viewer.