
@extends('layout.loggedin')

@section('page-css')
<style media="screen">
.jsgrid-grid-header {
    overflow: auto !important;
}
</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('content')
<section class="hero-wrap" style="background-image: url('{{ asset('images/h3.jpeg')}}'); background-attachment:fixed">
    <div class="overlay"></div>
    <div class="container">
        <div class="row description align-items-center justify-content-center">
            <div class="col-md-8 mx-auto text-center">
              <div class="text">
                    <h2 class="mb-5 text-center">Fidelity Youth Enterprenuer  <br> Initiative </h2>
                  <div class="designed d-inline-block">
                      <d class="d-flex align-items-center">
                          <div class="ml-3">
                              <h3 class=" text-white mb-0">FYEI Application Form </h3> <br>
                                  @include('layout.alert')
                          </div>
                      </d>
                  </div>
              </div>
            </div>
        </div>
    </div>
</section>

<section class="ftco-section bg-light pb-4 goto-here pb-0">
    <div class="container">

        <form class="" id="SaveLater" action="{!! route('submit.form',$id) !!}" method="post" enctype="multipart/form-data">
          @csrf

        <div >
          <section class="ftco-section ftco-section-2 bg-light" id="navigationTabs">
			<div class="container-fluid">
        {{-- <div class="row text-center justify-content-center"> --}}

        {{-- </div> --}}
				<div class="row">

					<div class="col-lg-12" id="rootwizard">
						<div class="tabulation-2">
							<ul class="nav nav-pills nav-fill d-md-flex d-block">
							  <li class="nav-item">
							    <a class="nav-link active py-3" data-toggle="tab" href="#sectionA"><span class="ion-io"></span>1</a>
							  </li>
							  <li class="nav-item px-lg-2">
							    <a class="nav-link  py-3" data-toggle="tab" href="#sectionB"><span class="ion-ios-"></span> 2</a>
							  </li>
							  <li class="nav-item px-lg-2">
							    <a class="nav-link py-3" data-toggle="tab" href="#sectionC"><span class="ion-io"></span> 3</a>
							  </li>
                <li class="nav-item px-lg-2">
							    <a class="nav-link py-3" data-toggle="tab" href="#sectionD"><span class="ion-io"></span> 4</a>
							  </li>
                <li class="nav-item px-lg-2">
							    <a class="nav-link py-3" data-toggle="tab" href="#sectionE"><span class="ion-io"></span> 5</a>
							  </li>
                <li class="nav-item px-lg-2">
							    <a class="nav-link py-3" data-toggle="tab" href="#sectionF"><span class="ion-io"></span> 6</a>
							  </li>
                <li class="nav-item px-lg-2">
							    <a class="nav-link py-3" data-toggle="tab" href="#sectionG"><span class="ion-io"></span> 7</a>
							  </li>
                <li class="nav-item px-lg-2">
                  <a class="nav-link py-3" data-toggle="tab" href="#sectionI"><span class="ion-io"></span> 8</a>
                </li>
                <li class="nav-item px-lg-2">
                  <a class="nav-link py-3" data-toggle="tab" href="#sectionH"><span class="ion-io"></span> 9</a>
                </li>
							</ul>
							<div class="tab-content rounded mt-2">
                <form class="" action="#" method="post">


							  <div class="tab-pane container p-4 active" id="sectionA">
							  {{--  --}}
                {{--  --}}
                <h3 class="fid">Section A: Grant Application</h3>

                <div class="row">


                  <div class="col-lg">
                    <div class="form-group">
                      <label for=""><strong>Grant Amount(GH₵) <span class="text-danger">*</span></strong></label>
                      <input id="kk" type="number" class="form-control" name="grant_amt" min="1" value="{{old('grant_amt', $user->grant_amt )}}">
                    </div>
                    <div class="form-group">
                      <label for=""><strong>Economic Sector <span class="text-danger">*</span></strong></label>
                      <select id="kk1" class="form-control" name="eco_sector">
                        <option selected disabled hidden>--Select an option--</option>
                          <option {{ $user->eco_sector == 'Textiles And Garments' ? 'selected' : ''}} value="Textiles And Garments">Textiles And Garments</option>
                          <option {{ $user->eco_sector == 'Agro-Processing' ? 'selected' : ''}} value="Agro-Processing">Agro-Processing</option>
                          <option {{ $user->eco_sector == 'Toiletries and Cosmetics' ? 'selected' : ''}} value="Toiletries and Cosmetics">Toiletries and Cosmetics</option>
                          <option {{ $user->eco_sector == 'Building And Construction Material Production' ? 'selected' : ''}} value="Building And Construction Material Production">Building And Construction Material Production</option>
                          <option {{ $user->eco_sector == 'Beverage' ? 'selected' : ''}} value="Beverage">Beverage</option>
                          <option {{ $user->eco_sector == 'Wood Processing' ? 'selected' : ''}} value="Wood Processing">Wood Processing</option>
                          <option {{ $user->eco_sector == 'Food Sector' ? 'selected' : ''}} value="Food Sector">Food Sector</option>

                          <option {{ $user->eco_sector == 'Pharmaceuticals' ? 'selected' : ''}} value="Pharmaceuticals">Pharmaceuticals</option>

                          <option {{ $user->eco_sector == 'Food Sector' ? 'selected' : ''}} value="Food Sector">Food Sector</option>

                        </select>
                    </div>
                    <div class="form-group">
                      <label for="">Are you an existing customer or new to bank?</label>
                      <select class="form-control" id="are_exist" name="existing_customer" required>
                        <option selected disabled hidden>--Select an option--</option>
                        <option {{ $user->existing_customer == 'Yes' ? 'selected' : ''}} value="Yes">Yes</option>
                        <option {{ $user->existing_customer == 'No' ? 'selected' : ''}} value="No">No</option>
                      </select>
                    </div>
                    <div id="exist_cus">
                      <div class="form-group">
                        <label for="">Account Name</label>
                        <input type="text" name="exist_acc_name" value="{{ old('exist_acc_name',$user->exist_acc_name) }}" class="form-control makereq">
                      </div>
                      <div class="form-group">
                        <label for="">Account Number</label>
                        <input type="number" name="exist_acc_num" value="{{ old('exist_acc_num',$user->exist_acc_num) }}" class="form-control makereq">
                      </div>
                      <div class="form-group">
                        <label for="">Branch Name</label>
                        <input type="text" name="exist_acc_branch" value="{{ old('exist_acc_branch',$user->exist_acc_branch) }}" class="form-control makereq">
                      </div>
                    </div>
                  </div>
                  <div class="col-lg">
                    <div class="form-group">
                      <label for=""><strong>Purpose of Grant<br>(State the equipment required for which you are seeking to utilize the grant. If the value of equipment required is more than the grant amount available, the applicant would need to match the grant with own funding.) <span class="text-danger">*</span></strong></label>
                      <textarea id="kk3" name="grant_purpose" class="form-control" rows="8" cols="80">{{ old('grant_purpose',$user->grant_purpose) }}</textarea>
                    </div>
                  </div>

                </div>
                {{--  --}}
							  </div>
							  <div class="tab-pane container p-4 fade" id="sectionB">
							  {{--  --}}
                <h3 class="fid">Section B: Company Details</h3>
                <div class="row">
                  <div class="col-lg">
                    <div class="form-group">
                        <label for=""><strong>Company Name <span class="text-danger">*</span></strong></label>
                        <input id="kk4" type="text"  class="form-control" name="company_name" value="{{ old('website',$user->company_name)}}">
                    </div>
                    <div class="form-group">
                        <label for=""><strong>Year of Registration <span class="text-danger">*</span></strong></label>
                        <select id="kk5" class="form-control" name="year_established">
                          <option value="{{ $user->year_established }}" selected>{{ $user->year_established }}</option>
   <?php
   for ($year = (int)date('Y'); 1900 <= $year; $year--): ?>

     <option value="<?=$year;?>"><?=$year;?></option>
   <?php endfor; ?>
  </select>
                        {{-- <input type="tel" min="4"  class="form-control" name="year_established" value="{{ $user->year_established }}"> --}}
                    </div>
                    <div class="form-group">
                        <label for=""><strong>TIN Number <span class="text-danger">*</span></strong></label>
                        <input id="kk6" type="text"  class="form-control" name="tin_num" value="{{ old('tin_num',$user->tin_num )}}">
                    </div>
                    <div class="form-group">
                      <label for=""><strong>Physical Address <span class="text-danger">*</span></strong></label>
                      <input id="kk7" type="text" class="form-control" name="physical_address" value="{{ old('physical_address',$user->physical_address )}}">
                    </div>

                    <div class="form-group">
                      <label for=""><strong>City/Town/Area <span class="text-danger">*</span></strong></label>
                      <input id="kk8" type="text" class="form-control" name="city" value="{{old('city', $user->city )}}">
                    </div>
                    <div class="form-group">
                      <label for=""><strong>GPS Code <span class="text-danger">*</span></strong></label>
                      <input id="kk9" type="text" class="form-control" name="gps" value="{{ old('gps',$user->gps) }}">
                    </div>
                    <div class="form-group">
                      <label for=""><strong>Contact Person 1 <span class="text-danger">*</span></strong></label>
                      <input id="kk10" type="text" class="form-control" name="contact_p_1" value="{{ old('contact_p_1',$user->contact_p_1) }}">
                    </div>
                    {{-- <div class="form-group">
                      <label for=""><strong>Please Upload Image of Business Registration (jpg,jpeg,png,webp allowed)</strong></label>
                      <input type="file" class="form-control" name="business_reg[]" multiple>
                      {{ $userop->business_reg }}
                    </div> --}}
                    <div class="form-group">
                      <label for=""><strong>Contact Person 1 Phone Number <span class="text-danger">*</span></strong></label>
                      <input id="kk11" type="tel" class="form-control"  oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" name="contact_p_1_num" value="{{ old('contact_p_1_num',$user->contact_p_1_num )}}">
                    </div>
                    <div class="form-group">
                      <label for=""><strong>Contact Person 2 <span class="text-danger">*</span></strong></label>
                      <input id="kk12" type="text" class="form-control" name="contact_p_2" value="{{ old('contact_p_2',$user->contact_p_2 )}}">
                    </div>
                    <div class="form-group">
                      <label for=""><strong>Contact Person 2 Phone Number <span class="text-danger">*</span></strong></label>
                      <input id="kk13" type="tel" class="form-control"  oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" name="contact_p_2_num" value="{{old('contact_p_2_num',$user->contact_p_2_num)}}">
                    </div>

                  </div>
                  <div class="col-lg">

                    <div class="form-group">
                        <label for=""><strong>State business associations you belong to. <span class="text-danger">*</span></strong></label>
                        <textarea id="kk14" name="business_assoc" class="form-control" rows="8" cols="80">{{old('business_assoc', $userop->business_assoc) }}</textarea>
                    </div>
                    <div class="form-group">
                      <label for=""><strong>Telephone Number <span class="text-danger">*</span></strong></label>
                      <input id="kk15" type="tel" class="form-control"  oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" name="telephone"  value="{{ old('telephone',$user->telephone )}}">
                    </div>
                    <div class="form-group">
                      <label for=""><strong>Email <span class="text-danger">*</span></strong></label>
                      <input id="kk16" type="email" class="form-control" name="comp_email" value="{{old('comp_email', $user->comp_email )}}">
                    </div>
                    <div class="form-group">
                      <label for=""><strong>Website(if available) </strong></label>
                      <input type="text" class="form-control" name="website"  value="{{old('website', $user->website)}}">
                    </div>
                    <div class="form-group">
                        <label for=""><strong>Description of Business <br>(Mention key elements of the business, products and key challenges) <span class="text-danger">*</span></strong></label>
                        <textarea id="kk17" name="business_desc" class="form-control" rows="8" cols="80">{{old('business_desc', $user->business_desc) }}</textarea>
                    </div>
                  </div>
                </div>
                {{--  --}}
							  </div>
							  <div class="tab-pane container-fluid p-4 fade" id="sectionC">
							  	{{--  --}}
