69 lines
10 KiB
PHP
69 lines
10 KiB
PHP
<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
|
||
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
|
||
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
|
||
<?php $component->withName('app-layout'); ?>
|
||
<?php if ($component->shouldRender()): ?>
|
||
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
|
||
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
|
||
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
|
||
<?php endif; ?>
|
||
<?php $component->withAttributes([]); ?>
|
||
<div class="mb-6 flex flex-col gap-4 md:flex-row md:items-end md:justify-between">
|
||
<div><h1 class="text-2xl font-bold text-slate-900">Beranda</h1><p class="mt-1 text-sm text-slate-500">Ringkasan kondisi cattery hari ini.</p></div>
|
||
<div class="flex gap-2"><a href="<?php echo e(route('cats.create')); ?>" class="bg-indigo-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-indigo-700"><i class="fas fa-plus mr-2"></i>Tambah kucing</a><a href="<?php echo e(route('matting.create')); ?>" class="border border-slate-300 bg-white px-4 py-2.5 text-sm font-semibold text-slate-700 hover:bg-slate-50">Catat perkawinan</a></div>
|
||
</div>
|
||
|
||
<div class="grid gap-4 sm:grid-cols-2 xl:grid-cols-4">
|
||
<?php $__currentLoopData = [
|
||
['Total kucing',$stats['total_cats'] ?? 0,'fa-cat','cats.index'],
|
||
['Dalam perawatan',$stats['sick_cats'] ?? 0,'fa-heart-pulse','cats.index'],
|
||
['Pembiakan aktif',$stats['total_mating'] ?? 0,'fa-venus-mars','matting.index'],
|
||
['Anakan tercatat',$stats['total_kittens'] ?? 0,'fa-paw','matting.index']
|
||
]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i=>$card): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||
<a href="<?php echo e($i===1 ? route($card[3],['filter_health'=>'treatment']) : route($card[3])); ?>" class="border border-slate-200 bg-white p-5 hover:border-slate-300">
|
||
<div class="flex items-start justify-between"><div><p class="text-sm text-slate-500"><?php echo e($card[0]); ?></p><p class="mt-2 text-3xl font-bold text-slate-900"><?php echo e($card[1]); ?></p></div><i class="fas <?php echo e($card[2]); ?> mt-1 text-slate-300"></i></div>
|
||
</a>
|
||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||
</div>
|
||
|
||
<div class="mt-6 grid gap-6 xl:grid-cols-3">
|
||
<section class="border border-slate-200 bg-white xl:col-span-2">
|
||
<div class="flex items-center justify-between border-b border-slate-200 px-5 py-4"><div><h2 class="font-semibold text-slate-900">Perkiraan kelahiran</h2><p class="text-xs text-slate-500">Perkawinan aktif dengan perkiraan lahir sekitar 63 hari setelah kawin.</p></div><a href="<?php echo e(route('matting.index')); ?>" class="text-sm font-medium text-indigo-600">Lihat semua</a></div>
|
||
<div class="divide-y divide-slate-100">
|
||
<?php $__empty_1 = true; $__currentLoopData = $upcomingBirths; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mating): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
||
<a href="<?php echo e(route('matting.edit',$mating->id)); ?>" class="grid gap-3 px-5 py-4 hover:bg-slate-50 sm:grid-cols-[1fr_auto] sm:items-center"><div><p class="font-semibold text-slate-800"><?php echo e($mating->dam->nama_kucing ?? 'Betina'); ?> <span class="font-normal text-slate-400">×</span> <?php echo e($mating->sire->nama_kucing ?? 'Jantan'); ?></p><p class="mt-1 text-sm text-slate-500">Perkiraan lahir <?php echo e($mating->edd?->translatedFormat('d M Y')); ?></p></div><span class="text-sm font-semibold <?php echo e($mating->days_to_go <= 2 ? 'text-rose-600' : 'text-slate-600'); ?>"><?php echo e($mating->days_to_go < 0 ? 'Lewat '.abs($mating->days_to_go).' hari' : $mating->days_to_go.' hari lagi'); ?></span></a>
|
||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><div class="px-5 py-10 text-center text-sm text-slate-500">Belum ada perkiraan kelahiran dalam waktu dekat.</div><?php endif; ?>
|
||
</div>
|
||
</section>
|
||
|
||
<section class="border border-slate-200 bg-white">
|
||
<div class="border-b border-slate-200 px-5 py-4"><h2 class="font-semibold text-slate-900">Jadwal yang terlambat</h2><p class="text-xs text-slate-500">Perlu ditindaklanjuti dari data kucing.</p></div>
|
||
<div class="grid grid-cols-2 gap-px bg-slate-200">
|
||
<?php $labels=['vaccine'=>'Vaksin','flea'=>'Obat kutu','deworming'=>'Obat cacing','grooming'=>'Grooming']; ?>
|
||
<?php $__currentLoopData = $overdueAlerts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><a href="<?php echo e($data['url']); ?>" class="bg-white p-4 hover:bg-slate-50"><p class="text-xs text-slate-500"><?php echo e($labels[$key] ?? $key); ?></p><p class="mt-1 text-2xl font-bold <?php echo e($data['count']>0?'text-rose-600':'text-slate-800'); ?>"><?php echo e($data['count']); ?></p></a><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
|
||
<div class="mt-6 grid gap-6 xl:grid-cols-3">
|
||
<section class="border border-slate-200 bg-white xl:col-span-2">
|
||
<div class="border-b border-slate-200 px-5 py-4"><h2 class="font-semibold text-slate-900">Berat badan</h2><p class="text-xs text-slate-500">Data terakhir pada periode yang dipilih.</p></div>
|
||
<div class="grid gap-3 border-b border-slate-100 p-4 sm:grid-cols-3"><div><p class="text-xs text-slate-500">Rata-rata</p><p class="text-lg font-semibold"><?php echo e(number_format($weightSummary['overall'] ?? 0,2)); ?> kg</p></div><div><p class="text-xs text-slate-500">Jantan</p><p class="text-lg font-semibold"><?php echo e(number_format($weightSummary['male'] ?? 0,2)); ?> kg</p></div><div><p class="text-xs text-slate-500">Betina</p><p class="text-lg font-semibold"><?php echo e(number_format($weightSummary['female'] ?? 0,2)); ?> kg</p></div></div>
|
||
<div class="max-h-80 overflow-y-auto divide-y divide-slate-100"><?php $__empty_1 = true; $__currentLoopData = ($individualBeratData ?? collect())->take(12); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><div class="flex items-center justify-between px-5 py-3"><div><p class="text-sm font-medium text-slate-800"><?php echo e($item->nama_kucing); ?></p><p class="text-xs text-slate-500"><?php echo e($item->jenis_kelamin); ?> · <?php echo e($item->usia); ?></p></div><p class="text-sm font-semibold"><?php echo e(number_format($item->berat,2)); ?> kg</p></div><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><div class="p-8 text-center text-sm text-slate-500">Belum ada data berat pada periode ini.</div><?php endif; ?></div>
|
||
</section>
|
||
<div class="space-y-6">
|
||
<section class="border border-slate-200 bg-white"><div class="border-b border-slate-200 px-5 py-4"><h2 class="font-semibold text-slate-900">Stok menipis</h2></div><div class="divide-y divide-slate-100"><?php $__empty_1 = true; $__currentLoopData = ($lowStock ?? collect())->take(5); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><a href="<?php echo e($item->url ?? '#'); ?>" class="flex justify-between px-5 py-3 text-sm hover:bg-slate-50"><span class="truncate pr-4"><?php echo e($item->name); ?></span><span class="font-semibold text-rose-600"><?php echo e((float)$item->qty); ?> <?php echo e($item->unit); ?></span></a><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><div class="p-5 text-sm text-slate-500">Tidak ada stok kritis.</div><?php endif; ?></div></section>
|
||
<section class="border border-slate-200 bg-white"><div class="border-b border-slate-200 px-5 py-4"><h2 class="font-semibold text-slate-900">Mendekati kedaluwarsa</h2></div><div class="divide-y divide-slate-100"><?php $__empty_1 = true; $__currentLoopData = $expiringItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><a href="<?php echo e($item->url ?? '#'); ?>" class="flex items-center justify-between gap-4 px-5 py-3 text-sm hover:bg-slate-50"><div class="min-w-0"><p class="truncate font-medium"><?php echo e($item->name); ?></p><p class="text-xs <?php echo e($item->is_expired?'text-rose-600':'text-amber-600'); ?>"><?php echo e($item->is_expired?'Sudah kedaluwarsa':$item->days_left.' hari lagi'); ?> · <?php echo e($item->formatted_date); ?></p></div><span class="shrink-0 text-xs text-slate-500"><?php echo e((float)$item->qty); ?> <?php echo e($item->unit); ?></span></a><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><div class="p-5 text-sm text-slate-500">Tidak ada peringatan kedaluwarsa.</div><?php endif; ?></div></section>
|
||
</div>
|
||
</div>
|
||
<?php echo $__env->renderComponent(); ?>
|
||
<?php endif; ?>
|
||
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
|
||
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
|
||
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
|
||
<?php endif; ?>
|
||
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
|
||
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
|
||
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
|
||
<?php endif; ?>
|
||
<?php /**PATH /home/u806112658/domains/earrinasia.com/ilycats/resources/views/pages/dashboard/index.blade.php ENDPATH**/ ?>
|