@extends('layouts.hcp')
@section('content')

<div class="bg-light">
    <div class="container pt-3">
        <nav class="mb-0">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="{{route('index')}}"><u>Home</u></a></li>
                <li class="breadcrumb-item"><a href="{{route('hcp.index')}}"><u>Healthcare Professionals</u></a></li>
                <li class="breadcrumb-item"><a href="{{route('hcp.practice-support')}}"><u>Practice Support</u></a></li>
                <li class="breadcrumb-item active" aria-current="page">Training</li>
            </ol>
        </nav>
    </div>
</div>
<div class="py-5">
  <div class="container">
    <div class="row justify-content-center">
      <div class="col-lg-5 text-start">
        <h5 class="subtitle mb-4 text-pry">Become a HemBand-trained physician today.</h5>
        <p>We’re excited that your practice is interested in offering the Snyder HemBand system to your patients. To provide the best in patient care, we have a number of training modules for Healthcare Professionals, clinical staff, and office staff available to support our practice partners. Our in-person and online module options have been created with the help of leading gastroenterologists to ensure best-in-class education.</p>
        <p>Fill out the form below to schedule a personalized training session with our team of experts. </p>
      </div>
      <div class="col-lg-6 offset-lg-1">
        <img src="{{asset('img/pc-top.jpg')}}" class="w-100" alt="">
      </div>
    </div>
  </div>
</div>
<div class="bg-light">
  <div class="container py-5">
    <div class="row justify-content-center">
      <div class="col-lg-8">
        <h5 class="header mb-4">Schedule a Session</h5>
        <form class="" action="{{ route('hcp.submit-training-request') }}" method="post" autocomplete="off">
          @csrf
          <div class="row">
            <div class="col-12">
              @if($errors->any())
                <div class="alert alert-danger fade show" role="alert">
                  There were errors found!
                </div>
              @endif
              @if(session('success'))
                <div class="alert alert-success fade show" role="alert">
                  {{session('success')}}
                </div>
              @endif
            </div>
            <div class="col-lg-4 form-group mb-4">
              <label>First Name <span class="text-danger">*</span> </label>
              <input type="text" class="form-control rounded-0 py-3" required name="name_first" value="{{ old('name_first') }}">
              @error('name_first')
                <small class="text-warning">{{$message}}</small>
              @enderror
            </div>
            <div class="col-lg-4 form-group mb-4">
              <label>Last Name <span class="text-danger">*</span> </label>
              <input type="text" class="form-control rounded-0 py-3" required name="name_last" value="{{ old('name_last') }}">
              @error('name_last')
                <small class="text-warning">{{$message}}</small>
              @enderror
            </div>
            <div class="col-lg-4 form-group mb-4">
              <label>Practice Name <span class="text-danger">*</span> </label>
              <input type="text" class="form-control rounded-0 py-3" required name="practice_name" value="{{ old('practice_name') }}">
              @error('practice_name')
                <small class="text-warning">{{$message}}</small>
              @enderror
            </div>
          </div>
          <div class="row">
            <div class="col-lg-6 form-group mb-4">
              <label>Contact Email <span class="text-danger">*</span> </label>
              <input type="email" class="form-control rounded-0 py-3" required name="email" value="{{ old('email') }}">
              @error('email')
                <small class="text-warning">{{$message}}</small>
              @enderror
            </div>
            <div class="col-lg-6 form-group mb-4">
              <label>Contact Phone Number <span class="text-danger">*</span> </label>
              <input type="tel" class="form-control rounded-0 py-3 phone" required name="phone" value="{{ old('phone') }}">
              @error('phone')
                <small class="text-warning">{{$message}}</small>
              @enderror
            </div>
          </div>
          <div class="form-group mb-4">
            <label>Zip Code <span class="text-danger">*</span> </label>
            <input type="text" class="form-control rounded-0 py-3 zip" required name="zip" value="{{ old('zip') }}">
            @error('zip')
                <small class="text-warning">{{$message}}</small>
              @enderror
          </div>
          <div class="form-group mb-4">
            <label>Training Type <span class="text-danger">*</span> </label>
            <select class="form-control rounded-0 py-3" onchange="return showField(this, 'other')" required name="training_type">
              <option value="">Select</option>
              <option value="clinical">Clinical Training</option>
              <option value="staff">Staff Training</option>
              <option value="other">Other</option>
            </select>
            @error('training_type')
              <small class="text-warning">{{$message}}</small>
            @enderror
          </div>
          <div class="form-group mb-4 training_type d-none">
            <label>Other <span class="text-danger">*</span> </label>
            <input type="text" class="form-control rounded-0 py-3" name="training_type_other" value="{{ old('training_type_other') }}">
            @error('training_type_other')
                <small class="text-warning">{{$message}}</small>
              @enderror
          </div>
          <div class="form-group mb-4">
            <label>Training Format <span class="text-danger">*</span> </label>
            <select class="form-control rounded-0 py-3" required name="training_format">
              <option value="">Select</option>
              <option value="In-person">In-person</option>
              <option value="Online">Online</option>
            </select>
            @error('training_format')
                <small class="text-warning">{{$message}}</small>
              @enderror
          </div>
          <div class="form-group mb-4">
            <label>Other notes</label>
            <textarea name="message" class="form-control rounded-0" rows="6">{{ old('message') }}</textarea>
            @error('message')
                <small class="text-warning">{{$message}}</small>
              @enderror
          </div>
          <div class="form-group mb-4">
            {!! htmlFormSnippet() !!}
            @error('g-recaptcha-response')
              <small class="text-danger"><i class="fas fa-exclamation-triangle mr-2"></i>Invalid</small>
            @enderror
          </div>
          <button type="submit" class="btn btn-pry w-100 py-3">SUBMIT</button>
        </form>

        <p class="mt-lg-5 mt-4 mb-0 text-center">If you are already a partner and need assistance, please contact us at <b><a href="mailto:support@hemband.com">support@hemband.com</a></b> </p>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  function showField(_elem, _trigger) {
    var name = _elem.name;
    var val = $(_elem).val();
    if (val == _trigger) {
      $('.'+name).removeClass('d-none')
    }else {
      $('.'+name).addClass('d-none');
    }
  }
</script>
@endsection