<h3 class="fid">Section C: Production/Operations</h3>
<div class="row">
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Location of Business. Provide a brief description of your business location, mention availability of electricity, water, telecommunication facilities and road network</strong></label>
      <textarea name="location_desc" class="form-control" rows="8" cols="80">{{ old('location_desc',$userop->location_desc )}}</textarea>
    </div>
  </div>
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Provide brief description of buildings/structures used for your business. Owned or rented, residential, all operations in one space. Do you have an admin block, factory and warehouse.</strong></label>
      <textarea name="struct_desc" class="form-control" rows="8" cols="80">{{old('struct_desc', $userop->struct_desc )}}</textarea>
    </div>
    <div class="form-group">
      <label for="">Please upload a picture of your buildings or workspace(jpg,jpeg,png,webp allowed)</label>
      <input type="file" class="form-control" name="building_img">
      <small>{{ $userop->building_img }}</small>
    </div>
  </div>
</div>

<div class="card">
  <div class="card-header">
    <strong>Provide a list of critical machines, equipment and vehicles used for your core business</strong>
  </div>
  <div class="card-body">
    <span class="text-primary">NB: Please press the <strong>+</strong> button beside your entry to save it </span>
    <div id="c1"></div>
    <input type="hidden" id="machineusedlist" name="machineusedlist" value=""/>
  </div>
</div>
<div class="card">
  <div class="card-header">
    <strong>Provide list of additional critical core of machines, equipment, and software required.</strong>
  </div>
  <div class="card-body">
    <span class="text-primary">NB: Please press the <strong>+</strong> button beside your entry to save it </span>
  <div id="c2"></div>
  <input type="hidden" id="additionalmachine" name="additionalmachine" value=""/>
  </div>
</div>

<div class="row">
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>How do you plan to finance the cost of these additional machinery and equipment?</strong></label>
      <textarea name="additional_cost" class="form-control" rows="8" cols="80">{{old('additional_cost', $userop->additional_cost) }}</textarea>
    </div>
  </div>
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Describe raw materials and inputs used and how you procure them. Are they readily available?</strong></label>
      <textarea name="raw_material" class="form-control" rows="8" cols="80">{{ old('raw_material',$userop->raw_material )}}</textarea>

    </div>
  </div>
</div>


<div class="card">
  <div class="card-header">
    <strong>Provide a brief description of your production levels</strong>
  </div>
  <div class="card-body">
    <span class="text-primary">NB: Please press the <strong>+</strong> button beside your entry to save it </span>
    <div id="c3"></div>
<input type="hidden" id="productionlevels" name="productionlevels" value=""/>
  </div>
</div>
                  {{--  --}}
							  </div>
      <div class="tab-pane container-fluid p-4 fade" id="sectionD">
        {{--  --}}
        <h3 class="fid">Section D: Human Resource Management</h3>
        <div class="row">

          <div class="col-lg">
            <div class="form-group">
              <label for="">How many workers do you have ?</label>
              <input type="number" class="form-control" name="num_workers" min="1" value="{{old('num_workers',$userop->num_workers)}}">
            </div>
          </div>
          <div class="col-lg">
            <div class="form-group">
              <label for=""><strong>What is the number of women in leadership and management? Please explain</strong></label>
              <textarea name="women_in_lead" rows="8" cols="80">{{ old('women_in_lead',$userop->women_in_lead )}}</textarea>
            </div>
          </div>
        </div>
        <div class="card">
          <div class="card-header">
