@extends('layouts.master')

@section('title')
    @isset($subscriber->room->name)
        {{ $subscriber->room->name }}
    @endisset
@endsection

@section('first-css')
@endsection

@section('content-body')
    <!--**********************************
                    Content body start
                ***********************************-->
    @include('massages')

    <!-- row -->
    <div class="container-fluid">
        <div class="row invoice-card-row">
            <div class="row invoice-card-row">
                <div class="col-xl-12">
                    <div class="card">
                        <div class="card-body pb-3 tran px-5">
                            <div class="form-validation">
                                <form class="validation need-validation" method="POST"
                                    action="{{ route('students_evaluation_store') }}">
                                    @csrf
                                    <input  type="hidden" name="subscriberId" value=" @isset($subscriber->id){{$subscriber->id}}@endisset">
                                    <div class="card-header">
                                        <h5 class="card-title ">
                                            @isset($subscriber->room->name)
                                                {{ $subscriber->room->name }}
                                            @endisset
                                        </h5>
                                    </div>
                                    <div class=" all-quations   py-3 mb-2" id="allQuationts">
                                        @isset($evaluations)
                                            @foreach ($evaluations as $evaluation)
                                                @isset($evaluation->type)
                                                    @if ($evaluation->type == 0)
                                                    <div class="border mb-2">
                                                        <div class="row   my-2 quation qution-radio mx-auto">
                                                            <div class="card-header">
                                                                <h5 class="card-title ">
                                                                    <span>{{$loop->iteration}} : @isset($evaluation->name){{$evaluation->name}}@endisset</span>
                                                                </h5>
                                                            </div>
                                                        </div>
                                                        @isset($evaluation->values)
                                                        @foreach ($evaluation->values as $value)

                                                        <div class="col-12 py-3 border-bottom ">
                                                            <label class="form-label fw-bold px-2 " for="name">{{$loop->iteration}} - @isset($value->name){{$value->name}}@endisset</label>
                                                            <div class="options" style="display: block;">
                                                                <div class="row    pt-3 single-option">
                                                                    <div
                                                                        class="col-12 col-md-12 fv-plugins-icon-container pt-2 pe-4 mb-1">
                                                                        <input  class="form-check-input radio row-option mt-0 me-3" id="benefit-@isset($value->id){{$value->id}}@endisset-4"
                                                                            type="radio" name="benefit[@isset($value->id){{$value->id}}@endisset]"
                                                                            value="4">
                                                                        <label class=" fw-bold me-3" for="benefit-@isset($value->id){{$value->id}}@endisset-4">ممتاز</label>
                                                                    </div>
                                                                    <div
                                                                        class="col-12 col-md-12 fv-plugins-icon-container pt-2 pe-4 mb-1">
                                                                        <input  class="form-check-input radio row-option mt-0 me-3" id="benefit-@isset($value->id){{$value->id}}@endisset-3"
                                                                            type="radio" name="benefit[@isset($value->id){{$value->id}}@endisset]"
                                                                            value="3">
                                                                        <label class=" fw-bold me-3" for="benefit-@isset($value->id){{$value->id}}@endisset-3">جيد جداً</label>
                                                                    </div>
                                                                    <div
                                                                        class="col-12 col-md-12 fv-plugins-icon-container pt-2 pe-4 mb-1">
                                                                        <input  class="form-check-input radio row-option mt-0 me-3" id="benefit-@isset($value->id){{$value->id}}@endisset-2"
                                                                            type="radio" name="benefit[@isset($value->id){{$value->id}}@endisset]"
                                                                            value="2">
                                                                        <label class=" fw-bold me-3" for="benefit-@isset($value->id){{$value->id}}@endisset-2">جيد</label>
                                                                    </div>
                                                                    <div
                                                                        class="col-12 col-md-12 fv-plugins-icon-container pt-2 pe-4 mb-1">
                                                                        <input  class="form-check-input radio row-option mt-0 me-3" id="benefit-@isset($value->id){{$value->id}}@endisset-1"
                                                                            type="radio" name="benefit[@isset($value->id){{$value->id}}@endisset]"
                                                                            value="1">
                                                                        <label class=" fw-bold me-3" for="benefit-@isset($value->id){{$value->id}}@endisset-1">مقبول</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        @endforeach
                                                        @endisset
                                                    </div>
                                                    @else
                                                    <div class="border mb-2">
                                                        <div class="row   my-2 quation qution-radio mx-auto">
                                                            <div class="card-header">
                                                                <h5 class="card-title ">
                                                                    <span>{{$loop->iteration}}: @isset($evaluation->name){{$evaluation->name}}@endisset</span>
                                                                </h5>
                                                            </div>
                                                        </div>
                                                        <div class="row px-3 mb-3 ">
                                                            <div class="col-12 ">
                                                                <textarea class="form-control form-white type-quation mt-2" rows="8" placeholder="ادخل نص الاجابة هنا ...." style="height: auto"
                                                                    name="txtValue[@isset($evaluation->values[0]->id){{$evaluation->values[0]->id}}@endisset]"></textarea>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    @endif
                                                @endisset
                                            @endforeach
                                        @endisset
                                    </div>
                                    <div class="col-xl-12" style="direction: ltr;">
                                        <button type="submit" class="btn btn-primary me-sm-3 me-1">حفظ </button>
                                    </div>
                                </form>
                            </div>

                        </div>
                    </div>

                </div>

            </div>
        </div>
    </div>
    <!--**********************************
                    Content body end
        ***********************************-->


@endsection

@section('script')
    <script src="{{ asset('/vendor/datatables/js/jquery.dataTables.min.js') }}"></script>
    <script src="{{ asset('/js/plugins-init/datatables.init.js') }}"></script>
@endsection
