@extends('layouts.master')

@section('title')
    تقرير الاختبارات للدورة التدريبية
@endsection

@section('first-css')
@endsection

@section('content-body')
    <!--**********************************
                            Content body start
                        ***********************************-->
    @include('massages')
@section('route-path')
    <div class="container-fluid container-fluid-traning px-0">
        <div class="d-flex flex-wrap align-items-end justify-content-between  mb-3">
            <h3>
                تقرير اختبارات  
                @isset($exams[0]->room->name)
                {{$exams[0]->room->name}}
                {{$exams[0]->room->course->title}}
                @endisset
            </h3>
            <div class="link">
                <a href="" class="px-4 ">                   
                </a>
            </div>
        </div>
    </div>
@endsection
<!-- row -->
<div class="container-fluid container-fluid-traning bg-white">
    <!--**********************************Tabs Start***********************************-->
    <div class="d-flex flex-wrap align-items-start justify-content-start  mb-3">
        <a href="{{route('export_exam',$exams[0]->room->id)}}" class="btn btn-primary  me-1" >
            <i class="mdi mdi-plus-circle ms-2"></i> تصدير
        </a>
    </div>
    <!--**********************************Tabs End***********************************-->
    <div class="row">
        <div class="col-xl-12 tab-content">
            <!--**********************************Table AllTransaction Start***********************************-->

            <div class="tab-pane fade show active" id="AllTransaction" role="tabpanel"
                aria-labelledby="transaction-tab">
                <div class="table-responsive fs-14">
                    <table class="table card-table display mb-4 dataTablesCard text-black text-center" id="example">
                        <thead>
                            <tr>
                                <th>رقم </th>
                                <th>اسم المتدرب </th>
                                {{-- <th> البرنامج</th> --}}
                                <th>نوع الاختبار</th>
                                <th> تاريخ رفع الاختبار</th>
                                <th> درجة الطالب</th>
                                <th>درجة الإختبار</th>

                            </tr>
                        </thead>
                        <tbody>
                            @isset($exams)
                            @foreach ($exams as $exam)
                                @foreach ($exam->uploaded as $student)
                                    <tr class="odd" role="row">
                                        <td>
                                             @isset($student)
                                                {{ $loop->iteration }}
                                            @endisset
                                        </td>
                                        <td>
                                            @isset($student->subscribe->student->name)
                                                {{$student->subscribe->student->name}}
                                            @endisset
                                           
                                        </td>
                                        {{-- <td>
                                            @isset($student->exam->room->name)
                                            {{$student->exam->room->name}}
                                            {{$student->exam->room->course->title}}
                                        @endisset
                                        </td> --}}
                                        <td>
                                            @isset($student->exam)
                                            @if($student->exam->type ==0)
                                                قبلي
                                                @elseif($student->exam->type==1)
                                                بعدي
                                                @else
                                                اجتياز
                                                @endif
                                            @endisset
                                        </td>
                                        <td> 
                                            @isset($student->created_at)
                                            {{$student->created_at}}
                                           
                                        @endisset
                                        </td>
                                        <td> 
                                            @isset($student->totalMark)
                                            {{$student->totalMark}}
                                        @endisset
                                        </td>
                                        <td> 
                                            @isset($student->questionMark)
                                            {{$student->questionMark}}
                                        @endisset
                                        </td>
                                        
                                    </tr>
                                @endforeach
                                @endforeach
                            @endisset
                        </tbody>
                    </table>
                </div>
            </div>
            <!--**********************************Table AllTransaction End***********************************-->
        </div>
    </div>
</div>

<!--**********************************
                        Content body end
            ***********************************-->
@endsection
@section('script')
@endsection
