@extends('admin.layouts.container')

@section('content')
    <div class="side-title">
        <h3>{{$head ?? '' }}</h3>
    </div>

    <div class="border-item">
        <form class="form-row">
            <div class="form-group col-lg-4">
                <label>{{ meta('user_id', getCurrentLocale()) ?? __('comments.user_id') }} </label>
                <input type="text" class="form-control" value='{{ $evaluate->user_name }}'/>
            </div>
            <div class="form-group col-lg-4">
                <label>{{ meta('email', getCurrentLocale()) ?? __('comments.email') }} </label>
                <input type="text" class="form-control" value='{{ $evaluate->user_email }}'/>
            </div>
            <div class="form-group col-lg-3">
                <label>{{ meta('phone', getCurrentLocale()) ?? __('comments.phone') }} </label>
                <input type="text" class="form-control" value='{{ $evaluate->user_phone }}'/>
            </div>
            <div class="form-group col-lg-1">
                <label>{{ __('evaluates.status') }}</label>
                <a style="cursor: pointer" class="active_evaluate icon form-control text-center" data-href="{{route('evaluates.activeEvaluate', $evaluate->id)}}">
                    <i class="fa fa-2x {{$evaluate->status ? 'fa-check text-success' : 'fa-times text-danger'}}"></i>
                </a>
            </div>

            @if($evaluate->hotel_id)
                <div class="form-group col-lg-12">
                    <label>{{ meta('hotel_id', getCurrentLocale()) ?? __('comments.hotel_id') }} </label>
                    <input type="text" class="form-control" value='{{ $evaluate->hotel_name }}'/>
                </div>
            @endif
            @if($evaluate->umrah_trip_id)
                <div class="form-group col-lg-12">
                    <label>{{ meta('umrah_trip_id', getCurrentLocale()) ?? __('comments.umrah_trip_id') }} </label>
                    <input type="text" class="form-control" value='{{ $evaluate->umrah_name }}'/>
                </div>
            @endif
{{--            <div class="form-group col-lg-2">--}}
{{--                <label>{{ meta('evaluate_average', getCurrentLocale()) ?? __('comments.evaluate_average') }}</label>--}}
{{--                <input type="text" class="form-control" value='{{ $evaluate->evaluate_average }}'/>--}}
{{--            </div>--}}
            <div class="form-group col-lg-12">
                <label>{{ meta('comment', getCurrentLocale()) ?? __('comments.comment') }} </label>
                <textarea class="form-control">{{ $evaluate->comment}}</textarea>
            </div>

            <div class="text-center mt-5 col-12">
                <a href="{{route('evaluates.index')}}" class="butn"><span>{{ __('evaluates.head') }}</span></a>
            </div>

        </form>
    </div>

@endsection

@section('inner_js')
    <script>
        $(document).ready(function () {
            $(document).on('click', '.active_evaluate' , async function (e) {
                e.preventDefault();
                let url = $(this).data('href'),
                    method = 'get';

                const response=await ajax({
                    url,
                    dataType: 'json',
                    method,
                });
                if (response.message) {
                    $(this).children('i').toggleClass('fa-check text-success fa-times text-danger')

                }
            });
        });

    </script>
@endsection



