'image/jpeg', 'png' => 'image/png', 'webp' => 'image/webp', 'gif' => 'image/gif', default => 'application/octet-stream' }; return "data:$mime;base64," . base64_encode($data); } function labelStatus(string $s): string { return match ($s) { 'refuge' => t('status.refuge'), 'fa' => t('status.fa'), 'fa_permanente' => t('status.fa_permanente'), 'quarantaine' => t('status.quarantaine'), 'soin' => t('status.soin'), 'isolation' => t('status.isolation'), 'hospitalise','hospitalisé' => t('status.hospitalise'), 'reserve','réservé' => t('status.reserve'), 'adopte','adopté' => t('status.adopte'), 'decede','décédé' => t('status.decede'), 'enfui' => t('status.enfui'), default => $s, }; } function fivFelvText(array $a): string { // adapte selon tes colonnes réelles (chez toi ça marche déjà côté liste) $fiv = (string)($a['fiv'] ?? ''); $felv = (string)($a['felv'] ?? ''); if ($fiv === '' && $felv === '') { return t('animals.test_unknown'); } if ($fiv === '0' && $felv === '0') { return t('animals.test_negative'); } if ($fiv === '1' && $felv === '1') { return 'FIV/FELV+'; } if ($fiv === '1') { return 'FIV+'; } if ($felv === '1') { return 'FELV+'; } // fallback : si tu stockes déjà du texte return trim($fiv . ' ' . $felv); } function kindClass(string $k): string { $k = strtolower(trim($k)); return match($k) { 'consult' => 'k-consult', 'contrôle','controle' => 'k-control', 'hospi','hospitalisation' => 'k-hospi', 'chirurgie' => 'k-surgery', 'analyse','analyses' => 'k-lab', 'vaccin' => 'k-vaccine', default => 'k-default' }; } $mainPhotoUri = null; if (!empty($primary_photo)) { $mainPhotoUri = fileToDataUri($photoDir . '/' . $primary_photo); } ?>
|
= h(t('pdf.no_main_photo')) ?>
= h(t('animal.status')) ?> : = h(labelStatus((string)($animal['status'] ?? ''))) ?>
= h(t('animal.species')) ?> : = h(match (strtolower((string)($animal['species'] ?? ''))) {
'cat', 'chat' => t('species.cat'), 'dog', 'chien' => t('species.dog'), 'nac' => t('species.nac'), default => (string)($animal['species'] ?? '')
}) ?>
= h(t('animal.sex')) ?> : = h($animal['sex'] ?? '') ?>
= h(t('animal.birth')) ?> : = h($animal['birth_date'] ?? '') ?>
= h(t('animal.form.identification')) ?> : = h(match((string)($animal['identification_type'] ?? 'unknown')) {
'microchip' => t('animal.microchip'),'tattoo' => t('animal.tattoo'),default => t('common.not_provided')
}) ?>= !empty($animal['chip_id']) ? ' · ' . h($animal['chip_id']) : '' ?>
FIV/FELV : = h(fivFelvText($animal)) ?>
= h(t('pdf.entry')) ?> : = h($animal['intake_date'] ?? '') ?>
= h(t('animal.form.quarantine_exit')) ?> :
= h($animal['quarantine_until'] ?? '') ?>
|
= h(t('pdf.summary')) ?>
= h(t('pdf.last_medical')) ?>
—
= h(substr((string)$last_med['noted_at'], 0, 16)) ?>
• = h($last_med['kind']) ?>
= h(t('pdf.reason')) ?> : = h($last_med['reason']) ?>
= h(t('pdf.weight')) ?> : = h($last_med['weight_kg']) ?> kg
= h(t('pdf.diagnosis')) ?> : = h($last_med['diagnosis']) ?>
= h(t('pdf.plan')) ?> : = h($last_med['plan']) ?>
= h(t('pdf.next_vaccine')) ?>
—
= h($next_vaccine['vaccine_name'] ?? '') ?>
• = h($next_vaccine['due_date'] ?? '') ?>
= h(t('common.notes')) ?>
= nl2br(h($animal['notes'])) ?>
= h(t('pdf.internal_document', ['association' => AppSettings::get('association_name')])) ?>
|
| = h(t('common.date')) ?> | = h(t('animal.form.type')) ?> | = h(t('pdf.content')) ?> | = h(t('pdf.clinic_vet')) ?> |
|---|---|---|---|
| = h(substr((string)$n['noted_at'], 0, 10)) ?> | = h($n['kind'] ?? '') ?> |
= h(t('pdf.reason')) ?>:
= h($n['reason']) ?> = h(t('pdf.weight')) ?>: = h($n['weight_kg']) ?> kg = h(t('pdf.symptoms')) ?>: = nl2br(h($n['symptoms'])) ?> = h(t('pdf.exam')) ?>: = nl2br(h($n['exam'])) ?> = h(t('pdf.diagnosis')) ?>: = nl2br(h($n['diagnosis'])) ?> = h(t('pdf.plan')) ?>: = nl2br(h($n['plan'])) ?>
= h(t('pdf.photos')) ?> :
|
= h($n['clinic_name']) ?> = h($n['vet_name']) ?> |
| = h(t('pdf.state')) ?> | = h(t('pdf.medication')) ?> | = h(t('pdf.start')) ?> | = h(t('pdf.end')) ?> | = h(t('pdf.clinic_vet')) ?> | = h(t('common.notes')) ?> |
|---|---|---|---|---|---|
| = ((int)$t['ongoing'] === 1) ? t('pdf.ongoing') : t('pdf.finished') ?> | = h($t['medication_name'] ?? '') ?> | = h($t['start_date'] ?? '') ?> | = h($t['end_date'] ?? '') ?> |
= h($t['clinic_name']) ?> = h($t['vet_name']) ?> |
= h(t('pdf.route')) ?>:
= h($t['route']) ?> = h(t('pdf.dosage')) ?>: = h($t['dose_text']) ?> = !empty($t['notes']) ? nl2br(h($t['notes'])) : '' ?> |
| = h(t('pdf.vaccine')) ?> | = h(t('pdf.done_on')) ?> | = h(t('pdf.booster')) ?> | = h(t('pdf.clinic_vet')) ?> | = h(t('common.notes')) ?> |
|---|---|---|---|---|
| = h($v['vaccine_name'] ?? '') ?> | = h($v['done_date'] ?? '') ?> | = h($v['due_date'] ?? '') ?> |
= h($v['clinic_name']) ?> = h($v['vet_name']) ?> |
= h(t('pdf.lot')) ?>: = h($v['lot']) ?> = !empty($v['notes']) ? nl2br(h($v['notes'])) : '' ?> |