[t('statistics.handled'),'teal'],'entries' => [t('statistics.entries'),'green'],'exits' => [t('statistics.exits'),'red'],'adoptions' => [t('statistics.adoptions'),'blue'],'deaths' => [t('statistics.deaths'),'dark'],'births' => [t('statistics.births'),'purple'],'vaccinations' => [t('statistics.vaccinations'),'cyan'],'treatments' => [t('statistics.treatments'),'orange'],'medical_notes' => [t('statistics.medical_notes'),'pink']];
$comparisonLabels = ['handled' => t('statistics.handled'),'entries' => t('statistics.entries'),'exits' => t('statistics.exits'),'adoptions' => t('statistics.adoptions'),'deaths' => t('statistics.deaths'),'births' => t('statistics.births'),'vaccinations' => t('statistics.vaccinations'),'treatments' => t('statistics.treatments_started'),'medical_notes' => t('statistics.medical_notes'),'avg' => t('statistics.avg_adoption_days')];
$intakeTypeLabels = [];
foreach (['unknown','found','owner_surrender','transfer','born_in_care','return','seizure','other'] as $key) {
$intakeTypeLabels[$key] = t('statistics.intake.' . $key);
}
$intakeReasonLabels = [];
foreach (['unknown','stray_found','unwanted_litter','owner_health','owner_death','owner_care_home','allergy','housing','financial','behavior','abandonment','danger','transfer','birth','other'] as $key) {
$intakeReasonLabels[$key] = t('statistics.reason.' . $key);
}
$distributionLabels = ['Femelles' => t('statistics.value.females'),'Mâles' => t('statistics.value.males'),'Inconnu' => t('statistics.value.unknown'),'Non renseigné' => t('statistics.value.not_provided'),'Non renseignée' => t('statistics.value.not_provided_f'),'Moins d’un an' => t('statistics.value.under_year'),'1 à 2 ans' => t('statistics.value.one_two_years'),'3 à 7 ans' => t('statistics.value.three_seven_years'),'8 ans et plus' => t('statistics.value.eight_plus'),'Moins d’un mois' => t('statistics.value.under_month'),'1 à 3 mois' => t('statistics.value.one_three_months'),'3 à 6 mois' => t('statistics.value.three_six_months'),'6 à 12 mois' => t('statistics.value.six_twelve_months'),'Plus d’un an' => t('statistics.value.over_year'),'Chats' => t('statistics.value.cats'),'Chiens' => t('statistics.value.dogs'),'Inconnue' => t('statistics.value.unknown_f'),'Refuge' => t('status.refuge'),'Famille d’accueil' => t('status.fa'),'Accueil permanent' => t('statistics.value.permanent_foster'),'Chats libres suivis' => t('statistics.free_cats'),'Quarantaine' => t('status.quarantaine'),'Infirmerie' => t('status.soin'),'Réservé' => t('status.reserve'),'Site non renseigné' => t('statistics.value.unprovided_site')];
$groups = [
[t('statistics.intake_modes'),$distributions['intakeTypes'],$intakeTypeLabels,'green'],
[t('statistics.intake_reasons'),$distributions['intakeReasons'],$intakeReasonLabels,'orange'],
[t('statistics.colors'),$distributions['colors'],[],'blue'],
[t('statistics.breeds'),$distributions['breeds'],[],'purple'],
[t('statistics.species'),$distributions['species'],[],'cyan'],
[t('statistics.sex'),$distributions['sex'],[],'pink'],
[t('statistics.age_at_entry'),$distributions['ages'],[],'orange'],
[t('statistics.origins'),$distributions['origins'],[],'green','municipality'],
[t('statistics.adoption_delay'),$distributions['stays'],[],'azure'],
[t('statistics.death_causes'),$distributions['deathCauses'],array_combine(array_keys(DeathController::CAUSES), array_map(static fn ($key) => DeathController::causeLabel($key), array_keys(DeathController::CAUSES))),'dark'],
[t('statistics.current_distribution'),$distributions['currentStatus'],[],'teal'],
[t('statistics.free_cat_sites'),$distributions['freeCatSites'] ?? [],[],'green'],
[$allYears ? t('statistics.releases_year') : t('statistics.releases_site'),$distributions['freeCatReleases'] ?? [],[],'lime'],
];
?>
= $municipality !== '' ? t('statistics.city_report', ['city' => $municipality]) : t('statistics.figures') ?>
= $municipality !== '' ? t('statistics.city_help') : t('statistics.help') ?>
= h($municipality) ?> ·
= h($allYears ? t('statistics.all_years') : (string)$year) ?>= h(t('statistics.city_filter_summary', ['count' => (int)$stats['handled']])) ?>= h(t('statistics.filter_applied')) ?>
= h(t('statistics.location_coverage')) ?>= h(t('statistics.location_documented', ['count' => $municipalityCoverage['documented']])) ?>= h(t('statistics.location_inferred', ['count' => $municipalityCoverage['inferred']])) ?>= h(t('statistics.location_born_in_care', ['count' => $municipalityCoverage['born_in_care']])) ?>= h(t('statistics.location_unknown', ['count' => $municipalityCoverage['unknown']])) ?>
= h(t('statistics.location_coverage_help')) ?>
= h(t('statistics.undated_deaths', ['total' => (int)$stats['deaths'],'count' => (int)$undatedDeaths])) ?>
= h(t('statistics.global_memory')) ?>
= h(t('statistics.undated_summary', ['entries' => (int)$undatedHandled,'exits' => (int)$undatedExits,'births' => (int)$undatedBirths,'vaccinations' => (int)$stats['vaccinations'],'vaccinated' => (int)($scopeCounts['vaccinated_animals'] ?? 0),'notes' => (int)$stats['medical_notes'],'medical' => (int)($scopeCounts['medical_animals'] ?? 0)])) ?>
[$label,$color]): ?>
= h($label) ?>
= (int)$stats[$key] ?>
= $allYears ? t('statistics.since_start') : t('statistics.in_year', ['year' => (int)$year]) ?>
= h($label) ?>
= $format === 'money' ? number_format($value / 100, 2, ',', ' ') . ' €' : $value ?>
= h(t('statistics.cost_metric_help')) ?>
= h(t('statistics.by_structure')) ?>
= h(t('statistics.structure_cost_help')) ?>
(int)$r['contact_id'],'year' => $allYears ? 'all' : $year,'municipality' => $municipality]) : null; ?>
= h($r['label']) ?>= h($r['label']) ?>= h(t('statistics.animals_short', ['count' => (int)$r['animals']])) ?>
· = number_format(((int)$r['average_cents']) / 100, 2, ',', ' ') ?> € /
= h(mb_strtolower(t('statistics.animals'))) ?>= number_format($r['total_cents'] / 100, 2, ',', ' ') ?> € = h(t('statistics.no_expense')) ?>
= h(t('statistics.by_category')) ?>
= h(t('statistics.category_cost_help')) ?>
= h(PricingService::categoryLabel($r['label'])) ?>= h(t('statistics.animals_short', ['count' => (int)$r['animals']])) ?>
· = number_format(((int)$r['average_cents']) / 100, 2, ',', ' ') ?> € /
= h(mb_strtolower(t('statistics.animals'))) ?>= number_format($r['total_cents'] / 100, 2, ',', ' ') ?> €
| = h(t('statistics.municipality')) ?> |
= h(t('statistics.cost_scope_animals')) ?> |
= h(t('statistics.expense_animals')) ?> |
= h(t('statistics.total_cost')) ?> |
= h(t('statistics.average_all')) ?> |
= h(t('statistics.average_with_expense')) ?> |
= h(t('statistics.median')) ?> |
$allYears ? 'all' : $year,'municipality' => $row['municipality']]); ?>
| = h($row['municipality']) ?>
|
= (int)$row['animals'] ?> |
= (int)$row['animals_with_expense'] ?> |
= number_format($row['total_cents'] / 100, 2, ',', ' ') ?> € |
= number_format($row['average_all_cents'] / 100, 2, ',', ' ') ?> € |
= number_format($row['average_expense_cents'] / 100, 2, ',', ' ') ?> € |
= number_format($row['median_expense_cents'] / 100, 2, ',', ' ') ?> € |
| = h(t('statistics.cost_no_city')) ?> |
= h(t('statistics.undated_handled', ['count' => (int)$undatedHandled])) ?>
| = h(t('statistics.year')) ?> |
= h(t('statistics.handled')) ?> |
= h(t('statistics.entries')) ?> |
= h(t('statistics.exits')) ?> |
= h(t('statistics.adoptions')) ?> |
= h(t('statistics.deaths')) ?> |
= h(t('statistics.births')) ?> |
$annual): ?>
| = (int)$timelineYear ?> |
= (int)$annual[$key] ?> |
| = h(t('statistics.unknown_date')) ?> |
= (int)$undatedHandled ?> |
— |
| = h(t('grant.indicator')) ?> |
= $year - 1 ?> |
= $year ?> |
= h(t('grant.evolution')) ?> |
$label): $c = $comparison[$key]; ?>
| = h($label) ?> |
= (int)round($c['previous']) ?> |
= (int)round($c['current']) ?> |
= $c['difference'] > 0 ? '+' : '' ?>= (int)round($c['difference']) ?>= $c['percent'] !== null ? ' · ' . ($c['percent'] > 0 ? '+' : '') . number_format($c['percent'], 1, ',', ' ') . ' %' : '' ?>
|
= (int)($health['total'] ?? 0) ?> = h(t('statistics.animals')) ?>
0 ? round($total / $health['total'] * 100) : 0; ?>
= h($label) ?>= (int)$total ?> · = $pct ?> %
= h(t('statistics.free_cat_help')) ?>
= h(t('statistics.profiles')) ?>
= h($allYears ? t('statistics.profiles_help_all') : t('statistics.profiles_help_year', ['year' => (int)$year])) ?>
= h(t('statistics.no_period_data')) ?>
$total): $display = $labels[$label] ?? $distributionLabels[$label] ?? $label;
$width = $maximum > 0 ? max(4, round($total / $maximum * 100)) : 0;
$pct = $sum > 0 ? round($total / $sum * 100) : 0;
$cityUrl = '/statistics?' . http_build_query(['year' => $allYears ? 'all' : $year,'municipality' => $label]); ?>