143 lines
7.5 KiB
PHP
143 lines
7.5 KiB
PHP
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<title><?php echo e($title); ?></title>
|
||
|
|
<style>
|
||
|
|
body { font-family: 'Helvetica', sans-serif; font-size: 10px; color: #333; margin: 0; }
|
||
|
|
.header { text-align: center; margin-bottom: 30px; border-bottom: 2px solid #4f46e5; padding-bottom: 10px; }
|
||
|
|
.header h1 { margin: 0; color: #1e293b; font-size: 18px; text-transform: uppercase; }
|
||
|
|
.header p { margin: 5px 0; color: #64748b; font-size: 8px; letter-spacing: 2px; }
|
||
|
|
|
||
|
|
.meta-info { margin-bottom: 20px; width: 100%; }
|
||
|
|
.meta-info td { vertical-align: top; }
|
||
|
|
|
||
|
|
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; table-layout: fixed; }
|
||
|
|
th { background-color: #f8fafc; border: 1px solid #e2e8f0; padding: 8px; text-align: left; text-transform: uppercase; color: #475569; font-size: 8px; }
|
||
|
|
td { border: 1px solid #e2e8f0; padding: 8px; vertical-align: top; word-wrap: break-word; }
|
||
|
|
|
||
|
|
/* Status Colors */
|
||
|
|
.badge { padding: 3px 6px; border-radius: 4px; font-weight: bold; font-size: 7px; text-transform: uppercase; }
|
||
|
|
.bg-red { background-color: #fee2e2; color: #991b1b; }
|
||
|
|
.bg-amber { background-color: #fef3c7; color: #92400e; }
|
||
|
|
.bg-green { background-color: #d1fae5; color: #065f46; }
|
||
|
|
.bg-slate { background-color: #f1f5f9; color: #475569; }
|
||
|
|
|
||
|
|
.footer { position: fixed; bottom: 0; width: 100%; text-align: center; font-size: 8px; color: #94a3b8; border-top: 1px solid #e2e8f0; padding-top: 5px; }
|
||
|
|
</style>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
|
||
|
|
<div class="header">
|
||
|
|
<h1>ILY CATTERY - INTELLIGENCE REPORT</h1>
|
||
|
|
<p>MODUL: <?php echo e(strtoupper($module)); ?> | UNIT ANALYTICS SYSTEM</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<table class="meta-info">
|
||
|
|
<tr>
|
||
|
|
<td width="50%">
|
||
|
|
<strong>Dicetak Oleh:</strong> <?php echo e(Auth::user()->name); ?><br>
|
||
|
|
<strong>Tanggal Cetak:</strong> <?php echo e(now()->translatedFormat('d F Y H:i')); ?>
|
||
|
|
|
||
|
|
</td>
|
||
|
|
<td width="50%" style="text-align: right;">
|
||
|
|
<strong>Total Data:</strong> <?php echo e(count($data)); ?> Records<br>
|
||
|
|
<strong>Status Laporan:</strong> <?php echo e(strtoupper($title)); ?>
|
||
|
|
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
|
||
|
|
<table>
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<th width="30px">No</th>
|
||
|
|
|
||
|
|
<?php if($module == 'cats'): ?>
|
||
|
|
<th>Nama Kucing</th><th>Ras</th><th>Kelamin</th><th>Tgl Lahir</th><th>Status</th>
|
||
|
|
<?php elseif(in_array($module, ['vaccine', 'deworming', 'flea', 'grooming'])): ?>
|
||
|
|
<th>Nama Kucing</th><th>Tindakan</th><th>PIC Staf</th><th>Jadwal</th><th>Status Analitik</th>
|
||
|
|
<?php elseif(in_array($module, ['medicine', 'food', 'supplies'])): ?>
|
||
|
|
<th>Nama Produk</th><th>Stok</th><th>Unit</th><th>Tgl Expired</th><th>Kondisi</th>
|
||
|
|
<?php else: ?>
|
||
|
|
<th>Informasi Utama</th><th>Detail</th><th>PIC</th><th>Tanggal</th><th>Status</th>
|
||
|
|
<?php endif; ?>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|
||
|
|
<?php $__empty_1 = true; $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
||
|
|
<?php
|
||
|
|
// Deteksi Kolom Tanggal
|
||
|
|
$dateCol = match($module) {
|
||
|
|
'cats' => 'tanggal_lahir',
|
||
|
|
'vaccine' => 'jadwal_vaksin',
|
||
|
|
'deworming' => 'jadwal_obat_cacing',
|
||
|
|
'flea' => 'jadwal_obat_kutu',
|
||
|
|
'grooming' => 'jadwal_grooming',
|
||
|
|
'medicine', 'food' => 'expired_date',
|
||
|
|
default => 'created_at'
|
||
|
|
};
|
||
|
|
$dateVal = $item->{$dateCol};
|
||
|
|
?>
|
||
|
|
<tr>
|
||
|
|
<td style="text-align: center;"><?php echo e($index + 1); ?></td>
|
||
|
|
|
||
|
|
|
||
|
|
<?php if($module == 'cats'): ?>
|
||
|
|
<td><strong><?php echo e($item->nama_kucing); ?></strong></td>
|
||
|
|
<td><?php echo e($item->ras); ?></td>
|
||
|
|
<td><?php echo e($item->jenis_kelamin); ?></td>
|
||
|
|
<td><?php echo e($item->tanggal_lahir ? \Carbon\Carbon::parse($item->tanggal_lahir)->format('d/m/Y') : '-'); ?></td>
|
||
|
|
<td>
|
||
|
|
<span class="badge <?php echo e($item->riwayat_sakit_terakhir ? 'bg-amber' : 'bg-green'); ?>">
|
||
|
|
<?php echo e($item->riwayat_sakit_terakhir ? 'In Treatment' : 'Healthy'); ?>
|
||
|
|
|
||
|
|
</span>
|
||
|
|
</td>
|
||
|
|
|
||
|
|
<?php elseif(in_array($module, ['vaccine', 'deworming', 'flea', 'grooming'])): ?>
|
||
|
|
<td><strong><?php echo e($item->nama_kucing); ?></strong></td>
|
||
|
|
<td><?php echo e(strtoupper($module)); ?></td>
|
||
|
|
<td><?php echo e($item->pic->name ?? '-'); ?></td>
|
||
|
|
<td><?php echo e($dateVal ? \Carbon\Carbon::parse($dateVal)->format('d/m/Y') : 'NOT SET'); ?></td>
|
||
|
|
<td>
|
||
|
|
<?php if(empty($dateVal)): ?>
|
||
|
|
<span class="badge bg-slate">Date Not Set</span>
|
||
|
|
<?php elseif(\Carbon\Carbon::parse($dateVal)->isPast()): ?>
|
||
|
|
<span class="badge bg-red">Overdue</span>
|
||
|
|
<?php elseif(\Carbon\Carbon::parse($dateVal)->diffInDays(now()) <= 7): ?>
|
||
|
|
<span class="badge bg-amber">Soon</span>
|
||
|
|
<?php else: ?>
|
||
|
|
<span class="badge bg-green">Safe</span>
|
||
|
|
<?php endif; ?>
|
||
|
|
</td>
|
||
|
|
|
||
|
|
<?php elseif(in_array($module, ['medicine', 'food', 'supplies'])): ?>
|
||
|
|
<td><strong><?php echo e($item->nama_obat ?? $item->nama_makanan ?? $item->nama_perlengkapan); ?></strong></td>
|
||
|
|
<td><?php echo e($item->qty); ?></td>
|
||
|
|
<td><?php echo e($item->unit); ?></td>
|
||
|
|
<td><?php echo e($item->expired_date ? \Carbon\Carbon::parse($item->expired_date)->format('d/m/Y') : '-'); ?></td>
|
||
|
|
<td>
|
||
|
|
<?php if($item->qty < 5): ?>
|
||
|
|
<span class="badge bg-red">Low Stock</span>
|
||
|
|
<?php elseif($item->expired_date && \Carbon\Carbon::parse($item->expired_date)->isPast()): ?>
|
||
|
|
<span class="badge bg-red">Expired</span>
|
||
|
|
<?php else: ?>
|
||
|
|
<span class="badge bg-green">Ready</span>
|
||
|
|
<?php endif; ?>
|
||
|
|
</td>
|
||
|
|
<?php endif; ?>
|
||
|
|
</tr>
|
||
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
||
|
|
<tr>
|
||
|
|
<td colspan="6" style="text-align: center; padding: 20px;">Data Tidak Ditemukan</td>
|
||
|
|
</tr>
|
||
|
|
<?php endif; ?>
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
|
||
|
|
<div class="footer">
|
||
|
|
Ily Cattery Intelligence System - Dokumen Sah Dihasilkan Secara Otomatis
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</body>
|
||
|
|
</html><?php /**PATH /home/u806112658/domains/earrinasia.com/ilycats/resources/views/pages/reports/pdf_template.blade.php ENDPATH**/ ?>
|