<?php $__env->startSection('title', trans('settings.title')); ?>

<?php $__env->startSection('page_stylesheets'); ?>
    <link href="<?php echo e(asset('assets/libs/datepicker/datepicker.min.css')); ?>" rel="stylesheet">
    <link href="<?php echo e(asset('assets/libs/dropify/css/dropify.css')); ?>" rel="stylesheet">
    <link href="<?php echo e(asset('assets/libs/intl-tel-input/css/intlTelInput.css')); ?>" rel="stylesheet"/>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
        @parent
        <?php echo $__env->make('global.status', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        <div class="ui top attached tabular menu insura-tabs">
            <a class="item<?php echo e(session()->get('tab', 'profile') === 'profile' ? ' active' : null); ?>" data-tab="profile"><?php echo e(trans('settings.tab.menu.profile')); ?></a>

            <?php echo $__env->yieldContent('company_menu'); ?>

            <?php echo $__env->yieldContent('system_menu'); ?>

            <?php echo $__env->yieldContent('reminders_menu'); ?>

            <a class="item<?php echo e(session()->get('tab', null) === 'security' ? ' active' : null); ?>" data-tab="security"><?php echo e(trans('settings.tab.menu.security')); ?></a>
        </div>
        <div class="ui bottom attached tab segment<?php echo e(session()->has('tab') ? null : ' active'); ?>" data-tab="profile">
            <div class="row">
                <div class="col-md-6">
                    <p><?php echo e(trans('settings.tab.message.profile')); ?></p>
                    <form action="<?php echo e(action('UserController@edit', array($user->id))); ?>" enctype="multipart/form-data" method="POST">
                        <?php echo e(csrf_field()); ?>

                        <div class="ui form">
                            <div class="field required">
                                <label><?php echo e(trans('settings.input.label.first_name')); ?></label>
                                <input type="text" name="first_name" placeholder="<?php echo e(trans('settings.input.placeholder.first_name')); ?>" required value="<?php echo e($user->first_name); ?>"/>
                            </div>
                            <div class="field">
                                <label><?php echo e(trans('settings.input.label.last_name')); ?></label>
                                <input type="text" name="last_name" placeholder="<?php echo e(trans('settings.input.placeholder.last_name')); ?>" value="<?php echo e($user->last_name); ?>"/>
                            </div>
                            <div class="field required">
                                <label><?php echo e(trans('settings.input.label.email')); ?></label>
                                <input type="email" name="email" placeholder="<?php echo e(trans('settings.input.placeholder.email')); ?>" required value="<?php echo e($user->email); ?>"/>
                            </div>
                            <div class="field">
                                <label><?php echo e(trans('settings.input.label.phone')); ?></label>
                                <input type="tel" placeholder="<?php echo e(trans('settings.input.placeholder.phone')); ?>" value="<?php echo e($user->phone); ?>"/>
                            </div>
                            <div class="field">
                                <label><?php echo e(trans('settings.input.label.birthday')); ?></label>
                                <input type="date" class="datepicker" name="birthday" placeholder="<?php echo e(trans('settings.input.placeholder.birthday')); ?>" value="<?php echo e($user->birthday); ?>"/>
                            </div>
                            <div class="field">
                                <label><?php echo e(trans('settings.input.label.address')); ?></label>
                                <input type="text" name="address" placeholder="<?php echo e(trans('settings.input.placeholder.address')); ?>" value="<?php echo e($user->address); ?>"/>
                            </div>
                            <div class="field required">
                                <label><?php echo e(trans('settings.input.label.locale')); ?></label>
                                <select class="ui fluid search dropdown" name="locale">
                                    <?php foreach(config('insura.languages') as $language): ?>
                                    <option<?php echo e($user->locale === $language['locale'] ? ' selected' : ''); ?> value="<?php echo e($language['locale']); ?>"><?php echo e($language['name']); ?></option>
                                    <?php endforeach; ?>
                                </select>
                            </div>
                            <div class="field">
                                <label><?php echo e(trans('settings.input.label.profile_image')); ?></label>
                                <input type="file"  accept="image/*" class="file-upload" data-allowed-file-extensions="bmp gif jpeg jpg png svg" data-default-file="<?php echo e(asset('uploads/images/users/' . $user->profile_image_filename)); ?>" name="profile_image">
                            </div>
                            <div class="field">
                                <button class="ui right floated button primary m-w-140" type="submit"><?php echo e(trans('settings.button.save')); ?></button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <?php echo $__env->yieldContent('company_tab'); ?>

        <?php echo $__env->yieldContent('system_tab'); ?>

        <?php echo $__env->yieldContent('reminders_tab'); ?>

        <div class="ui bottom attached tab segment<?php echo e(session()->get('tab', null) === 'security' ? ' active' : ''); ?>" data-tab="security">
            <div class="row">
                <div class="col-md-6">
                    <p><?php echo e(trans('settings.tab.message.security')); ?></p>
                    <form action="<?php echo e(action('Auth\PasswordController@update')); ?>" method="POST">
                        <?php echo e(csrf_field()); ?>

                        <div class="ui form">
                            <div class="field required">
                                <label><?php echo e(trans('settings.input.label.current_password')); ?></label>
                                <input type="password" name="current_password" placeholder="<?php echo e(trans('settings.input.placeholder.current_password')); ?>" required/>
                            </div>
                            <div class="field required">
                                <label><?php echo e(trans('settings.input.label.new_password')); ?></label>
                                <input type="password" name="new_password" placeholder="<?php echo e(trans('settings.input.placeholder.new_password')); ?>" required/>
                            </div>
                            <div class="field required">
                                <label><?php echo e(trans('settings.input.label.confirm_password')); ?></label>
                                <input type="password" name="new_password_confirmation" placeholder="<?php echo e(trans('settings.input.placeholder.confirm_password')); ?>" required/>
                            </div>
                            <div class="field">
                                <button class="ui right floated button primary m-w-140" type="submit"><?php echo e(trans('settings.button.save')); ?></button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_scripts'); ?>
    <script src="<?php echo e(asset('assets/libs/datepicker/datepicker.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('assets/libs/dropify/js/dropify.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('assets/libs/intl-tel-input/js/intlTelInput.min.js')); ?>" type="text/javascript"></script>
    <script type="text/javascript">
        (function($insura, $) {
            $(document).ready(function() {
                $insura.helpers.initAccordion('div.ui.accordion');
                $insura.helpers.initDatepicker('input.datepicker');
                $insura.helpers.initDropdown('div.dropdown, select.dropdown');
                $insura.helpers.initDropify('input.file-upload');
                $insura.helpers.initScrollbar('div.scrollbar');
                $insura.helpers.initTabs('div.insura-tabs a.item');
                $insura.helpers.initTelInput('input[type="tel"]');
                $insura.helpers.listenForChats();
                $insura.helpers.requireDropdownFields('form div.required select');
            });
        })(window.insura, window.jQuery);
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('global.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>