'That asset no longer exists.']); exit; } $asset_name = escapeHtml($row['asset_name']); $client_id = intval($row['asset_client_id']); enforceClientAccess(); $choices = credentialRows("credential_client_id = $client_id AND credential_asset_id <> $asset_id"); // Free ones first, then the ones that would move from another asset uasort($choices, function ($a, $b) { return [empty($a['asset_id']) ? 0 : 1, strtolower($a['credential_name'])] <=> [empty($b['asset_id']) ? 0 : 1, strtolower($b['credential_name'])]; }); ob_start(); ?>