
<?php $__env->startSection('content'); ?>
    <div class="page-container">

        <div class="page-title-head d-flex align-items-sm-center flex-sm-row flex-column gap-2">
            <div class="flex-grow-1">
                <h4 class="fs-18 fw-semibold mb-0"><?php echo e($title); ?></h4>
            </div>

            <div class="text-end">
                <?php if (isset($component)) { $__componentOriginalf249638ac7504c50bf0259c0cb71919d = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalf249638ac7504c50bf0259c0cb71919d = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.user.breadcrumbs','data' => ['breadcrumbs' => $breadcrumbs]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.user.breadcrumbs'); ?>
<?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(['breadcrumbs' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($breadcrumbs)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalf249638ac7504c50bf0259c0cb71919d)): ?>
<?php $attributes = $__attributesOriginalf249638ac7504c50bf0259c0cb71919d; ?>
<?php unset($__attributesOriginalf249638ac7504c50bf0259c0cb71919d); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalf249638ac7504c50bf0259c0cb71919d)): ?>
<?php $component = $__componentOriginalf249638ac7504c50bf0259c0cb71919d; ?>
<?php unset($__componentOriginalf249638ac7504c50bf0259c0cb71919d); ?>
<?php endif; ?>
            </div>
        </div>

        <div class="row">
            <div class="col-xl-12 col-lg-12">
                <?php if (isset($component)) { $__componentOriginal87dd96fabcb1ce9254eda7ff7199227b = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal87dd96fabcb1ce9254eda7ff7199227b = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.admin.card','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.admin.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([]); ?>
                    <?php $__env->slot('header'); ?>
                        <?php echo e($title); ?>

                    <?php $__env->endSlot(); ?>

                    <p>
                        <strong>Requested Amount:</strong>
                        <?php echo e(currency($loan->user->currency)); ?><?php echo e(formatAmount($loan->amount)); ?>

                    </p>

                    <p><strong>Duration:</strong> <?php echo e($loan->duration); ?> months</p>

                    <p><strong>Facility:</strong> <?php echo e($loan->facility); ?></p>

                    <p><strong>Purpose:</strong> <?php echo e($loan->purpose); ?></p>

                    <p><strong>Monthly Income:</strong> <?php echo e($loan->monthly_income); ?></p>

                    <p><strong>Status:</strong>
                        <span class="<?php echo e($loan->status->badge()); ?>"><?php echo e($loan->status->label()); ?></span>
                    </p>

                    <?php if($loan->isRejected()): ?>
                        <p>
                            <strong>Remarks:</strong>
                            <?php echo e($loan->remarks); ?>

                        </p>
                    <?php endif; ?>

                    <?php if($loan->isApproved() || $loan->isDisbursed()): ?>
                        <p><strong>Approved Amount:</strong>
                            <?php echo e(currency($user->currency)); ?><?php echo e(formatAmount($loan->approved_amount)); ?></p>
                    <?php endif; ?>

                    <?php if($loan->isApproved() || $loan->isDisbursed()): ?>
                        <p><strong>Interest Rate:</strong> <?php echo e($loan->interest_rate); ?>%</p>
                    <?php endif; ?>

                    <?php if($loan->isApproved() || $loan->isDisbursed()): ?>
                        <p><strong>Total Payable:</strong>
                            <?php echo e(currency($user->currency)); ?><?php echo e(formatAmount($loan->total_payable)); ?></p>
                    <?php endif; ?>

                    <?php if($loan->isDisbursed()): ?>
                        <p><strong>Disbursed At:</strong> <?php echo e(formatDate($loan->disbursed_at)); ?></p>
                    <?php endif; ?>

                    <dl>
                        <?php if($loan->loanRepayment): ?>
                            <?php $__currentLoopData = $loan->loanRepayment; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $loanRepayment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <dt class="col-sm-3">Loan Repayment Status</dt>
                                <dd class="col-sm-9">
                                    Amount:
                                    <?php echo e(currency($loan->user->currency)); ?><?php echo e(formatAmount($loanRepayment->amount)); ?><br>
                                    Status: <span
                                        class="<?php echo e($loanRepayment->status->badge()); ?>"><?php echo e($loanRepayment->status->label()); ?></span><br>
                                    Repaid At:
                                    <?php echo e($loanRepayment->repaid_at ? formatDate($loanRepayment->repaid_at) : 'N/A'); ?>

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

                    <?php if($loan->isDisbursed() && !$latestLoanRepayment->isPaid()): ?>
                        <a href="<?php echo e(route('user.loan.repay', $loan->uuid)); ?>" onclick="return confirm('Are you sure?')"
                            class="btn btn-primary">
                            Repay (<?php echo e(currency($loan->user->currency)); ?><?php echo e(formatAmount($loan->total_payable)); ?>)
                        </a>
                    <?php endif; ?>

                    <div class="float-end">
                        <?php if (isset($component)) { $__componentOriginal85363d436c73ae3b977fe300a0042f5d = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal85363d436c73ae3b977fe300a0042f5d = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.user.back-button','data' => ['href' => ''.e(route('user.loan.index')).'','name' => 'Back to Loans']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.user.back-button'); ?>
<?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(['href' => ''.e(route('user.loan.index')).'','name' => 'Back to Loans']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal85363d436c73ae3b977fe300a0042f5d)): ?>
<?php $attributes = $__attributesOriginal85363d436c73ae3b977fe300a0042f5d; ?>
<?php unset($__attributesOriginal85363d436c73ae3b977fe300a0042f5d); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal85363d436c73ae3b977fe300a0042f5d)): ?>
<?php $component = $__componentOriginal85363d436c73ae3b977fe300a0042f5d; ?>
<?php unset($__componentOriginal85363d436c73ae3b977fe300a0042f5d); ?>
<?php endif; ?>
                    </div>
                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal87dd96fabcb1ce9254eda7ff7199227b)): ?>
<?php $attributes = $__attributesOriginal87dd96fabcb1ce9254eda7ff7199227b; ?>
<?php unset($__attributesOriginal87dd96fabcb1ce9254eda7ff7199227b); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal87dd96fabcb1ce9254eda7ff7199227b)): ?>
<?php $component = $__componentOriginal87dd96fabcb1ce9254eda7ff7199227b; ?>
<?php unset($__componentOriginal87dd96fabcb1ce9254eda7ff7199227b); ?>
<?php endif; ?>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('dashboard.user.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\projects\online-banking-v7.0\resources\views/dashboard/user/loan/show.blade.php ENDPATH**/ ?>