<x-app-layout>

<div class="col-12">
    <div class="card">
        <div class="card-body">
            <x-form action="{{ route('offices.update',['office'=>$office->id]) }}" method="post" enctype="multipart/form-data">
                @method('PUT')
                @csrf
                <div class="card">
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="card">
                                    <div class="card-body">
                                        <h5 class="dividing">{{ __('General Info') }}</h5>
                                        <div class="row mt-3">
                                            <x-form.input name="name" value="{{ $office->name }}" classGroup="col-md-6 required" />
                                            <x-form.input name="email" value="{{ $office->email }}" classGroup="col-md-6 required" />  
                                        </div>
                                        <x-form.input name="address" value="{{ $office->address }}" classGroup="required" />
                                        <x-form.input name="phone" value="{{ $office->phone}}" classGroup="required" />
                                    </div>
                                </div>
                                <div class="card">
                                    <div class="card-body">
                                        <x-form.input name="employers_number" value="{{ $office->employers_number }}" classGroup="required" />
                                        <x-form.switch name="status" value="{{ $office->status }}"  />
                                    </div>
                                       <div class="card-body">
                                        <lable  style="font-weight:700px;" >is_admin</lable>
                                        <br>
                                        <br>
                                        <div class="form-check form-check-inline">
                                          <input  type="radio" value="1" name="is_admin" @if($office->is_admin==1) checked @endif id="flexRadioDefault1">
                                          <label class="form-check-label" for="flexRadioDefault1">
                                             yes
                                          </label>
                                        </div>
                                        <div class="form-check form-check-inline">
                                          <input type="radio" value="0"  name="is_admin"    @if($office->is_admin==0) checked @endif id="flexRadioDefault2" >
                                          <label class="form-check-label" for="flexRadioDefault2">
                                             no
                                          </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="card">
                                    <div class="card-body">
                                        <h5 class="dividing">{{ __('Additional information') }}</h5>
                                        <div class="mt-3">
                                            <x-form.upload name="image" value="{{ $office->image }}" label="Avatar" />                                         
                                        </div>
                                    </div>
                               

                                    
                                    
                                </div>
                                <div class="card">
                                    <div class="card-body">
                                        <h5 class="dividing">{{ __('Account information') }}</h5>
                                        <div class="mt-3">
                                            <x-form.input name="booking_commission" label="Booking Commission" value="{{ $office->booking_commission }}" classGroup="required" />
                                            <x-form.input name="exchange_commission" label="Exchange Commission" value="{{ $office->exchange_commission }}" classGroup="required" />
                                            <x-form.input name="canellation_commission" label="Booking Commission" value="{{ $office->canellation_commission }}" classGroup="required" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="card-footer">
                        <x-button  class="btn btn-primary" > {{__('save')}} </x-button>
                    </div>
                </div>
            </x-form>
        </div>
    </div>
</div>

</x-app-layout>

