<div class="col-lg-12 row pricing-list-item border-item mb-4" style="background-color: rgba(21,97,203,0.1);height:auto">
    @if(count($models))
        <div class="form-group col-lg-6">
            <label>{{ meta('model_id', getCurrentLocale()) ?? __('products.model_id') }} </label>
            <select class="form-control {{ $errors->has('model_id') ? 'is-invalid' : '' }}" name="model_id" >
                <option value="">{{__('dashboard.select')}}</option>
                @foreach($models as $row)
                    <option value="{{$row->id}}">{{$row->name}}</option>
                @endforeach
            </select>
        </div>
    @endif

    @if($category->brand_status == 'true')
        <div class="form-group col-lg-6">
            <label>{{ meta('brand_id', getCurrentLocale()) ?? __('products.brand_id') }} </label>
            <select  class="form-control {{ $errors->has('brand_id') ? 'is-invalid' : '' }}" name="brand_id" >
                <option value="">{{__('dashboard.select')}}</option>
                @foreach($brands as $row)
                    <option value="{{$row->id}}">{{$row->name}}</option>
                @endforeach
            </select>
        </div>
    @endif

    @if($category->gender_status == 'true')
        <div class="form-group col-lg-6">
            <label>{{ meta('gender', getCurrentLocale()) ?? __('products.gender') }} </label>
            <select  class="form-control {{ $errors->has('gender') ? 'is-invalid' : '' }}" name="gender" >
                <option value="">{{__('dashboard.select')}}</option>
                <option value="male">{{__('web.male')}}</option>
                <option value="female">{{__('web.female')}}</option>
            </select>
        </div>
    @endif
    @foreach($ones as $attribute)
            <div class="col-lg-12 row pricing-list-item border-item mb-4" style="background-color:white;height:auto">
                <div class="col-lg-12">
                    <h3>{{$attribute->name}}</h3>
                </div>
                <div class="form-group col-lg-6">
                    <label>{{ __('products.choice') }} </label>
                    <select class="form-control" name="one[{{$attribute->id}}][choice_id]" >
                        <option value="">{{__('dashboard.select')}}</option>
                        @foreach($attribute->choices as $choice)
                            <option value="{{$choice->choice_id}}">{{$choice->choice->currentLangauge->name}}</option>
                        @endforeach
                    </select>
                </div>
            </div>
    @endforeach

    @if($main)
        <div class="col-lg-12 row pricing-list-item border-item mb-4" style="background-color:white;height:auto">
            <div class="col-lg-12">
                <h3>{{$main->details->name}}</h3>
            </div>

            @foreach($main->choices as $key_main => $main_choice)
                <div class="col-lg-12 row">
                    <div class="col-lg-12 row pricing-list-item border-item mb-4" style="background-color: rgba(21,97,203,0.1);height:auto">
                        <div class="form-group col-lg-12">
                            <h3>{{ $main_choice->choice->details->name}}</h3>
                        </div>
                        @if(!$sub)
                            <div class="form-group col-lg-6">
                                <label>{{ __('products.count') }} </label>
                                <input type="number" min='0' name="multi[{{$main->id}}][{{$main_choice->choice_id}}][count]" class="form-control" placeholder="{{ __('products.count') }}">
                            </div>
                        @endif
                        <div class="form-group col-lg-6 image_container">
                            <label>{{  __('pages.image') }} </label>
                            <input id="image_{{$main->id . 'choice'.$main_choice->id }}_thumbnail" class="image_{{$main->id . 'choice'.$main_choice->id }}_thumbnail" type="hidden" name="multi[{{$main->id}}][{{$main_choice->choice_id}}][image]" />

                            <div class="photos main_{{$main->id . 'choice'.$main_choice->id }}_photo hide">
                                <div class="col-md-4">
                                    <div class="items">
                                        <div class="img">
                                            <a href="#" id="lfm" data-input=".image_{{$main->id . 'choice'.$main_choice->id }}_thumbnail" data-preview=".image_{{$main->id . 'choice'.$main_choice->id }}_holder" class="lfm" data-hide=".pick_{{$main->id . 'choice'.$main_choice->id }}_button">
                                                <img   id="image_{{$main->id . 'choice'.$main_choice->id }}_holder" class="image_{{$main->id . 'choice'.$main_choice->id }}_holder"/>
                                            </a>
                                        </div>
                                        <a href="#" class="showHide resetImage close" data-empty=".image_{{$main->id . 'choice'.$main_choice->id }}_thumbnail" data-hide=".main_{{$main->id . 'choice'.$main_choice->id }}_photo" data-show=".pick_{{$main->id . 'choice'.$main_choice->id }}_button"><i class="fas fa-times"></i></a>
                                    </div>
                                </div>
                            </div>

                            <div class="clearfix"></div>
                            <span class="input-group-btn pick_{{$main->id . 'choice'.$main_choice->id }}_button ">
                                <a id="lfm"  data-input=".image_{{$main->id . 'choice'.$main_choice->id }}_thumbnail" data-preview=".image_{{$main->id . 'choice'.$main_choice->id }}_holder" data-show=".main_{{$main->id . 'choice'.$main_choice->id }}_photo" data-hide=".pick_{{$main->id . 'choice'.$main_choice->id }}_button" class="lfm btn btn-primary text-light">
                                    <i class="fas fa-camera-retro"></i> Choose
                                </a>
                             </span>
                        </div>
                        @if($sub)
                        <div class="form-group col-lg-12">

                            <h4>{{ $sub->details->name}}</h4>
                        </div>

                            @foreach($sub->choices as $choice)
                                    <div class="col-lg-12 row pricing-list-item border-item mb-4" style="background-color: rgba(21,97,203,0.1);height:auto">
                                        <div class="form-group col-lg-12">
                                            <h5>{{ $choice->choice->details->name}}</h5>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label>{{ __('products.count') }} </label>
                                            <input type="number"min="0" name="multi[{{$main->id}}][{{$main_choice->choice_id}}][sub][{{$sub->id}}][{{$choice->choice_id}}][count]" class="form-control" placeholder="{{ __('products.count') }}">
                                        </div>
                                        <div class="form-group col-lg-6 image_container">
                                            <label>{{  __('pages.image') }} </label>
                                            <input id="image_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_thumbnail" class="image_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_thumbnail" type="hidden" name="multi[{{$main->id}}][{{$main_choice->choice_id}}][sub][{{$sub->id}}][{{$choice->choice_id}}][image]" />

                                            <div class="photos main_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_photo hide">
                                                <div class="col-md-4">
                                                    <div class="items">
                                                        <div class="img">
                                                            <a href="#" id="lfm" data-input=".image_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_thumbnail" data-preview=".image_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_holder" class="lfm" data-hide=".pick_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_button">
                                                                <img   id="image_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_holder" class="image_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_holder"/>
                                                            </a>
                                                        </div>
                                                        <a href="#" class="showHide resetImage close" data-empty=".image_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_thumbnail" data-hide=".main_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_photo" data-show=".pick_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_button"><i class="fas fa-times"></i></a>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="clearfix"></div>
                                            <span class="input-group-btn pick_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_button ">
                                            <a id="lfm"  data-input=".image_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_thumbnail" data-preview=".image_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_holder" data-show=".main_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_photo" data-hide=".pick_{{$main->id . 'choice'.$main_choice->id . 'subattr'.$sub->id .'choice'.$choice->id}}_button" class="lfm btn btn-primary text-light">
                                                <i class="fas fa-camera-retro"></i> Choose
                                            </a>
                                         </span>
                                        </div>
                                    </div>
                                @endforeach
                        @endif
                    </div>
                </div>
            @endforeach
        </div>
    @endif
</div>
<script src="{{ asset('assets/admin/js/editor.js') }}"></script>
<script src="{{ asset('assets/admin/js/lfm.js') }}"></script>
<script src="{{ asset('assets/admin/js/articles.js') }}"></script>
