<!-- Modal -->
<div class="modal" id="editCallingDatabaseModal" data-keyboard="false" data-backdrop="static">
    <div class="modal-dialog modal-lg">
        <div class="modal-content border-primary">
            <div class="modal-header bg-primary">
                <h5 class="modal-title text-white">Edit</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 data-toggle="validator" autocomplete="off" class="form-styled" id="edit_callingDatabase_form">
                    @csrf
                    <input type="hidden" id="callingDatabase_id">
                    <div class="row">
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Phone*</label>
                                <input type="text" id="edit_cd_phone" maxlength="20" 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 has-feedback">
                                <label class="control-label">Name</label>
                                <input type="text" id="edit_cd_name" maxlength="50" class="form-control">
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Email</label>
                                <input type="text" id="edit_cd_email" maxlength="50" class="form-control">
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Unit Number</label>
                                <input type="text" id="edit_cd_unit_no" maxlength="20" class="form-control">
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Tower</label>
                                <input type="text" id="edit_cd_tower" maxlength="100" class="form-control">
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Area</label>
                                <input type="text" id="edit_cd_area" maxlength="100" class="form-control">
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">City</label>
                                <input type="text" id="edit_cd_city" maxlength="100" class="form-control">
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Property Tpe</label>
                                <input type="text" id="edit_pt" maxlength="100" class="form-control">
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Additional Info:</label>
                                <input type="text" id="edit_cd_description" maxlength="500" class="form-control">
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Status</label>
                                <select data-live-search="true" id="edit_cd_status"
                                        class="form-control selectpicker show-tick">
                                    <option value="">Select Status</option>
                                    @foreach (App\Models\Attribute::orderBy('name')->where('type', 'leadStatus')->get() as $attr)
                                        <option value="{{ $attr->id }}">
                                            {{ $attr->name }}
                                        </option>
                                    @endforeach
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Category</label>
                                <select data-live-search="true" id="edit_cd_category"
                                        class="form-control selectpicker show-tick">
                                    <option value="">Select Category</option>
                                    @foreach (App\Models\Attribute::orderBy('name')->where('type', 'leadCategory')->get() as $attr)
                                        <option value="{{ $attr->id }}">
                                            {{ $attr->name }}
                                        </option>
                                    @endforeach
                                </select>
                            </div>
                        </div>
                        @if(auth()->user()->type == 1 || auth()->user()->type == 2)
                            <div class="col-xs-12 col-lg-12">
                                <div class="form-group">
                                    <label class="control-label">Assign To</label>
                                    <select data-live-search="true" id="edit_cd_assign_to"
                                            class="form-control selectpicker show-tick">
                                        <option value="">Select User</option>
                                        @if(auth()->user()->type == 1)
                                            @foreach (App\Models\User::orderBy('name')->where('type', 3)->get() as $attr)
                                                <option value="{{ $attr->id }}">
                                                    {{ $attr->name }}
                                                </option>
                                            @endforeach
                                        @else
                                            @foreach (App\Models\User::orderBy('name')->where('parent_id', auth()->id())->get() as $attr)
                                                <option value="{{ $attr->id }}">
                                                    {{ $attr->name }}
                                                </option>
                                            @endforeach
                                        @endif
                                    </select>
                                </div>
                            </div>
                        @endif
                    </div>
                    <div class="row">
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <button type="submit" id="edit_submit_btn" 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 class="alert alert-danger edit_errors" style="display: none">
                                    <ul></ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
