

<?php $__env->startSection('title'); ?>
    تقرير الحضور والغياب للدورة التدريبية
<?php $__env->stopSection(); ?>

<?php $__env->startSection('first-css'); ?>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/charts.css/dist/charts.min.css">
    <style>
        #my-chart.column {
            height: 200px;
            /* max-width: 500px; */
            margin: 0 auto;
        }
    </style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content-body'); ?>
    <!--**********************************
                                    Content body start
                                ***********************************-->
    <?php echo $__env->make('massages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->startSection('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>
                تقرير الحضور والغياب للدورة التدريبية <?php echo e($rooms[0]->room->name); ?> <?php echo e($rooms[0]->room->course->title); ?>

            </h3>
            <div class="link">
                <a href="" class="px-4 ">عرض تقرير الحضور والغياب
                </a>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<!-- 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="<?php echo e(route('export_attendance', $rooms[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>
                                
                                <?php $__currentLoopData = $rooms[0]->attendances; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lesson): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if(isset($lesson)): ?>
                                        <th>
                                            <?php echo e($arrayDays[$lesson->created_at->format('D')]); ?>

                                        </th>
                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                



                                <th>نسبة الحضور</th>
                                <th>نسبة الغياب</th>
                                <th>نسبة الدروس الغير منجزة</th>

                            </tr>
                        </thead>
                        <tbody>
                            <?php if(isset($rooms)): ?>
                                <?php $__currentLoopData = $rooms; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $room): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr class="odd" role="row">
                                        <td>
                                            <?php if(isset($room)): ?>
                                                <?php echo e($loop->iteration); ?>

                                            <?php endif; ?>
                                        </td>
                                        <td>
                                            <?php if(isset($room->student->name)): ?>
                                                <?php echo e($room->student->name); ?>

                                            <?php endif; ?>
                                        </td>
                                        <?php $__currentLoopData = $room->attendances; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attendance): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if($attendance->is_present == 1): ?>
                                                <td>&#10003;</td>
                                            <?php else: ?>
                                                <td>&#10007;</td>
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                        <td>
                                            <?php if(isset($room->presentsPercentage)): ?>
                                                <?php echo e($room->presentsPercentage); ?>

                                            <?php else: ?>
                                                0
                                            <?php endif; ?>
                                            %
                                        </td>
                                        <td>
                                            <?php if(isset($room->absentsPercentage)): ?>
                                                <?php echo e($room->absentsPercentage); ?>

                                            <?php else: ?>
                                                0
                                            <?php endif; ?>
                                            %
                                        </td>
                                        <td>
                                            <?php if(isset($room->notAttendantPercentage)): ?>
                                                <?php echo e($room->notAttendantPercentage); ?>

                                            <?php else: ?>
                                                0
                                            <?php endif; ?>
                                            %
                                        </td>

                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
            <!--**********************************Table AllTransaction End***********************************-->
        </div>
    </div>

</div>

<div class="container-fluid">
    <div class="row row-cols-1  justify-content-around">
        <div class="card text-white bg-white mb-3 col-10">
            <div class="card-body d-flex row">
                <div class="col-md-12 col-lg-5 col-xl-5 col-sm-12 d-flex flex-column justify-content-start">
                    <div class="d-flex justify-content-start align-items-center mb-2 mt-4">
                        <div class="color-pointer bg-excellent"></div>
                        <div class="text-dark fw-bold pe-2">نسبة الحضور <span class="text-success">
                                <?php if(isset($presentsAll)): ?>
                                    <?php echo e($presentsAll); ?>

                                <?php endif; ?>%
                            </span></div>
                    </div>
                    <div class="d-flex justify-content-start align-items-center mb-2">
                        <div></div>
                        <div class="color-pointer bg-v-good"></div>
                        <div class="text-dark fw-bold pe-2">نسبة الغياب <span class="text-success">
                                <?php if(isset($absentsAll)): ?>
                                    <?php echo e($absentsAll); ?>

                                <?php endif; ?>%
                            </span></div>
                    </div>
                    <div class="d-flex justify-content-start align-items-center mb-2">
                        <div></div>
                        <div class="color-pointer bg-good"></div>
                        <div class="text-dark fw-bold pe-2">نسبة الغير منجزة <span class="text-success">
                                <?php if(isset($notAttendantAll)): ?>
                                    <?php echo e($notAttendantAll); ?>

                                <?php endif; ?>%
                            </span></div>
                    </div>


                </div>
                <div class="col-md-12 col-lg-7 col-xl-7 col-sm-12">

                    <div
                        style="
                        width: 250px; height: 250px;
                        border-radius: 50%;
                        margin:auto;

                        background: conic-gradient(
                            #35537d 0deg <?php echo e($presentsAllDeg); ?>deg,
                            #a31e23 <?php echo e($presentsAllDeg); ?>deg <?php echo e($presentsAllDeg + $absentsAllDeg); ?>deg,
                            #b37053 <?php echo e($presentsAllDeg + $absentsAllDeg); ?>deg <?php echo e($presentsAllDeg + $absentsAllDeg + $notAttendantAllDeg); ?>deg
                        );">
                    </div>
                    <h5 class="text-center text-primary mt-2">محتوى الدورة</h5>
                </div>
            </div>
        </div>


    </div>
</div>

<!--**********************************
                        Content body end
            ***********************************-->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\Nasser\Desktop\TrainingManagementPlatform\resources\views/reports/attendances-room.blade.php ENDPATH**/ ?>