<strong>Please Describe the Size of your work force. How many are males, females and how many are permanent workers, no of casuals and those within the age range of (15-24 years)  </strong>        </div>
          <div class="card-body">
            <table class="table table-bordered table-responsive">
              <thead >
                <tr>
                  <th></th>
                  <th>Male</th>
                  <th>Female</th>
                  <th>How many are within the age range of (15 - 24)</th>
                </tr>
                <tbody>
                  <tr>
                    <td>Permanent</td>
                    <td> <input type="number" name="perma_male" class="form-control" value="{{old('perma_male',$userop->perma_male)}}" > </td>
                    <td> <input type="number" name="perma_female" class="form-control" value="{{old('perma_female',$userop->perma_female)}}" > </td>
                    <td> <input type="number" name="perma_range" class="form-control" value="{{old('perma_range',$userop->perma_range)}}" > </td>
                  </tr>
                  <tr>
                    <td>Hired</td>
                    <td> <input type="number" name="hired_male" class="form-control" value="{{old('hired_male',$userop->hired_male)}}" > </td>
                    <td> <input type="number" name="hired_female" class="form-control" value="{{old('hired_female',$userop->hired_female)}}" > </td>
                    <td> <input type="number" name="hired_range" class="form-control" value="{{old('hired_range',$userop->hired_range)}}" > </td>
                  </tr>


                </tbody>
              </thead>
            </table>
          </div>
        </div>
        {{-- <div class="card">
          <div class="card-header">
            <strong>Provide the following information on your directors</strong>
          </div>
          <div class="card-body">
            <div id="d1"></div>
            <input type="hidden" id="directors" name="directors" value=""/>
          </div>
        </div> --}}

        <div class="card">
          <div class="card-header">
            <strong>Provide the following information on Key Management/Operating Personnel</strong>
          </div>
          <div class="card-body">
            <span class="text-primary">NB: Please press the <strong>+</strong> button beside your entry to save it </span>
            <div id="d2"></div>
<input type="hidden" id="operatingperson" name="operatingperson" value=""/>
          </div>
        </div>

        <div class="col-lg">
          <div class="form-group">
            <label for=""><strong>Governance. Do you have a Board? How often does the Board meet?</strong></label>
            <textarea name="board" class="form-control" rows="8" cols="80">{{ old('board',$userop->board) }}</textarea>
          </div>
        </div>



        {{--  --}}
      </div>

      <div class="tab-pane container-fluid p-4 fade" id="sectionE">
        {{--  --}}
<h3 class="fid">Section E: Market Information</h3>
{{-- <div class="card">
  <div class="card-header">
    <strong>Please list the different types of products produced by your business and packaging used</strong>
  </div>
  <div class="card-body">
  <div id="e1"></div>
<input type="hidden" id="product_packaging" name="product_packaging" value=""/>
  </div>
</div>

<div class="row">
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Please state what is <em>innovative</em> about your products?</strong></label>
      <textarea name="innovative_product" class="form-control" rows="8" cols="80">{{ old('innovative_product',$userop->innovative_product) }}</textarea>
    </div>
  </div> --}}
  {{-- <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>How do you price your products? Describe your pricing policy</strong></label>
      <textarea name="price_policy" class="form-control" rows="8" cols="80">{{ $userop->price_policy }}</textarea>
    </div>
  </div> --}}
{{-- </div>

<div class="row">
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>How do you promote / market your products?</strong></label>
      <textarea name="promote_product" class="form-control" rows="8" cols="80">{{old('promote_product', $userop->promote_product )}}</textarea>
    </div>
  </div>
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>How do you distribute your products?</strong></label>
      <textarea name="distribute_product" class="form-control" rows="8" cols="80">{{ old('distribute_product',$userop->distribute_product )}}</textarea>
    </div>
  </div>
</div> --}}

<div class="row">
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Who are your major customers (especially corporate ones)?</strong></label>
      <textarea name="major_customers" class="form-control" rows="8" cols="80">{{ old('major_customers',$userop->major_customers )}}</textarea>
    </div>
  </div>
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Do you have an off taker/ Supermarket /Lead Company for your products? Describe the relationship</strong></label>
      <textarea name="off_taker" class="form-control" rows="8" cols="80">{{ old('off_taker',$userop->off_taker) }}</textarea>
    </div>
  </div>
</div>

<div class="row">
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Who are your major competitors; what do they do?</strong></label>
      <textarea name="major_competitor" class="form-control" rows="8" cols="80">{{ old('major_competitor',$userop->major_competitor) }}</textarea>
    </div>
  </div>
  <div class="col-lg">
    <div class="form-group">
      <label for="">What do you do better than them?</strong></label>
      <textarea name="better_than" class="form-control" rows="8" cols="80">{{old('better_than', $userop->better_than )}}</textarea>
    </div>
  </div>
</div>
      </div>
      <div class="tab-pane container-fluid p-4 fade" id="sectionF">
        {{--  --}}
<h3 class="fid">Section F: Business Strategy</h3>
{{-- <p><strong>Does Your Company have a Business Strategy or plan?</strong></p> --}}
        {{--  --}}
<div class="row">
<div class="col-lg">
  <div class="form-group">
    <label for=""><strong>Does your company have a business strategy or plan?</strong></label>
    <select class="form-control" name="business_plan">
      <option selected disabled hidden>--Select an Option--</option>
      <option {{ $userop->business_plan == 'Yes' ? 'selected' : '' }} value="Yes">Yes</option>
      <option {{ $userop->business_plan == 'No' ? 'selected' : '' }} value="No">No</option>
    </select>
  </div>
</div>
<div class="col-lg">
  <div class="form-group">
    <label for=""><strong>Vision (how do you see your business in the next five years)</strong></label>
    <textarea name="vision" class="form-control" rows="8" cols="80">{{old('vision', $userop->vision) }}</textarea>
  </div>
</div>
<div class="col-lg">
  <div class="form-group">
    <label for=""><strong>Mission Statement (What do you want your company to be known for)</strong></label>
    <textarea name="mission" class="form-control" rows="8" cols="80">{{ old('mission',$userop->mission )}}</textarea>

  </div>
</div>
</div>

<div class="row">

<div class="col-lg">
  <div class="form-group">
    <label for=""><strong>Please state one short term, medium term, and long-term objectives for your business.</strong></label>
    <textarea name="business_obj" class="form-control" rows="8" cols="80">{{old('business_obj', $userop->business_obj) }}</textarea>
  </div>
  <div class="form-group">
    <label for=""><strong>Strengths</strong></label>
    <textarea name="strength" class="form-control" rows="8" cols="80">{{ old('strength',$userop->strength) }}</textarea>
  </div>
</div>
<div class="col-lg">
  <div class="form-group">
    <label for=""><strong>Weaknesses</strong></label>
    <textarea name="weakness" class="form-control" rows="8" cols="80">{{ old('weakness',$userop->weakness) }}</textarea>

  </div>
</div>
</div>

<div class="row">

<div class="col-lg">
  <div class="form-group">
    <label for=""><strong>Opportunities</strong></label>
    <textarea name="opportunity" class="form-control" rows="8" cols="80">{{ old('opportunity',$userop->opportunity )}}</textarea>
  </div>
