Files
ilycats/resources/views/pages/reports/matting/pdf.blade.php
T
2026-02-08 15:16:35 +07:00

137 lines
6.6 KiB
PHP

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
@page { margin: 0.8cm; }
body { font-family: 'Helvetica', sans-serif; font-size: 9px; color: #334155; line-height: 1.4; }
/* Header Section */
.header { text-align: center; border-bottom: 3px double #4f46e5; padding-bottom: 10px; margin-bottom: 20px; }
.header h1 { margin: 0; font-size: 18px; color: #1e293b; text-transform: uppercase; letter-spacing: 2px; }
.header p { margin: 5px 0 0; color: #64748b; font-weight: bold; letter-spacing: 1px; }
/* Meta Info Section */
.meta { width: 100%; margin-bottom: 15px; }
.meta td { padding: 2px 0; font-weight: bold; font-size: 8px; color: #475569; }
/* Table Styling */
table { width: 100%; border-collapse: collapse; margin-top: 10px; table-layout: fixed; }
th { background: #f8fafc; border: 1px solid #e2e8f0; padding: 8px 4px; text-transform: uppercase; font-size: 7px; color: #64748b; text-align: center; }
td { border: 1px solid #e2e8f0; padding: 6px 4px; word-wrap: break-word; vertical-align: middle; }
/* Branding Colors */
.row-sire { background-color: #f5f7ff; } /* Light Indigo */
.row-dam { background-color: #fff9fa; } /* Light Rose */
.text-sire { color: #4f46e5; font-weight: bold; }
.text-dam { color: #e11d48; font-weight: bold; }
.badge { padding: 2px 5px; border-radius: 4px; font-size: 7px; font-weight: bold; color: white; display: inline-block; }
.bg-indigo { background-color: #4f46e5; }
.bg-rose { background-color: #e11d48; }
.italic-slate { font-style: italic; color: #94a3b8; font-size: 7px; }
</style>
</head>
<body>
<div class="header">
<h1>ILY CATTERY - STRATEGIC BREEDING REPORT</h1>
<p>PARENTAL LINEAGE & ANALYTICS REPORT</p>
</div>
<table class="meta">
<tr>
<td width="50%">DICETAK OLEH: {{ strtoupper(Auth::user()->name) }}</td>
<td width="50%" style="text-align: right">PERIODE LAPORAN: {{ now()->translatedFormat('d F Y') }}</td>
</tr>
<tr>
<td>TOTAL DATA: {{ count($data) }} RECORDS</td>
<td style="text-align: right">SISTEM: ILYCATS MANAGEMENT UNIT</td>
</tr>
</table>
<table>
<thead>
<tr>
<th width="15%">Nama Indukan (♂/♀)</th>
<th width="12%">Silsilah (Sire x Dam)</th>
<th width="10%">Registry</th>
<th width="10%">EMS Code</th>
<th width="18%">No. Pedigree</th>
<th width="15%">Microchip</th>
<th width="10%">Tgl Kawin</th>
<th width="10%">Status</th>
</tr>
</thead>
<tbody>
@foreach($data as $item)
{{-- Baris Bapak (Sire) --}}
<tr class="row-sire">
<td class="text-sire">
♂ {{ strtoupper($item->sire->nama_kucing ?? 'N/A') }}
<div class="italic-slate">{{ $item->sire->ras ?? '-' }}</div>
</td>
<td style="text-align: center; font-weight: bold; font-size: 7px;">SIRE UNIT</td>
{{-- Registry: Menampilkan Asosiasi (ICA/CFA/WCF) --}}
<td style="text-align: center">
{{ is_array($item->sire->registry) ? implode(', ', $item->sire->registry) : ($item->sire->registry ?? '-') }}
</td>
{{-- EMS Code: Diambil dari kolom kode_ems di tabel cats --}}
<td style="text-align: center" class="text-sire">
{{ $item->sire->kode_ems ?? '-' }}
</td>
{{-- No Pedigree: Diambil dari kolom pedigree di tabel cats --}}
<td style="text-align: center">
{{ $item->sire->pedigree ?? 'NON PEDIGREE' }}
</td>
{{-- Microchip: Diambil dari kolom microchip di tabel cats --}}
<td style="text-align: center">
{{ $item->sire->microchip ?? '-' }}
</td>
{{-- Tgl Kawin: Rowspan untuk menggabung baris bapak & ibu --}}
<td rowspan="2" style="text-align: center; font-weight: bold;">
{{ \Carbon\Carbon::parse($item->tgl_kawin_awal)->format('d/m/Y') }}
</td>
<td style="text-align: center">
<span class="badge bg-indigo">{{ strtoupper($item->sire->status ?? 'BREEDING') }}</span>
</td>
</tr>
{{-- Baris Ibu (Dam) --}}
<tr class="row-dam">
<td class="text-dam">
♀ {{ strtoupper($item->dam->nama_kucing ?? 'N/A') }}
<div class="italic-slate">{{ $item->dam->ras ?? '-' }}</div>
</td>
<td style="text-align: center; font-size: 7px; color: #64748b;">
Mated with {{ $item->sire->nama_kucing ?? 'Sire' }}
</td>
<td style="text-align: center">
{{ is_array($item->dam->registry) ? implode(', ', $item->dam->registry) : ($item->dam->registry ?? '-') }}
</td>
{{-- EMS Code Ibu --}}
<td style="text-align: center" class="text-dam">
{{ $item->dam->kode_ems ?? '-' }}
</td>
{{-- No Pedigree Ibu --}}
<td style="text-align: center">
{{ $item->dam->pedigree ?? 'NON PEDIGREE' }}
</td>
{{-- Microchip Ibu --}}
<td style="text-align: center">
{{ $item->dam->microchip ?? '-' }}
</td>
{{-- Tgl Kawin di-rowspan dari baris sire di atas --}}
<td style="text-align: center">
<span class="badge bg-rose">{{ strtoupper($item->dam->status ?? 'BREEDING') }}</span>
</td>
</tr>
{{-- Separator Row --}}
<tr><td colspan="8" style="border:none; height: 8px; background: white;"></td></tr>
@endforeach
</tbody>
</table>
<div style="margin-top: 30px; font-size: 7px; text-align: center; color: #94a3b8;">
Laporan ini dihasilkan secara otomatis oleh IlyCats Management System. Segala data silsilah telah diverifikasi sesuai standar Registry (ICA/CFA/WCF).
</div>
</body>
</html>