

<?php $__env->startSection('title', 'Loan Details'); ?>

<?php $__env->startSection('content'); ?>

<style>
    .details-card {
        border-top: 6px solid #104042;
    }

    .details-label {
        color: #6c757d;
        font-size: 13px;
        margin-bottom: 4px;
    }

    .details-value {
        font-weight: 600;
        word-break: break-word;
    }

    .section-title {
        border-bottom: 1px solid #dee2e6;
        padding-bottom: 10px;
        margin-bottom: 25px;
        font-weight: 600;
    }

    .back-btn {
        text-decoration: none;
        color: #000;
    }

    .back-btn:hover {
        color: #104042;
    }
</style>

<section class="container py-3">

    <div class="row g-3">

        <!-- SIDEBAR -->
        <div class="col-md-3 d-none d-md-block">

            <div class="row">
                <div class="col-12">
                    <h4 class="fw-bold mb-3">My Account</h4>
                </div>
            </div>

            <div class="sidebar">

                <a href="<?php echo e(url('my-account')); ?>">
                    <i class="fa fa-user"></i>
                    Profile
                </a>

                <a href="<?php echo e(url('my-account')); ?>#my-loans-tab" >
                    <i class="fa fa-credit-card"></i>
                    My Loans
                </a>

                <a href="<?php echo e(url('my-account')); ?>#security-and-help-tab">
                    <i class="fa fa-shield-alt"></i>
                    Help and Security
                </a>

            </div>

        </div>

        <!-- CONTENT -->
        <div class="col-md-9">

            <!-- HEADER -->
            <div class="d-flex justify-content-between align-items-center gap-2 mb-3">
                
                <a href="<?php echo e(url('my-account')); ?>"
                   class="back-btn fw-semibold">
                    
                    <h4><i class="fa-solid fa-arrow-left-long me-2"></i> Loan Application Details</h4>

                </a>

                <a href="<?php echo e(route('loan.details.download', $application->id)); ?>"
                   class="btn btn-primary-custom">
                    <i class="fa fa-download me-1"></i>
                    Download PDF & Documents
                </a>

            </div>

            <!-- CARD -->
            <div class="card-custom p-4 details-card">


                <!-- PERSONAL -->
                <div class="preview-section mb-5">

                    <h5 class="section-title">
                        Personal Information
                    </h5>

                    <div class="row g-3">

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Full Name</div>
                            <div class="details-value">
                                <?php echo e($application->full_name ?? 'N/A'); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Date of Birth</div>
                            <div class="details-value">
                                <?php echo e($application->dob ? \Carbon\Carbon::parse($application->dob)->format('m-d-Y') : 'N/A'); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Gender</div>
                            <div class="details-value">
                                <?php echo e($application->gender ?? 'N/A'); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Marital Status</div>
                            <div class="details-value">
                                <?php echo e($application->marital_status ?? 'N/A'); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Father Name</div>
                            <div class="details-value">
                                <?php echo e($application->father_name ?? 'N/A'); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">PAN Number</div>
                            <div class="details-value">
                                <?php echo e($application->pan_number ?? 'N/A'); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Aadhaar Number</div>
                            <div class="details-value">
                                <?php echo e($application->aadhaar_number ?? 'N/A'); ?>

                            </div>
                        </div>

                    </div>

                </div>

                <!-- ADDRESS -->
                <div class="preview-section mb-5">

                    <h5 class="section-title">
                        Address Details
                    </h5>

                    <div class="row g-3">

                        <div class="col-12 col-lg-6">
                            <div class="details-label">Current Address</div>
                            <div>
                                <strong>Address :</strong>
                                <span ><?php echo e($application->current_address ?? 'N/A'); ?></span>
                            </div>
                            
                            <div>
                                <strong>City :</strong>
                                <span ><?php echo e($application->current_city ?? 'N/A'); ?></span>
                            </div>
                
                
                            <div>
                                <strong>State :</strong>
                                <span ><?php echo e($application->current_state ?? 'N/A'); ?></span>
                            </div>
                                        <div>
                                <strong>Country :</strong>
                                <span ><?php echo e($application->current_country ?? 'N/A'); ?></span>
                            </div>
                        </div>

                        <div class="col-12 col-lg-6">
                            <div class="details-label">Permanent Address</div>
                             <div>
                                <strong>Address :</strong>
                                <span ><?php echo e($application->permanent_address ?? 'N/A'); ?></span>
                            </div>
                            
                            <div>
                                <strong>City :</strong>
                                <span ><?php echo e($application->permanent_city ?? 'N/A'); ?></span>
                            </div>
                
                
                            <div>
                                <strong>State :</strong>
                                <span ><?php echo e($application->permanent_state ?? 'N/A'); ?></span>
                            </div>
                                        <div>
                                <strong>Country :</strong>
                                <span ><?php echo e($application->permanent_country ?? 'N/A'); ?></span>
                            </div>
                        </div>

                    </div>

                </div>

                <!-- LOAN -->
                <div class="preview-section mb-5">

                    <h5 class="section-title">
                        Loan Details
                    </h5>

                    <div class="row g-3">

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Loan Type</div>
                            <div class="details-value">
                                <?php echo e($application->loan_type ?? 'N/A'); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Purpose</div>
                            <div class="details-value">
                                <?php echo e($application->purpose_of_loan ?? 'N/A'); ?>

                            </div>
                        </div>



                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Kit Cost</div>
                            <div class="details-value">
                                ₹ <?php echo e(number_format((float)($application->kit_cost ?? 0))); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Down Payment</div>
                            <div class="details-value">
                                ₹ <?php echo e(number_format((float)($application->down_payment ?? 0))); ?>

                            </div>
                        </div>

                                                <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Loan Amount</div>
                            <div class="details-value">
                                ₹ <?php echo e(number_format((float)($application->loan_amount ?? 0))); ?>

                            </div>
                        </div>


                                                <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Period In Months</div>
                            <div class="details-value">
                                <?php echo e($application->loan_tenure ?? 0); ?> Months
                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4" style="display:none;">
                            <div class="details-label">Membership Fees</div>
                            <div class="details-value">
                                ₹ <?php echo e(number_format((float)($application->membership_fees ?? 0))); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4" style="display:none;">
                            <div class="details-label">Documentation Fees</div>
                            <div class="details-value">
                                ₹ <?php echo e(number_format((float)($application->documentation_fees ?? 0))); ?>

                            </div>
                        </div>

                        
                        <div class="col-12 col-sm-6 col-lg-4" style="display:none;">
                            <div class="details-label">Processing Fees</div>
                            <div class="details-value">
                                ₹ <?php echo e(number_format((float)($application->processing_charges ?? 0))); ?>

                            </div>
                        </div>

                        
                       <div class="col-12 col-sm-6 col-lg-4">
                        <div class="details-label d-flex align-items-center">

                            <span>Total Loan Amount (Including fees & charges)</span>

                            <i class="fa fa-circle-info ms-2 text-primary"
                            style="cursor:pointer;"
                            data-bs-toggle="modal"
                            data-bs-target="#feeBreakupModal"
                            title="View Fee Details"></i>

                        </div>

                        <div class="details-value">
                            ₹ <?php echo e(number_format((float)($application->total_payment ?? 0))); ?>

                        </div>
                    </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Rate of Interest</div>
                            <div class="details-value">
                                <?php echo e($application->rate_of_intrest !== null && $application->rate_of_intrest !== '' ? $application->rate_of_intrest . '%' : 'N/A'); ?>

                            </div>
                        </div>



                        <div class="col-12 col-sm-6 col-lg-4" style="display:none;">
                            <div class="details-label">Preferred EMI</div>
                            <div class="details-value">
                                ₹ <?php echo e(number_format((float)($application->preferred_emi ?? 0))); ?>

                            </div>
                        </div>

                        

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Total Interest Amount</div>
                            <div class="details-value">
                                ₹ <?php echo e(number_format((float)($application->total_interest ?? 0))); ?>

                            </div>
                        </div>


 <h5  class="section-title">
                                            Payment Details Per One Payout
                                        </h5>

                         <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Loan Principle</div>
                            <div class="details-value">
                                ₹ <?php echo e(number_format((float)($application->loan_principle ?? 0))); ?>

                            </div>
                        </div>

                         <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Loan Intrest</div>
                            <div class="details-value">
                                ₹ <?php echo e(number_format((float)($application->intrest_principle ?? 0))); ?>

                            </div>
                        </div>

                        
                         <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Total Deduction Per Payout</div>
                            <div class="details-value">
                                ₹ <?php echo e(number_format((float)($application->deduction_principle ?? 0))); ?>

                            </div>
                        </div>
                        
                        
                        <div class="col-12 col-sm-6 col-lg-6">
    <div class="details-label">
        Total Payouts : <?php echo e($application->loan_tenure * 12); ?> (considering 12 payouts per month)
    </div>