</div>
<div class="col-lg">
  <div class="form-group">
    <label for=""><strong>Threats</strong></label>
    <textarea name="threats" class="form-control" rows="8" cols="80">{{ old('threats',$userop->threats) }}</textarea>

  </div>
  <div class="col-lg">
  <div class="form-group">
    <label for="">Proposed Collateral details</label>
    <textarea name="collateral"  rows="8" cols="40" class="form-control">{{ old('collateral',$userop->collateral) }}</textarea>
  </div>
  <div class="form-group">
    <label for="">Tenor</label>
    <input type="text" class="form-control" value="{{ old('tenor',$userop->tenor) }}" name="tenor">
  </div>
  </div>
</div>
</div>
<div class="row">
<div class="col-lg-4">
  <div class="form-group">
    <label for="">Have you applied for a loan before?</label>
<select class="form-control" name="applied_loan" id="loanapp">
  <option selected disabled hidden>--Select an option--</option>
  <option {{ $userop->applied_loan == 'Yes' ? 'selected' : ''}} value="Yes">Yes</option>
  <option {{ $userop->applied_loan == 'No' ? 'selected' : ''}} value="No">No</option>
</select>
</div>
</div>
<div class="col-lg-4">
  <div class="form-group" id="extraloan">
    <label for="">Which financial institution provided the loaning facility</label>
    <input type="text" name="applied_loan_facility" class="form-control makeextrareq" value="{{ old('applied_loan_facility',$userop->applied_loan_facility) }}">
  </div>
</div>
</div>

{{-- <div class="card">
  <div class="card-header">
    <strong>Please provide the Credit History of your company</strong>
  </div>
  <div class="card-body">
  <div id="f1"></div>
<input type="hidden" id="credit_history" name="credit_history" value=""/>
  </div>
</div>

<div class="row">
<div class="col-lg-12">
  <div class="form-group">
    <label for=""><strong>Will other businesses benefit from the grant to your company.? Describe how?</strong></label>
    <textarea name="other_business_benefit" class="form-control" rows="8" cols="80">{{ $userop->other_business_benefit }}</textarea>
  </div>
</div>
</div> --}}
        {{--  --}}
      </div>

      <div class="tab-pane container-fluid p-4 fade" id="sectionG">
        {{--  --}}
<h3 class="fid">Section G: FINANCIAL PERFORMANCE</h3>
<div class="row">
  <div class="col-lg">
<h6>LIQUIDITY RATIOS</h6>
<div class="form-group">
  <label for="">Current Assets <small>(the company’s inventory, plus trade receivables, plus cash and cash equivalent on the SOFP)</small> <span class="text-danger">*</span></label>
  <input type="number" id="fin1" step="any"  name="curr_asset" class="form-control" value="{{ old('curr_asset',$finratio->curr_asset) }}">
</div>
<div class="form-group">
  <label for="">Current Liabilities <small>(the company’s trade payables plus other payables on the statement of financial position (SOFP))</small> <span class="text-danger">*</span></label>
  <input type="number" id="fin2" step="any"  name="curr_lia" class="form-control" value="{{ old('curr_lia',$finratio->curr_lia) }}">
</div>
<div class="form-group">
  <label for="">Inventory <span class="text-danger">*</span></label>
  <input type="number" id="fin3" step="any"  name="inventory" class="form-control" value="{{ old('inventory',$finratio->inventory) }}">
</div>
</div>

  <div class="col-lg">
<h6>GEARING RATIOS</h6>
<div class="form-group">
  <label for="">Total Debts <small>(current liabilities+ long term liabilities)</small> <span class="text-danger">*</span></label>
  <input type="number" id="fin4" step="any"  name="total_debt" class="form-control" value="{{ old('total_debt',$finratio->total_debt) }}">
</div>
<div class="form-group">
  <label for="">Shareholders Equity <small>(Stated Capital+Revaluation Reserves +Retained Earnings )</small> <span class="text-danger">*</span></label>
  <input type="number" id="fin5" step="any"  name="share_equity" class="form-control" value="{{ old('share_equity',$finratio->share_equity) }}">
</div>
  </div>
</div>
<div class="row">
  <div class="col-12">
    <h6>Efficiency RATIOS</h6>
  </div>
  <div class="col-lg">

<div class="form-group">
  <label for="">Average Trade Receivables <small>(trade receivables in previous year , plus receivables in current year ,divided by two (2)-SOFP)</small> <span class="text-danger">*</span></label>
  <input type="number" id="fin6" step="any"  name="trade_receivables" class="form-control" value="{{ old('trade_receivables',$finratio->trade_receivables) }}">
</div>
<div class="form-group">
  <label for="">Credit Sales <small>(Total Sales – Cash Sales)</small> <span class="text-danger">*</span></label>
  <input type="number" id="fin7" step="any"  name="credit_sales" class="form-control" value="{{ old('credit_sales',$finratio->credit_sales) }}">
</div>
<div class="form-group">
  <label for="">Average Trade Payables <small>(payables in previous year, plus payables in current year, divided by 2- SOFP)</small> <span class="text-danger">*</span></label>
  <input type="number" id="fin8" step="any"  name="trade_payables" class="form-control" value="{{ old('trade_payables',$finratio->trade_payables) }}">
</div>


</div>

  <div class="col-lg">
    <div class="form-group">
      <label for="">Credit Purchases <small>(Total Purchases-Cash Purchases )</small> <span class="text-danger">*</span></label>
      <input type="number" id="fin9" step="any"  name="credit_purchases" class="form-control" value="{{ old('credit_purchases',$finratio->credit_purchases) }}">
    </div>
    <div class="form-group">
      <label for="">Average Inventory <small>(Inventory in previous year, plus inventory in current year, divided by 2-SOFP)</small> <span class="text-danger">*</span></label>
      <input type="number" id="fin0" step="any"  name="avg_inventory" class="form-control" value="{{ old('credit_purchases',$finratio->credit_purchases) }}">
    </div>
    <div class="form-group">
      <label for="">Cost of Sales <small>(Opening Inventory+Purchases-Closing Inventory)</small>  <span class="text-danger">*</span></label>
      <input type="number" id="fin11" step="any"  name="cost_sales" class="form-control" value="{{ old('cost_sales',$finratio->cost_sales) }}">
    </div>

  </div>
</div>
<div class="row">
  <div class="col-12">
    <h6>PROFITABILITY RATIOS</h6>
  </div>
  <div class="col-lg">

<div class="form-group">
  <label for="">Gross Profit <small>(Sales minus the cost of sales- Statement of Comprehensive Income (Income Statement))</small> <span class="text-danger">*</span></label>
  <input type="number" id="fin" step="any"  name="gross_profit" class="form-control" value="{{ old('gross_profit',$finratio->gross_profit) }}">
</div>
<div class="form-group">
  <label for="">Sales Turnover <span class="text-danger">*</span></label>
  <input type="number" id="fin" step="any"  name="sales_turnover" class="form-control" value="{{ old('sales_turnover',$finratio->sales_turnover) }}">
</div>


</div>

  <div class="col-lg">
    <div class="form-group">
      <label for="">Net Profit <span class="text-danger">*</span></label>
      <input type="number" id="fin" step="any"  name="net_profit" class="form-control" value="{{ old('net_profit',$finratio->net_profit) }}">
    </div>
    <div class="form-group">
      <label for="">Sales Turnover(Revenue) <span class="text-danger">*</span></label>
      <input type="number" id="fin" step="any"  name="sales_turnover_revenue" class="form-control" value="{{ old('sales_turnover_revenue',$finratio->sales_turnover_revenue) }}">
    </div>

  </div>
