@extends('layout.adminapp')
@section('page-css')
    <link rel="stylesheet" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
    <link href="{{ asset('css0/buttons.bootstrap.min.css') }}" rel="stylesheet">
    <link href="{{ asset('css0/buttons.dataTables.min.css') }}" rel="stylesheet">
    <link rel="stylesheet" href="{!! asset('css/hover-min.css') !!}">

    <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.0.3/css/buttons.dataTables.min.css">
    <style media="screen">
        .fid {
            color: #f9971a !important;
        }
    </style>
@endsection
@section('page-content')

    <section class="content bg-light">


        <div class="content-inner container content-docs">
            @if ($interview !== null)
                <nav aria-label="breadcrumb">
                    <div class="d-flex justify-content-between align-items-center">
                        <ol class="breadcrumb">

                            <li class="text-center breadcrumb-item active">
                                <span>{{ Str::title($userdetails->applicant_name) }}'s Interview date -
                                    {{ date('l d M, Y g:i:a', strtotime($interview)) }}</span>
                            </li>
                        </ol>
                        <a href="{!! route('admin.print.application', $userdetails->user_id) !!}" class="btn btn-sm btn-primary float-right"><span
                                class="fa fa-print"></span> Print</a>
                    </div>
                </nav>
            @endif
            <div class="row mt-2 mb-4 d-flex justify-content-center">
                <div class="col-lg hvr-float">
                    <div class="card border-light">
                        <div class="card-body text-center">
                            <h6 class="fid">Applicant Name </h6>
                            <p>{{ Str::title($userdetails->applicant_name) }}</p>
                        </div>
                    </div>
                </div>
                <div class="col-lg hvr-float">
                    <div class="card border-light">
                        <div class="card-body text-center">
                            <h6 class="fid">Applicant Position</h6>
                            <p>{{ $userdetails->company_name }}</p>
                        </div>
                    </div>
                </div>
                <div class="col-lg hvr-float">
                    <div class="card border-light">
                        <div class="card-body text-center">
                            <h6 class="fid">Applicant Email</h6>
                            <p>{{ $userdetails->email }}</p>
                        </div>
                    </div>
                </div>
                <div class="col-lg hvr-float">
                    <div class="card border-light">
                        <div class="card-body text-center">
                            <h6 class="fid">Applicant Phone</h6>
                            <p>{{ $userdetails->business_phone }}</p>
                        </div>
                    </div>
                </div>

            </div>
            <div class="card">
                <div class="card-body">
                    <h4 class="text-center">Fidelity Youth Enterprenuer Initiative(FYEI)</h4>
                    <h5 class="text-center">Application Form - Company Proposal</h5>
                    <br> <br>
                    <table class="table table-bordered">

                        <tbody>
                            <tr>
                                <td> <strong>Physical Address of Business</strong> </td>
                                <td>{{ $userdetails->physical_address !== null ? $userdetails->physical_address : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Postal Address</strong></td>
                                <td>{{ $userdetails->postal_address !== null ? $userdetails->postal_address : 'N/A' }}</td>
                            </tr>
                            <tr>
                                <td><strong>Digital Address</strong></td>
                                <td>{{ $userdetails->digital_address !== null ? $userdetails->digital_address : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Address of Applicant</strong></td>
                                <td>{{ $userdetails->applicant_address !== null ? $userdetails->applicant_address : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Business Telephone</strong></td>
                                <td>{{ $userdetails->business_phone !== null ? $userdetails->business_phone : 'N/A' }}</td>
                            </tr>
                            <tr>
                                <td><strong>Primary Contact Person</strong></td>
                                <td>{{ $userdetails->primary_contact !== null ? $userdetails->primary_contact : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Phone Number</strong></td>
                                <td>{{ $userdetails->primary_contact_phone !== null ? $userdetails->primary_contact_phone : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Current Bankers</strong></td>
                                <td>{{ $userdetails->current_bankers !== null ? $userdetails->current_bankers : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Branch</strong></td>
                                <td>{{ $userdetails->branch !== null ? $userdetails->branch : 'N/A' }}</td>
                            </tr>
                            <tr>
                                <td> <strong>Structure of Business</strong> </td>
                                <td>{{ $userdetails->business_structure !== null ? $userdetails->business_structure : 'N/A' }}
                                </td>
                            </tr>
                            {{-- <tr>
      <td><strong>State Business Structure</strong></td>
      <td>{{ $userdetails->business_structure !== null ? $userdetails->business_structure : 'N/A' }}</td>
    </tr> --}}
                            <tr>
                                <td><strong>Application funds</strong></td>
                                <td>{!! !empty($application_fund) ? str_replace(',', '<br>', $application_fund) : 'N/A' !!}</td>
                            </tr>
                        </tbody>
                    </table>

                    <br>

                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td colspan="4"> <strong>Ownership of Applicant Company (Shareholders with 20% or more
                                        ownership)</strong></td>
                            </tr>
                            <tr>
                                <td> <strong>Name</strong></td>
                                <td> <strong>TIN</strong></td>
                                <td> <strong>Date</strong></td>
                                <td> <strong>Percentage Owned</strong></td>
                            </tr>
                            @forelse ($ownership_applicants as $key)
                                <tr>
                                    <td>{{ $key->name !== null ? $key->name : 'N/A' }}</td>
                                    <td>{{ $key->tin !== null ? $key->tin : 'N/A' }}</td>
                                    <td>{{ $key->date !== null ? $key->date : 'N/A' }}</td>
                                    <td>{{ $key->percentage_owned !== null ? $key->percentage_owned : 'N/A' }}</td>
                                </tr>
                            @empty
                                <tr class="text-center">
                                    <td>No date available</td>
                                </tr>
                            @endforelse
                        </tbody>
                    </table>

                    <br>
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td colspan="4"> <strong>List of Key Management Personnel</strong></td>
                            </tr>

                            <tr>
                                <td> <strong>Name</strong></td>
                                <td> <strong>Title</strong></td>
                                <td> <strong>Years With Company</strong></td>
                                <td> <strong>Date of Birth</strong></td>
                            </tr>
                            @forelse ($key_management_personnels as $key)
                                <tr>
                                    <td>{{ $key->name !== null ? $key->name : 'N/A' }}</td>
                                    <td>{{ $key->title !== null ? $key->title : 'N/A' }}</td>
                                    <td>{{ $key->years_with_company !== null ? $key->years_with_company : 'N/A' }}</td>
                                    <td>{{ $key->date_of_birth !== null ? $key->date_of_birth : 'N/A' }}</td>
                                </tr>
                            @empty
                                <tr class="text-center">
                                    <td>No date available</td>
                                </tr>
                            @endforelse
                        </tbody>
                    </table>


                    <br>

                    <table class="table table-bordered">

                        <tbody>
                            <tr>
                                <td> <strong>Date Business was Established</strong> </td>
                                <td>{{ $userdetails->business_established_date !== null ? $userdetails->business_established_date : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Tax Identification Number (TIN)</strong></td>
                                <td>{{ $userdetails->tin !== null ? $userdetails->tin : 'N/A' }}</td>
                            </tr>
                            {{-- <tr>
      <td><strong>Nature of Business</strong></td>
      <td>{{ $userdetails->nature_of_business !== null ? $userdetails->nature_of_business : 'N/A' }}</td>
    </tr> --}}
                            <tr>
                                <td><strong>Industry Type</strong></td>
                                <td>{{ $industrytype !== null ? $industrytype : 'N/A' }}</td>
                            </tr>
                            <tr>
                                <td><strong>Industry Description</strong></td>
                                <td>{{ $userdetails->industry_desc !== null ? $userdetails->industry_desc : 'N/A' }}</td>
                            </tr>
                            <tr>
                                <td><strong>Type of Business Premises</strong></td>
                                <td>{{ $userdetails->business_premises !== null ? $userdetails->business_premises : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Business Premise</strong></td>
                                <td>{{ $userdetails->business_premises !== null ? $userdetails->business_premises : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>If Rented, Number of Years outstanding</strong></td>
                                <td>{{ $userdetails->outstanding_years !== null ? $userdetails->outstanding_years : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Business Commencement Date</strong></td>
                                <td>{{ $userdetails->business_commencement_date !== null ? $userdetails->business_commencement_date : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Incorporation Date (For LLCs)</strong></td>
                                <td>{{ $userdetails->incorporation_date !== null ? $userdetails->incorporation_date : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td> <strong>No. of Full Time Employees</strong> </td>
                                <td>{{ $userdetails->full_time_employees !== null ? $userdetails->full_time_employees . ' (Male: ' . $userdetails->full_time_male . ', Female: ' . $userdetails->full_time_female . ')' : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>No. of Part Time Employees</strong></td>
                                <td>{{ $userdetails->part_time_employees !== null ? $userdetails->part_time_employees . ' (Male: ' . $userdetails->part_time_male . ', Female: ' . $userdetails->part_time_female . ')' : 'N/A' }}
                                </td>
                            </tr>
                        </tbody>
                    </table>

                    <br>
                    <table class="table table-bordered">

                        <tbody>
                            <tr>
                                <td> <strong>Required licenses from the regulator governing business operations</strong>
                                </td>
                                <td>{{ $userdetails->required_licenses !== null ? $userdetails->required_licenses : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>2 years historic audited financials/ 2 years historic management
                                        accounts</strong></td>
                                <td>{{ $userdetails->audited_financials !== null ? $userdetails->audited_financials : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Business have a bank account</strong></td>
                                <td>{{ $userdetails->has_bank_account !== null ? $userdetails->has_bank_account : 'N/A' }}
                                </td>
                            </tr>
                            {{-- <tr>
      <td><strong>Industry Type</strong></td>
      <td>{{ $industrytype !== null ? $industrytype : 'N/A' }}</td>
    </tr> --}}
                            <tr>
                                <td><strong>No. of Expected jobs to be created (Next two years)</strong></td>
                                <td>{{ $userdetails->expected_jobs !== null ? $userdetails->expected_jobs : 'N/A' }}</td>
                            </tr>
                            <tr>
                                <td><strong>No. of Full Time Employees (Expected to be Created in the Next Two
                                        Years)</strong></td>
                                <td>{{ $userdetails->expected_full_time_employees !== null ? $userdetails->expected_full_time_employees : 'N/A' }}
                                </td>
                            </tr>
                            <tr>
                                <td><strong>No. of Part Time Employees (Expected to be Created in the Next Two
                                        Years)</strong></td>
                                <td>{{ $userdetails->expected_part_time_employees !== null ? $userdetails->expected_part_time_employees : 'N/A' }}
                                </td>
                            </tr>

                        </tbody>
                    </table>

                    <br>
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td colspan="2"> <strong>List of Major Product Lines</strong></td>
                            </tr>
                            <tr>
                                <td> <strong>Product</strong></td>
                                <td> <strong>Percentage of Sales</strong></td>
                            </tr>
                            @forelse ($major_product_lines as $key)
                                <tr>
                                    <td>{{ $key->product !== null ? $key->product : 'N/A' }}</td>
                                    <td>{{ $key->percentage_of_sales !== null ? $key->percentage_of_sales : 'N/A' }}</td>

                                </tr>
                            @empty
                                <tr class="text-center">
                                    <td colspan="2">No data available</td>
                                </tr>
                            @endforelse
                        </tbody>
                    </table>

                    <br>
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td colspan="2"> <strong>Details of facility request</strong></td>
                            </tr>
                            <tr>
                                <td> <strong>Request</strong></td>
                                <td> <strong>Amount</strong></td>
                            </tr>
                            @forelse ($facility_requests as $key)
                                <tr>
                                    <td>{{ $key->request !== null ? $key->request : 'N/A' }}</td>
                                    <td>{{ $key->amount !== null ? $key->amount : 'N/A' }}</td>

                                </tr>
                            @empty
                                <tr class="text-center">
                                    <td colspan="2">No data available</td>
                                </tr>
                            @endforelse
                        </tbody>
                    </table>

                    <br>
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td> <strong>Tenure of Proposed Facility</strong></td>
                                <td>{{ $userdetails->proposed_facility_tenure !== null ? $userdetails->proposed_facility_tenure : 'N/A' }}
                                </td>
                            </tr>

                        </tbody>
                    </table>

                    <br>
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td colspan="3"> <strong>Details of Cash Collaterals to support Request</strong></td>
                            </tr>
                            <tr>
                                <td> <strong>Instrument Type</strong></td>
                                <td> <strong>Account Name</strong></td>
                                <td> <strong>Amount</strong></td>
                            </tr>
                            @forelse ($cash_collaterals as $key)
                                <tr>
                                    <td>{{ $key->instrument_type !== null ? $key->instrument_type : 'N/A' }}</td>
                                    <td>{{ $key->account_name !== null ? $key->account_name : 'N/A' }}</td>
                                    <td>{{ $key->amount !== null ? $key->amount : 'N/A' }}</td>

                                </tr>
                            @empty
                                <tr class="text-center">
                                    <td colspan="3">No date available</td>
                                </tr>
                            @endforelse
                        </tbody>
                    </table>
                    <br>
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td colspan="2"> <strong>Non-cash Collaterals to support Request</strong></td>
                            </tr>

                            <tr>
                                <td> <strong>Product</strong></td>
                                <td> <strong>Market Value</strong></td>
                            </tr>
                            @forelse ($non_cash_collaterals as $key)
                                <tr>
                                    <td>{{ $key->product !== null ? $key->product : 'N/A' }}</td>
                                    <td>{{ $key->market_value !== null ? $key->market_value : 'N/A' }}</td>

                                </tr>
                            @empty
                                <tr class="text-center">
                                    <td colspan="2">No dat available</td>
                                </tr>
                            @endforelse
                        </tbody>
                    </table>

                    <br>
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td> <strong>Outstanding credit facilities with Fidelity Bank</strong></td>
                                <td>{{ $userdetails->credit_facilities !== null ? $userdetails->credit_facilities : 'N/A' }}
                                </td>
                            </tr>

                            {{-- <tr >
      <td > <strong>If other is chosen from above question</strong></td>
      <td >{{ $userdetails->credit_facilities_others_fidelity !== null ? $userdetails->credit_facilities_others_fidelity : 'N/A' }}</td>
    </tr> --}}

                        </tbody>
                    </table>

                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td colspan="5"> <strong>Credit Facility Details</strong></td>
                            </tr>

                            <tr>
                                <td> <strong>Facility Type</strong></td>
                                <td> <strong>Amount</strong></td>
                                <td> <strong>Outstanding Amount</strong></td>
                                <td> <strong>Monthly Repayment</strong></td>
                                <td> <strong>Expiry Date</strong></td>
                            </tr>
                            @forelse ($credit_facility_details as $key)
                                <tr>
                                    <td>{{ $key->facility_type !== null ? $key->facility_type : 'N/A' }}</td>
                                    <td>{{ $key->amount !== null ? $key->amount : 'N/A' }}</td>
                                    <td>{{ $key->outstanding_amount !== null ? $key->outstanding_amount : 'N/A' }}</td>
                                    <td>{{ $key->monthly_repayment !== null ? $key->monthly_repayment : 'N/A' }}</td>
                                    <td>{{ $key->expiry_date !== null ? $key->expiry_date : 'N/A' }}</td>

                                </tr>
                            @empty
                                <tr class="text-center">
                                    <td colspan="5">No data available</td>
                                </tr>
                            @endforelse
                        </tbody>
                    </table>

                    <br>
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td> <strong>Outstanding credit facilities with Other Banks</strong></td>
                                <td>{{ $userdetails->credit_facilities_others !== null ? $userdetails->credit_facilities_others : 'N/A' }}
                                </td>
                            </tr>
                            {{-- <tr >
      <td > <strong>If Yes is chosen from above question</strong></td>
      <td >{{ $userdetails->credit_facilities_others !== null ? $userdetails->credit_facilities_others : 'N/A' }}</td>
    </tr> --}}

                        </tbody>
                    </table>

                    <br>
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td colspan="5"> <strong>Credit Facility Details With Other Banks</strong></td>
                            </tr>

                            <tr>
                                <td> <strong>Facility Type</strong></td>
                                <td> <strong>Amount</strong></td>
                                <td> <strong>Outstanding Amount</strong></td>
                                <td> <strong>Monthly Repayment</strong></td>
                                <td> <strong>Expiry Date</strong></td>
                            </tr>
                            @forelse ($credit_facility_other_details as $key)
                                <tr>
                                    <td>{{ $key->instrument_type !== null ? $key->instrument_type : 'N/A' }}</td>
                                    <td>{{ $key->amount !== null ? $key->amount : 'N/A' }}</td>
                                    <td>{{ $key->outstanding_amount !== null ? $key->outstanding_amount : 'N/A' }}</td>
                                    <td>{{ $key->monthly_repayment !== null ? $key->monthly_repayment : 'N/A' }}</td>
                                    <td>{{ $key->expiry_date !== null ? $key->expiry_date : 'N/A' }}</td>

                                </tr>
                            @empty
                                <tr class="text-center">
                                    <td colspan="5">No data available</td>
                                </tr>
                            @endforelse
                        </tbody>
                    </table>
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td> <strong>business goals regarding production, sales, profit, job creation</strong></td>
                                <td>{{ $userdetails->comment !== null ? $userdetails->comment : 'N/A' }}</td>
                            </tr>


                        </tbody>
                    </table>
                    <div class="row">
                        <div class="col-md-12">
                            <table class="table table-bordered">
                                <tbody class="text-center">
                                    <tr>
                                        <td>
                                            <h4>Financial Details</h4>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        {{--                  quick_ratio_total --}}
                        {{--                  current_ratio_total --}}
                        {{--                  gearing_total --}}
                        {{--                  gross_profit_margin_total --}}
                        {{--                  net_profit_margin_total --}}
                        {{--                  efficiency_ratio_total --}}
                        <div class="col-md">
                            <table class="table table-bordered">
                                <thead>
                                    @if ($log_user->position !== 'OCIF Applicant')
                                        <tr class="text-center">
                                            <th colspan="2">2020</th>
                                        </tr>
                                    @endif

                                </thead>
                                <tbody>
                                    <tr>
                                        <td><strong>Quick Ratio Total</strong></td>
                                        <td><strong>{{ $financial_data->quick_ratio_total ?? 'N/A' }}</strong></td>
                                    </tr>
                                    <tr>
                                        <td><strong>Current Ratio Total</strong></td>
                                        <td><strong>{{ $financial_data->current_ratio_total ?? 'N/A' }}</strong></td>
                                    </tr>
                                    <tr>
                                        <td><strong>Gearing Total</strong></td>
                                        <td><strong>{{ $financial_data->gearing_total ?? 'N/A' }}</strong></td>
                                    </tr>
                                    <tr>
                                        <td><strong>Gross Profit Margin Total</strong></td>
                                        <td><strong>{{ $financial_data->gross_profit_margin_total ?? 'N/A' }}</strong></td>
                                    </tr>
                                    <tr>
                                        <td><strong>Net Profit Margin Total</strong></td>
                                        <td><strong>{{ $financial_data->net_profit_margin_total ?? 'N/A' }}</strong></td>
                                    </tr>
                                    <tr>
                                        <td><strong>Efficiency Ratio Total</strong></td>
                                        <td><strong>{{ $financial_data->efficiency_ratio_total ?? 'N/A' }}</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        @if ($log_user->position !== 'OCIF Applicant')
                            <div class="col-md">
                                <table class="table table-bordered">
                                    <thead>
                                        <tr class="text-center">
                                            <th colspan="2">2021</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td><strong>Quick Ratio Total</strong></td>
                                            <td><strong>{{ $financial_data->quick_ratio_total_21 ?? 'N/A' }}</strong></td>
                                        </tr>
                                        <tr>

                                            <td><strong>Current Ratio Total</strong></td>
                                            <td><strong>{{ $financial_data->current_ratio_total_21 ?? 'N/A' }}</strong>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><strong>Gearing Total</strong></td>
                                            <td><strong>{{ $financial_data->gearing_total_21 ?? 'N/A' }}</strong></td>
                                        </tr>
                                        <tr>
                                            <td><strong>Gross Profit Margin Total</strong></td>
                                            <td><strong>{{ $financial_data->gross_profit_margin_total_21 ?? 'N/A' }}</strong>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><strong>Net Profit Margin Total</strong></td>
                                            <td><strong>{{ $financial_data->net_profit_margin_total_21 ?? 'N/A' }}</strong>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><strong>Efficiency Ratio Total</strong></td>
                                            <td><strong>{{ $financial_data->efficiency_ratio_total_21 ?? 'N/A' }}</strong>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        @endif

                    </div>

                    <div class="row">
                        <div class="col-md-12">
                            <h4>Financial Documents</h4>
                            <table class="table table-bordered">
                                <tbody>
                                    @if (!empty($financial_data->business_plan))
                                        <tr>
                                            <td class="pt-3">
                                                <h6>Business Plan</h6>
                                            </td>
                                            <td><a href="{!! asset($financial_data->business_plan) !!}" download
                                                    class="btn btn-sm btn-primary"><span class="fa fa-download"></span>
                                                    Download</a></td>
                                        </tr>
                                    @endif

                                    @if (!empty($financial_data->projected_financial_statement))
                                        <tr>
                                            <td class="pt-3">
                                                <h6>Projected Financial Statement</h6>
                                            </td>
                                            <td><a href="{!! asset($financial_data->projected_financial_statement) !!}" download
                                                    class="btn btn-sm btn-primary"><span class="fa fa-download"></span>
                                                    Download</a></td>
                                        </tr>
                                    @endif

                                    @if (!empty($management_account))
                                        <tr>
                                            <td>
                                                <h6>Management Account Documents</h6>
                                            </td>
                                            <td><a class="btn btn-sm btn-primary"
                                                    href="{{ route('download.finance.file', ['id' => $financial_data->user_id, 'type' => 'management_account']) }}"><span
                                                        class="fa fa-download"></span> Download</a></td>
                                        </tr>
                                    @endif
                                    @if ($userdetails->application_funds == 'OCIF Applicant')
                                        @if (!empty($historical_financial))
                                            <tr>
                                                <td>
                                                    <h6>Historic Financial/1 Year Financial Statment Documents</h6>
                                                </td>
                                                <td><a class="btn btn-sm btn-primary"
                                                        href="{{ route('download.historic_financial.file', ['id' => $userdetails->user_id, 'type' => 'historic_financial']) }}"><span
                                                            class="fa fa-download"></span> Download</a></td>
                                            </tr>
                                        @endif
                                    @endif
                                    @if (!empty($id_cards))
                                        <tr>
                                            <td>
                                                <h6>ID Card Documents</h6>
                                            </td>
                                            <td><a class="btn btn-sm btn-primary"
                                                    href="{{ route('download.finance.file', ['id' => $financial_data->user_id, 'type' => 'id_cards']) }}"><span
                                                        class="fa fa-download"></span> Download</a></td>
                                        </tr>
                                    @endif
                                    @if (!empty($permits))
                                        <tr>
                                            <td>
                                                <h6>Permit Documents</h6>
                                            </td>
                                            <td><a class="btn btn-sm btn-primary"
                                                    href="{{ route('download.finance.file', ['id' => $financial_data->user_id, 'type' => 'permits']) }}"><span
                                                        class="fa fa-download"></span> Download</a></td>
                                        </tr>
                                    @endif
                                    @if (!empty($business_registration_documents))
                                        <tr>
                                            <td>
                                                <h6>Business Registration Documents</h6>
                                            </td>
                                            <td><a class="btn btn-sm btn-primary"
                                                    href="{{ route('download.finance.file', ['id' => $financial_data->user_id, 'type' => 'business_registration_documents']) }}"><span
                                                        class="fa fa-download"></span> Download</a></td>
                                        </tr>
                                    @endif
                                    @if (!empty($bank_statements))
                                        <tr>
                                            <td>
                                                <h6>Bank Statements</h6>
                                            </td>
                                            <td><a class="btn btn-sm btn-primary"
                                                    href="{{ route('download.finance.file', ['id' => $financial_data->user_id, 'type' => 'bank_statements']) }}"><span
                                                        class="fa fa-download"></span> Download</a></td>
                                        </tr>
                                    @endif
                                </tbody>
                            </table>
                        </div>
                    </div>

                    <h4 class="fid">Declaration</h4>
                    <hr>
                    <p>I, {{ Str::title($userdetails->applicant_name) }} declare that I am the owner of the company and all
                        information
                        provided here are true as at the time of application. If it should later transpire that information
                        is false, I am willing to refund all costs including loan amount and related costs to the project
                        <br>Date: @php
                            echo date('d M, Y', strtotime($userdetails->created_at));
                        @endphp
                    </p> <br><br>
                    {{-- <h4 class="fid">CONDITION PRECENT </h4> <hr> --}}
                    {{-- <div class="row">
  <div class="col-lg-6">
      <h6 class="fid text-center">Formal request for the facility</h6>
      @if ($reqfac !== null)

              @foreach ($reqfac as $key)
                <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->formal_request) !!}" download> <i class="fas fid fa-download"></i> Formal Request({{ $key->formal_request }}) </a> <br>
              @endforeach
            @else
              <p class="text-center">No Files Attached</p>
            @endif
  </div>
  <div class="col-lg-6">
      <h6 class="fid text-center">Duly accepted offer letter</h6>
      @if ($accept !== null)

              @foreach ($accept as $key)
                <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->accepted_offer_letter) !!}" download> <i class="fas fid fa-download"></i> Accepted Offer Letter({{ $key->accepted_offer_letter }}) </a> <br>
              @endforeach
            @else
              <p class="text-center">No Files Attached</p>
            @endif
  </div>
  <div class="col-lg-6">
      <h6 class="fid text-center">Upfront payment of Facility Fees</h6>
      @if ($uppay !== null)

              @foreach ($uppay as $key)
                <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->upfront_payment) !!}" download> <i class="fas fid fa-download"></i> Upfront payment({{ $key->upfront_payment }}) </a> <br>
              @endforeach
            @else
              <p class="text-center">No Files Attached</p>
            @endif
  </div>

  <div class="col-lg-6">
      <h6 class="fid text-center">FYEP application form</h6>
      @if ($fyapp !== null)

              @foreach ($fyapp as $key)
                <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->fyep_application) !!}" download> <i class="fas fid fa-download"></i> FYEP application form({{ $key->fyep_application }}) </a> <br>
              @endforeach
            @else
              <p class="text-center">No Files Attached</p>
            @endif
  </div>

  <div class="col-lg-6">
      <h6 class="fid text-center">Irrevocable instruction from the Borrower</h6>
      @if ($irr !== null)

              @foreach ($irr as $key)
                <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->irrevocable_instruction) !!}" download> <i class="fas fid fa-download"></i> Instruction from the Borrower({{ $key->irrevocable_instruction }}) </a> <br>
              @endforeach
            @else
              <p class="text-center">No Files Attached</p>
            @endif
  </div>

  <div class="col-lg-6">
      <h6 class="fid text-center">Business operating permit</h6>
      @if ($oppermit !== null)

              @foreach ($oppermit as $key)
                <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->operating_permit) !!}" download> <i class="fas fid fa-download"></i> {{ $key->operating_permit }} </a> <br>
              @endforeach
            @else
              <p class="text-center">No Files Attached</p>
            @endif
  </div>

  <div class="col-lg-6">
      <h6 class="fid text-center">ESRM Report</h6>
      @if ($esrm !== null)

              @foreach ($esrm as $key)
                <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->esrm_report) !!}" download> <i class="fas fid fa-download"></i> {{ $key->esrm_report }} </a> <br>
              @endforeach
            @else
              <p class="text-center">No Files Attached</p>
            @endif
  </div>

  <div class="col-lg-6">
      <h6 class="fid text-center">Directional sketch to the residence</h6>
      @if ($sketch !== null)

              @foreach ($sketch as $key)
                <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->directional_sketch) !!}" download> <i class="fas fid fa-download"></i> {{ $key->directional_sketch }} </a> <br>
              @endforeach
            @else
              <p class="text-center">No Files Attached</p>
            @endif
  </div>
</div> --}}

                    {{-- <br>
<h4 class="fid">File Attachments</h4> <hr>


<div class="row">
  <div class="col-lg">
    <h6 class="fid text-center">Bank/Momo Statement</h6>
    @if ($bankmomo !== null)

            @foreach ($bankmomo as $key)
              <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->bank_momo) !!}" download> <i class="fas fid fa-download"></i> Bank/Momo Statement File({{ $key->bank_momo }}) </a> <br>
            @endforeach
          @else
            <p class="text-center">No Files Attached</p>
          @endif
  </div>
  <div class="col-lg">
    <h6 class="fid text-center">Business Registrations</h6>
    @if ($busregs !== null)

      @foreach ($busregs as $key)
        <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->bus_regs) !!}" download> <i class="fas fid fa-download"></i> Business Registration File({{ $key->bus_regs }}) </a> <br>
      @endforeach
    @else
      <p class="text-center">No Files Attached</p>
    @endif
  </div>

  <div class="col-lg">
    <h6 class="fid text-center">Historical Financials</h6>
    @if ($hist !== null)

      @foreach ($hist as $key)
        <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->historical_financial) !!}" download> <i class="fas fid fa-download"></i> Historical Financial Statement File({{ $key->historical_financial }}) </a> <br>
      @endforeach
    @else
      <p class="text-center">No Files Attached</p>
    @endif
  </div>
</div>
<div class="row mt-3">
  <div class="col-lg">
    <h6 class="fid text-center">License</h6>
    @if ($license !== null)

      @foreach ($license as $key)
        <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->licenses) !!}" download> <i class="fas fid fa-download"></i> license File({{ $key->licenses }}) </a> <br>
      @endforeach
    @else
      <p class="text-center">No Files Attached</p>
    @endif
  </div>
  <div class="col-lg">
    <h6 class="fid text-center">Pitch Deck</h6>
    @if ($pitch !== null)

      @foreach ($pitch as $key)
        <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$key->pitchdeck) !!}" download> <i class="fas fid fa-download"></i> Pitch Deck File({{ $key->pitchdeck }}) </a> <br>
      @endforeach
      @else
        <p class="text-center">No Files Attached</p>
    @endif
  </div>
  <div class="col-lg">
    <h6 class="fid text-center">Other files</h6>
    @if ($oppe->building_img !== null)
      <a style="text-decoration:none;" href="{!! asset('storage/ApplicationImages/'.$oppe->building_img) !!}" download> <i class="fas fa-download"></i> Picture of buildings or workspace</a> <br>
    @endif
    @if ($oppe->company_regulation !== null)
      <a style="text-decoration:none;" href="{!! asset('storage/ApplicationImages/'.$oppe->company_regulation) !!}" download> <i class="fas fa-download"></i> Copies of Company’s Regulations</a> <br>
    @endif
    @if ($oppe->tax_payment !== null)
      <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$oppe->tax_payment) !!}" download> <i class="fas fa-download"></i> Tax and SSNIT Payment Evidence</a><br>
    @endif
    @if ($oppe->land_detail !== null)
      <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$oppe->land_detail) !!}" download> <i class="fas fa-download"></i> Land Title Details or Rent Agreement Details</a><br>
    @endif
    @if ($oppe->org_chart !== null)
      <a class="text-dark" href="{!! asset('storage/ApplicationImages/'.$oppe->org_chart) !!}" download> <i class="fas fa-download"></i> Organization Chart </a>
    @endif
  </div>
</div> --}}













                </div>
            </div>
        @endsection

        @section('page-js')
        @endsection
