

<?php $__env->startSection('title'); ?>
    لوحة التحكم
<?php $__env->stopSection(); ?>

<?php $__env->startSection('first-css'); ?>
<?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 if(Auth::user()->role == 0): ?>
        <?php echo $__env->make('admin.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php elseif(Auth::user()->role == 1): ?>
        <?php echo $__env->make('trainer.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php else: ?>
        <!--**********************************
                            Content body end
                        ***********************************-->


        <div class="container">
            <div class="" style="min-height: 828px;">
                <div class="container-fluid">
                    <div class="row">
                        <?php if(isset($rooms)): ?>
                            <?php $__currentLoopData = $rooms; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $room): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="col-xl-4 col-lg-4 col-md-6">
                                    <div class="card">
                                        <img class="card-img-top img-fluid"
                                            src="<?php echo e(asset('/images/card/' . mt_rand(1, 4) . '.jpg')); ?>" style="border-radius: 0"
                                            alt="Card image cap">
                                        <div class="mt-2">
                                            <h3 class="text-center text-primary fw-bold">
                                                برنامج <?php if(isset($room->room->course->title)): ?>
                                                    <?php echo e($room->room->course->title); ?>

                                                <?php endif; ?>
                                            </h3>
                                        </div>

                                        <div class="mt-1 py-2 pt-0 w-75 m-auto">
                                            <div class="d-flex align-items-center justify-content-start text-center">
                                                <i class="fa fa-briefcase ms-3 text-warning"></i>
                                                <h6 class="text-center text-secondary">
                                                    برنامج <?php if(isset($room->room->course->title)): ?>
                                                        <?php echo e($room->room->course->title); ?>

                                                    <?php endif; ?>
                                                </h6>
                                            </div>
                                            <div class="d-flex align-items-center justify-content-start">
                                                <i class="mdi mdi-account-group  ms-3 text-warning"></i>
                                                <div> مشرف البرنامج: <?php if(isset($room->room->trainer->name)): ?>
                                                        <?php echo e($room->room->trainer->name); ?>

                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                            <div class="d-flex align-items-center justify-content-start">
                                                <i class=" bi bi-pencil-square  ms-3 text-warning"></i>
                                                <div> عدد الدروس
                                                    <?php if(isset($room->room->course->lessons)): ?>
                                                        <?php echo e(count($room->room->course->lessons)); ?>

                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="post-more my-3 text-center">
                                            <a
                                                class="btn btn-primary mb-2  w-75 "href="<?php echo e(route('appendix_listRoom', $room->id)); ?>">
                                                الملحقات
                                            </a>
                                            <?php
                                                $hase_certificate = false;
                                            ?>
                                            <?php if(isset($certificates)): ?>
                                                <?php $__currentLoopData = $certificates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $certificate): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <?php if($certificate->room_id == $room->room->id): ?>
                                                        <a
                                                            class="btn btn-primary  w-75 "href="<?php echo e(route('get_certificate', $certificate->id)); ?>">
                                                            الشهادة
                                                        </a>
                                                        <?php
                                                            $hase_certificate = true;
                                                        ?>
                                                        <?php break; ?>
                                                    <?php else: ?>
                                                        <?php
                                                            $hase_certificate = false;
                                                        ?>
                                                    <?php endif; ?>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            <?php if(!$hase_certificate): ?>
                                                <a
                                                    class="btn btn-primary  w-75 "href="<?php echo e(route('students_exam_list', $room->room->id)); ?>">
                                                    الاختبارات
                                                </a>
                                            <?php endif; ?>
                                        <?php else: ?>
                                            <a
                                                class="btn btn-primary  w-75 "href="<?php echo e(route('students_exam_list', $room->room->id)); ?>">
                                                الاختبارات
                                            </a>
                                        <?php endif; ?>

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

    </div>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
<script>
    $(document).ready(function() {
        $('table.display').DataTable();
    });
</script>
<script src="<?php echo e(asset('/vendor/datatables/js/jquery.dataTables.min.js')); ?>"></script>
<script src="<?php echo e(asset('/js/plugins-init/datatables.init.js')); ?>"></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/student/dashboard.blade.php ENDPATH**/ ?>