</div>
<div class="row">
<label for=""> <strong>Accounting Software. ( Do you use any accounting software in your business) If  Yes, mention the name of the software}</strong> </label>
<textarea name="acc_software" class="form-control" rows="8" cols="80">{{ old('acc_software',$userop->acc_software )}}</textarea>
</div>
</div>
<div class="tab-pane container-fluid p-4 fade" id="sectionI">
  <h3 class="fid">Section I: CONDITION PRECENT</h3>
  <p class="fid">Please upload clear images in this section(jpg,jpeg,png,webp)</p>
  <div class="row">
    <div class="col-lg">
      <div class="form-group">
        <label for=""> <strong>A formal request for the facility</strong> </label>
        <input type="file" name="request_facility[]" multiple  class="form-control">
        <small>{{ $reqfac !== null ? $reqfac.' File(s) Added' : ''}}</small>
      </div>
      <div class="form-group">
        <label for=""> <strong>Duly accepted offer letter signed by the authorized signatory to the facility</strong> </label>
        <input type="file" name="accepted_offer_letter[]" multiple class="form-control">
        <small>{{ $accept !== null ? $accept.' File(s) Added' : ''}}</small>
      </div>
      <div class="form-group">
        <label for=""> <strong>Upfront payment of Facility Fees</strong> </label>
        <input type="file" name="upfront_payment[]" multiple class="form-control">
        <small>{{ $uppay !== null ? $uppay.' File(s) Added' : ''}}</small>
      </div>
      <div class="form-group">
        <label for=""> <strong>FYEP application form</strong> </label>
        <input type="file" name="fyep_application[]" multiple class="form-control">
        <small>{{ $fyapp !== null ? $fyapp.' File(s) Added' : ''}}</small>
      </div>
      <div class="form-group">
        <label for=""> <strong>Irrevocable instruction from the Borrower to off-takers to make all payments due Borrower to their account held with Fidelity Bank Ghana Limited and letter duly acknowledged by off-takers</strong> </label>
        <input type="file" name="irrevocable_instruction[]" multiple class="form-control">
        <small>{{ $irr !== null ? $irr.' File(s) Added' : ''}}</small>
      </div>
    </div>
    <div class="col-lg">
      <div class="form-group">
        <label for=""> <strong>Current Business operating permit</strong> </label>
        <input type="file" name="operating_permit[]" multiple class="form-control">
        <small>{{ $oppermit !== null ? $oppermit.' File(s) Added' : ''}}</small>
      </div>

      <div class="form-group">
        <label for=""> <strong>Approved Environmental and Social Risk Management (ESRM) Report</strong> </label>
        <input type="file" name="esrm_report[]" multiple class="form-control">
        <small>{{ $esrm !== null ? $esrm.' File(s) Added' : ''}}</small>
      </div>
      <div class="form-group">
        <label for=""> <strong>Descriptive and directional sketch as well as the Ghana Post GPS coordinates to the residence and business premises of Borrower endorsed by the Hub Manager</strong> </label>
        <input type="file" name="directional_sketch[]" multiple class="form-control">
        <small>{{ $sketch !== null ? $sketch.' File(s) Added' : ''}}</small>
      </div>
    </div>
  </div>
</div>
<div class="tab-pane container-fluid p-4 fade" id="sectionH">
  {{--  --}}
<h3 class="fid">Section H: MONITORING & EVALUATION AND KEY PERFORMANCE INDICATORS</h3>
<div class="card">
  <div class="card-header">
<strong>Please state how the grant will improve the following</strong></div>
  <div class="card-body">
    <table class="table table-bordered table-responsive">
      <thead >
        <tr>
          <th>Item.</th>
          <th>6 Months</th>
          <th>1 Year</th>
          <th>2 Years</th>
        </tr>
        <tbody>
          <tr>
            <td>Turnover</td>
<td> <input type="text" name="turnover_six_months" class="form-control" value="{{ old('turnover_six_months',$userkpi->turnover_six_months )}}" > </td>
            <td> <input type="text" name="turnover_one_year" class="form-control"  value="{{ old('turnover_one_year',$userkpi->turnover_one_year )}}" > </td>
            <td> <input type="text" name="turnover_two_year" class="form-control"  value="{{ old('turnover_two_year',$userkpi->turnover_two_year )}}" > </td>
          </tr>

          <tr>
            <td>Net Profit</td>
            <td> <input type="text" name="netprofit_six_months" class="form-control"  value="{{ old('netprofit_six_months',
              $userkpi->netprofit_six_months )}}" > </td>
            <td> <input type="text" name="netprofit_one_year" class="form-control"  value="{{ old('netprofit_one_year',$userkpi->netprofit_one_year )}}" > </td>
            <td> <input type="text" name="netprofit_two_year" class="form-control"  value="{{ old('netprofit_two_year',$userkpi->netprofit_two_year )}}" > </td>
          </tr>

          <tr>
            <td>Number of new jobs created</td>
            <td> <input type="text" name="newjobs_six_months" class="form-control"  value="{{ old('newjobs_six_months',$userkpi->newjobs_six_months )}}" > </td>
            <td> <input type="text" name="newjobs_one_year" class="form-control"  value="{{ old('newjobs_one_year',$userkpi->newjobs_one_year )}}" > </td>
            <td> <input type="text" name="newjobs_two_year" class="form-control"  value="{{ old('newjobs_two_year',$userkpi->newjobs_two_year )}}" > </td>
          </tr>

          <tr>
            <td>Annual Payroll</td>
            <td> <input type="text" name="annualpay_six_months" class="form-control"
              value="{{ old('annualpay_six_months',$userkpi->annualpay_six_months )}}" > </td>
            <td> <input type="text" name="annualpay_one_year" class="form-control"
            value="{{ old('annualpay_one_year',$userkpi->annualpay_one_year )}}" > </td>
            <td> <input type="text" name="annualpay_two_year" class="form-control"
             value="{{ old('annualpay_two_year',$userkpi->annualpay_two_year )}}" > </td>
          </tr>

          <tr>
            <td>Productivity</td>
            <td> <input type="text" name="productivity_six_months" class="form-control"  value="{{ old('productivity_six_months',$userkpi->productivity_six_months )}}" > </td>
            <td> <input type="text" name="productivity_one_year" class="form-control"  value="{{ old('productivity_one_year',$userkpi->productivity_one_year )}}" > </td>
            <td> <input type="text" name="productivity_two_year" class="form-control"  value="{{ old('productivity_two_year',$userkpi->productivity_two_year )}}" > </td>
          </tr>




        </tbody>
      </thead>
    </table>


  </div>
</div>

<div class="row">
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Describe the new jobs that will  be created</strong></label>
      <textarea name="new_jobs" class="form-control" rows="8" cols="80">{{old('new_jobs', $userop->new_jobs )}}</textarea>
    </div>
  </div>
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Describe the impact your business will have on the Environment, Health, and safety of your workers</strong></label>
      <textarea name="impact_safety" class="form-control" rows="8" cols="80">{{ old('impact_safety',$userop->impact_safety )}}</textarea>
    </div>
  </div>
</div>


<p class="text-success">NB: Please upload only pdf files.</p>

<div class="row">
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Provide Copies of Company’s Regulations</strong></label>
      <input type="file" class="form-control"  name="company_regulation">
      <small>{{ $userop->company_regulation !== null ? $userop->company_regulation : ''}}</small>
    </div>
  </div>
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Tax and SSNIT Payment Evidence</strong></label>
      <input type="file" class="form-control"  name="tax_payment" >
      <small>{{ $userop->tax_payment !== null ? $userop->tax_payment : ''}}</small>
    </div>
  </div>
</div>

<div class="row">
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Land Title Details or Rent Agreement Details</strong></label>
      <input type="file" class="form-control"  name="land_detail" >
      <small>{{ $userop->land_detail !== null ? $userop->land_detail : ''}}</small>
    </div>
  </div>
  <div class="col-lg">
    <div class="form-group">
      <label for=""><strong>Organization Chart Please attach an Organization Chart for your business</strong></label>
      <input type="file" class="form-control"  name="org_chart" >
      <small>{{ $userop->org_chart !== null ? $userop->org_chart : ''}}</small>
    </div>
  </div>
