<div class="col-md-12">
    <div class="accordion" id="accordionExample">
        <div class="collapse-margin">
            <div class="card-header" id="headingOne" data-toggle="collapse" role="button" data-target="#collapseOne"
                aria-expanded="false" aria-controls="collapseOne">
                <span class="lead collapse-title">
                    <i class="fa fa-filter"></i> @lang('admin.orders.Filter')
                </span>
            </div>

            <div id="collapseOne" class="collapse" aria-labelledby="headingOne" data-parent="#accordionExample">
                <div class="card-body">
                    <form method="get" action="{{ route('dashboard.product.search') }}">
                        <div class="form-body">
                            <div class="row">
                                <div class="col-md-6 col-12">
                                    <div class="form-group">
                                        <label for="id">@lang('admin.products.product_Id')</label>
                                        <input type="number" id="id" class="form-control"
                                            value="{{ request()->get('id') }}" placeholder="@lang('admin.products.product_Id')"
                                            name="id">
                                    </div>
                                </div>

                                <div class="col-md-6 col-12">
                                    <div class="form-group">
                                        <label for="name">@lang('admin.products.name')</label>
                                        <input type="text" id="name" class="form-control"
                                            value="{{ request()->get('name') }}" placeholder="@lang('admin.products.name')"
                                            name="name">
                                    </div>
                                </div>

                                <div class="col-md-6 col-12">
                                    <div class="form-group">
                                        <label for="category">@lang('admin.categories.title')</label>
                                        <select class="form-control" id="category" name="category">
                                            <option selected disabled>@lang('admin.categories.Not selected')</option>
                                            @foreach ($categories as $category)
                                                <option value="{{ $category->id }}"
                                                    @if (request('category') == $category->id) selected @endif>
                                                    {{ $category->getName() }}
                                                </option>

                                                @foreach ($category->parents as $parent)
                                                    <option value="{{ $parent->id }}"
                                                        @if (request('category') == $parent->id) selected @endif>
                                                        {{ $parent->getName() }}
                                                    </option>

                                                    @foreach ($parent->parents as $parentt)
                                                        <option value="{{ $parentt->id }}"
                                                            @if (request('category') == $parentt->id) selected @endif>
                                                            {{ $parentt->getName() }}
                                                        </option>
                                                    @endforeach
                                                @endforeach
                                            @endforeach
                                        </select>
                                    </div>
                                </div>

                                <div class="col-md-6 col-12">
                                    <div class="form-group">
                                        <label for="in_stock">@lang('admin.products.In stock')</label>
                                        <select class="form-control" id="in_stock" name="in_stock">
                                            <option selected value="2">@lang('admin.categories.Not selected')</option>
                                            <option value="1" @if (request('in_stock') == '1') selected @endif>
                                                @lang('admin.products.In stock')</option>
                                            <option value="0" @if (request('in_stock') == '0') selected @endif>
                                                @lang('admin.products.not available')
                                            </option>
                                        </select>
                                    </div>
                                </div>

                                <div class="col-md-6 col-12">
                                    <div class="form-group">
                                        <label for="published">@lang('admin.products.Moderation status')</label>
                                        <select class="form-control" id="published" name="published">
                                            <option selected disabled>@lang('admin.categories.Not selected')</option>
                                            <option value="1" @if (request('published') == '1') selected @endif>
                                                @lang('admin.products.published')
                                            </option>
                                            <option value="2" @if (request('published') == '2') selected @endif>
                                                @lang('admin.products.not_published')
                                            </option>
                                        </select>
                                    </div>
                                </div>

                                <div class="col-md-6 col-12">
                                    <div class="form-group">
                                        <label for="article_number">@lang('admin.orders.article_number')</label>
                                        <input type="text" id="article_number" class="form-control"
                                            value="{{ request()->get('article_number') }}" placeholder="@lang('admin.orders.article_number')"
                                            name="article_number">
                                    </div>
                                </div>

                                <div class="col-12">
                                    <button type="submit" class="btn btn-primary mr-1 mb-1 waves-effect waves-light"><i
                                            class="fa fa-filter"></i> @lang('admin.products.Apply')</button>
                                    <a href="{{ route('dashboard.products') }}"
                                        class="btn btn-outline-warning mr-1 mb-1 waves-effect waves-light">@lang('admin.products.Reset')</a>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
