<table >
   <tr>
    <td>اسم البرنامج : </td>
    <td> {{$rooms[0]->room->name }} {{$rooms[0]->room->course->title }}</td>
   </tr>
   <tr>
    <td>تاريخ التنفيذ  : </td>
    <td>
{{         $rooms[0]->attendances[$rooms[0]->attendances->count()-1]->created_at->format('Y/m/d').' - '. $rooms[0]->attendances[0]->created_at->format('Y/m/d');}}
    </td>
   </tr>
   <tr>
    <td> مكان التنفيذ : </td>
    <td> 
        {{$rooms[0]->room->place }}
    </td>
   </tr>
</table>
<table >
    <thead>
        <tr>
            <th>رقم </th>
            <th>اسم المتدرب </th>
            @foreach ($rooms[0]->attendances as $lesson)
            @isset($lesson)
                <th>
                    {{$arrayDays[$lesson->created_at->format('D')]}}
                </th>
            @endisset
        @endforeach
            <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->student->name)
                            {{ $room->student->name }}
                        @endisset
                    </td>
                    @foreach ($room->attendances as $attendance)
                    @if ($attendance->is_present == 1)
                        <td>&#10003;</td>
                    @else
                        <td>&#10007;</td>
                    @endif
                @endforeach
                    <td>
                        @isset($room->presentsPercentage)
                            {{ $room->presentsPercentage }}
                        @else
                            0
                        @endisset
                            %
                    </td>
                    <td>
                        @isset($room->absentsPercentage)
                            {{ $room->absentsPercentage }}
                        @else
                            0
                        @endisset
                            %
                    </td>
                    <td>
                        @isset($room->notAttendantPercentage)
                            {{ $room->notAttendantPercentage }}
                        @else
                            0
                        @endisset
                            %
                    </td>

                </tr>
            @endforeach
        @endisset
    </tbody>
</table>