@extends('pro.my_clients.view')
@section('content-inner')

    <div class="form-contents"><div class="failed-form-contents">

    <h4 class="d-flex m-0 p-3 stag-heading stag-heading-modal">
        <div>Edit Misc Demographics</div>
        <div class="ml-auto">
            <a class="text-secondary" href="#" up-close>
                <i class="fa fa-times"></i>
            </a>
        </div>
    </h4>

    <form action="/post-to-api"
          up-target="#main-content" up-history="false" up-fail-target=".failed-form-contents" up-reveal="false"
          method="post" enctype="multipart/form-data"
          class="border-top px-3 pt-3 pb-1 custom-submit">
        @csrf

        @if (session('message'))
            <div class="alert alert-danger">{{ session('message') }}</div>
        @endif

        <input type="hidden" name="_uid" value="{{ $record->uid }}">
        <input type="hidden" name="_api" value="/api/client/editMiscDemographics">
        <input type="hidden" name="_success" value="{{route('my_clients-view', ['uid' => $record->uid])}}">
        <input type="hidden" name="_return" value="{{route('my_clients_SINGLE-ACTION_editMiscDemographics', ['uid' => $record->uid])}}">
        <div class='form-group mb-3'>
<label class='control-label'>Citizenships </label>
<input class='form-control' type='text' name='citizenships' value='{{ old('citizenships') ? old('citizenships') : $record->citizenships }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Education </label>
<input class='form-control' type='text' name='education' value='{{ old('education') ? old('education') : $record->education }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Birth Country </label>
<input class='form-control' type='text' name='birthCountry' value='{{ old('birthCountry') ? old('birthCountry') : $record->birth_country }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Birth State </label>
<input class='form-control' type='text' name='birthState' value='{{ old('birthState') ? old('birthState') : $record->birth_state }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Birth City </label>
<input class='form-control' type='text' name='birthCity' value='{{ old('birthCity') ? old('birthCity') : $record->birth_city }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Nationality </label>
<input class='form-control' type='text' name='nationality' value='{{ old('nationality') ? old('nationality') : $record->nationality }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Religious Affiliation </label>
<input class='form-control' type='text' name='religiousAffiliation' value='{{ old('religiousAffiliation') ? old('religiousAffiliation') : $record->religious_affiliation }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Religious Facility </label>
<select class='form-control' name='religiousFacilityUid' value='{{ old('religiousFacilityUid') ? old('religiousFacilityUid') : '' }}' >
<option value=''>-- Select --</option>
<?php $dbOptions = \Illuminate\Support\Facades\DB::table('facility')->get(); ?>
<?php foreach($dbOptions as $o): ?>
<option <?= $o->uid === (old('religiousFacilityUid') ? old('religiousFacilityUid') : '') ? 'selected' : '' ?> value='<?= $o->uid ?>'><?= $o->name ?> (<?= $o->uid ?>)</option>
<?php endforeach; ?>
</select>
</div>
<div class='form-group mb-3'>
<label class='control-label'>Is On Special Diet *</label>
<select class='form-control' name='isOnSpecialDiet' value='{{ old('isOnSpecialDiet') ? old('isOnSpecialDiet') : $record->is_on_special_diet }}' required>
<option value=''>-- Select --</option>
<option <?= 'YES' === (old('isOnSpecialDiet') ? old('isOnSpecialDiet') : $record->is_on_special_diet) ? 'selected' : '' ?> value='YES'>YES</option>
<option <?= 'NO' === (old('isOnSpecialDiet') ? old('isOnSpecialDiet') : $record->is_on_special_diet) ? 'selected' : '' ?> value='NO'>NO</option>
<option <?= 'UNKNOWN' === (old('isOnSpecialDiet') ? old('isOnSpecialDiet') : $record->is_on_special_diet) ? 'selected' : '' ?> value='UNKNOWN'>UNKNOWN</option>
</select>
</div>
<div class='form-group mb-3'>
<label class='control-label'>Special Diet Category </label>
<input class='form-control' type='text' name='specialDietCategory' value='{{ old('specialDietCategory') ? old('specialDietCategory') : $record->special_diet_category }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Special Diet Memo </label>
<input class='form-control' type='text' name='specialDietMemo' value='{{ old('specialDietMemo') ? old('specialDietMemo') : $record->special_diet_memo }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Preferred Language </label>
<input class='form-control' type='text' name='preferredLanguage' value='{{ old('preferredLanguage') ? old('preferredLanguage') : $record->preferred_language }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Other Languages </label>
<input class='form-control' type='text' name='otherLanguages' value='{{ old('otherLanguages') ? old('otherLanguages') : $record->other_languages }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>English Level </label>
<input class='form-control' type='text' name='englishLevel' value='{{ old('englishLevel') ? old('englishLevel') : $record->english_level }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Driver License State </label>
<input class='form-control' type='text' name='driverLicenseState' value='{{ old('driverLicenseState') ? old('driverLicenseState') : $record->driver_license_state }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Driver License Number </label>
<input class='form-control' type='text' name='driverLicenseNumber' value='{{ old('driverLicenseNumber') ? old('driverLicenseNumber') : $record->driver_license_number }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Is Hispanic *</label>
<select class='form-control' name='isHispanic' value='{{ old('isHispanic') ? old('isHispanic') : $record->is_hispanic }}' required>
<option value=''>-- Select --</option>
<option <?= 'YES' === (old('isHispanic') ? old('isHispanic') : $record->is_hispanic) ? 'selected' : '' ?> value='YES'>YES</option>
<option <?= 'NO' === (old('isHispanic') ? old('isHispanic') : $record->is_hispanic) ? 'selected' : '' ?> value='NO'>NO</option>
<option <?= 'UNKNOWN' === (old('isHispanic') ? old('isHispanic') : $record->is_hispanic) ? 'selected' : '' ?> value='UNKNOWN'>UNKNOWN</option>
</select>
</div>
<div class='form-group mb-3'>
<label class='control-label'>Is Black Or AA *</label>
<select class='form-control' name='isBlackOrAA' value='{{ old('isBlackOrAA') ? old('isBlackOrAA') : $record->is_black_oraa }}' required>
<option value=''>-- Select --</option>
<option <?= 'YES' === (old('isBlackOrAA') ? old('isBlackOrAA') : $record->is_black_oraa) ? 'selected' : '' ?> value='YES'>YES</option>
<option <?= 'NO' === (old('isBlackOrAA') ? old('isBlackOrAA') : $record->is_black_oraa) ? 'selected' : '' ?> value='NO'>NO</option>
<option <?= 'UNKNOWN' === (old('isBlackOrAA') ? old('isBlackOrAA') : $record->is_black_oraa) ? 'selected' : '' ?> value='UNKNOWN'>UNKNOWN</option>
</select>
</div>
<div class='form-group mb-3'>
<label class='control-label'>Ethnicities </label>
<input class='form-control' type='text' name='ethnicities' value='{{ old('ethnicities') ? old('ethnicities') : $record->ethnicities }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Race </label>
<input class='form-control' type='text' name='race' value='{{ old('race') ? old('race') : $record->race }}' >
</div>
<div class='form-group mb-3'>
<label class='control-label'>Specific Races </label>
<input class='form-control' type='text' name='specificRaces' value='{{ old('specificRaces') ? old('specificRaces') : $record->specific_races }}' >
</div>
        <div class="form-group mb-3 d-flex justify-content-center">
            <button class="btn btn-sm btn-primary mr-3 px-5">Submit</button>
            <a href="{{route('my_clients-view', ['uid' => $record->uid])}}" class="btn btn-sm btn-default px-5" up-close>Cancel</a>
        </div>
    </form>

    </div></div>

@endsection
