@extends ('layouts.patient')
@section('inner-content')

    <div class="row">
        <div class="col-12 col-md-6">
            <select
                class="form-control form-control-sm"
                onchange="return this.value ? fastLoad('/patients/view/{{$patient->uid}}/intake?it=' + this.value) : false">
                <option value="">-- Select Intake Template --</option>
                @foreach($templates as $template)
                    <option
                        {{ (isset($_REQUEST['it']) && ($_REQUEST['it'] === $template)) ? 'selected' : '' }}
                        value="{{ $template }}">{{ ucwords($template) }}</option>
                @endforeach
            </select>
        </div>
    </div>
    <hr class="m-neg-4 mt-3 mb-4">

@include('app/intake-templates/' . (isset($_REQUEST['it']) && !empty($_REQUEST['it']) ? $_REQUEST['it'] : 'default'))

@endsection