</div>

<h5 class="fid">Supporting Documents</h5>
<p class="text-success">NB: Please upload pdf,jpg,jpeg,png,webp files only.</p>
<div class="row">
  <div class="col-lg">
    <div class="form-group">
      <label for="">Historical Financials(at least 2 years)</label>
      <input type="file" name="hist_fin[]" class="form-control" multiple>
      <small>{{ $hist!== null ? $hist.' File(s) Added' : ''}}</small>
    </div>
    <div class="form-group">
      <label for="">Pitch Deck / Business Plan</label>
      <input type="file" name="pitchdeck[]" class="form-control" multiple>
      <small>{{ $pitch !== null ? $pitch.' File(s) Added' : ''}}</small>
    </div>
    <div class="form-group">
      <label for="">Valid Licenses(Business Operating Permits, EPA, FDA, off taker agreements) </label>
      <input type="file" name="license[]" class="form-control" multiple>
      <small>{{ $license !== null ? $license.' File(s) Added' : ''}}</small>
    </div>
  </div>
  <div class="col-lg">
    <div class="form-group">
      <label for="">One-year bank statement / MOMO statement</label>
      <input type="file" name="bankmomo[]" class="form-control" multiple>
      <small>{{ $bankmomo !== null ? $bankmomo.' File(s) Added' : ''}}</small>
    </div>
    <div class="form-group">
      <label for="">business registration documents(including renewals)</label>
      <input type="file" name="business_reg[]" class="form-control" multiple>
      <small>{{ $busregs !== null ? $busregs.' File(s) Added' : ''}}</small>
    </div>
  </div>
</div>

{{--  --}}
<h4 class="text-primary">Declaration</h4>
<p>I 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 grant amount and related costs to the project</p>
Name:{{ $user->name }} <br>
Date: @php
echo date('d M, Y')
@endphp
<p class="fid">Should be Shareholder/Director </p>

</div>

<div class="row pagination wizard  pb-4">

  <div class="col-lg text-center">
    <li class=" text-white previous disabled"><button type="button" class="text-white mb-3 btn fidbtn"><span class="text-white ion-ios-arrow-back" style="font-size:15px; "> Previous</span></button></li>

    {{-- <button type="button" class="btn btn-secondary" name="button">Save for later</button> --}}
  </div>
  <div class="col-lg text-center">
    <li class=" text-white  "><button type="submit"  name="saveforlater" value="saveforlater" class="mb-3 text-white btn btn-success" style=""><span class="text-white " style="font-size:15px">  Save For Later</span></button></li>
  </div>

<div class="col-lg text-center">
  <li class=" text-white  "><button type="submit" style="width:150px !important;" name="complete" value="complete" class="mb-3 text-white btn btn-success"><span class="text-white" style="font-size:15px">Submit</span></button></li>

</div>

  <div class="col-lg text-center">
    <li class=" text-white next "><button type="button" style="width:150px !important;" class="mb-3 text-white btn fidbtn">Next <span class="text-white ion-ios-arrow-forward" style="font-size:15px; "> </span></button></li>
  </div>


</div>
                  </form>

							</div>

						</div>

					</div>
				</div>
			</div>
	  </section>
        </div>



    </div>
</section>
<div class="modal modal-fluid fade" id="myModal" 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-body">
                <div class="row justify-content-center">
                    <div class="col-lg-12 text-center py-4">
                        <h5 class="heading h5">Required Fields Cannot be left Blank</h5>
                        <p class="lead text-muted">
                            Please fill all fields with the <span class="text-danger">*</span> mark <br>
                            <small>Sections 1,2 and 7 are required</small>
                        </p>

                        <button type="button" class="btn btn-primary" data-dismiss="modal">Okay</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{{-- <section class="ftco-section bg- goto-here pb-0">
    <div class="container">
        <div class="row">
            <div class="col-lg">
                <img src="{!! asset('images/team.png') !!}" class="img-fluid" alt="">
            </div>
        </div>

</section> --}}
@endsection

