303 lines
22 KiB
PHP
303 lines
22 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 uppercase leading-none mb-1">Tambah Kucing Baru</h2>
|
|
<p class="text-[10px] text-slate-400 font-bold uppercase tracking-[0.2em]">Registrasi Identitas Permanen • Ilycats Database</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">Terdapat Kesalahan Input:</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.store')); ?>" method="POST" enctype="multipart/form-data" class="space-y-6">
|
|
<?php echo csrf_field(); ?>
|
|
|
|
|
|
<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="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
|
|
<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 (Sesuai Pedigree)</label>
|
|
<input type="text" name="nama_kucing" value="<?php echo e(old('nama_kucing')); ?>" required placeholder="Contoh: Earrin Cats Moonlight" class="w-full px-5 py-4 bg-slate-50 border border-slate-200 rounded-2xl focus:ring-4 focus:ring-indigo-500/10 focus:border-indigo-500 transition-all text-sm font-bold text-slate-800">
|
|
</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')); ?>" placeholder="ICA.LO.xxxx" 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')); ?>" placeholder="90011xxxx" 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')); ?>" 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 focus:ring-2 focus:ring-indigo-500 transition-all text-sm font-bold text-slate-800">
|
|
<?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') == $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')); ?>" class="w-full px-4 py-4 bg-slate-50 border border-slate-200 rounded-2xl focus:ring-2 focus:ring-indigo-500 transition-all text-sm font-bold text-slate-800">
|
|
</div>
|
|
|
|
|
|
<div class="md:col-span-2 space-y-3">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1 block">Federasi / Registry</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(); ?>
|
|
<label class="block cursor-pointer group">
|
|
<input type="checkbox" name="registry[]" value="<?php echo e($reg); ?>"
|
|
<?php echo e((is_array(old('registry')) && in_array($reg, old('registry'))) || ($reg === 'NON-PED' && !old('registry')) ? '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', 'Jantan') == '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') == '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 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">Induk Jantan (Sire)</label>
|
|
<input type="text" list="sire_list" id="sire_search" 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')); ?>">
|
|
</div>
|
|
|
|
|
|
<div class="space-y-2">
|
|
<label class="text-[10px] font-bold text-slate-400 uppercase ml-1">Induk Betina (Dam)</label>
|
|
<input type="text" list="dam_list" id="dam_search" 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')); ?>">
|
|
</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') == $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-xs 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', auth()->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 = ['vaksin' => 'Vaksin', 'obat_cacing' => 'Obat Cacing', 'obat_kutu' => 'Obat Kutu', 'grooming' => 'Grooming']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $task => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<div class="space-y-1">
|
|
<label class="text-[9px] font-bold text-slate-400 uppercase ml-1"><?php echo e($label); ?></label>
|
|
<input type="date" name="jadwal_<?php echo e($task); ?>" value="<?php echo e(old('jadwal_'.$task)); ?>" class="w-full 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="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>
|
|
<div class="space-y-4">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase ml-1">Berat Badan Awal</label>
|
|
<div class="relative mt-2">
|
|
<input type="number" step="0.01" name="berat_badan" value="<?php echo e(old('berat_badan')); ?>" placeholder="0.00" class="w-full pl-6 pr-14 py-5 bg-slate-50 border border-slate-200 rounded-3xl 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-6 top-1/2 -translate-y-1/2 text-xs font-black text-slate-400">KG</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="bg-white border border-slate-200 rounded-[2.5rem] p-8 shadow-sm space-y-4">
|
|
<h4 class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1 mb-2">Unggah Foto Utama</h4>
|
|
<div class="relative group">
|
|
<input type="file" name="foto" id="foto" class="hidden" onchange="previewImage(event)" accept="image/*">
|
|
<label for="foto" class="flex flex-col items-center justify-center border-4 border-dashed border-slate-100 rounded-[3rem] p-12 text-center cursor-pointer hover:border-indigo-200 hover:bg-indigo-50/20 transition-all duration-500 group">
|
|
<div id="preview-container" class="hidden mb-6">
|
|
<img id="image-preview" class="w-48 h-48 rounded-[2.5rem] object-cover shadow-2xl ring-8 ring-white">
|
|
</div>
|
|
<div id="upload-instruction" class="space-y-4">
|
|
<div class="w-20 h-20 bg-slate-50 rounded-3xl flex items-center justify-center mx-auto group-hover:scale-110 group-hover:bg-white transition-all duration-500 shadow-sm">
|
|
<i class="fas fa-camera-retro text-3xl text-slate-300 group-hover:text-indigo-500"></i>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs text-slate-600 font-black tracking-widest uppercase">Pilih Foto Terbaik</p>
|
|
<p class="text-[10px] text-slate-400 mt-1 uppercase font-bold tracking-tighter italic">JPG, PNG, WEBP (Maks 3MB)</p>
|
|
</div>
|
|
</div>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="pt-4">
|
|
<button type="submit" class="w-full py-6 bg-indigo-600 text-white text-xs font-black rounded-[2.5rem] shadow-2xl shadow-indigo-100 hover:bg-indigo-700 hover:-translate-y-1 transition-all active:scale-[0.98] flex items-center justify-center gap-4 group">
|
|
<i class="fas fa-save text-xl group-hover:rotate-12 transition-transform"></i>
|
|
<span class="tracking-[0.2em] uppercase">Simpan Record Baru Ilycats</span>
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<style>
|
|
.animate-fade-in { animation: fadeIn 0.4s ease-out; }
|
|
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
|
</style>
|
|
|
|
<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;
|
|
hidden.value = ""; // Reset hidden ID setiap kali input berubah
|
|
|
|
for (let i = 0; i < options.length; i++) {
|
|
if (options[i].value === input.value) {
|
|
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
|
|
function previewImage(event) {
|
|
const reader = new FileReader();
|
|
reader.onload = function() {
|
|
const output = document.getElementById('image-preview');
|
|
const container = document.getElementById('preview-container');
|
|
const instruction = document.getElementById('upload-instruction');
|
|
|
|
output.src = reader.result;
|
|
container.classList.remove('hidden');
|
|
instruction.classList.add('hidden');
|
|
}
|
|
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/create.blade.php ENDPATH**/ ?>
|