<?php
    $backendSetting = get_theme_option(key: 'backend_general') ?? null;
    $currency = $backendSetting['currency'] ?? 'USD-$';
    $currencySymbol = get_currency_symbol($currency);
    $view = translate('View');
?>

<?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('Offline/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' => 'Offline Payment','pageTo' => 'Payment']] + (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' => 'Offline Payment','page-to' => 'Payment']); ?>
<?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; ?>
    <div class="card">
        <?php if($offlinePayments->count() > 0): ?>
            <div class="overflow-x-auto scrollbar-table">
                <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">
                        <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('User')); ?>

                            </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('Amount')); ?>

                            </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('Document')); ?>

                            </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('Date')); ?>

                            </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 w-10">
                                <?php echo e(translate('Status')); ?>

                            </th>
                        </tr>
                    </thead>
                    <tbody class="divide-y divide-gray-200 dark:divide-dark-border-three">
                        <?php $__currentLoopData = $offlinePayments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $offlinePayment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php
                                $user = $offlinePayment->user->userable ?? null;
                                $statusClass = '';
                                if ($offlinePayment->status == 'success') {
                                    $statusClass = 'badge-success-outline';
                                } elseif ($offlinePayment->status == 'pending') {
                                    $statusClass = 'badge-primary-outline';
                                } elseif ($offlinePayment->status == 'rejected') {
                                    $statusClass = 'badge-danger-outline';
                                }
                                $paymentDocument = $offlinePayment?->paymentDocument?->document ?? '';
                                $document =
                                    isset($paymentDocument) &&
                                    fileExists('lms/offline/documents', $paymentDocument) == true
                                        ? asset("storage/lms/offline/documents/{$paymentDocument}")
                                        : '';

                            ?>
                            <td class="px-3.5 py-4">
                                <?php echo e($user->first_name . ' ' . $user->last_name); ?>

                            </td>
                            <td class="px-3.5 py-4">
                                <?php echo e($currencySymbol); ?><?php echo e($offlinePayment->total_amount); ?>

                            </td>
                            <td class="px-3.5 py-4">
                                <button data-modal-id="view-document<?php echo e($offlinePayment->id); ?>"
                                    class="btn btn-primary-solid text-white"> <?php echo e($view); ?></button>
                                <div id="view-document<?php echo e($offlinePayment->id); ?>"
                                    class="fixed inset-0 z-modal flex-center !hidden bg-black/50 modal">
                                    <div
                                        class="modal-content bg-white rounded-lg shadow-lg w-full max-w-screen-md transform transition-all duration-300 opacity-0 -translate-y-10 m-4">
                                        <!-- Modal Header -->
                                        <div class="flex items-center justify-between p-5 border-b">
                                            <button type="button" aria-label="Course demo video modal close button"
                                                class="absolute end-2.5 text-heading dark:text-white bg-gray-200 rounded-lg size-8 flex-center close-modal-btn demo-course-video-stop">
                                                <i class="ri-close-line text-inherit"></i>
                                            </button>
                                        </div>
                                        <!-- Modal Body -->
                                        <div class="p-4 pt-0 max-h-[80vh] overflow-auto">
                                            <?php if($document): ?>
                                                <img src="<?php echo e($document); ?>" alt="">
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                </div>
                            </td>
                            <td class="px-3.5 py-4">
                                <?php echo e(customDateFormate($offlinePayment->created_at, $format = 'd M y h:i A')); ?></td>
                            <td class="px-3.5 py-4">
                                <span
                                    class="badge b-outline <?php echo e($statusClass); ?>"><?php echo e(translate($offlinePayment->status)); ?>

                                </span>
                            </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>
            <?php echo e($offlinePayments->links('portal::admin.pagination.paginate')); ?>

        <?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 Offline Payment']] + (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 Offline Payment']); ?>
<?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; ?>
    </div>
 <?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\student\payment\offline\index.blade.php ENDPATH**/ ?>