'That contact no longer exists.']); exit; } $contact_name = escapeHtml($row['contact_name']); $client_id = intval($row['contact_client_id']); enforceClientAccess(); $choices = credentialRows("credential_client_id = $client_id AND credential_contact_id <> $contact_id"); // Nobody's first, then the ones that would move from someone else uasort($choices, function ($a, $b) { return [empty($a['contact_id']) ? 0 : 1, strtolower($a['credential_name'])] <=> [empty($b['contact_id']) ? 0 : 1, strtolower($b['credential_name'])]; }); ob_start(); ?>