<!-- Modal -->
<div class="modal" id="addLeadModal" 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 new</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="create_lead_form">
                    <?php echo csrf_field(); ?>
                    <div class="row">
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group has-feedback">
                                <label class="control-label">Title</label>
                                <input type="text" id="lead_title" maxlength="100"
                                       data-error="Must be at least 3 character" class="form-control">
                            </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="lead_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 has-feedback">
                                <label class="control-label">Phone* (+971 XX XXXXXXX)</label>
                                <input type="text" id="lead_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">
                                <label class="control-label">Property Type</label>
                                <select data-live-search="true" id="lead_property_type"
                                        class="form-control selectpicker show-tick">
                                    <option value="">Select Property Type</option>
                                    <?php $__currentLoopData = App\Models\Attribute::orderBy('name')->with('parent')->where('type', 'propertyType')->whereNotNull('parent_id')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($attr->id); ?>">
                                            <?php echo e($attr->parent ? $attr->name . ' (' . $attr->parent->name . ')' : $attr->name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Type</label>
                                <select data-live-search="true" id="lead_lead_type"
                                        class="form-control selectpicker show-tick">
                                    <option value="">Select Type</option>
                                    <?php $__currentLoopData = App\Models\Attribute::orderBy('name')->where('type', 'leadType')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($attr->id); ?>">
                                            <?php echo e($attr->name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Lead Category</label>
                                <select data-live-search="true" id="lead_lead_category"
                                        class="form-control selectpicker show-tick">
                                    <option value="">Select Category</option>
                                    <?php $__currentLoopData = App\Models\Attribute::orderBy('name')->where('type', 'leadCategory')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($attr->id); ?>">
                                            <?php echo e($attr->name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Lead Status</label>
                                <select data-live-search="true" id="lead_lead_status"
                                        class="form-control selectpicker show-tick">
                                    <option value="">Select Lead Status</option>
                                    <?php $__currentLoopData = App\Models\Attribute::orderBy('name')->where('type', 'leadStatus')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($attr->id); ?>">
                                            <?php echo e($attr->name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Primary Source</label>
                                <select data-live-search="true" id="lead_primary_source"
                                        class="form-control selectpicker show-tick">
                                    <option value="">Select Primary Source</option>
                                    <?php $__currentLoopData = App\Models\Attribute::orderBy('name')->where(['type' => 'leadSource', 'is_primary' => 1])->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($attr->id); ?>">
                                            <?php echo e($attr->name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Secondary Source</label>
                                <select data-live-search="true" id="lead_secondary_source"
                                        class="form-control selectpicker show-tick">
                                    <option value="">Select Secondary Source</option>
                                    <?php $__currentLoopData = App\Models\Attribute::orderBy('name')->where(['type' => 'leadSource', 'is_primary' => 2])->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($attr->id); ?>">
                                            <?php echo e($attr->name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Lead Interest Level</label>
                                <select data-live-search="true" id="lead_lead_interest_level"
                                        class="form-control selectpicker show-tick">
                                    <option value="">Select Lead Interest Level</option>
                                    <?php $__currentLoopData = App\Models\Attribute::orderBy('name')->where('type', 'leadInterestLevel')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($attr->id); ?>">
                                            <?php echo e($attr->name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <?php 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="lead_assign_to"
                                            class="form-control selectpicker show-tick">
                                        <option value="">Select User</option>
                                        <?php if(auth()->user()->type == 1): ?>
                                            <?php $__currentLoopData = App\Models\User::orderBy('name')->where('type', 3)->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($attr->id); ?>">
                                                    <?php echo e($attr->name); ?>

                                                </option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php else: ?>
                                            <?php $__currentLoopData = App\Models\User::orderBy('name')->where('parent_id', auth()->id())->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($attr->id); ?>">
                                                    <?php echo e($attr->name); ?>

                                                </option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php endif; ?>
                                    </select>
                                </div>
                            </div>
                        <?php endif; ?>
                        <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="lead_description" maxlength="500" class="form-control">
                            </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>
<?php /**PATH E:\xampp\htdocs\propco\resources\views/admin/leads/modals/addLeadModal.blade.php ENDPATH**/ ?>