@extends('web.layouts.container')

@section('content')
    <section class="inner_header">
        <img src="{{asset('assets/web/images/icons/inner.svg')}}" alt="" class="inner_shap">
        <div class="container">
            <ul class="links">
                <li>
                    <a href="{{LaravelLocalization::getLocalizedURL($lang, route('home'), [], true)}}">{{__('main.home')}}</a>
                </li>
                <li>
                    <a href="#"> {{$title}} </a>
                </li>
            </ul>
            <h4>{{$title}}</h4>
        </div>
    </section>
    <section class="consultation-sec section_padding">
        <div class="container">
            <div class="table-consultation table-responsive">
                <table class="table bg-white">
                    <thead>
                    <tr>
                        <th>{{__('activeConsultings.consulting_id')}}</th>
                        <th>{{__('activeConsultings.type')}}</th>
                        <th>{{__('activeConsultings.way')}}</th>
                        <th>{{__('activeConsultings.consulting_subject')}}</th>
                        <th>{{__('activeConsultings.date')}}</th>
                        <th>{{__('activeConsultings.time')}}</th>
                        <th>{{__('activeConsultings.status')}}</th>
                    </tr>
                    </thead>
                    <tbody>
                    @if(count($consultings))
                        @foreach($consultings as $consulting)
                            <tr>
                                <td>{{$consulting->id}}</td>
                                <td>{{ __('consultings.consulting') . __('consultings.'.$consulting->consulting_type)}}</td>
                                <td>{{ __('consultings.consulting') . __('consultings.'.$consulting->consulting_way)}}</td>
                                <td>{{wordLimit($consulting->consulting_subject, 5)}}</td>
                                <td>{{date('d/m/Y', strtotime($consulting->consulting_date))}}</td>
                                <td>{{date('h:i A', strtotime($consulting->consulting_time))}}</td>
                                <td>
                                    <a href="{{route('user.myConsultingDetails', $consulting->id)}}">
                                        <span class="badge bg-{{$consulting->status == 'active' ? 'success' : 'danger'}}">
                                        {{__('activeConsultings.'.$consulting->status)}}
                                    </span>
                                    </a>
                                </td>
                            </tr>
                        @endforeach
                        @else
                        <tr><td colspan="8" class="text-danger">{{__('consultings.no_consulting_requests')}}</td></tr>
                    @endif
                    </tbody>
                </table>
            </div>
        </div>
    </section>
@endsection

@section('inner_js')

@endsection
