<!-- Modal -->
<div class="modal" id="addStreamModal" 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">Add Note</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">
                    @csrf
                    <input type="hidden" name="type" value="stream">
                    <div class="row">
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Type*</label>
                                <select required name="sub_type" class="form-control">
                                    <option value="Note">Note</option>
                                    <option value="SMS">SMS</option>
                                    <option value="Email">Email</option>
                                    <option value="Call">Call</option>
                                    <option value="Letter">Letter</option>
                                    <option value="Meeting">Meeting</option>
                                </select>
                                <span class="help-block with-errors"></span>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Property</label>
                                <select name="listing_id" class="form-control">
                                    <option value="">Select Property</option>
                                    @if(auth()->user()->type == 1)
                                        @foreach (\App\Models\Listing::whereType(1)->orderBy('title')->get() as $attr)
                                            <option value="{{ $attr->id }}">
                                                {{ $attr->title }} ({{ $attr->p_id }})
                                            </option>
                                        @endforeach
                                    @else
                                        @foreach (auth()->user()->simple_listings()->orderBy('title')->get() as $attr)
                                            <option value="{{ $attr->id }}">
                                                {{ $attr->title }} ({{ $attr->p_id }})
                                            </option>
                                        @endforeach
                                    @endif
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Note</label>
                                <textarea minlength="3" maxlength="1000" name="note" cols="30" rows="2"
                                          class="form-control content_area"></textarea>
                                <span class="help-block with-errors"></span>
                            </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>
