297 lines
23 KiB
PHP
297 lines
23 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="max-w-4xl mx-auto space-y-6 pb-12">
|
|
|
|
<div class="flex items-center gap-4">
|
|
<a href="<?php echo e(route('cats.index')); ?>" class="p-3 bg-white border border-slate-200 rounded-2xl text-slate-400 hover:text-indigo-600 transition-all shadow-sm active:scale-90">
|
|
<i class="fas fa-arrow-left"></i>
|
|
</a>
|
|
<div>
|
|
<h2 class="text-2xl font-black text-slate-800 tracking-tight leading-none mb-1">Edit Profil: <?php echo e($cat->nama_kucing); ?></h2>
|
|
<p class="text-[10px] text-slate-400 font-bold uppercase tracking-[0.2em]">Cattery Management • Pasien #<?php echo e(str_pad($cat->id, 4, '0', STR_PAD_LEFT)); ?></p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<?php if($errors->any()): ?>
|
|
<div class="p-5 bg-rose-50 border-2 border-rose-100 text-rose-600 rounded-[2rem] shadow-sm animate-fade-in">
|
|
<div class="flex items-center gap-3 mb-2">
|
|
<i class="fas fa-exclamation-circle text-lg"></i>
|
|
<h3 class="text-xs font-black uppercase tracking-widest">Gagal Memperbarui Data:</h3>
|
|
</div>
|
|
<ul class="list-disc list-inside text-[11px] font-bold space-y-1 ml-1">
|
|
<?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<li><?php echo e($error); ?></li>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</ul>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<form action="<?php echo e(route('cats.update', $cat->id)); ?>" method="POST" enctype="multipart/form-data" class="space-y-6">
|
|
<?php echo csrf_field(); ?>
|
|
<?php echo method_field('PUT'); ?>
|
|
|
|
|
|
<div class="bg-white border border-slate-200 rounded-[2.5rem] p-8 shadow-sm space-y-8">
|
|
<div class="flex items-center gap-4 mb-2 border-b border-slate-100 pb-4">
|
|
<div class="w-8 h-8 bg-indigo-600 text-white rounded-xl flex items-center justify-center text-xs shadow-lg">
|
|
<i class="fas fa-id-card"></i>
|
|
</div>
|
|
<h4 class="font-black text-slate-800 uppercase tracking-tighter text-lg">Identitas & Dokumen Resmi</h4>
|
|
</div>
|
|
|
|
<div class="flex flex-col md:flex-row gap-8 items-start">
|
|
|
|
<div class="relative group self-center md:self-start flex-shrink-0">
|
|
<div class="w-28 h-28 rounded-[2rem] bg-slate-50 border-2 border-slate-200 overflow-hidden ring-8 ring-indigo-50/50 shadow-md flex items-center justify-center">
|
|
<img id="image-preview" src="<?php echo e($cat->foto_url); ?>" class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-110">
|
|
</div>
|
|
<label for="foto" class="absolute -bottom-2 -right-2 w-10 h-10 bg-indigo-600 text-white rounded-2xl border-4 border-white cursor-pointer shadow-lg hover:bg-indigo-700 transition-all flex items-center justify-center">
|
|
<i class="fas fa-camera text-xs"></i>
|
|
<input type="file" name="foto" id="foto" class="hidden" accept="image/*" onchange="previewImage(event)">
|
|
</label>
|
|
</div>
|
|
|
|
|
|
<div class="flex-1 grid grid-cols-1 md:grid-cols-2 gap-6 w-full">
|
|
<div class="space-y-2 md:col-span-2">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Nama Lengkap Kucing</label>
|
|
<input type="text" name="nama_kucing" value="<?php echo e(old('nama_kucing', $cat->nama_kucing)); ?>" required class="w-full px-5 py-4 bg-slate-50 border border-slate-200 rounded-2xl text-sm font-bold text-slate-800 focus:ring-4 focus:ring-indigo-500/10 focus:border-indigo-500 transition-all">
|
|
</div>
|
|
|
|
<div class="md:col-span-2 grid grid-cols-1 md:grid-cols-3 gap-4 border-y border-slate-50 py-6 my-2">
|
|
<div class="space-y-2">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">No. Pedigree</label>
|
|
|
|
<input type="text" name="pedigree" value="<?php echo e(old('pedigree', $cat->pedigree)); ?>" placeholder="ICA.LO.xxx"
|
|
class="w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-xl focus:ring-2 focus:ring-indigo-500 text-xs font-bold text-slate-800">
|
|
</div>
|
|
|
|
<div class="space-y-2">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">No. Microchip</label>
|
|
<input type="text" name="microchip" value="<?php echo e(old('microchip', $cat->microchip)); ?>" placeholder="9001xxxx"
|
|
class="w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-xl focus:ring-2 focus:ring-indigo-500 text-xs font-bold text-slate-800">
|
|
</div>
|
|
|
|
<div class="space-y-2">
|
|
<label class="text-[10px] font-black text-indigo-600 uppercase tracking-widest ml-1 flex items-center gap-2">
|
|
<i class="fas fa-dna text-[10px]"></i> Kode EMS
|
|
</label>
|
|
|
|
<input type="text" name="kode_ems" value="<?php echo e(old('kode_ems', $cat->kode_ems)); ?>" placeholder="PER d 03"
|
|
class="w-full px-4 py-3 bg-indigo-50/30 border border-indigo-100 rounded-xl focus:ring-2 focus:ring-indigo-500 text-xs font-black text-indigo-700">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="space-y-2">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Ras / Breed</label>
|
|
<select name="ras" required class="w-full px-4 py-4 bg-slate-50 border border-slate-200 rounded-2xl text-sm font-bold text-slate-800 focus:ring-2 focus:ring-indigo-500">
|
|
<?php $__currentLoopData = ['Persian', 'British Shorthair', 'Scottish Fold', 'Maine Coon', 'Munchkin', 'Lainnya']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ras): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option value="<?php echo e($ras); ?>" <?php echo e(old('ras', $cat->ras) == $ras ? 'selected' : ''); ?>><?php echo e($ras); ?></option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="space-y-2">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Tanggal Lahir</label>
|
|
<input type="date" name="tanggal_lahir" value="<?php echo e(old('tanggal_lahir', $cat->tanggal_lahir?->format('Y-m-d'))); ?>" class="w-full px-4 py-4 bg-slate-50 border border-slate-200 rounded-2xl text-sm font-bold text-slate-800 focus:ring-2 focus:ring-indigo-500">
|
|
</div>
|
|
|
|
<div class="space-y-3 md:col-span-2">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Registry / Federasi</label>
|
|
<div class="grid grid-cols-2 md:grid-cols-5 gap-3">
|
|
<?php $__currentLoopData = ['ICA', 'CFA', 'WCF', 'FFF', 'NON-PED']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $reg): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<?php
|
|
$isChecked = old('registry')
|
|
? in_array($reg, old('registry'))
|
|
: (is_array($cat->registry) && in_array($reg, $cat->registry));
|
|
?>
|
|
<label class="block cursor-pointer group">
|
|
<input type="checkbox" name="registry[]" value="<?php echo e($reg); ?>" <?php echo e($isChecked ? 'checked' : ''); ?> class="sr-only peer">
|
|
<div class="py-4 text-center border-2 border-slate-100 rounded-2xl text-[10px] font-black text-slate-400 peer-checked:bg-indigo-600 peer-checked:text-white peer-checked:border-indigo-600 transition-all shadow-sm group-hover:border-slate-300 uppercase">
|
|
<?php echo e($reg); ?>
|
|
|
|
</div>
|
|
</label>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="space-y-2 md:col-span-2">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Jenis Kelamin</label>
|
|
<div class="flex gap-4">
|
|
<label class="flex-1 cursor-pointer group">
|
|
<input type="radio" name="jenis_kelamin" value="Jantan" <?php echo e(old('jenis_kelamin', $cat->jenis_kelamin) == 'Jantan' ? 'checked' : ''); ?> class="sr-only peer">
|
|
<div class="p-4 text-center border-2 border-slate-100 rounded-2xl text-xs font-black text-slate-400 peer-checked:bg-blue-50 peer-checked:border-blue-500 peer-checked:text-blue-600 transition-all shadow-sm group-hover:border-slate-200">
|
|
<i class="fas fa-mars mr-2"></i> JANTAN (SIRE)
|
|
</div>
|
|
</label>
|
|
<label class="flex-1 cursor-pointer group">
|
|
<input type="radio" name="jenis_kelamin" value="Betina" <?php echo e(old('jenis_kelamin', $cat->jenis_kelamin) == 'Betina' ? 'checked' : ''); ?> class="sr-only peer">
|
|
<div class="p-4 text-center border-2 border-slate-100 rounded-2xl text-xs font-black text-slate-400 peer-checked:bg-pink-50 peer-checked:border-pink-500 peer-checked:text-pink-600 transition-all shadow-sm group-hover:border-slate-200">
|
|
<i class="fas fa-venus mr-2"></i> BETINA (DAM)
|
|
</div>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="bg-white border border-slate-200 rounded-[2.5rem] p-8 shadow-sm space-y-6">
|
|
<h4 class="text-xs font-black text-indigo-600 uppercase tracking-widest border-b border-slate-100 pb-4 mb-2 flex items-center gap-2 italic">
|
|
<i class="fas fa-dna text-sm"></i> Penempatan & Silsilah Induk
|
|
</h4>
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
|
|
|
<div class="space-y-2">
|
|
<label class="text-[10px] font-bold text-slate-400 uppercase ml-1">Sire (Bapak)</label>
|
|
<input type="text" list="sire_list" id="sire_search"
|
|
value="<?php echo e(old('sire_search', $cat->sire?->nama_kucing)); ?>"
|
|
placeholder="Ketik nama sire..."
|
|
class="w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-2xl text-xs font-bold text-slate-700 focus:ring-2 focus:ring-indigo-500" autocomplete="off">
|
|
<datalist id="sire_list">
|
|
<?php $__currentLoopData = $sires; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sire): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option data-id="<?php echo e($sire->id); ?>" value="<?php echo e($sire->nama_kucing); ?>">
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</datalist>
|
|
<input type="hidden" name="induk_jantan_id" id="induk_jantan_id" value="<?php echo e(old('induk_jantan_id', $cat->induk_jantan_id)); ?>">
|
|
</div>
|
|
|
|
|
|
<div class="space-y-2">
|
|
<label class="text-[10px] font-bold text-slate-400 uppercase ml-1">Dam (Ibu)</label>
|
|
<input type="text" list="dam_list" id="dam_search"
|
|
value="<?php echo e(old('dam_search', $cat->dam?->nama_kucing)); ?>"
|
|
placeholder="Ketik nama dam..."
|
|
class="w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-2xl text-xs font-bold text-slate-700 focus:ring-2 focus:ring-indigo-500" autocomplete="off">
|
|
<datalist id="dam_list">
|
|
<?php $__currentLoopData = $dams; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dam): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option data-id="<?php echo e($dam->id); ?>" value="<?php echo e($dam->nama_kucing); ?>">
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</datalist>
|
|
<input type="hidden" name="induk_betina_id" id="induk_betina_id" value="<?php echo e(old('induk_betina_id', $cat->induk_betina_id)); ?>">
|
|
</div>
|
|
|
|
<div class="space-y-2">
|
|
<label class="text-[10px] font-bold text-slate-400 uppercase ml-1">Lokasi Kandang</label>
|
|
<select name="lokasi_kandang" class="w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-2xl text-sm font-black text-indigo-600 uppercase focus:ring-2 focus:ring-indigo-500">
|
|
<?php $__currentLoopData = ['A1', 'A2', 'Lorong', 'E1', 'E2', 'Karantina']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $loc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option value="<?php echo e($loc); ?>" <?php echo e(old('lokasi_kandang', $cat->lokasi_kandang) == $loc ? 'selected' : ''); ?>><?php echo e($loc); ?></option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="space-y-2">
|
|
<label class="text-[10px] font-bold text-slate-400 uppercase ml-1">PIC Bertugas</label>
|
|
<select name="pic_id" class="w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-2xl text-[11px] font-bold text-slate-700 focus:ring-2 focus:ring-indigo-500">
|
|
<?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option value="<?php echo e($user->id); ?>" <?php echo e(old('pic_id', $cat->pic_id) == $user->id ? 'selected' : ''); ?>><?php echo e($user->name); ?></option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
|
<div class="lg:col-span-2 bg-white border border-slate-200 rounded-[2.5rem] p-8 shadow-sm">
|
|
<div class="flex items-center gap-3 mb-6 border-b border-slate-100 pb-4">
|
|
<div class="w-7 h-7 bg-rose-50 text-rose-600 rounded-lg flex items-center justify-center text-[10px]">
|
|
<i class="fas fa-calendar-alt"></i>
|
|
</div>
|
|
<h4 class="text-xs font-black text-rose-600 uppercase tracking-widest italic">Jadwal Perawatan</h4>
|
|
</div>
|
|
<div class="grid grid-cols-2 gap-4">
|
|
<?php $__currentLoopData = ['jadwal_vaksin' => 'Vaksin', 'jadwal_obat_cacing' => 'Obat Cacing', 'jadwal_obat_kutu' => 'Obat Kutu', 'jadwal_grooming' => 'Grooming']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<div>
|
|
<label class="text-[9px] font-bold text-slate-400 uppercase ml-1"><?php echo e($label); ?></label>
|
|
<input type="date" name="<?php echo e($key); ?>" value="<?php echo e(old($key, $cat->$key ? $cat->$key->format('Y-m-d') : '')); ?>" class="w-full mt-1 p-3 bg-slate-50 border border-slate-200 rounded-xl text-[10px] font-black text-slate-700 focus:ring-2 focus:ring-rose-200 transition-all">
|
|
</div>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="space-y-6">
|
|
<div class="bg-white border border-slate-200 rounded-[2.5rem] p-8 shadow-sm">
|
|
<h4 class="text-xs font-black text-emerald-600 uppercase tracking-widest border-b border-slate-100 pb-4 mb-6 italic flex items-center gap-2">
|
|
<i class="fas fa-weight-scale text-sm"></i> Vitalitas
|
|
</h4>
|
|
<label class="text-[10px] font-bold text-slate-400 uppercase ml-1">Berat Badan</label>
|
|
<div class="relative mt-2">
|
|
<input type="number" step="0.01" name="berat_badan" value="<?php echo e(old('berat_badan', $cat->berat_badan)); ?>" class="w-full pl-5 pr-14 py-4 bg-slate-50 border border-slate-200 rounded-[1.5rem] text-2xl font-black text-slate-800 focus:ring-4 focus:ring-emerald-500/10 focus:border-emerald-500 transition-all">
|
|
<span class="absolute right-5 top-1/2 -translate-y-1/2 text-xs font-black text-slate-400">KG</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="bg-white border border-slate-200 rounded-[2.5rem] p-8 shadow-sm border-l-4 border-l-rose-500">
|
|
<label class="text-[10px] font-black text-rose-600 uppercase tracking-widest ml-1">Kondisi Kesehatan</label>
|
|
<textarea name="riwayat_sakit_terakhir" placeholder="Ceritakan kondisi kesehatan..." class="w-full mt-2 p-4 bg-slate-50 border border-slate-200 rounded-2xl text-xs font-bold text-slate-700 h-24 focus:ring-2 focus:ring-rose-200 transition-all"><?php echo e(old('riwayat_sakit_terakhir', $cat->riwayat_sakit_terakhir)); ?></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<button type="submit" class="w-full py-6 bg-indigo-600 text-white text-xs font-black rounded-[2.5rem] shadow-2xl hover:bg-indigo-700 hover:shadow-indigo-200 transition-all active:scale-[0.98] flex items-center justify-center gap-4 group">
|
|
<i class="fas fa-save text-lg group-hover:rotate-12 transition-transform"></i>
|
|
<span class="tracking-[0.2em] uppercase">Simpan Perubahan Data Ilycats</span>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
// Logika Sinkronisasi Searchable Datalist untuk Sire/Dam
|
|
function handleSearchableDatalist(inputId, listId, hiddenId) {
|
|
const input = document.getElementById(inputId);
|
|
const list = document.getElementById(listId);
|
|
const hidden = document.getElementById(hiddenId);
|
|
|
|
input.addEventListener('input', function() {
|
|
const options = list.options;
|
|
const val = input.value;
|
|
hidden.value = ""; // Reset hidden ID jika input tidak cocok dengan opsi apa pun
|
|
|
|
for (let i = 0; i < options.length; i++) {
|
|
if (options[i].value === val) {
|
|
hidden.value = options[i].getAttribute('data-id');
|
|
break;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
handleSearchableDatalist('sire_search', 'sire_list', 'induk_jantan_id');
|
|
handleSearchableDatalist('dam_search', 'dam_list', 'induk_betina_id');
|
|
|
|
// Preview Foto saat dipilih
|
|
function previewImage(event) {
|
|
const reader = new FileReader();
|
|
const preview = document.getElementById('image-preview');
|
|
reader.onload = function() {
|
|
if(reader.readyState === 2) {
|
|
preview.src = reader.result;
|
|
}
|
|
}
|
|
reader.readAsDataURL(event.target.files[0]);
|
|
}
|
|
</script>
|
|
<?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/cats/edit.blade.php ENDPATH**/ ?>
|