@extends('component.app')
@section('title', 'Brand')
@section('active11', 'active')
@section('menu1', 'open')
@section('content')

    <div class="content-wrapper">
        <div class="container-xxl flex-grow-1 container-p-y">
            <div class="card">
                <div class="header-menu d-flex justify-content-between align-items-center">
                    <h3 class="card-header">Data Brand</h3>
                    <form action="{{ route('brand.update', $data->id) }}" method="POST" enctype="multipart/form-data">
                        <button type="sumbit" 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">

                    @csrf
                    <div class="row">
                        <!-- Kolom Kiri -->
                        <div class="col-md-6">
                            <!-- Nama Brand -->
                            <div class="mb-3">
                                <label for="nama_brand" class="form-label">Nama Brand</label>
                                <input type="text" class="form-control" id="nama_brand" name="nama_brand"
                                    placeholder="Masukkan Nama Brand" value="{{ $data->nama_brand }}" required>
                            </div>

                            <!-- Logo Brand -->
                            <div class="mb-3">
                                <label for="logo_brand" class="form-label">Logo Brand</label>
                                <input type="file" class="form-control" id="logo_brand" name="logo_brand">
                                <span class="text-danger">*Isi jika ingin mengganti logo</span>
                            </div>

                            <!-- Alamat -->
                            <div class="mb-3">
                                <label for="alamat" class="form-label">Alamat</label>
                                <textarea class="form-control" id="alamat" name="alamat" placeholder="Masukkan Alamat" rows="3" required>{{ $data->alamat }}</textarea>
                            </div>

                            <!-- Email -->
                            <div class="mb-3">
                                <label for="email" class="form-label">Email</label>
                                <input type="email" class="form-control" id="email" name="email"
                                    placeholder="Masukkan Email" value="{{ $data->email }}" required>
                            </div>
                        </div>

                        <!-- Kolom Kanan -->
                        <div class="col-md-6">
                            <!-- Users ID -->
                            <div class="mb-3">
                                <label for="users_id" class="form-label">Pilih Admin</label>
                                <select id="pelanggan" name="users_id" class="form-select form-control-sm" required>
                                    <option value="{{ $data->users_id }}"> {{ $data->user->username }} -
                                        {{ $data->user->email }}
                                    </option>
                                    <option value="">--Pilih Admin--</option>
                                    @foreach ($admin as $admin)
                                        <option value="{{ $admin->id }}">{{ $admin->username }} -
                                            {{ $admin->email }}</option>
                                    @endforeach
                                </select>
                            </div>

                            <!-- No Telp -->
                            <div class="mb-3">
                                <label for="no_telp" class="form-label">No. Telp</label>
                                <input type="text" class="form-control" id="no_telp" name="no_telp"
                                    placeholder="Masukkan No. Telp" value="{{ $data->no_telp }}" required>
                            </div>

                            <!-- Moto -->
                            <div class="mb-3">
                                <label for="moto" class="form-label">Moto</label>
                                <input type="text" class="form-control" id="moto" name="moto"
                                    placeholder="Masukkan Moto" value="{{ $data->moto }}" required>
                            </div>
                        </div>
                    </div>

                    </form>
                </div>

            </div>

        </div>
    </div>

@endsection
