@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="{!! asset('css/css/izitoast.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;
    }

    .bgbg{
      background: #e9ecef ;
    }
</style>
<link type="text/css" rel="stylesheet" href="{!! asset('css/jsgrid.min.css') !!}" />
<link type="text/css" rel="stylesheet" href="{!! asset('css/jsgrid-theme.min.css') !!}" />
@endsection
@section('page-content')

<section class="content bg-light">

    <div class="content-inner container content-docs">
      <nav aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="{!! route('admin.dashboard') !!}">Dashboard</a></li>
    <li class="breadcrumb-item"><a href="{!! route('admin.fyei.evaluation.index') !!}">FYEI Evaluation</a></li>
    <li class="breadcrumb-item active">{{$user->name}} Pre Condition</li>
  </ol>
</nav>
<div class="col-lg-6 mx-auto">
  @include('layout.alert')
</div>
<div class="bgbg rounded p-3">
  <ul class="nav  nav-pills nav-fill flex-column flex-sm-row" id="myTab" role="tablist">

              <li class="nav-item">
                  <a class="nav-link mb-sm-3 active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">APPLICANT OVERVIEW</a>
              </li>
              <li class="nav-item">
                  <a class="nav-link mb-sm-3" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false">FYEI DASHBOARD</a>
              </li>
              <li class="nav-item">
                  <a class="nav-link text-uppercase mb-sm-3" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false">Application Details</a>
              </li>


          </ul>
          <div class="tab-content" id="myTabContent">
            <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
              <h5 class="text-center text-uppercase">APPLICANT OVERVIEW
                    </h5>
                    <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">NAME OF ENTREPRENEUR / BUSINESS </h6>
                                    <p>{{ $user->applicant_name }} / {{ $user->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">INDUSTRY</h6>
                                    <p>{{ $industrytype}} <br> <br> </p>
                                </div>
                            </div>
                        </div>
                        {{-- <div class="col-lg hvr-float">
                            <div class="card border-light">
                                <div class="card-body text-center">
                                    <h6 class="fid">PURPOSE</h6>
                                    <p>{{ $user->grant_purpose }}  <br> <br> </p>
                                </div>
                            </div>
                        </div> --}}

                    </div>
                    <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">AMOUNT </h6>
                                    <p>{{ $user->grant_amt }}</p>
                                </div>
                            </div>
                        </div> --}}
                        {{-- <div class="col-lg hvr-float">
                            <div class="card border-light">
                                <div class="card-body text-center">
                                    <h6 class="fid">TENURE</h6>
                                    <p>{{ $user->proposed_facility_tenure }}</p>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg hvr-float">
                            <div class="card border-light">
                                <div class="card-body text-center">
                                    <h6 class="fid">SCORE</h6>
                                    <p>{{ $score }}%</p>
                                </div>
                            </div>
                        </div> --}}

                    </div>
                  <div class="card">
                      <div class="card-body">
                        <form class="mt-5" id="SaveLater" action="{!! route('admin.applicant.overview.update', $user->id) !!}" method="post">
                          @csrf
                          <div class="row">
                              <div class="col-lg">
                                <div class="form-group">
                                  <label for="">Background</label>
                                  <textarea name="background" class="form-control" rows="4" cols="100">{{old('background', $user->background ?? 'N/A')}}</textarea>
                                </div>
                              </div>
                              <div class="col-lg">
                                <div class="form-group">
                                  <label for="">Customer base</label>
                                  <textarea name="customer_base" class="form-control" rows="4" cols="100">{{old('customer_base', $user->customer_base ?? 'N/A')}}</textarea>
                                </div>
                              </div>
                              <div class="col-lg">
                                <div class="form-group">
                                  <label for="">Investment plan</label>
                                  <textarea name="investment_plan" class="form-control" rows="4" cols="100">{{old('investment_plan', $user->investment_plan ?? 'N/A')}}</textarea>
                                </div>
                              </div>
                          </div>
              <input type="hidden" name="user_id" value="{{ $user->user_id }}">
                          <div class="text-center mt-5">
                            <button type="submit" class="btn btn-primary col-lg-3 m-1" name="button">Update</button>
                          </div>

                        </form>
                      </div>
                  </div>
            </div>
            <div class="modal  fade" id="setinterview" tabindex="-1" role="dialog" aria-labelledby="modal_1" aria-hidden="true">
                <div class="modal-dialog modal-md" role="document">
                    <div class="modal-content">
                    <div class="modal-header"><h6 class="heading h6">Set Interview for {{ $user->applicant_name }} </h6></div>
                        <div class="modal-body">
                            <div class="row justify-content-center">
                                <div class="col-lg-11 text-center py-4">
                                    <form method="post" action="{!! route('admin.setinterview',$user->user_id) !!}">
