<div class="card">
    <div class="card-header">
        <h5>Edit Pelanggan</h5>
    </div>

    <div class="card-body">
        <form method="POST" action="/pelanggan/update/{{ $pelanggan->id_pelanggan }}">
            @csrf

            <div class="mb-3">
                <label>Nama Pelanggan</label>
                <input type="text" name="nama_pelanggan" class="form-control"
                       value="{{ $pelanggan->nama_pelanggan }}">
            </div>

            <div class="mb-3">
                <label>Alamat</label>
                <textarea name="alamat" class="form-control">{{ $pelanggan->alamat }}</textarea>
            </div>

            <div class="mb-3">
                <label>No Telp</label>
                <input type="text" name="no_telp" class="form-control"
                       value="{{ $pelanggan->no_telp }}">
            </div>

            <div class="mb-3">
                <label>Jenis Kelamin</label>
                <select name="jenis_kelamin" class="form-select">
                    <option value="L" {{ $pelanggan->jenis_kelamin == 'L' ? 'selected' : '' }}>
                        Laki-laki
                    </option>
                    <option value="P" {{ $pelanggan->jenis_kelamin == 'P' ? 'selected' : '' }}>
                        Perempuan
                    </option>
                </select>
            </div>

            <button class="btn btn-primary">Update</button>
            <a href="/pelanggan" class="btn btn-secondary">Kembali</a>
        </form>
    </div>
</div>
