He '; $cellContent .= ' ' . $displayName . ''; $cellContent .= ' (' . $slots['ports'] . 'x' . $plugName . ')'; $cellContent .= ''; $cellContent .= '
'; if (!empty($slots['cables'])) { usort($slots['cables'], function ($a, $b) { return $a['port_start'] <=> $b['port_start']; }); $lastPort = 0; foreach ($slots['cables'] as $cable) { $freePorts = $cable['port_start'] - $lastPort - 1; if ($freePorts > 0) { $freeWidth = ($freePorts / $slots['ports']) * 100; $cellContent .= '
Ports ' . ($lastPort + 1) . '-' . ($cable['port_start'] - 1) . ' frei
'; } $portCount = $cable['port_end'] - $cable['port_start'] + 1; $cableWidth = ($portCount / $slots['ports']) * 100; $popTitle = htmlspecialchars($cable['cable_name'], ENT_QUOTES); $popContent = 'Ports: ' . $cable['port_start'] . '-' . $cable['port_end']; if (!empty($cable['fiber_start'])) { $popContent .= '
Fasern: ' . $cable['fiber_start'] . '-' . $cable['fiber_end']; } if (!empty($cable['description'])) { $popContent .= '
' . htmlspecialchars($cable['description'], ENT_QUOTES) . '
'; } $narrowClass = ($cableWidth < 12) ? 'narrow' : ''; $cellContent .= '
'; $fontSize = ($cableWidth < 10) ? '10px' : 'inherit'; $cellContent .= '' . $cable['cable_name'] . ""; if (!empty($cable['description'])) { $descVisibilityClass = ($cableWidth <= 20) ? 'hide-if-narrow' : ''; $cellContent .= '' . htmlspecialchars($cable['description'], ENT_QUOTES) . ''; } $rangesVisibilityClass = ($cableWidth <= 5) ? 'hide-if-narrow' : ''; $infoSize = '10px'; $infoGap = '8px'; if ($cableWidth < 8) { $infoSize = '8px'; $infoGap = '1px'; } elseif ($cableWidth < 15) { $infoSize = '9px'; $infoGap = '3px'; } $toolStyle = 'font-size: ' . $infoSize . '; white-space: nowrap;'; $cellContent .= '
'; $cellContent .= 'P: ' . $cable['port_start'] . '-' . $cable['port_end'] . ''; if (!empty($cable['fiber_start'])) { $cellContent .= 'F: ' . $cable['fiber_start'] . '-' . $cable['fiber_end'] . ""; } $cellContent .= '
'; $cellContent .= '
'; $lastPort = $cable['port_end']; } $remainingPorts = $slots['ports'] - $lastPort; if ($remainingPorts > 0) { $remainingWidth = ($remainingPorts / $slots['ports']) * 100; $cellContent .= '
P: ' . ($lastPort + 1) . '-' . $slots['ports'] . ' frei
'; } } else { $cellContent .= 'Ports ' . '1 -' . $slots['ports'] . ' frei'; } $cellContent .= '
'; $slots['modulname'] = $cellContent; $extTextspan = ""; } else if ($slots['type'] == '1') { $slots['modulname'] = ' $slots['device_id']]) . '">' . $displayName . ''; $colorclass = "rack-color-device"; } else if ($slots['type'] == '2') { $colorclass = "rack-color-rpanel"; } else if ($slots['type'] == '3') { $colorclass = "rack-color-infra"; } else if ($slots['type'] == '4') { $colorclass = "rack-color-panel"; } else if ($slots['type'] == '5') { $colorclass = "rack-color-blocked"; } if ($slots['width'] == "12") $width = "85%"; else if ($slots['width'] == "6") $width = "42.5%"; else if ($slots['width'] == "4") $width = "28.33%"; else if ($slots['width'] == "3") $width = "21.25%"; while ($position < $slots['position']) { echo 'frei'; $position++; $calcwidth += $slots['width']; } echo '' . $slots['modulname'] . $extTextspan . ''; $position++; $calcwidth += $slots['width']; } if ($calcwidth < 12) { $remaining_width = 12 - $calcwidth; echo 'frei'; } $blocktd = $modulelenght + $i; } } if ($i >= $blocktd) { echo ' frei'; } ?>