@section('page-js')
  <script src="{!! asset('js/jquery.bootstrap.wizard.min.js') !!}" charset="utf-8"></script>
  <script type="text/javascript">
  $(document).ready(function() {
    var fin1 = $('#fin1').val();
    var fin2 = $('#fin2').val();
    var fin3 = $('#fin3').val();
    var fin4 = $('#fin4').val();
    var fin5 = $('#fin5').val();
    var fin6 = $('#fin6').val();
    var fin7 = $('#fin7').val();
    var fin8 = $('#fin8').val();
    var fin9 = $('#fin9').val();
    var fin0 = $('#fin0').val();
    var fin11 = $('#fin11').val();


      if (fin1 === '') {
        $('#myModal').modal('show')
        return false;
      }else if (fin2 === '') {
        $('#myModal').modal('show')
        return false;
      }else if (fin3 === '') {
        $('#myModal').modal('show')
        return false;
      }
      else if (fin4 === '') {
        $('#myModal').modal('show')
        return false;
      }
      else if (fin5 === '') {
        $('#myModal').modal('show')
        return false;
      }
      else if (fin6 === '') {
        $('#myModal').modal('show')
        return false;
      }
      else if (fin7 === '') {
        $('#myModal').modal('show')
        return false;
      }
      else if (fin8 === '') {
        $('#myModal').modal('show')
        return false;
      }
      else if (fin9 === '') {
        $('#myModal').modal('show')
        return false;
      }
      else if (fin0 === '') {
        $('#myModal').modal('show')
        return false;
      }
      else if (fin11 === '') {
        $('#myModal').modal('show')
        return false;
      }






    $('#rootwizard').bootstrapWizard({
	  		'tabClass': 'nav nav-pills',
	  		'onNext': function(tab, navigation, index) {
          // console.log(index);
          var Input1 =$('#kk').val();
          var Input2 = $('#kk1').val();
          var Input3 = $('#kk3').val();
          var Input4 = $('#kk4').val();
          var Input5 = $('#kk5').val();
          var Input6 = $('#kk6').val();
          var Input7 = $('#kk7').val();
          var Input8 = $('#kk8').val();
          var Input9 = $('#kk9').val();
          var Input10 = $('#kk10').val();
          var Input11 = $('#kk11').val();
          var Input12 = $('#kk12').val();
          var Input13 = $('#kk13').val();
          var Input14 = $('#kk14').val();
          var Input15 = $('#kk15').val();
          var Input16 = $('#kk16').val();
          var Input17 = $('#kk17').val();

          var fin1 = $('#fin1').val();
          var fin2 = $('#fin2').val();
          var fin3 = $('#fin3').val();
          var fin4 = $('#fin4').val();
          var fin5 = $('#fin5').val();
          var fin6 = $('#fin6').val();
          var fin7 = $('#fin7').val();
          var fin8 = $('#fin8').val();
          var fin9 = $('#fin9').val();
          var fin0 = $('#fin0').val();
          var fin11 = $('#fin11').val();


          if (index ==1) {
            if (Input1 === '') {
$('#myModal').modal('show')
            return false;
            }
            else if(Input2 === '') {
             $('#myModal').modal('show')
             return false;
           }else if(Input3 === '') {
             $('#myModal').modal('show')
             return false;
           }
         }else if (index == 7) {
           if (fin1 === '') {
             $('#myModal').modal('show')
             return false;
           }else if (fin2 === '') {
             $('#myModal').modal('show')
             return false;
           }else if (fin3 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin4 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin5 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin6 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin7 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin8 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin9 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin0 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin11 === '') {
             $('#myModal').modal('show')
             return false;
           }



         } else if(index ==2){
           if(Input4 === '') {
             $('#myModal').modal('show')
             return false;
           }else if (Input5 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input6 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input7 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input8 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input9 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input10 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input11 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input12 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input13 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input14 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input15 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input16 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input17 === '') {
             $('#myModal').modal('show')
             return false;
           }
          }

	  		},

        'onTabClick': function(tab, navigation, index) {
          var Input1 =$('#kk').val();
          var Input2 = $('#kk1').val();
          var Input3 = $('#kk3').val();
          var Input4 = $('#kk4').val();
          var Input5 = $('#kk5').val();
          var Input6 = $('#kk6').val();
          var Input7 = $('#kk7').val();
          var Input8 = $('#kk8').val();
          var Input9 = $('#kk9').val();
          var Input10 = $('#kk10').val();
          var Input11 = $('#kk11').val();
          var Input12 = $('#kk12').val();
          var Input13 = $('#kk13').val();
          var Input14 = $('#kk14').val();
          var Input15 = $('#kk15').val();
          var Input16 = $('#kk16').val();
          var Input17 = $('#kk17').val();

          var fin1 = $('#fin1').val();
          var fin2 = $('#fin2').val();
          var fin3 = $('#fin3').val();
          var fin4 = $('#fin4').val();
          var fin5 = $('#fin5').val();
          var fin6 = $('#fin6').val();
          var fin7 = $('#fin7').val();
          var fin8 = $('#fin8').val();
          var fin9 = $('#fin9').val();
          var fin0 = $('#fin0').val();
          var fin11 = $('#fin11').val();
console.log(index);
          if (index ==0) {
            if (Input1 === '') {
  $('#myModal').modal('show')
            return false;
            }
            else if(Input2 === '') {
             $('#myModal').modal('show')
             return false;
           }else if(Input3 === '') {
             $('#myModal').modal('show')
             return false;
           }
         }else if (index == 6) {
           if (fin1 === '') {
             $('#myModal').modal('show')
             return false;
           }else if (fin2 === '') {
             $('#myModal').modal('show')
             return false;
           }else if (fin3 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin4 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin5 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin6 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin7 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin8 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin9 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin0 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (fin11 === '') {
             $('#myModal').modal('show')
             return false;
           }



         } else if(index ==1){
           if(Input4 === '') {
             $('#myModal').modal('show')
             return false;
           }else if (Input5 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input6 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input7 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input8 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input9 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input10 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input11 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input12 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input13 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input14 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input15 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input16 === '') {
             $('#myModal').modal('show')
             return false;
           }
           else if (Input17 === '') {
             $('#myModal').modal('show')
             return false;
           }
          }
	  		}

	  	});

    });
  </script>
<script type="text/javascript">
    $('#aa').hide();
    $('#busasso').hide();
    $('#fund').hide();
    $('#enter_net').hide();
    $('.radio_other').click(function() {

        if ($(this).is(':checked')) {
            $('#aa').show();
            // $('.aa-btn').show();
            var b = document.getElementsByClassName('radio_other_text');
            b.setAttribute('required', 'required');
        } else {
            $('#aa').hide();
        }
    })
    $('.radio_yes').click(function() {

        if ($(this).is(':checked')) {
            $('#aa').hide();
            // $('.aa-btn').hide();

        }
    })
    $('.radio_no').click(function() {

        if ($(this).is(':checked')) {
            $('#aa').hide();

        }
    })

//
  $('#exist_cus').hide();
  // $('#are_exist').load(function() {
          if ($('#are_exist').val()=='Yes') {
            $('#exist_cus').show();
  //             $('#aa').hide()
  // $('.aa-btn').show();
  //
  var b = document.getElementsByClassName('makereq');

  var i;
  for (i = 0; i < b.length; i++) {
  b[i].setAttribute('required','required');
  }
  //
  }else {
  $('#exist_cus').hide();
  //             $('#aa').hide()
  // $('.aa-btn').show();
  //
  var b = document.getElementsByClassName('makereq');

  var i;
  for (i = 0; i < b.length; i++) {
  b[i].removeAttribute('required','required');
  b[i].setAttribute('value','');}
  }
      // })



      // $('#loanapp').change(function() {
              if ($('#loanapp').val()=='Yes') {
                $('#extraloan').show();
      //             $('#aa').hide()
      // $('.aa-btn').show();
      //
      var b = document.getElementsByClassName('makeextrareq');

      var i;
      for (i = 0; i < b.length; i++) {
      b[i].setAttribute('required','required');
      }
      //
    }else {
      $('#extraloan').hide();
    //             $('#aa').hide()
    // $('.aa-btn').show();
    //
    var b = document.getElementsByClassName('makeextrareq');

    var i;
    for (i = 0; i < b.length; i++) {
    b[i].removeAttribute('required','required');
    b[i].setAttribute('value','');}
    }
          // })





    $('.busasso_yes').click(function() {

        if ($(this).is(':checked')) {
            $('#busasso').show();

        }
    })

    $('.busasso_no').click(function() {

        if ($(this).is(':checked')) {
            $('#busasso').hide();

        }
    })
    $('.enter_yes').click(function() {

        if ($(this).is(':checked')) {
            $('#enter_net').show();

        }
    })

    $('.enter_no').click(function() {

        if ($(this).is(':checked')) {
            $('#enter_net').hide();

        }
    })

    $('.fund_yes').click(function() {

        if ($(this).is(':checked')) {
            $('#fund').show();

        }
    })

    $('.fund_no').click(function() {

        if ($(this).is(':checked')) {
            $('#fund').hide();

        }
    })

</script>

 <script type="text/javascript" src="{!! asset('css/jsgrid.min.js') !!}"></script>
 <script type="text/javascript">
var token = $('input[name=_token]');

$("#c1").jsGrid({
    width: "100%",
    height: "auto",
    controller: {
      loadData: function (tt) {
          var session = {!! !empty(session('machineusedlist')) ? json_encode(session('machineusedlist')) : ($items ?? json_encode([])) !!};
          if (jQuery.isEmptyObject(session))
          return $.ajax({
              type: "GET",
              url: "{!! route('get.machinee',$id) !!}",
              data: tt
          });
          else
              return session;
      }
  },
    inserting: true,
    editing: true,
    sorting: false,
    paging: true,
autoload:true,
    fields: [
        { name: "item_desc",title:"Item Description", type: "text",validate: "required"},
        { name: "qty",title:"Quantity", type: "number",validate: "required" },
        { name: "age",title:"Age", type: "number",  validate: "required"},
        { name: "present_condition",title:"Present Condition", type: "text", sorting: false ,validate: "required"},
        { type: "control" }
    ]
});

$("#c2").jsGrid({
    width: "100%",
    height: "auto",
    autoload:true,
    controller: {
      loadData: function (jij) {
          var session = {!! !empty(session('additionalmachine')) ? json_encode(session('additionalmachine')) : ($items ?? json_encode([])) !!};
          if (jQuery.isEmptyObject(session))
          return $.ajax({
              type: "GET",
              url: "{!! route('get.addmachine',$id) !!}",
              data: jij
          });
          else
              return session;
      }
  },
    inserting: true,
    editing: true,
    sorting: false,
    paging: true,
    fields: [
        { name: "item_desc",title:"Item Description", type: "text",validate: "required"},
        { name: "qty",title:"Quantity", type: "number" ,validate: "required"},
        { name: "supplier",title:"Supplier/Source", type: "text",validate: "required" },
        { name: "estimated_cost",title:"Estimated Cost(GH₵)", type: "number", sorting: false ,validate: "required"},
        { type: "control" }
    ]
});

$("#c3").jsGrid({
    width: "100%",
    height: "auto",
    inserting: true,
    editing: true,
    sorting: false,
    paging: true,
    autoload:true,
    controller: {
      loadData: function (f) {
          var session = {!! !empty(session('productionlevels')) ? json_encode(session('productionlevels')) : ($items ?? json_encode([])) !!};
          if (jQuery.isEmptyObject(session))
          return $.ajax({
              type: "GET",
              url: "{!! route('get.productlevel',$id) !!}",
              data: f
          });
          else
              return session;
      }
  },
    fields: [
        { name: "product",title:"Product/Service", type: "text", validate: "required" },
        { name: "annual_capacity",title:"Annual Feasible Capacity (Units)", type: "text", validate: "required"},
        { name: "past",title:"Past (2021)", type: "text" , validate: "required"},
        { name: "current",title:"Current (2022)", type: "text", validate: "required" },
        { name: "year_1",title:"Projected Year 1", type: "text", sorting: false , validate: "required"},
        { name: "year_2",title:"Projected Year 2", type: "text", sorting: false , validate: "required"},
        { type: "control" }
    ]
});

$("#d1").jsGrid({
    width: "100%",
    height: "auto",
    autoload:true,
    controller: {
      loadData: function (fi) {
          var session = {!! !empty(session('directors')) ? json_encode(session('directors')) : ($items ?? json_encode([])) !!};
          if (jQuery.isEmptyObject(session))
          return $.ajax({
              type: "GET",
              url: "{!! route('get.director',$id) !!}",
              data: fi
          });
          else
              return session;
      }
  },
    inserting: true,
    editing: true,
    sorting: false,
    paging: true,
    fields: [

        { name: "name",title:"Name", type: "text", validate: "required" },
        { name: "academic_qua",title:"Academic/Professional Qualifications", type: "text", validate: "required"},
        { name: "working_exp",title:"Post Qualification Working Experience", type: "text" , validate: "required"},
        { name: "years_as_board",title:"No of Years as a Board Member", type: "text", validate: "required" },

        { type: "control" }
    ]
});

$("#d2").jsGrid({
    width: "100%",
    height: "auto",
    autoload:true,
    controller: {
      loadData: function (fil) {
          var session = {!! !empty(session('operatingperson')) ? json_encode(session('operatingperson')) : ($items ?? json_encode([])) !!};
          if (jQuery.isEmptyObject(session))
          return $.ajax({
              type: "GET",
              url: "{!! route('get.opper',$id) !!}",
              data: fil
          });
          else
              return session;
      }
  },
    inserting: true,
    editing: true,
    sorting: false,
    paging: true,
    fields: [
      'name',
      'academic_qua',
      'working_exp',
      'years_with_company',
        { name: "name",title:"Name and Designation", type: "text", validate: "required" },
        { name: "academic_qua",title:"Academic/Professional Qualifications", type: "text", validate: "required"},
        { name: "working_exp",title:"Post Qualification Working Experience", type: "text", validate: "required" },
        { name: "years_with_company",title:"No of Years with Company", type: "text", validate: "required"  },

        { type: "control" }
    ]
});



$("#e1").jsGrid({
    width: "100%",
    height: "auto",
    autoload:true,
    controller: {
      loadData: function (filt) {
          var session = {!! !empty(session('product_packaging')) ? json_encode(session('product_packaging')) : ($items ?? json_encode([])) !!};
          if (jQuery.isEmptyObject(session))
          return $.ajax({
              type: "GET",
              url: "{!! route('get.pack',$id) !!}",
              data: filt
          });
          else
              return session;
      }
  },
    inserting: true,
    editing: true,
    sorting: false,
    paging: true,
    fields: [

        { name: "product",title:"Product/Service", type: "text", validate: "required" },
        { name: "packaging",title:"Packaging Information", type: "text", validate: "required"},
        { type: "control" }
    ]
});

$("#f1").jsGrid({
    width: "100%",
    height: "auto",
    inserting: true,
    autoload:true,
    editing: true,
    sorting: false,
    paging: true,
    controller: {
      loadData: function (filte) {
          var session = {!! !empty(session('credit_history')) ? json_encode(session('credit_history')) : ($items ?? json_encode([])) !!};
          if (jQuery.isEmptyObject(session))
          return $.ajax({
              type: "GET",
              url: "{!! route('get.credit',$id) !!}",
              data: filte
          });
          else
              return session;
      }
  },
    fields: [

        { name: "bank",title:"Name of Bank", type: "text", validate: "required" },
        { name: "loan_date",title:"Date of Loan", type: "text", validate: "required"},
        { name: "amt",title:"Amount", type: "text", validate: "required"},
        { name: "payment_history",title:"Payment History", type: "text", validate: "required"},
        { type: "control" }
    ]
});


$('#SaveLater').on('submit', function () {
       machineusedlist = $("#c1").jsGrid("option", "data");
       $('#machineusedlist').val(JSON.stringify(machineusedlist));

       additionalmachine = $("#c2").jsGrid("option", "data");
       $('#additionalmachine').val(JSON.stringify(additionalmachine));

       productionlevels = $("#c3").jsGrid("option", "data");
       $('#productionlevels').val(JSON.stringify(productionlevels));

       directors = $("#d1").jsGrid("option", "data");
       $('#directors').val(JSON.stringify(directors));

       operatingperson = $("#d2").jsGrid("option", "data");
       $('#operatingperson').val(JSON.stringify(operatingperson));

       product_packaging = $("#e1").jsGrid("option", "data");
       $('#product_packaging').val(JSON.stringify(product_packaging));

       credit_history = $("#f1").jsGrid("option", "data");
       $('#credit_history').val(JSON.stringify(credit_history));

                  var Input1 =$('#kk').val();
                  var Input2 = $('#kk1').val();
                  var Input3 = $('#kk3').val();
                  var Input4 = $('#kk4').val();
                  var Input5 = $('#kk5').val();
                  var Input6 = $('#kk6').val();
                  var Input7 = $('#kk7').val();
                  var Input8 = $('#kk8').val();
                  var Input9 = $('#kk9').val();
                  var Input10 = $('#kk10').val();
                  var Input11 = $('#kk11').val();
                  var Input12 = $('#kk12').val();
                  var Input13 = $('#kk13').val();
                  var Input14 = $('#kk14').val();
                  var Input15 = $('#kk15').val();
                  var Input16 = $('#kk16').val();
                  var Input17 = $('#kk17').val();

                  var fin1 = $('#fin1').val();
                  var fin2 = $('#fin2').val();
                  var fin3 = $('#fin3').val();
                  var fin4 = $('#fin4').val();
                  var fin5 = $('#fin5').val();
                  var fin6 = $('#fin6').val();
                  var fin7 = $('#fin7').val();
                  var fin8 = $('#fin8').val();
                  var fin9 = $('#fin9').val();
                  var fin0 = $('#fin0').val();
                  var fin11 = $('#fin11').val();


                  if (Input1 === '') {
        $('#myModal').modal('show')
                  return false;
                  }
                  else if(Input2 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }else if(Input3 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }else if (fin1 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }else if (fin2 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }else if (fin3 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (fin4 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (fin5 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (fin6 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (fin7 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (fin8 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (fin9 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (fin0 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (fin11 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }else if(Input4 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }else if (Input5 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (Input6 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (Input7 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (Input8 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (Input9 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (Input10 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (Input11 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (Input12 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (Input13 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (Input14 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (Input15 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (Input16 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
                 else if (Input17 === '') {
                   $('#myModal').modal('show')
                   return false;
                 }
   });

 // $('.jsgrid-table').setAttribute('calss','table table-responsive');
   // document.getElementsByClassName('');
 </script>
@endsection