@csrf
                                      <div class="form-group">
                                        <label for="">Time For Interview <span class="text-danger">*</span></label>
                                        <input id="" type="datetime-local" required  class=" makereq form-control" name="interviewtime" >
                                      </div>

                                      <div class="text-center">
                                        <button style="background:#f9971a;" type="submit" class="btn text-white btn-sm col-lg-7" name="button">Move to Interview Stage</button>
                                      </div>
                                    </form>


                                </div>

                            </div>
                              <div class="modal-footer"><button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Cancel</button></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
              <h5 class="text-center text-uppercase">FYEI EVALUATION DASHBOARD
                    </h5>
                    <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">NAME OF ENTREPRENEUR  </h6>
                                    <p>{{ $user->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">INDUSTRY</h6>
                                    <p>{{ $industrytype }} </p>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg hvr-float">
                            <div class="card border-light">
                                <div class="card-body text-center">
                                    <h6 class="fid">BUSINESS</h6>
                                    <p>{{ $user->company_name }}  </p>
                                </div>
                            </div>
                        </div>

                    </div>

                  <div class="card">
                      <div class="card-body">

            <table class="table table-bordered table-hover">
            <thead>
              <th>EVALUATION AREAS</th>
              <th>WEIGHTED SCORES</th>
              <th>SCORES (100%)</th>
            </thead>
            <tbody>
              <tr class="text-center">
                <td>Business Model Canvas (5%)</td>
                <td>5%</td>
                <td>{{ $eva->bus_model_canvas_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Business  Concept and Idea (15%)</td>
                <td>15%</td>
                <td>{{ $eva->bus_concept_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Organizational and Management team (7%)</td>
                <td>7%</td>
                <td>{{ $eva->man_team_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Industry Analysis (5%)</td>
                <td>5%</td>
                <td>{{ $eva->industry_ana_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Operations and Production Management (10%)</td>
                <td>10%</td>
                <td>{{ $eva->production_man_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Distribution Analysis (5%)</td>
                <td>5%</td>
                <td>{{ $eva->distribution_ana_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Supplier Analysis (5%)</td>
                <td>5%</td>
                <td>{{ $eva->supplier_ana_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Offtaker Analysis (5%)</td>
                <td>5%</td>
                <td>{{ $eva->offtaker_analysis_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Product/ Service Analysis (5%)</td>
                <td>5%</td>
                <td>{{ $eva->service_ana_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Markets and Marketing Strategy 10%</td>
                <td>10%</td>
                <td>{{ $eva->market_strategy_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Environmental & Social Impact  (5%)</td>
                <td>5%</td>
                <td>{{ $eva->social_impact_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Investment requirment,Financial projections and Analysis (15%)</td>
                <td>15%</td>
                <td>{{ $eva->investment_ana_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Security Collateral Postion (3%)</td>
                <td>3%</td>
                <td>{{ $eva->collateral_tt }}%</td>
              </tr>
              <tr class="text-center">
                <td>Risk Mitigation and Sustainability strategies (5%)</td>
                <td>5%</td>
                <td>{{ $eva->risk_mitigation_tt }}%</td>
              </tr>

              <tr class="text-center">
                <td></td>
                <td>100%</td>
                @if ($eva->total <45)
                  <td class="text-bold text-white bg-danger">{{ $eva->total }}%</td>
                  @else
                    <td class="text-bold text-white bg-success">{{ $eva->total }}%</td>
                @endif

              </tr>



            </tbody>
            </table>
            </div>
      </div>
</div>

<div class="tab-pane fade p-3" id="contact" role="tabpanel" aria-labelledby="contact-tab">
  <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 >{{ $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_state !== null ? $userdetails->business_structure_state : '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>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_premise !== null ? $userdetails->business_premise : '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 : 'N/A' }}</td>
</tr>
<tr>
<td><strong>No. of Part Time Employees</strong></td>
<td>{{ $userdetails->part_time_employees !== null ? $userdetails->part_time_employees : '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>No date 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>No date 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>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>No date 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>No date 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_other_banks_others !== null ? $userdetails->credit_facilities_other_banks_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 > <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(!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->id, 'type' => 'historic_financial']) }}"><span class="fa fa-download"></span> Download</a></td>
                  </tr>
                  @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>

  </div>
</div>
</div>
</div>
        @endsection

        @section('page-js')
<script src="https://cdnjs.cloudflare.com/ajax/libs/izitoast/1.4.0/js/iziToast.min.js" charset="utf-8"></script>
<script type="text/javascript" src="{!! asset('css/jsgrid.min.js') !!}"></script>
        @endsection
