
<?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)) { $__componentOriginalb2c223f2cabdcb0c6da76bfac943142c = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalb2c223f2cabdcb0c6da76bfac943142c = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.admin.breadcrumbs','data' => ['breadcrumbs' => $breadcrumbs]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.admin.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($__attributesOriginalb2c223f2cabdcb0c6da76bfac943142c)): ?>
<?php $attributes = $__attributesOriginalb2c223f2cabdcb0c6da76bfac943142c; ?>
<?php unset($__attributesOriginalb2c223f2cabdcb0c6da76bfac943142c); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalb2c223f2cabdcb0c6da76bfac943142c)): ?>
<?php $component = $__componentOriginalb2c223f2cabdcb0c6da76bfac943142c; ?>
<?php unset($__componentOriginalb2c223f2cabdcb0c6da76bfac943142c); ?>
<?php endif; ?>
            </div>
        </div>

        <div class="row">
            <?php echo $__env->make('dashboard.admin.user.partials.account_options_and_status', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            <div class="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->isPending()): ?>
                        <form method="POST" action="<?php echo e(route('admin.user.loan.approve', [$user->uuid, $loan->uuid])); ?>"
                            class="mb-3">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('PATCH'); ?>

                            <?php if (isset($component)) { $__componentOriginal377af9bacdfb9429d949663393821085 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal377af9bacdfb9429d949663393821085 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.admin.form-input','data' => ['name' => 'approved_amount','label' => 'Approved Amount','class' => 'col-md-12 mb-3','value' => ''.e($loan->amount).'','type' => 'number']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.admin.form-input'); ?>
<?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(['name' => 'approved_amount','label' => 'Approved Amount','class' => 'col-md-12 mb-3','value' => ''.e($loan->amount).'','type' => 'number']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal377af9bacdfb9429d949663393821085)): ?>
<?php $attributes = $__attributesOriginal377af9bacdfb9429d949663393821085; ?>
<?php unset($__attributesOriginal377af9bacdfb9429d949663393821085); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal377af9bacdfb9429d949663393821085)): ?>
<?php $component = $__componentOriginal377af9bacdfb9429d949663393821085; ?>
<?php unset($__componentOriginal377af9bacdfb9429d949663393821085); ?>
<?php endif; ?>

                            <div class="mb-3">
                                <label>Interest Rate (%)</label>
                                <input type="number" value="<?php echo e($setting->loan_interest_rate); ?>" class="form-control"
                                    disabled>
                            </div>

                            <?php if (isset($component)) { $__componentOriginal13a88fbf273148408f775167f18e1ad3 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal13a88fbf273148408f775167f18e1ad3 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.admin.form-button','data' => ['class' => 'btn btn-success','name' => 'Approve Loan']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.admin.form-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(['class' => 'btn btn-success','name' => 'Approve Loan']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal13a88fbf273148408f775167f18e1ad3)): ?>
<?php $attributes = $__attributesOriginal13a88fbf273148408f775167f18e1ad3; ?>
<?php unset($__attributesOriginal13a88fbf273148408f775167f18e1ad3); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal13a88fbf273148408f775167f18e1ad3)): ?>
<?php $component = $__componentOriginal13a88fbf273148408f775167f18e1ad3; ?>
<?php unset($__componentOriginal13a88fbf273148408f775167f18e1ad3); ?>
<?php endif; ?>
                        </form>

                        <form method="POST" action="<?php echo e(route('admin.user.loan.reject', [$user->uuid, $loan->uuid])); ?>">
                            <?php echo csrf_field(); ?>

                            <?php if (isset($component)) { $__componentOriginal377af9bacdfb9429d949663393821085 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal377af9bacdfb9429d949663393821085 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.admin.form-input','data' => ['name' => 'remarks','label' => 'Remarks','type' => 'textarea','class' => 'col-md-12 mb-3','value' => ''.e($loan->remarks).'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.admin.form-input'); ?>
<?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(['name' => 'remarks','label' => 'Remarks','type' => 'textarea','class' => 'col-md-12 mb-3','value' => ''.e($loan->remarks).'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal377af9bacdfb9429d949663393821085)): ?>
<?php $attributes = $__attributesOriginal377af9bacdfb9429d949663393821085; ?>
<?php unset($__attributesOriginal377af9bacdfb9429d949663393821085); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal377af9bacdfb9429d949663393821085)): ?>
<?php $component = $__componentOriginal377af9bacdfb9429d949663393821085; ?>
<?php unset($__componentOriginal377af9bacdfb9429d949663393821085); ?>
<?php endif; ?>

                            <?php if (isset($component)) { $__componentOriginal13a88fbf273148408f775167f18e1ad3 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal13a88fbf273148408f775167f18e1ad3 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.admin.form-button','data' => ['class' => 'btn btn-danger','name' => 'Reject Loan']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.admin.form-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(['class' => 'btn btn-danger','name' => 'Reject Loan']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal13a88fbf273148408f775167f18e1ad3)): ?>
<?php $attributes = $__attributesOriginal13a88fbf273148408f775167f18e1ad3; ?>
<?php unset($__attributesOriginal13a88fbf273148408f775167f18e1ad3); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal13a88fbf273148408f775167f18e1ad3)): ?>
<?php $component = $__componentOriginal13a88fbf273148408f775167f18e1ad3; ?>
<?php unset($__componentOriginal13a88fbf273148408f775167f18e1ad3); ?>
<?php endif; ?>
                        </form>
                    <?php endif; ?>

                    <?php if($loan->isApproved()): ?>
                        <form method="POST" action="<?php echo e(route('admin.user.loan.disburse', [$user->uuid, $loan->uuid])); ?>">
                            <?php echo csrf_field(); ?>
                            <?php if (isset($component)) { $__componentOriginal13a88fbf273148408f775167f18e1ad3 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal13a88fbf273148408f775167f18e1ad3 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.admin.form-button','data' => ['name' => 'Disburse Loan']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.admin.form-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(['name' => 'Disburse Loan']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal13a88fbf273148408f775167f18e1ad3)): ?>
<?php $attributes = $__attributesOriginal13a88fbf273148408f775167f18e1ad3; ?>
<?php unset($__attributesOriginal13a88fbf273148408f775167f18e1ad3); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal13a88fbf273148408f775167f18e1ad3)): ?>
<?php $component = $__componentOriginal13a88fbf273148408f775167f18e1ad3; ?>
<?php unset($__componentOriginal13a88fbf273148408f775167f18e1ad3); ?>
<?php endif; ?>
                        </form>
                    <?php endif; ?>

                 <?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>
            <!-- end col -->
        </div>
        <!-- end row -->

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

<?php echo $__env->make('dashboard.admin.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/admin/user/loan/show.blade.php ENDPATH**/ ?>