 <div class="row">      
        <div class="col-12">          
          <h2 class="h4">
          Library Recommendations
          </h2>
          <hr>
        </div>
       <div class="col-12">

        @if ($errors->any())
        <div class="alert alert-danger">
        <ul>
          @foreach ($errors->all() as $error)
              <li>{{ $error }}</li>
          @endforeach
        </ul>
        </div>
        @endif

        @if ($message = Session::get('success'))
            <div class="alert alert-success alert-dismissable">
                <p>{!! $message !!}</p>
            </div>
        @endif

    <div class="card">
      <div class="card-body">
      <form name="first" method="post" action="{{route('library_recommendation')}}" enctype="multipart/form-data">
      <input type="hidden" name="_token" value="<?=csrf_token()?>">
        
          <h5 class="border-bottom pb-2 mb-4">
          Reasons of Recommendation
          </h5>

          <div class="custom-control custom-checkbox">
            <input type="checkbox" class="custom-control-input" value="1" name="rec_reason1" id="rec_reason1" {{ (Request::old("rec_reason1") == 1 ? "checked":"") }}>
            <label class="custom-control-label" for="rec_reason1">This journal will be a value addition to our organisation's collection of scientific resources</label>
          </div>

          <div class="custom-control custom-checkbox">
            <input type="checkbox" class="custom-control-input" value="1" name="rec_reason2" id="rec_reason2">
            <label class="custom-control-label" for="rec_reason2" {{ (Request::old("rec_reason2") == 1 ? "checked":"") }}>I will refer my students to this journal and it is critical that they have access to this information</label>
          </div>

          <div class="custom-control custom-checkbox">
            <input type="checkbox" class="custom-control-input" value="1" name="rec_reason3" id="rec_reason3" {{ (Request::old("rec_reason3") == 1 ? "checked":"") }}>
            <label class="custom-control-label" for="rec_reason3">I have published/intend to publish articles in this journal</label>
          </div>

          <div class="form-group mt-3">
            <label>Additional Reasons:</label>
            <textarea name="additional_reasons" placeholder="Write something here..." class="form-control resize_vertical " data-autogrow="" rows="3" cols="80">{{ old('additional_reasons') }}</textarea>
          </div> 

          <div class="form-group">
              <label class="control-label" for="select21">Journal: *</label>
              <select class="form-control select2" id="journal_id" name="journal_id" required>
                  <option selected="true" value="" disabled="disabled" hidden>Select Journal:</option>
                  @foreach($journal_search as $key => $value)
                          <option value="{{ $key }}" {{ old('journal_id', $journal_id) == $key ? 'selected' : '' }}>{{ $value }}</option>
                  @endforeach 
              </select>
          </div>

          <h5 class="border-bottom mt-5 pb-2 mb-4">Librarian Contact Details</h4>
          <div class="form-row">
           <div class="form-group col-md-6">
            <label>Library Contact: *</label>
            <input type="text" name="library_contact" class="form-control" required = 'required' value="{{ old('library_contact') }}"/>
          </div>
           <div class="form-group col-md-6">
            <label>Library Name: *</label>
            <input type="text" name="library_name" class="form-control" required = 'required' value="{{ old('library_name') }}" />
          </div>
        </div>

        <div class="form-row">
           <div class="form-group col-md-6">
            <label>Institution: *</label>
            <input type="text" name="institution" class="form-control" required = 'required' value="{{ old('institution') }}" />
          </div>       
       
           <div class="form-group col-md-6">
            <label>Library Address: *</label>
            <textarea placeholder="Write something here..." name="library_address" class="form-control resize_vertical " data-autogrow="" rows="3" cols="80" required = 'required'> {{ old('library_address') }}</textarea>
          </div>
        </div>
        <div class="form-row">
           <div class="form-group col-md-6">
            <label>Country: * </label>
             <select class="form-control" id="library_country" name="library_country" required = 'required'>
                <option value="">Country</option>
             @foreach ($country as $countries)
                <option value="{{$countries->printable_name}}" {{ (Request::old("library_country") == $countries->printable_name ? "selected":"") }}> {{$countries->printable_name}}</option>
            @endforeach
            </select>
          </div>
        
           <div class="form-group col-md-6">
            <label>Library Email: *</label>
            <input type="email" name="library_email" class="form-control" required = 'required' value="{{ old('library_email') }}"/>
          </div>
          </div>
        <div class="form-row">
          <div class="form-group col-md-6">
            <label>Library Phone:</label>
            <input type="text" name="library_phone" class="form-control" value="{{ old('library_phone') }}" />
          </div>
          <div class="form-group col-md-6">
            <label>Library Fax:</label>
            <input type="text" name="library_fax" class="form-control" value="{{ old('library_fax') }}" />
          </div> 
        </div> 

            <h5 class="border-bottom pb-2 mt-5 mb-4">Contact Information</h4>
          <div class="form-row">
           <div class="form-group col-md-4">
            <label>Title: *</label>
             <select class="form-control" id="salutation" name="salutation" required = 'required'>
                <option value="Mr." {{ (Request::old("salutation") == 'Mr.'? "selected":"") }}>Mr</option>
                <option value="Mrs." {{ (Request::old("salutation") == 'Mrs.'? "selected":"") }}>Mrs</option>
                <option value="Ms." {{ (Request::old("salutation") == 'Ms.'? "selected":"") }}>Ms</option>
                <option value="Prof." {{ (Request::old("salutation") == 'Prof.'? "selected":"") }}>Prof</option>
                <option value="Dr." {{ (Request::old("salutation") == 'Dr.'? "selected":"") }}>Dr</option>
            </select>
          </div>
          <div class="form-group col-md-4">
            <label>First Name: *</label>
            <input type="text" name="first_name" class="form-control" required = 'required' value="{{ old('first_name') }}" />
          </div>
          <div class="form-group col-md-4">
            <label>Last Name: *</label>
            <input type="text" name="last_name" class="form-control" required = 'required' value="{{ old('last_name') }}" />
          </div>
        </div>
        <div class="form-row">
           <div class="form-group col-md-6">
            <label>User Category: *</label>
             <select class="form-control" id="usercat" name="usercat" required = 'required'>
                <option value="">--Please select--</option>
                <option value="Professor" {{ (Request::old("usercat") == 'Professor'? "selected":"") }}>Professor</option>
                <option value="Student" {{ (Request::old("usercat") == 'Student'? "selected":"") }}>Student</option>
                <option value="Researcher" {{ (Request::old("usercat") == 'Researcher'? "selected":"") }}>Researcher</option>
                <option value="Medical professional/Practitioner"  {{ (Request::old("usercat") == 'Medical professional/Practitioner'? "selected":"") }}>Medical professional/Practitioner</option>
                <option value="Other" {{ (Request::old("usercat") == 'Other'? "selected":"") }}>Other</option>
            </select>
          </div>
           <div class="form-group col-md-6">
            <label>Address: *</label>
            <textarea name="address" placeholder="Write something here..." class="form-control resize_vertical " data-autogrow="" rows="2" cols="80" required = 'required'>{{ old('address') }}</textarea>
          </div>
        </div>
        <div class="form-row">
           <div class="form-group col-md-6">
            <label>City/Town: *</label>
            <input type="text" name="city" class="form-control" required = 'required' value="{{ old('city') }}" />
          </div>                  
          <div class="form-group col-md-6">
            <label>State/Province:</label>
            <input type="text" name="state" class="form-control" value="{{ old('state') }}" />
          </div>
        </div>
        <div class="form-row">
           <div class="form-group col-md-6">
            <label>Country: *</label>
             <select class="form-control" id="country" name="country" required = 'required'>
                <option value="">Country</option>
             @foreach ($country as $countries)
                <option value="{{$countries->printable_name}}"  {{ (Request::old("country") == $countries->printable_name ? "selected":"") }}> {{$countries->printable_name}}</option>
            @endforeach
            </select>
          </div>
           <div class="form-group col-md-6">
            <label>ZIP/Postal code:</label>
            <input type="text" name="zip" class="form-control" value="{{ old('zip') }}"/>
        </div>
      </div>
        <div class="form-row">
           <div class="form-group col-md-4">
            <label>E-mail: *</label>
            <input type="email" name="email" class="form-control" required = 'required' value="{{ old('email') }}"/>
          </div>
          <div class="form-group col-md-4">
            <label>Phone</label>
            <input type="text" name="phone" class="form-control" value="{{ old('fax') }}" />
          </div>
          <div class="form-group col-md-4">
            <label>Fax:</label>
            <input type="text" name="fax" class="form-control" value="{{ old('fax') }}"/>
          </div>
        </div>

          <div class="form-group text-center">                
                
                    <div class="g-recaptcha" data-sitekey="{{ env('SETTINGS_GOOGLE_RECAPTCHA_SITE_KEY') }}"></div>
                    @if ($errors->has('g-recaptcha-response'))
                      <span class="invalid-feedback">
                        <strong>{{ $errors->first('g-recaptcha-response') }}</strong>
                      </span>
                    @endif
                
          </div>

          <div class="form-group text-center border-top pt-3">
            <input class="btn btn-dark col-md-2" type="submit" name="submit" />
          </div>
  </form> 
      </div> 
</div>
  </div>
    </div>
    