65 lines
4.6 KiB
PHP
65 lines
4.6 KiB
PHP
<x-app-layout>
|
|
<div class="max-w-3xl mx-auto space-y-6 pb-12">
|
|
<div class="flex items-center gap-4 px-2">
|
|
<a href="{{ route('inventory.medicines.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">Edit Data Obat</h2>
|
|
<p class="text-sm text-slate-500 font-medium italic">Pembaruan stok medis {{ $medicine->nama_obat }}.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<form action="{{ route('inventory.medicines.update', $medicine->id) }}" method="POST" enctype="multipart/form-data" class="space-y-6 mx-2">
|
|
@csrf
|
|
@method('PATCH')
|
|
|
|
<div class="bg-white border border-slate-200 rounded-[2.5rem] p-8 shadow-sm space-y-6">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
<div class="md:col-span-2 space-y-1">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Nama Produk Medis</label>
|
|
<input type="text" name="nama_obat" value="{{ old('nama_obat', $medicine->nama_obat) }}" 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-2 focus:ring-indigo-500 transition-all outline-none">
|
|
</div>
|
|
|
|
<div class="space-y-1">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Jumlah Stok (QTY)</label>
|
|
<input type="number" step="any" name="qty" value="{{ old('qty', (float)$medicine->qty) }}" 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-2 focus:ring-indigo-500 transition-all outline-none">
|
|
</div>
|
|
|
|
<div class="space-y-1">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Satuan (Unit)</label>
|
|
<input type="text" name="unit" value="{{ old('unit', $medicine->unit) }}" required placeholder="Contoh: Tablet, ml, Bottle"
|
|
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-2 focus:ring-indigo-500 transition-all outline-none">
|
|
</div>
|
|
|
|
<div class="space-y-1">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Tanggal Kadaluarsa</label>
|
|
<input type="date" name="expired_at" value="{{ old('expired_at', $medicine->expired_at ? $medicine->expired_at->format('Y-m-d') : '') }}"
|
|
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-2 focus:ring-indigo-500 transition-all outline-none">
|
|
</div>
|
|
|
|
<div class="space-y-1">
|
|
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Foto Produk (Opsional)</label>
|
|
<input type="file" name="foto_produk"
|
|
class="w-full px-5 py-3 bg-slate-50 border border-slate-200 rounded-2xl text-xs font-bold text-slate-500 file:mr-4 file:py-2 file:px-4 file:rounded-xl file:border-0 file:text-[10px] file:font-black file:bg-indigo-50 file:text-indigo-600 hover:file:bg-indigo-100">
|
|
</div>
|
|
</div>
|
|
|
|
@if($medicine->foto_produk)
|
|
<div class="pt-4 border-t border-slate-100">
|
|
<p class="text-[10px] font-black text-slate-400 uppercase tracking-widest mb-3">Foto Saat Ini</p>
|
|
<div class="w-32 h-32 rounded-2xl border-4 border-white shadow-md overflow-hidden bg-slate-50">
|
|
<img src="{{ asset('storage/' . $medicine->foto_produk) }}" class="w-full h-full object-cover">
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
<button type="submit" class="w-full py-5 bg-indigo-600 text-white text-sm font-black rounded-[2rem] shadow-xl shadow-indigo-100 hover:bg-indigo-700 transition-all active:scale-[0.98] flex items-center justify-center gap-3">
|
|
<i class="fas fa-save text-lg"></i> SIMPAN PERUBAHAN OBAT
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</x-app-layout> |