</div>

                    </div>

                </div>

                <!-- FINANCIAL -->
                <div class="preview-section mb-5">

                    <h5 class="section-title">
                        Financial Details
                    </h5>

                    <div class="row g-3">

                    <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Occupation</div>
                            <div class="details-value">
                                <?php echo e($application->occupation ?? ''); ?>

                            </div>
                        </div>


                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Income particulars</div>
                            <div class="details-value">
                                 <?php echo e($application->income_particulars ?? ''); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Repayment schedule</div>
                            <div class="details-value">
                                 <?php echo e($application->repayment_schedule ?? ''); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Renewal After</div>
                            <div class="details-value">
                                 <?php echo e($application->renewal_after ?? ''); ?>

                            </div>
                        </div>


                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Security Purpose</div>
                            <div class="details-value">
                                 <?php echo e($application->security_purpose ??  ''); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Annual Income</div>
                            <div class="details-value">
                                ₹ <?php echo e(number_format((float)($application->annual_income ?? 0))); ?>

                            </div>
                        </div>

                        <div class="col-12 col-sm-6 col-lg-4">
                            <div class="details-label">Employment Type</div>
                            <div class="details-value">
                                <?php echo e($application->employment_type ?? 'N/A'); ?>

                            </div>
                        </div>

                    </div>

                </div>

                <!-- DOCUMENTS -->
                <div class="preview-section">

                    <h5 class="section-title">
                        Documents
                    </h5>

                    <div class="row g-2 g-md-3">

                        <?php if($application->id_proof): ?>
                            <div class="col-6 col-sm-6 col-lg-4">
                                <a href="<?php echo e(asset('storage/' . $application->id_proof)); ?>"
                                   target="_blank"
                                   class="btn btn-primary-custom w-100">
                                    View ID Proof
                                </a>
                            </div>
                        <?php endif; ?>

                        <?php if($application->address_proof): ?>
                            <div class="col-6 col-sm-6 col-lg-4">
                                <a href="<?php echo e(asset('storage/' . $application->address_proof)); ?>"
                                   target="_blank"
                                   class="btn btn-primary-custom w-100">
                                    View Address Proof
                                </a>
                            </div>
                        <?php endif; ?>

                        <?php if($application->income_proof): ?>
                            <div class="col-6 col-sm-6 col-lg-4">
                                <a href="<?php echo e(asset('storage/' . $application->income_proof)); ?>"
                                   target="_blank"
                                   class="btn btn-primary-custom w-100">
                                    View Income Proof
                                </a>
                            </div>
                        <?php endif; ?>

                        <?php if($application->bankstatements_proof): ?>
                            <div class="col-6 col-sm-6 col-lg-4">
                                <a href="<?php echo e(asset('storage/' . $application->bankstatements_proof)); ?>"
                                   target="_blank"
                                   class="btn btn-primary-custom w-100">
                                    View Bank Statements
                                </a>
                            </div>
                        <?php endif; ?>

                        <?php if($application->business_proof): ?>
                            <div class="col-6 col-sm-6 col-lg-4">
                                <a href="<?php echo e(asset('storage/' . $application->business_proof)); ?>"
                                   target="_blank"
                                   class="btn btn-primary-custom w-100">
                                    View Business Proof
                                </a>
                            </div>
                        <?php endif; ?>


                         <?php if($application->on_boarding_letter): ?>
                            <div class="col-6 col-sm-6 col-lg-4">
                                <a href="<?php echo e(asset('storage/' . $application->on_boarding_letter)); ?>"
                                   target="_blank"
                                   class="btn btn-primary-custom w-100">
                                   OnBoarding Letter
                                </a>
                            </div>
                        <?php endif; ?>

                         <?php if($application->background_verification): ?>
                            <div class="col-6 col-sm-6 col-lg-4">
                                <a href="<?php echo e(asset('storage/' . $application->background_verification)); ?>"
                                   target="_blank"
                                   class="btn btn-primary-custom w-100">
                                   Background Verification
                                </a>
                            </div>
                        <?php endif; ?>
                         <?php if($application->file_name3): ?>
                            <div class="col-6 col-sm-6 col-lg-4">
                                <a href="<?php echo e(asset('storage/' . $application->file_name3)); ?>"
                                   target="_blank"
                                   class="btn btn-primary-custom w-100">
                                    File name3
                                </a>
                            </div>
                        <?php endif; ?>
                         <?php if($application->file_name4): ?>
                            <div class="col-6 col-sm-6 col-lg-4">
                                <a href="<?php echo e(asset('storage/' . $application->file_name4)); ?>"
                                   target="_blank"
                                   class="btn btn-primary-custom w-100">
                                    File name4
                                </a>
                            </div>
                        <?php endif; ?>
                         <?php if($application->file_name5): ?>
                            <div class="col-6 col-sm-6 col-lg-4">
                                <a href="<?php echo e(asset('storage/' . $application->file_name5)); ?>"
                                   target="_blank"
                                   class="btn btn-primary-custom w-100">
                                   File name5
                                </a>
                            </div>
                        <?php endif; ?>

                        <?php if($application->photo_proof): ?>
                            <div class="col-6 col-sm-6 col-lg-4">
                                <a href="<?php echo e(asset('storage/' . $application->photo_proof)); ?>"
                                   target="_blank"
                                   class="btn btn-primary-custom w-100">
                                   Photo Proof
                                </a>
                            </div>
                        <?php endif; ?>

                    </div>

                </div>

            </div>

        </div>

    </div>

