@extends('layouts.master')

@section('title')
    عرض  طلاب للدورة  @isset($classRoom->name)
        {{ $classRoom->name }}
    @endisset
@endsection

@section('first-css')
@endsection

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

    <!-- row -->
    <div class="container-fluid container-fluid-traning bg-white">
        <!--**********************************Tabs Start***********************************-->
        <!--**********************************Tabs End***********************************-->
        <div class="row">
            <div class="col-xl-12 tab-content">
                <form id="studentForm" method="POST" action="{{ route('certificate_store') }}"
                    class="row g-3 fv-plugins-bootstrap5 fv-plugins-framework  form-disable" >
                    @csrf
                    <input type="hidden" name="classRoomId" value="{{ $classRoom->id }}">
                    <!--**********************************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>
                                    </tr>
                                </thead>
                                <tbody>
                                    @isset($students)
                                        @foreach ($students as $student)
                                            <tr class="odd" role="row">
                                                <td>
                                                    @isset($student->id)
                                                        {{ $student->id }}
                                                    @endisset
                                                </td>
                                                <td>
                                                    @isset($student->name)
                                                        {{ $student->name }}
                                                    @endisset
                                                </td>
                                                <td>
                                                    @isset($student->certificate_name)
                                                        {{ $student->certificate_name }}
                                                    @endisset
                                                </td>
                                                <td>
                                                    @isset($student->id)
                                                    <div class="checkbox-primary check-lg">
                                                        <input type="hidden" name="roomId" value="{{$classRoom->id}}">
                                                        <input type="checkbox" class="form-check-input" name="studentsId[]" value="{{ $student->id }}" id="customCheckBox9" >
                                                    </div>
                                                    @endisset
                                                </td>
                                            </tr>
                                        @endforeach
                                    @endisset
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <!--**********************************Table AllTransaction End***********************************-->
                    <button type="submit" class="btn btn-primary me-sm-3 me-1 form-btn-disable">صرف الشهادات</button>
                </form>
            </div>
        </div>
    </div>

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

@endsection
@section('script')
@endsection
