'That rack no longer exists.']); exit; } $rack_name = escapeHtml($row['rack_name']); $rack_units = intval($row['rack_units']); $client_id = intval($row['rack_client_id']); enforceClientAccess(); // A new item. Clicking an empty U on the rack page passes where it was. $unit_id = 0; $unit_asset_id = 0; $unit_device = ''; $unit_type = 'Device'; $unit_start = min($rack_units, max(0, intval($_GET['u'] ?? 0))); $unit_height = 1; $unit_face = ($_GET['face'] ?? '') === 'rear' ? 'rear' : 'front'; $unit_full_depth = 1; $unit_power_watts = 0; $unit_notes = ''; // "Rack it" on the rack page, or an asset dragged onto it, passes the asset - start from what that kind of kit usually is $unit_asset_id = intval($_GET['asset_id'] ?? 0); if ($unit_asset_id) { $preset = rackAssetDefaults(getFieldById('assets', $unit_asset_id, 'asset_type')); $unit_height = $preset['height']; $unit_full_depth = $preset['full_depth']; } ob_start(); ?>