<!-- Modal -->
<div class="modal" id="editProfileModal" data-keyboard="false" data-backdrop="static">
    <div class="modal-dialog modal-lg" style="max-width: 500px">
        <div class="modal-content border-primary">
            <div class="modal-header bg-primary">
                <h5 class="modal-title text-white">Edit Profile</h5>
                <button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form method="post" action="{{route('updateContact', $contact->id)}}" data-toggle="validator" autocomplete="off" class="form-styled" enctype="multipart/form-data">
                    @csrf
                    <input type="hidden" name="type" value="profile">
                    <div class="row">
                        <div class="col-md-12 text-center">
                            @if($contact->image)
                                <img style="width: 30%" class="header__banner__img"
                                     src="/{{$contact->image}}">
                            @else
                                <img style="width: 30%" class="header__banner__img"
                                     src="{{ asset('back_assets/assets/images/avatars/avatar-13.jpg') }}">
                            @endif
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Update Picture</label>
                                <input style="padding: 3px" type="file" class="form-control"
                                       name="contact_picture">
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Title</label>
                                <select name="contact_salutation" class="form-control">
                                    <option value="">Select an option</option>
                                    <option {{$contact->salutation == 'Mr' ? 'selected' : ''}} value="Mr">Mr</option>
                                    <option {{$contact->salutation == 'Ms' ? 'selected' : ''}}  value="Ms">Ms</option>
                                    <option {{$contact->salutation == 'M/S' ? 'selected' : ''}}  value="M/S">M/S</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Name*</label>
                                <input value="{{$contact->name}}" type="text" name="contact_name" maxlength="50" required data-minlength="1"
                                       data-error="Must be at least 3 character" class="form-control"><span
                                    class="help-block with-errors"></span>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Contact Role</label>
                                <select name="contact_role_id" class="form-control">
                                    <option value="">Select Contact Role</option>
                                    @foreach (App\Models\Attribute::orderBy('name')->where('type', 'contactRole')->get() as $attr)
                                        <option {{$contact->contact_role_id == $attr->id ? 'selected' : ''}} value="{{ $attr->id }}">
                                            {{ $attr->name }}
                                        </option>
                                    @endforeach
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <button type="submit" name="submit" class="btn btn-success"><i
                                        class="fa fa-check fa-lg"> </i>&nbsp;Submit
                                </button>
                                <button type="button" class="btn btn-secondary" data-dismiss="modal"><i
                                        class="fa fa-times fa-lg"></i> Close
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
