@extends('component.app')
@section('title', 'Parfum')
@section('active9', 'active')
@section('menu1', 'open')
@section('content')
    <div class="content-wrapper">
        <div class="container-xxl flex-grow-1 container-p-y">
            <!-- Invoice List Table -->
            <div class="card">
                <div class="header-menu d-flex justify-content-between align-items-center">
                    <h4 class="card-header">Edit Data Parfum</h4>
                    <form action="{{ route('parfum.update', $data->id) }}" method="POST" enctype="multipart/form-data">
                        @csrf
                        <button type="submit" class="btn btn-primary me-2" data-bs-toggle="modal"
                            data-bs-target="#staticBackdrop"><i class="bx bx-save bx-sm"></i> Simpan</button>
                </div>

                <div class="card-body">
                    <div class="row">
                        <!-- Kolom Kiri -->
                        <div class="col-md-6">
                            @if (Auth::user()->role == 'superadmin')
                                <div class="mb-3">
                                    <label for="users_id" class="form-label">Pilih Laundry</label>

                                    <select id="pelanggan" name="laundry_id" class="form-select form-control-sm" required>
                                        <option value="{{ $data->laundry_id }}"> {{ $data->laundry->nama_laundry }} -
                                            {{ $data->laundry->email }}</option>
                                        <option value="">Pilih Laundry</option>
                                        @foreach ($laundry as $laundry)
                                            <option value="{{ $laundry->id }}">{{ $laundry->nama_laundry }} -
                                                {{ $laundry->email }}</option>
                                        @endforeach
                                    </select>
                                </div>
                            @endif
                            <!-- Nama Brand -->
                            <div class="mb-3">
                                <label for="nama_brand" class="form-label">Nama Parfum</label>
                                <input type="text" class="form-control" id="nama_parfum" name="nama_parfum"
                                    placeholder="Masukkan Nama Parfum" value="{{ $data->nama_parfum }}" required>
                            </div>
                            <div class="mb-3">
                                <label for="wangi" class="form-label">Wangi</label>
                                <input type="text" class="form-control" id="wangi" name="wangi"
                                    placeholder="Masukkan wangi" value="{{ $data->wangi }}" required>
                            </div>

                            <!-- Logo Brand -->
                            <div class="mb-3">
                                <label for="foto_parfum" class="form-label">Foto Parfum</label>
                                <input type="file" class="form-control" id="foto" name="foto">
                                <span class="text-danger">*Isi jika mengganti foto</span>
                            </div>
                            <div class="nb-3">
                                <img src="{{ asset('storage/img/' . $data->foto) }}" alt="" width="100px"
                                    height="100px">
                            </div>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

@endsection
