@extends('server-side.layouts.server-app')
@section('pageTitle', 'Edit Data Penyakit | KlinikSapi.Go')
@section('mainContent')
    <div class="content d-flex flex-column flex-column-fluid" id="kt_content">
        <div class="toolbar" id="kt_toolbar">
            <div id="kt_toolbar_container" class="container-fluid d-flex flex-stack">
                <div data-kt-swapper="true" data-kt-swapper-mode="prepend"
                    data-kt-swapper-parent="{default: '#kt_content_container', 'lg': '#kt_toolbar_container'}"
                    class="page-title d-flex align-items-center flex-wrap me-3 mb-5 mb-lg-0">
                    <h1 class="d-flex align-items-center text-dark fw-bolder fs-3 my-1">Manajemen Data
                        <span class="h-20px border-gray-200 border-start ms-3 mx-2"></span>
                        <small class="text-muted fs-7 fw-bold my-1 ms-1">Penyakit / Data Penyakit / Edit Penyakit</small>
                    </h1>
                </div>
            </div>
        </div>
        <div class="post d-flex flex-column-fluid" id="kt_post">
            <div id="kt_content_container" class="container-xxl">
                <div class="card mb-5 mb-xl-8 px-10 px-lg-15 py-15">
                    <form action="{{ route('penyakit.update', $penyakit->penyakitId) }}" method="POST" class="form" autocomplete="off">
                        @csrf
                        @method('PUT')
                        <div class="mb-10">
                            <h1 class="mb-3">Formulir Perubahan Data Penyakit</h1>
                            <div class="text-muted fw-bold fs-5">Silahkan lengkapi formulir perubahan <strong>Data Penyakit</strong> di bawah ini!</div>
                        </div>
                        <div class="row g-9 mb-8">
                            <div class="col-md-12 fv-row">
                                <label class="d-flex align-items-center fs-6 fw-bold mb-2">
                                    <span class="required">Kode Penyakit</span>
                                </label>
                                <input type="text" class="form-control form-control-solid" name="penyakitId" value="{{ $penyakit->penyakitId }}" readonly />
                            </div>
                            <div class="col-md-12 fv-row">
                                <label class="d-flex align-items-center fs-6 fw-bold mb-2">
                                    <span class="required">Nama Penyakit</span>
                                </label>
                                <input type="text" class="form-control form-control-solid" name="penyakit" value="{{ old('penyakit', $penyakit->penyakit) }}" />
                                @if ($errors->has('penyakit'))
                                    <p class="mt-2 text-sm" style="color: red; font-weight: 500;"><span
                                            class="font-medium">Oops!</span> {{ $errors->first('penyakit') }}</p>
                                @endif
                            </div>
                        </div>
                        <div class="d-flex flex-column mb-8">
                            <label class="fs-6 fw-bold mb-2 required">Deskripsi</label>
                            <textarea class="form-control form-control-solid" rows="6" name="deskripsi">{{ old('deskripsi', $penyakit->deskripsi) }}</textarea>
                            @if ($errors->has('deskripsi'))
                                <p class="mt-2 text-sm" style="color: red; font-weight: 500;"><span
                                        class="font-medium">Oops!</span> {{ $errors->first('deskripsi') }}</p>
                            @endif
                        </div>
                        <div class="d-flex flex-column mb-8">
                            <label class="fs-6 fw-bold mb-2 required">Solusi</label>
                            <textarea class="form-control form-control-solid" rows="6" name="solusi" placeholder="Contoh: Jaga kebersihan kandang, beri minum tiap hari, dst...">{{ old('solusi', $penyakit->solusi) }}</textarea>
                            @if ($errors->has('solusi'))
                                <p class="mt-2 text-sm" style="color: red; font-weight: 500;"><span
                                        class="font-medium">Oops!</span> {{ $errors->first('solusi') }}</p>
                            @endif
                        </div>
                        <div class="float-start">
                            <button type="submit" class="btn btn-primary">
                                <span class="indicator-label">Simpan Perubahan</span>
                            </button>
                            <a href="{{ route('penyakit.index') }}" class="btn btn-light me-3">Batal</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
