@extends('frontend::page')

@section('content')

<!-- Big Container -->
<div class="big-container mt-3">

    <!-- Container -->
    <div class="container">

        <!-- Grid row -->
        <div class="row">

            <!-- Grid column -->
            <div class="col-md-8 mb-3">

                @if (!is_null($ad[5]))<div class="mb-3">{!! $ad[5] !!}</div>@endif

                @if ($settings['breadcrumbs'] == '1')
                <div class="breadcrumbs mb-3">
                    <a href="{{ asset('') }}">@lang('general.homepage')</a> »
                    @lang('general.search_results_for') <strong>"{{$search_query}}"</strong>
                </div>
                @endif

                @foreach ($categories as $category)
                @php $category_name[$category->id]=$category->title; @endphp
                @endforeach

                @if ($apps->isEmpty())
                <h6 class="alert alert-warning">@lang('general.no_search_results')
                </h6>
                @endif

                <div class="row apps mb-1">
                    @foreach ($apps as $app)

                    @if(empty($app->image))
                    @php $app->image='no_image.png'; @endphp
                    @endif

                    <div class="col-4 mb-2">
                        <a href="{{ asset($settings['app_base']) }}/{{ $app->slug }}"><img src="{{ asset('images/pixel.png') }}" data-src="{{ asset('images') }}/{{ $app->image }}" class="float-none mb-2 float-md-left" width="200" height="200" alt="{{ $app->title }}"></a>
                        <div class="box pl-2"><a href="{{ asset($settings['app_base']) }}/{{ $app->slug }}">{{ $app->title }}</a>

                            @if($settings['rating_as_number'] == '1')

                            @if(round($app->votes) == '0')
                            {!! svg_icon('fas fa-star') !!}
                            @else
                            {!! svg_icon('fas fa-star checked') !!}<span class="rating-numbers">{{$app->votes}}</span>
                            @endif

                            @else

                            @for ($i = 1; $i <= 5; $i++) @if($i<=round($app->votes))
                                {!! svg_icon('fas fa-star checked') !!}
                                @else
                                {!! svg_icon('fas fa-star') !!}
                                @endif
                                @endfor
                                @endif

                                <span class="category">{{ $category_name[$app->category] }}</span>
                                <span class="license">{{ $app->license }}</span>

                        </div>
                    </div>
                    @endforeach

                </div>

                @if (!is_null($ad[6])){!! $ad[6] !!}@endif

            </div>
            <!-- /Grid column -->

            <!-- Grid column -->
            <div class="col-md-4 bl-1 mb-3">
                @if (!is_null($ad[3]))<div class="mb-3">{!! $ad[3] !!}</div>@endif
                @include('frontend::inc.top', ['type' => '1'])
                @if (!is_null($ad[4]))<div class="mt-3">{!! $ad[4] !!}</div>@endif
            </div>
            <!-- /Grid column -->

        </div>
        <!-- /Grid row -->

    </div>
    <!-- /Container -->

</div>
<!-- /Big Container -->

@endsection
