33 lines
6.3 KiB
PHP
33 lines
6.3 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 sm:flex-row sm:items-end sm:justify-between"><div><h1 class="text-2xl font-bold text-slate-900">Perkawinan & pembiakan</h1><p class="mt-1 text-sm text-slate-500">Riwayat pasangan induk, periode kawin, perkiraan kelahiran, dan data anakan.</p></div><?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('check-access',['matting','create'])): ?><a href="<?php echo e(route('matting.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>Catat perkawinan</a><?php endif; ?></div>
|
||
<div class="mb-4 border border-slate-200 bg-white p-4"><p class="text-xs text-slate-500">Total riwayat pembiakan</p><p class="mt-1 text-2xl font-bold text-slate-900"><?php echo e($mattings->total()); ?></p></div>
|
||
<section class="border border-slate-200 bg-white"><div class="overflow-x-auto"><table class="min-w-full divide-y divide-slate-200 text-sm"><thead class="bg-slate-50 text-left text-xs font-semibold text-slate-500"><tr><th class="px-4 py-3">Pasangan induk</th><th class="px-4 py-3">Periode kawin</th><th class="px-4 py-3">Perkiraan lahir</th><th class="px-4 py-3">Status & anakan</th><th class="px-4 py-3 text-right">Aksi</th></tr></thead><tbody class="divide-y divide-slate-100">
|
||
<?php $__empty_1 = true; $__currentLoopData = $mattings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $m): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
||
<?php $edd=$m->tgl_kawin_awal?->copy()->addDays(63); $days=$edd ? (int)now()->startOfDay()->diffInDays($edd->copy()->startOfDay(),false) : null; ?>
|
||
<tr class="hover:bg-slate-50"><td class="px-4 py-4"><div class="flex items-center gap-3"><div class="flex -space-x-2"><?php $__currentLoopData = [$m->sire,$m->dam]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parent): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><img src="<?php echo e($parent?->foto_url ?? asset('images/default-cat.png')); ?>" class="h-10 w-10 rounded-full border-2 border-white object-cover" alt=""><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div><div><p class="font-semibold text-slate-900"><?php echo e($m->sire->nama_kucing ?? '-'); ?> × <?php echo e($m->dam->nama_kucing ?? '-'); ?></p><p class="mt-1 text-xs text-slate-500">EMS <?php echo e($m->sire->kode_ems ?? '-'); ?> × <?php echo e($m->dam->kode_ems ?? '-'); ?></p></div></div></td>
|
||
<td class="px-4 py-4"><p class="text-slate-700"><?php echo e($m->tgl_kawin_awal?->format('d-m-Y') ?? '-'); ?><?php echo e($m->tgl_kawin_akhir ? ' s.d. '.$m->tgl_kawin_akhir->format('d-m-Y') : ''); ?></p><?php if($m->tgl_kawin_awal && $m->tgl_kawin_akhir): ?><p class="mt-1 text-xs text-slate-500"><?php echo e($m->tgl_kawin_awal->diffInDays($m->tgl_kawin_akhir)+1); ?> hari</p><?php endif; ?></td>
|
||
<td class="px-4 py-4"><?php if($edd): ?><p class="font-medium text-slate-800"><?php echo e($edd->format('d-m-Y')); ?></p><p class="mt-1 text-xs <?php echo e($days!==null && $days<=7 && $days>=0?'text-rose-600':'text-slate-500'); ?>"><?php echo e($days<0?'Lewat '.abs($days).' hari':($days===0?'Perkiraan hari ini':$days.' hari lagi')); ?></p><?php else: ?><span class="text-slate-400">-</span><?php endif; ?></td>
|
||
<td class="px-4 py-4"><p class="font-medium <?php echo e($m->status==='berhasil'?'text-emerald-700':($m->status==='gagal'?'text-rose-600':'text-indigo-700')); ?>"><?php echo e($m->status==='proses'?'Dalam proses':ucfirst($m->status)); ?></p><p class="mt-1 text-xs text-slate-500"><?php echo e($m->kittens_count); ?> anakan tercatat</p></td>
|
||
<td class="px-4 py-4"><div class="flex justify-end gap-1"><?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('check-access',['matting','update'])): ?><a href="<?php echo e(route('matting.edit',$m)); ?>" class="p-2 text-slate-500 hover:bg-slate-100" title="Ubah"><i class="fas fa-pen"></i></a><?php endif; ?> <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('check-access',['matting','delete'])): ?><form method="POST" action="<?php echo e(route('matting.destroy',$m)); ?>" id="delete-matting-<?php echo e($m->id); ?>"><?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?><button type="button" onclick="confirmDelete('delete-matting-<?php echo e($m->id); ?>','<?php echo e(addslashes(($m->sire->nama_kucing ?? '').' × '.($m->dam->nama_kucing ?? ''))); ?>')" class="p-2 text-rose-500 hover:bg-rose-50"><i class="fas fa-trash"></i></button></form><?php endif; ?></div></td></tr>
|
||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><tr><td colspan="5" class="px-4 py-12 text-center text-sm text-slate-500">Belum ada riwayat pembiakan.</td></tr><?php endif; ?>
|
||
</tbody></table></div><div class="border-t border-slate-200 p-4"><?php echo e($mattings->links()); ?></div></section>
|
||
<?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/matting/index.blade.php ENDPATH**/ ?>
|