format($format); } catch (\Exception $e) { return $input; } }; $hireDateLabel = $formatDate($hireDate, $localeFormat); $lastLoginLabel = $formatDate((string) ($adminExtras['last_login_at'] ?? ''), $localeFormatTime); $emailVerifiedLabel = $formatDate((string) ($adminExtras['email_verified_at'] ?? ''), $localeFormatTime); $createdLabel = $formatDate((string) ($adminExtras['created'] ?? ''), $localeFormatTime); $modifiedLabel = $formatDate((string) ($adminExtras['modified'] ?? ''), $localeFormatTime); $lastLoginProvider = trim((string) ($adminExtras['last_login_provider'] ?? '')); $isActive = (bool) ($adminExtras['active'] ?? false); $initials = ''; if ($displayName !== '') { $parts = array_filter(array_map('trim', preg_split('/\s+/', $displayName) ?: [])); $chars = ''; foreach ($parts as $part) { if (function_exists('mb_substr')) { $chars .= mb_substr($part, 0, 1); } else { $chars .= substr($part, 0, 1); } } $initials = strtoupper($chars !== '' ? $chars : '?'); } $hasContact = ($email !== '' || $phone !== '' || $mobile !== '' || $shortDial !== ''); $hasAddress = ($address !== '' || $postalCode !== '' || $city !== '' || $region !== '' || $country !== ''); $hasOrganization = (!empty($tenantGroups) || !empty($roleLabels)); ?>