<?php if (isset($component)) { $__componentOriginald7f77a02f879fd4954ea3c39c4e952cb = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginald7f77a02f879fd4954ea3c39c4e952cb = $attributes; } ?>
<?php $component = Modules\LMS\View\Components\Dashboard\Layout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Modules\LMS\View\Components\Dashboard\Layout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('title', null, []); ?> <?php echo e(translate('Enrollment/Manage')); ?> <?php $__env->endSlot(); ?>
    <!-- BREADCRUMB -->
    <?php if (isset($component)) { $__componentOriginalcf27f2c2c873893339708d5fdeeb6984 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalcf27f2c2c873893339708d5fdeeb6984 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => '7ee9c4f86007ba41bc79bbfab1cd8a68::admin.breadcrumb','data' => ['title' => 'Student List','pageTo' => 'Enroll','actionRoute' => ''.e(route('enrollment.create')).'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('portal::admin.breadcrumb'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['title' => 'Student List','page-to' => 'Enroll','action-route' => ''.e(route('enrollment.create')).'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalcf27f2c2c873893339708d5fdeeb6984)): ?>
<?php $attributes = $__attributesOriginalcf27f2c2c873893339708d5fdeeb6984; ?>
<?php unset($__attributesOriginalcf27f2c2c873893339708d5fdeeb6984); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalcf27f2c2c873893339708d5fdeeb6984)): ?>
<?php $component = $__componentOriginalcf27f2c2c873893339708d5fdeeb6984; ?>
<?php unset($__componentOriginalcf27f2c2c873893339708d5fdeeb6984); ?>
<?php endif; ?>

    <?php if($enrollments->count() > 0): ?>
        <div class="card overflow-hidden">
            <div class="overflow-x-auto">
                <table
                    class="table-auto w-full whitespace-nowrap text-left text-gray-500 dark:text-dark-text font-medium leading-none">
                    <thead class="text-primary-500">
                        <tr>
                            <th
                                class="px-3.5 py-4 bg-[#F2F4F9] dark:bg-dark-card-two first:rounded-l-lg last:rounded-r-lg first:dk-theme-card-square-left last:dk-theme-card-square-right">
                                <?php echo e(translate('Name')); ?>

                            </th>
                            <th
                                class="px-3.5 py-4 bg-[#F2F4F9] dark:bg-dark-card-two first:rounded-l-lg last:rounded-r-lg first:dk-theme-card-square-left last:dk-theme-card-square-right">
                                <?php echo e(translate('Instructor/Organization')); ?>

                            </th>
                            <th
                                class="px-3.5 py-4 bg-[#F2F4F9] dark:bg-dark-card-two first:rounded-l-lg last:rounded-r-lg first:dk-theme-card-square-left last:dk-theme-card-square-right">
                                <?php echo e(translate('Course/Bundle')); ?>

                            </th>
                            <th
                                class="px-3.5 py-4 bg-[#F2F4F9] dark:bg-dark-card-two first:rounded-l-lg last:rounded-r-lg first:dk-theme-card-square-left last:dk-theme-card-square-right">
                                <?php echo e(translate('Enroll')); ?>

                            </th>
                            <th
                                class="px-3.5 py-4 bg-[#F2F4F9] dark:bg-dark-card-two first:rounded-l-lg last:rounded-r-lg first:dk-theme-card-square-left last:dk-theme-card-square-right">
                                <?php echo e(translate('Payment Method')); ?>

                            </th>

                            <th
                                class="px-3.5 py-4 bg-[#F2F4F9] dark:bg-dark-card-two first:rounded-l-lg last:rounded-r-lg first:dk-theme-card-square-left last:dk-theme-card-square-right">
                                <?php echo e(translate('Payment Status')); ?>

                            </th>
                            <th
                                class="px-3.5 py-4 bg-[#F2F4F9] dark:bg-dark-card-two first:rounded-l-lg last:rounded-r-lg first:dk-theme-card-square-left last:dk-theme-card-square-right">
                                <?php echo e(translate('Action')); ?>

                            </th>
                        </tr>
                    </thead>

                    <tbody class="divide-y divide-gray-200 dark:divide-dark-border-three">
                        <?php $__currentLoopData = $enrollments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $enrollment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php
                                $userInfo = $enrollment?->user?->userable ?? null;
                                $instructors = $enrollment?->course?->instructors ?? [];
                                $bundleInstructor = $enrollment?->courseBundle->instructor ?? null;
                                $bundleOrganization = $enrollment?->courseBundle->organization ?? null;

                                $studentTranslations = parse_translation($userInfo);

                            ?>
                            <tr>
                                <td class="px-2 py-4">
                                    <div class="flex items-center gap-3">
                                        <div class="flex flex-col space-y-2.5">
                                            <h6 class="text-sm">
                                                <span class="text-heading dark:text-dark-text font-semibold">
                                                    <?php echo e(translate('Name')); ?>:
                                                </span>
                                                <?php echo e($studentTranslations['first_name'] ?? $userInfo?->first_name); ?>

                                                <?php echo e($studentTranslations['last_name'] ?? $userInfo?->last_name); ?>

                                            </h6>
                                            <h6 class="text-sm">
                                                <span class="text-heading dark:text-dark-text font-semibold">
                                                    <?php echo e(translate('Email')); ?>:
                                                </span>
                                                <?php echo e($enrollment?->user?->email); ?>

                                            </h6>
                                            <h6 class="text-sm">
                                                <span class="text-heading dark:text-dark-text font-semibold">
                                                    <?php echo e(translate('Phone')); ?>:
                                                </span>
                                                <?php echo e($userInfo?->phone); ?>

                                            </h6>
                                        </div>
                                    </div>
                                </td>
                                <td class="px-2 py-4">
                                    <?php if(isset($instructors) && !empty($instructors)): ?>
                                        <?php $__currentLoopData = $instructors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $instructor): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php
                                                $instructorInfo = $instructor?->userable ?? null;
                                                $instructorTranslations = parse_translation($instructorInfo);
                                            ?>
                                            <?php echo e($instructorTranslations['first_name'] ?? $instructorInfo->first_name); ?>

                                            <?php echo e($instructorTranslations['last_name'] ?? $instructorInfo->last_name); ?>

                                            <?php if(!$loop->last): ?>
                                                ,
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php elseif($bundleInstructor): ?>
                                        <?php
                                            $bundleUser = $bundleInstructor->userable ?? null;
                                            $bundleUserTranslations = parse_translation($bundleUser);
                                        ?>
                                        <?php echo e($bundleUserTranslations['first_name'] ?? $user->first_name); ?>

                                        <?php echo e($bundleUserTranslations['last_name'] ?? $user->last_name); ?>

                                    <?php elseif($bundleOrganization): ?>
                                        <?php
                                            $orgUser = $bundleOrganization->userable ?? null;
                                            $orgUserTranslations = parse_translation($orgUser);
                                        ?>
                                        <?php echo e($orgUserTranslations['name'] ?? $user->name); ?>

                                    <?php endif; ?>
                                </td>
                                <td class="px-2 py-4">
                                    <?php if($enrollment->purchase_type == 'course'): ?>
                                        <?php
                                            $courseTranslations = parse_translation($enrollment->course);
                                        ?>
                                        <a href="<?php echo e(route('course.edit', $enrollment->course_id)); ?>">
                                            <?php echo e(str_limit($courseTranslations['title'] ?? $enrollment->course?->title, 20, '...')); ?></a>
                                    <?php elseif($enrollment->purchase_type == 'bundle'): ?>
                                        <?php
                                            $bundleTranslations = parse_translation($enrollment->courseBundle);
                                        ?>

                                        <a href="<?php echo e(route('course.bundle')); ?>">
                                            <?php echo e(str_limit($bundleTranslations['title'] ?? $enrollment->courseBundle?->title, 20, '...')); ?></a>
                                    <?php endif; ?>
                                </td>
                                <td class="px-2 py-4">
                                    <?php echo e(customDateFormate($enrollment->created_at, $format = 'd M Y h:i a')); ?>

                                </td>

                                <td class="px-2 py-4">
                                    <?php echo e($enrollment?->purchase->payment_method); ?>

                                </td>
                                <td class="px-2 py-4">
                                    <?php switch($enrollment?->purchase->status):
                                        case ('success'): ?>
                                            <span class="badge b-solid badge-warning-solid capitalize">
                                                <?php echo e(translate('success')); ?>

                                            </span>
                                        <?php break; ?>

                                        <?php case ('fail'): ?>
                                            <span class="badge b-solid badge-danger-solid capitalize">
                                                <?php echo e(translate('fail')); ?>

                                            </span>
                                        <?php break; ?>
                                    <?php endswitch; ?>
                                </td>

                                <td>
                                    <div class="flex items-center gap-1">
                                        <a href="<?php echo e(route('enrollment.show', $enrollment->id)); ?>"
                                            class="btn-icon btn-primary-icon-light size-8">
                                            <i class="ri-eye-line text-inherit text-base"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>
            <!-- Start Pagination -->
            <?php echo e($enrollments->links('portal::admin.pagination.paginate')); ?>

        </div>
    <?php else: ?>
        <?php if (isset($component)) { $__componentOriginal5d13c2904e1f07d85da185576dbff28d = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal5d13c2904e1f07d85da185576dbff28d = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => '7ee9c4f86007ba41bc79bbfab1cd8a68::admin.empty-card','data' => ['title' => 'No enrollment','action' => ''.e(route('enrollment.create')).'','btnText' => 'Add New']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('portal::admin.empty-card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['title' => 'No enrollment','action' => ''.e(route('enrollment.create')).'','btnText' => 'Add New']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal5d13c2904e1f07d85da185576dbff28d)): ?>
<?php $attributes = $__attributesOriginal5d13c2904e1f07d85da185576dbff28d; ?>
<?php unset($__attributesOriginal5d13c2904e1f07d85da185576dbff28d); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal5d13c2904e1f07d85da185576dbff28d)): ?>
<?php $component = $__componentOriginal5d13c2904e1f07d85da185576dbff28d; ?>
<?php unset($__componentOriginal5d13c2904e1f07d85da185576dbff28d); ?>
<?php endif; ?>
    <?php endif; ?>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginald7f77a02f879fd4954ea3c39c4e952cb)): ?>
<?php $attributes = $__attributesOriginald7f77a02f879fd4954ea3c39c4e952cb; ?>
<?php unset($__attributesOriginald7f77a02f879fd4954ea3c39c4e952cb); ?>
<?php endif; ?>
<?php if (isset($__componentOriginald7f77a02f879fd4954ea3c39c4e952cb)): ?>
<?php $component = $__componentOriginald7f77a02f879fd4954ea3c39c4e952cb; ?>
<?php unset($__componentOriginald7f77a02f879fd4954ea3c39c4e952cb); ?>
<?php endif; ?>
<?php /**PATH D:\www\edulab\Modules\LMS\resources\views\portals\admin\enrollment\index.blade.php ENDPATH**/ ?>