{{--@php()--}}

{{--@endphp--}}

<tr data-index="{{ $index }}">
    {{--{!! Form::select('city_id', $cities, old('city_id'), ['class' => 'form-control select2']) !!}--}}

    {{--{!! Form::select('heating[]', $heatings, old('heating') ? old('heating') : $residential_complex->heating->pluck('id')->toArray(), ['class' => 'form-control select2', 'multiple' => 'multiple', 'id' => 'selectall-heating' ]) !!}--}}

    <td>
        @can('residential_complex_create')
            {!! Form::select('planning_prices['.$index.'][section_id]', $sectionsPlanning, isset($field) ? $field->section_id: '', ['class' => 'form-control select2']) !!}
        @else
            {!! Form::select('planning_prices['.$index.'][section_id]', $sectionsPlanning, isset($field) ? $field->section_id: '', ['class' => 'form-control select2', "disabled"]) !!}
            {!! Form::hidden('planning_prices['.$index.'][section_id]', isset($field) ? $field->section_id: '') !!}
        @endcan
    </td>

    <td>
        @can('residential_complex_create')
            {!! Form::select('planning_prices['.$index.'][room_count_id]', $count_of_room_per_flats, isset($field) ? $field->room_count_id: '', ['class' => 'form-control select2']) !!}
        @else
            {!! Form::select('planning_prices['.$index.'][room_count_id]', $count_of_room_per_flats, isset($field) ? $field->room_count_id: '', ['class' => 'form-control select2', "disabled"]) !!}
            {!! Form::hidden('planning_prices['.$index.'][room_count_id]', isset($field) ? $field->room_count_id: '') !!}
        @endcan
    </td>
    {{--<td>--}}
        {{--@can('residential_complex_create')--}}
            {{--{!! Form::select('planning_prices['.$index.'][room_count_id]', $count_of_room_per_flats, isset($field) ? $field->room_count_id: '', ['class' => 'form-control select2']) !!}--}}
        {{--@else--}}
            {{--{!! Form::select('planning_prices['.$index.'][room_count_id]', $count_of_room_per_flats, isset($field) ? $field->room_count_id: '', ['class' => 'form-control select2', "disabled"]) !!}--}}
            {{--{!! Form::hidden('planning_prices['.$index.'][room_count_id]', isset($field) ? $field->room_count_id: '') !!}--}}
        {{--@endcan--}}
    {{--</td>--}}

    <td>
        @can('residential_complex_create')
            {!! Form::select('planning_prices['.$index.'][room_type_id]', $room_types, isset($field) ? $field->room_type_id: '', ['class' => 'form-control select2']) !!}
        @else
            {!! Form::select('planning_prices['.$index.'][room_type_id]', $room_types, isset($field) ? $field->room_type_id: '', ['class' => 'form-control select2', "disabled"]) !!}
            {!! Form::hidden('planning_prices['.$index.'][room_type_id]', isset($field) ? $field->room_type_id: '') !!}
        @endcan
    </td>

    <td>
        @can('residential_complex_create')
            {!! Form::text('planning_prices['.$index.'][min_space]', old('planning_prices['.$index.'][min_space]', isset($field) ? $field->min_space: ''), ['class' => 'form-control']) !!}
        @else
            {!! Form::text('planning_prices['.$index.'][min_space]', old('planning_prices['.$index.'][min_space]', isset($field) ? $field->min_space: ''), ['class' => 'form-control', "readonly"]) !!}
        @endcan
    </td>
    <td>
        @can('residential_complex_create')
            {!! Form::text('planning_prices['.$index.'][max_space]', old('planning_prices['.$index.'][max_space]', isset($field) ? $field->max_space: ''), ['class' => 'form-control']) !!}
        @else
            {!! Form::text('planning_prices['.$index.'][max_space]', old('planning_prices['.$index.'][max_space]', isset($field) ? $field->max_space: ''), ['class' => 'form-control', "readonly"]) !!}
        @endcan
    </td>
    <td>
        @can('residential_complex_create')
            {!! Form::text('planning_prices['.$index.'][price_per_squera_meter]', old('planning_prices['.$index.'][price_per_squera_meter]', isset($field) ? $field->price_per_squera_meter: ''), ['class' => 'form-control']) !!}
        @else
            {!! Form::text('planning_prices['.$index.'][price_per_squera_meter]', old('planning_prices['.$index.'][price_per_squera_meter]', isset($field) ? $field->price_per_squera_meter: ''), ['class' => 'form-control', "readonly"]) !!}
        @endcan
    </td>
    <td>
        @can('residential_complex_create')
            {!! Form::text('planning_prices['.$index.'][price_per_squera_meter_max]', old('planning_prices['.$index.'][price_per_squera_meter_max]', isset($field) ? $field->price_per_squera_meter_max: ''), ['class' => 'form-control']) !!}
        @else
            {!! Form::text('planning_prices['.$index.'][price_per_squera_meter_max]', old('planning_prices['.$index.'][price_per_squera_meter_max]', isset($field) ? $field->price_per_squera_meter_max: ''), ['class' => 'form-control', "readonly"]) !!}
        @endcan
    </td>
    <td>
        @can('residential_complex_create')
            {!! Form::text('planning_prices['.$index.'][min_price]', old('planning_prices['.$index.'][min_price]', isset($field) ? $field->min_price: ''), ['class' => 'form-control']) !!}
        @else
            {!! Form::text('planning_prices['.$index.'][min_price]', old('planning_prices['.$index.'][min_price]', isset($field) ? $field->min_price: ''), ['class' => 'form-control', "readonly"]) !!}
        @endcan
    </td>
    <td>
        @can('residential_complex_create')
            {!! Form::text('planning_prices['.$index.'][max_price]', old('planning_prices['.$index.'][max_price]', isset($field) ? $field->max_price: ''), ['class' => 'form-control']) !!}
        @else
            {!! Form::text('planning_prices['.$index.'][max_price]', old('planning_prices['.$index.'][max_price]', isset($field) ? $field->max_price: ''), ['class' => 'form-control', "readonly"]) !!}
        @endcan
    </td>
    {{--<td>{!! Form::text('planning_prices['.$index.'][number_of_apartments]', old('planning_prices['.$index.'][number_of_apartments]', isset($field) ? $field->number_of_apartments: ''), ['class' => 'form-control']) !!}</td>--}}

    <td>
        @can('residential_complex_create')
            <a href="#" class="remove btn btn-xs btn-danger">@lang('quickadmin.qa_delete')</a>
        @endcan
    </td>
</tr>
