@extends('layouts.patient.layout')
@section('title')
    <title>{{ seoSetting()->where('page_name', 'Doctor')->first()?->seo_title ?? 'Doctor | DocMent' }}</title>
@endsection
@section('meta')
    <meta name="description"
        content="{{ seoSetting()->where('page_name', 'Doctor')->first()?->seo_description ?? 'Doctor | DocMent' }}">
@endsection
@section('patient-content')

    <!--Banner Start-->
    <div class="banner-area flex"
        style="background-image:url({{ $setting?->breadcrumb_image ? url($setting?->breadcrumb_image) : '' }});">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <div class="banner-text">
                        <h1>{{ __('Doctors') }}</h1>
                        <ul>
                            <li><a aria-label="{{ __('Home') }}" href="{{ url('/') }}">{{ __('Home') }}</a></li>
                            <li><span>{{ __('Doctors') }}</span></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--Banner End-->


    <div class="doctor-search">
        <div class="container">
            <div class="row">
                <div class="col-md-12">

                    <div class="s-container">
                        <form action="{{ route('website.search.doctor') }}">

                            <div class="s-box">
                                <select name="location" class="form-control select2">
                                    <option value="">{{ __('Select Location') }}</option>
                                    @foreach ($locations as $location)
                                        <option {{ @$location_id == $location?->id ? 'selected' : '' }}
                                            value="{{ $location?->id }}">{{ ucwords($location?->name) }}</option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="s-box">
                                <select name="department" class="form-control select2">
                                    <option value="">{{ __('Select Department') }}</option>
                                    @foreach ($departments as $department)
                                        <option {{ @$department_id == $department?->id ? 'selected' : '' }}
                                            value="{{ $department?->id }}">{{ ucwords($department?->name) }}</option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="s-box">
                                <select name="doctor" class="form-control select2">
                                    <option value="">{{ __('Select Doctor') }}</option>
                                    @foreach ($doctorsForSearch as $doctor)
                                        <option {{ @$doctor_id == $doctor->id ? 'selected' : '' }}
                                            value="{{ $doctor?->id }}">
                                            {{ ucwords($doctor?->name) }}</option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="s-button">
                                <button type="submit">{{ __('Search') }}</button>
                            </div>
                        </form>
                    </div>

                </div>
            </div>
        </div>
    </div>




    <!--Service Start-->
    <div class="team-page pb_70">
        <div class="container">
            <div class="row">

                @if ($doctors->count() != 0)
                    @foreach ($doctors as $doctor)
                        <div class="col-lg-3 col-md-4 col-sm-6 mt_30">
                            <div class="team-item">
                                <div class="team-photo">
                                    <img src="{{ url($doctor?->image ? $doctor?->image : $setting?->default_avatar) }}"
                                        alt="{{$doctor?->name}}" loading="lazy">
                                </div>
                                <div class="team-text">
                                    <a aria-label="{{ $doctor?->name }}"
                                        href="{{ route('website.doctor.details', $doctor?->slug) }}">{{ ucfirst($doctor?->name) }}</a>
                                    <p>{{ ucfirst($doctor?->department?->name) }}</p>
                                    <p><span><i class="fas fa-graduation-cap"></i> {{ $doctor?->designations }}</span></p>
                                    <p><span><b><i class="fas fa-street-view"></i>
                                                {{ ucfirst($doctor?->location?->name) }}</b></span></p>
                                </div>
                                <div class="team-social">
                                    <ul>
                                        @foreach ($doctor?->socialMedia as $socialMedia)
                                            <li><a target="_blank" aria-label="{{ $socialMedia?->icon }}"
                                                    href="{{ $socialMedia?->link }}"><img src="{{ asset($socialMedia?->icon) }}" alt="{{ $socialMedia?->link }}" loading="lazy"></a>
                                            </li>
                                        @endforeach
                                    </ul>
                                </div>
                            </div>
                        </div>
                    @endforeach
                @else
                    <h3 class="text-danger text-center mt-5">{{ __('Doctor Not Found') }}</h3>
                @endif


            </div>
            @if ($doctors->hasPages())
                {{ $doctors->links('patient.paginator') }}
            @endif
        </div>
    </div>
    <!--Service End-->






@endsection
