<!-- Modal -->
<div class="modal" id="addAppointmentModal" data-keyboard="false" data-backdrop="static">
    <div class="modal-dialog modal-lg" style="max-width: 1000px">
        <div class="modal-content border-primary">
            <div class="modal-header bg-primary">
                <h5 class="modal-title text-white">Add Appointment</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="<?php echo e(route('updateContact', $contact->id)); ?>" data-toggle="validator"
                      autocomplete="off" class="form-styled">
                    <?php echo csrf_field(); ?>
                    <input type="hidden" name="type" value="appointment">
                    <div class="row">
                        <div class="col-xs-12 col-lg-4">
                            <div class="form-group has-feedback">
                                <label class="control-label">Title*</label>
                                <input required type="text" name="title" maxlength="100"
                                       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-4">
                            <div class="form-group has-feedback">
                                <label class="control-label">Type*</label>
                                <select required name="atype" class="form-control">
                                    <option value="">Select Type</option>
                                    <option value="1">General Appointment</option>
                                    <option value="2">Accompanied Viewing</option>
                                    <option value="3">Valuation</option>
                                    <option value="4">Unaccompanied Viewing</option>
                                </select><span class="help-block with-errors"></span>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-4">
                            <div class="form-group">
                                <label class="control-label">Start*</label>
                                <input required name="start" type="datetime-local" class="form-control">
                                <span class="help-block with-errors"></span>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-4">
                            <div class="form-group">
                                <label class="control-label">End*</label>
                                <input required name="end" type="datetime-local" class="form-control">
                                <span class="help-block with-errors"></span>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-4">
                            <div class="form-group">
                                <label class="control-label">Listing</label>
                                <select name="listing_id" class="form-control">
                                    <option value="">Select Listing</option>
                                    <?php if(auth()->user()->type == 1): ?>
                                        <?php $__currentLoopData = \App\Models\Listing::whereType(1)->orderBy('title')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($attr->id); ?>">
                                                <?php echo e($attr->title); ?> (<?php echo e($attr->p_id); ?>)
                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php else: ?>
                                        <?php $__currentLoopData = auth()->user()->simple_listings()->orderBy('title')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($attr->id); ?>">
                                                <?php echo e($attr->title); ?> (<?php echo e($attr->p_id); ?>)
                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php endif; ?>
                                </select>
                            </div>
                        </div>
                        <?php if(auth()->user()->type == 1 || auth()->user()->type == 2): ?>
                            <div class="col-xs-12 col-lg-4">
                                <div class="form-group">
                                    <label class="control-label">Guest</label>
                                    <select name="guest_id" class="form-control">
                                        <option value="">Select Guest</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; ?>
                        <?php if(auth()->user()->type == 1 || auth()->user()->type == 2): ?>
                            <div class="col-xs-12 col-lg-4">
                                <div class="form-group">
                                    <label class="control-label">Select User</label>
                                    <select name="user_id" class="form-control">
                                        <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-4">
                            <div class="form-group has-feedback">
                                <label class="control-label">Guest will appear as</label>
                                <select name="appear_as" class="form-control">
                                    <option value="1">Busy</option>
                                    <option value="2">Free</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Location</label>
                                <input name="location" maxlength="200" class="form-control">
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Description</label>
                                <textarea name="description" maxlength="500" cols="30" rows="5"
                                          class="form-control content_area"></textarea>
                            </div>
                        </div>
                        <div class="col-xs-12 col-lg-12">
                            <div class="form-group">
                                <label class="control-label">Private Description</label>
                                <textarea name="private_description" maxlength="500" cols="30" rows="5"
                                          class="form-control"></textarea>
                            </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>
<?php /**PATH E:\xampp\htdocs\propco\resources\views/admin/contacts/modals/addAppointmentModal.blade.php ENDPATH**/ ?>