πŸ”Ž : count($animals)])) ?>
species_label($mosaicSpeciesCode),'icon' => '🐾','color' => '#6c757d']; [$mosaicStatusClass,$mosaicStatusLabel] = status_badge((string)($a['status'] ?? '')); [$mosaicSexSymbol,$mosaicSexClass,$mosaicSexLabel] = match((string)($a['sex'] ?? 'U')) { 'M' => ['β™‚','bg-blue-lt text-blue',t('sex.male')],'F' => ['♀','bg-purple-lt text-purple',t('sex.female')],default => ['?','bg-secondary-lt text-secondary',t('sex.unknown')] }; $mosaicFoster = in_array((string)($a['status'] ?? ''), ['fa','fa_permanente'], true) ? $shortContactName($a['foster_contact_name'] ?? null) : ''; $mosaicFreeCat = (string)($a['status'] ?? '') === 'chat_libre' ? trim((string)($a['free_cat_site_name'] ?: $a['free_cat_city'])) : ''; ?>
<?= h(t('animals.photo_of', ['name' => $a['name']])) ?>
species_label($animalSpecies),'icon' => '🐾','color' => '#6c757d']; $isCat = SpeciesService::isCat($animalSpecies); $fiv = $a['fiv'] ?? null; $felv = $a['felv'] ?? null; $fivStatus = (string)(($a['fiv_status'] ?? '') ?: ((int)$fiv === 1 ? 'pos' : 'neg')); $felvStatus = (string)(($a['felv_status'] ?? '') ?: ((int)$felv === 1 ? 'pos' : 'neg')); $shortStatusLabels = ['unknown' => mb_strtolower(t('animals.test_unknown')), 'neg' => mb_strtolower(t('animals.test_negative')), 'pos' => mb_strtolower(t('animals.test_positive')), 'doubtful' => mb_strtolower(t('animals.test_doubtful'))]; $healthLabel = $isCat ? ('FIV ' . ($shortStatusLabels[$fivStatus] ?? mb_strtolower(t('animals.test_unknown'))) . ' Β· FeLV ' . ($shortStatusLabels[$felvStatus] ?? mb_strtolower(t('animals.test_unknown')))) : t('animals.tests_not_applicable'); $testBadgeMeta = [ 'unknown' => ['?', 'bg-secondary-lt', t('animals.test_unknown')], 'neg' => ['βˆ’', 'bg-green-lt', t('animals.test_negative')], 'pos' => ['+', 'bg-red-lt', t('animals.test_positive')], 'doubtful' => ['?', 'bg-yellow-lt', t('animals.test_doubtful')], ]; [$fivSymbol, $fivBadgeClass, $fivBadgeTitle] = $testBadgeMeta[$fivStatus] ?? $testBadgeMeta['unknown']; [$felvSymbol, $felvBadgeClass, $felvBadgeTitle] = $testBadgeMeta[$felvStatus] ?? $testBadgeMeta['unknown']; $ageLabel = 'β€”'; $ageTitle = t('animals.age_unknown'); if (!empty($a['birth_date'])) { try { $birth = new DateTimeImmutable((string)$a['birth_date']); $age = $birth->diff(new DateTimeImmutable('today')); if ($age->y > 0) { $ageLabel = $age->y . ' a'; if ($age->m > 0) { $ageLabel .= ' Β· ' . $age->m . ' m'; } $ageTitle = $age->y . ' an' . ($age->y > 1 ? 's' : ''); if ($age->m > 0) { $ageTitle .= ' et ' . $age->m . ' mois'; } } else { $ageLabel = $age->m . ' m'; $ageTitle = $age->m . ' mois'; } if (!empty($a['birth_is_estimated'])) { $ageLabel = '~ ' . $ageLabel; $ageTitle .= ' (' . t('animals.age_estimated') . ')'; } } catch (Throwable) { $ageLabel = 'β€”'; } } $sexLabel = match ((string)($a['sex'] ?? 'U')) { 'M' => t('sex.male'), 'F' => t('sex.female'), default => t('animals.sex_not_provided'), }; $hairLabel = match ((string)($a['hair_type'] ?? '')) { 'court' => t('animals.short_hair'), 'mi-long' => t('animals.medium_hair'), 'long' => t('animals.long_hair'), 'frise' => t('animals.curly_hair'), 'sans-poil' => t('animals.hairless'), default => t('animals.hair_unknown'), }; $appearance = implode(' Β· ', [ (string)($a['breed'] ?: t('animals.breed_unknown')), (string)($a['color'] ?: t('animals.coat_unknown')), $hairLabel, ]); $weightLabel = t('animals.weight_unknown'); if ($a['last_weight'] !== null) { $trend = 'β†’'; if ($a['prev_weight'] !== null) { if ((float)$a['last_weight'] > (float)$a['prev_weight']) { $trend = '↑'; } elseif ((float)$a['last_weight'] < (float)$a['prev_weight']) { $trend = '↓'; } } $weightLabel = number_format((float)$a['last_weight'], 2, ',', ' ') . ' kg ' . $trend; } $vaccineLabel = !empty($a['next_vaccine_due']) ? (($a['next_vaccine_name'] ?: t('animal.vaccine_booster')) . ' Β· ' . $a['next_vaccine_due']) : t('animals.no_vaccine'); $treatmentLabel = $a['ongoing_treatment_names'] ?: t('animals.no_current_treatment'); $medicalPoint = $a['latest_medical_point'] ?: t('animals.no_recent_medical'); $profileMark = static function (string $value, string $label): string { [$symbol,$class,$state] = match($value) { 'yes' => ['βœ“','life-profile-yes',t('common.yes')], 'no' => ['βœ•','life-profile-no',t('common.no')], default => ['β€”','life-profile-unknown',t('common.unknown')], }; return '' . h($symbol) . ''; }; ?>
Β·
['🐢',t('animals.compatible_dogs')],'compatibility_cats' => ['🐱',t('animals.compatible_cats')],'compatibility_children' => ['πŸ§’',t('animals.compatible_children')],'house_trained' => ['🧼',t('animals.cleanliness')]] as $profileSortKey => $profileHeader): $profileQs = $_GET; $profileQs['sort'] = $profileSortKey; $profileQs['dir'] = ($sort === $profileSortKey && strtoupper($dir) === 'ASC') ? 'desc' : 'asc'; $profileArrow = $sort === $profileSortKey ? (strtoupper($dir) === 'ASC' ? '↑' : '↓') : ''; ?>
['β™‚', 'bg-blue-lt text-blue', t('sex.male')], 'F' => ['♀', 'bg-purple-lt text-purple', t('sex.female')], default => ['?', 'bg-secondary-lt text-secondary', t('sex.unknown')], }; ?> πŸ”—
🌿
FIV FeLV
β€”