<!-- Modal -->
<div class="modal" id="bulkModal" 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">Bulk Actions</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 action="{{route('leads-bulk-action')}}" method="post" autocomplete="off"
                      class="form-styled" id="upload_file_form">
                    <input type="hidden" id="bulkIds" name="bulkIds">
                    @csrf
                    <div class="row">
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Selected ID(s)*</label>
                                <h4 style="word-wrap: break-word" id="slBulkIds"></h4>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        @if(auth()->user()->type == 1 || auth()->user()->type == 2)
                            <div class="col-xs-12 col-lg-6">
                                <div class="form-group has-feedback">
                                    <label class="control-label">Assign To</label>
                                    <select name="bulk_assign_to" id="bulk_assign_to"
                                            class="form-control">
                                        <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 class="col-xs-12 col-lg-6">
                            <div class="form-group has-feedback">
                                <label class="control-label">Primary Source</label>
                                <select name="bulk_ps" id="bulk_ps"
                                        class="form-control">
                                    <option value="">Select Select Primary Source</option>
                                    @foreach (App\Models\Attribute::orderBy('name')->where(['type' => 'leadSource', 'is_primary' => 1])->get() as $attr)
                                        <option value="{{ $attr->id }}">
                                            {{ $attr->name }}
                                        </option>
                                    @endforeach
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-6">
                            <div class="form-group has-feedback">
                                <label class="control-label">Secondary Source</label>
                                <select name="bulk_ss" id="bulk_ss"
                                        class="form-control">
                                    <option value="">Select Select Secondary Source</option>
                                    @foreach (App\Models\Attribute::orderBy('name')->where(['type' => 'leadSource', 'is_primary' => 2])->get() as $attr)
                                        <option value="{{ $attr->id }}">
                                            {{ $attr->name }}
                                        </option>
                                    @endforeach
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-6">
                            <div class="form-group has-feedback">
                                <label class="control-label">Status</label>
                                <select name="bulk_status" id="bulk_status"
                                        class="form-control">
                                    <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>
                    <div class="row">
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <button type="submit" id="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 add_errors" style="display: none">
                                    <ul></ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
