<!--**********************************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>
                    <th>الحالة</th>
                    <th>العمليات</th>
                </tr>
            </thead>
            <tbody>
                    @isset($rooms)
                        @foreach ($rooms as $room)
                        <tr class="odd" role="row">
                            <td>
                                @isset($room)
                                    {{ $loop->iteration }}
                                @endisset
                            </td>
                            <td>
                                @isset($room->name)
                                    {{ $room->name }}
                                @endisset
                            </td>
                            <td>
                                @isset($room->place)
                                    {{ $room->place }}
                                @endisset
                            </td>
                            <td>
                                @isset($room->course->title)
                                    {{ $room->course->title }}
                                @endisset
                            </td>
                            <td>
                                @isset($room->trainer->name)
                                    {{ $room->trainer->name }}
                                @endisset
                            </td>
                            <td>
                                @isset($room->coordinator->name)
                                    {{ $room->coordinator->name }}
                                @endisset
                            </td>
                            <td>
                                @isset($room->students)
                                    {{count($room->students) }}
                                @endisset
                            </td>

                            <td>
                                @isset($room->is_active)
                                    @if ($room->is_active == 1)
                                        <span class="badge badge-success light">نشط</span>
                                    @else
                                        <span class="badge badge-danger light">غير نشط</span>
                                    @endif
                                @endisset
                            </td>
                            <td>
                                <div class="dropdown dropstart">
                                    <a href="javascript:void(0);" class="btn-link" data-bs-toggle="dropdown"
                                        aria-expanded="false">
                                        <svg width="24" height="24" viewBox="0 0 24 24" fill="none"
                                            xmlns="http://www.w3.org/2000/svg">
                                            <path
                                                d="M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z"
                                                stroke="#575757" stroke-width="2" stroke-linecap="round"
                                                stroke-linejoin="round"></path>
                                            <path
                                                d="M12 6C12.5523 6 13 5.55228 13 5C13 4.44772 12.5523 4 12 4C11.4477 4 11 4.44772 11 5C11 5.55228 11.4477 6 12 6Z"
                                                stroke="#575757" stroke-width="2" stroke-linecap="round"
                                                stroke-linejoin="round"></path>
                                            <path
                                                d="M12 20C12.5523 20 13 19.5523 13 19C13 18.4477 12.5523 18 12 18C11.4477 18 11 18.4477 11 19C11 19.5523 11.4477 20 12 20Z"
                                                stroke="#575757" stroke-width="2" stroke-linecap="round"
                                                stroke-linejoin="round"></path>
                                        </svg>
                                    </a>
                                    <div class="dropdown-menu">
                                        <a class="dropdown-item" href="{{route('lesson_attendances_list',$room->id)}}"><i
                                            class="fa fa-briefcase ms-3 text-primary"></i>إدارة الحضور</a>
                                            
                                        @if(Auth::user()->role == 0)
                                        <a href="{{route('students_subscribers',$room->id)}}"
                                            class="dropdown-item" ><i class="mdi mdi-account-group  ms-3 text-warning"></i>عرض الطلاب</a>
                                            <a class="dropdown-item" href="{{route('appendix_list',$room->id)}}"><i
                                                class="fa fa-briefcase ms-3 text-primary"></i> الملحقات</a>
                                        <button type="button" value=""
                                            data-id="@isset($room->id){{ $room->id }} @endisset"
                                            data-space="@isset($room->space){{ $room->space }}@endisset"
                                            data-name="@isset($room->name){{ $room->name }}@endisset"
                                            data-course_id="@isset($room->course->id){{ $room->course->id }}@endisset"
                                            data-trainer_id="@isset($room->trainer->id){{ $room->trainer->id }}@endisset"
                                            data-coordinator_id="@isset($room->coordinator->id){{ $room->coordinator->id }}@endisset"
                                            data-type="1" class="updateRoom dropdown-item" href=" transaction-details.html"><i
                                                class="bi bi-pencil-square text-success ms-3"></i>تعديل </button>
                                        <button type="button" value="" data-id="{{ $room->id }}"
                                            data-is_active="{{ $room->is_active }}" data-title="الدورة التدريبية"
                                            data-route='{{ route('class_room_toggle') }}' class="toggle dropdown-item"
                                            href="toggle ">
                                            @if ($room->is_active == 1)
                                                <i class="bi bi-eye-slash-fill fa-trash ms-3 text-danger"></i>تعليق
                                            @else
                                                <i class="bi bi-eye-fill ms-3 text-success"></i>تفعيل
                                            @endif
                                        </button>
                                        <button type="button" data-route="{{ route('class_room_delete') }}"
                                            data-id="@isset($room->id){{ $room->id }}@endisset"
                                            class=" delete-item   dropdown-item" href="toggle "><i
                                                class="fa fa-trash ms-3 text-danger"></i>حذف
                                            </button>
                                            {{-- <a href="{{route('report_attendances_students',$room->id)}}"
                                            class="    dropdown-item" href="toggle "><i
                                                class="uil uil-chart ms-3 text-info"></i>تقرير الحضور والغياب
                                            </a>
                                            <a href="{{route('report_exam_students',$room->id)}}"
                                            class="    dropdown-item" href="toggle "><i
                                                class="uil uil-chart ms-3 text-info"></i>تقرير  الاختبارات
                                            </a>
                                            <a href="{{route('report_evaluation',$room->id)}}"
                                            class="    dropdown-item" href="toggle "><i
                                                class="uil uil-chart ms-3 text-info"></i>تقرير الاستبيانات 
                                            </a> --}}
                                            <a href="{{route('class_room_students_certificates',$room->id)}}"
                                            class="    dropdown-item" href="toggle "><i
                                                class="uil uil-chart ms-3 text-info"></i>صرف الشهادات  
                                            </a>  
                                            
                                        @endif
                                    </div>
                                </div>
                            </td>
                        </tr>
                    @endforeach
                @endisset
            </tbody>
        </table>
    </div>
</div>
<!--**********************************Table AllTransaction End***********************************-->