</section>
<!-- Fee Details Modal -->
<div class="modal fade" id="feeBreakupModal" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">

            <div class="modal-header">
                <h5 class="modal-title">
                    Total Loan Amount (Including fees & charges)
                </h5>

                <button type="button"
                        class="btn-close"
                        data-bs-dismiss="modal"></button>
            </div>

            <div class="modal-body">

                <table class="table  mb-0">
                    <tbody>

                        <tr>
                            <th>Membership Fee</th>
                            <td>
                                ₹ <?php echo e(number_format((float)($application->membership_fees ?? 0))); ?>

                            </td>
                        </tr>

                        <tr>
                            <th>Documentation Fee</th>
                            <td>
                                ₹ <?php echo e(number_format((float)($application->documentation_fees ?? 0))); ?>

                            </td>
                        </tr>

                        <tr>
                            <th>Processing Fee</th>
                            <td>
                                ₹ <?php echo e(number_format((float)($application->processing_charges ?? 0))); ?>

                            </td>
                        </tr>

                    </tbody>
                </table>

                <!-- <div class="alert alert-info mt-3 mb-0">
                    <strong>Note:</strong><br>
                    The Total Loan Amount includes the approved loan amount along
                    with the applicable Membership Fee, Documentation Fee and
                    Processing Fee.
                </div> -->

            </div>

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

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/neefc25/public_html/kapstono/resources/views/pages/loan_application_details.blade.php ENDPATH**/ ?>