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

<?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('action_buttons'); ?>
            <div class="ui right floated segment transparent page-actions">
                <button class="ui labeled icon button primary open-modal" data-target="#newStaffModal" data-toggle="modal">
                    <i class="ion-ios-plus-outline icon"></i> 
                    <?php echo e(trans('staff.button.new')); ?> 
                </button>
            </div>
<?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="row clients-list">
            <!-- start staff -->
            <?php $__empty_1 = true; foreach($staff as $employee): $__empty_1 = false; ?>
            <div class="col-md-6">
                <div class="ui segment white client-list-card">
                    <div class="client-list-about">
                        <div class="client-list-avatar">
                            <?php if($employee->profile_image_filename === 'default-profile.jpg'): ?>
                            <div class="text-avatar small w-h-70" style="background-color:<?php echo e(collect(config('insura.colors'))->random()); ?>;"><?php echo e(strtoupper($employee->first_name[0] . (isset($employee->last_name) ? $employee->last_name[0] : ''))); ?></div>
                            <?php else: ?>
                            <img src="<?php echo e(asset('uploads/images/users/' . $employee->profile_image_filename)); ?>" alt="<?php echo e($employee->first_name); ?> <?php echo e($employee->last_name); ?>"/>
                            <?php endif; ?>
                        </div>
                        <div class="client-list-info">
                            <h3><?php echo e($employee->first_name); ?> <?php echo e($employee->last_name); ?></h3>
                            <span>
                                <?php if($employee->status): ?>
                                <i class="ion-ios-circle-filled text-success"></i> <?php echo e(trans('staff.status.active')); ?>

                                <?php else: ?>
                                <i class="ion-ios-circle-filled text-danger"></i> <?php echo e(trans('staff.status.inactive')); ?>

                                <?php endif; ?>
                            </span>
                            <div class="client-list-contact">
                                <div class="col-xs-6 col-sm-6 col-md-6 b-r text-ellipsis p-0">
                                    <i class="ion-ios-email"></i> <?php echo e($employee->email); ?>

                                </div>
                                <div class="col-xs-6 col-sm-6 col-md-6 text-ellipsis">
                                    <i class="ion-ios-telephone"></i> <?php echo e(isset($employee->phone) ? $employee->phone : '(---) ---- --- ---'); ?>

                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row client-list-footer">
                        <div class="col-xs-3 col-sm-4 col-md-4">
                            <p>
                                <strong><?php echo e(trans('staff.label.commission')); ?>:</strong> <?php echo e(isset($employee->currency_symbol) ? $employee->currency_symbol : $staff->currency_symbol); ?><?php echo e($employee->commission); ?>

                            </p>
                        </div>
                        <div class="col-xs-5 col-sm-4 col-md-4">
                            <p>
                                <strong><?php echo e(trans('staff.label.sales')); ?>:</strong>
                                <?php if($employee->sales > $employee->paid): ?>
                                <span class="text-danger"><?php echo e(isset($employee->currency_symbol) ? $employee->currency_symbol : $staff->currency_symbol); ?><?php echo e($employee->due); ?></span>
                                <?php elseif($employee->sales === $employee->paid): ?>
                                <span class="text-success"><?php echo e(trans('staff.label.status.paid')); ?></span>
                                <?php else: ?>
                                <span class="text-info"><?php echo e(isset($employee->currency_symbol) ? $employee->currency_symbol : $staff->currency_symbol); ?><?php echo e($employee->due); ?></span>
                                <?php endif; ?>
                            </p>
                        </div>
                        <div class="col-xs-4 col-sm-4 col-md-4 text-right client-list-more">
                            <a href="<?php echo e(action('StaffController@getOne', array($employee->id))); ?>" class="mini ui button"> <?php echo e(trans('staff.link.profile')); ?> </a>
                        </div>
                    </div>
                </div>
            </div>
            <?php endforeach; if ($__empty_1): ?>
            <div class="col-md-4 col-md-offset-3">
                <div class="segment text-center ui white">
                    <i class="huge icon ion-android-alert"></i>
                    <p><?php echo e(trans('staff.message.empty')); ?></p>
                </div>
            </div>
            <?php endif; ?>
            <!-- end staff -->
            <div class="col-md-12 text-center">
                <?php echo $staff->render($presenter); ?>

            </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.initDatepicker('input.datepicker');
                $insura.helpers.initDropdown('div.dropdown, select.dropdown');
                $insura.helpers.initDropify('input.file-upload');
                $insura.helpers.initModal('div.modal', true);
                $insura.helpers.initScrollbar('div.scrollbar');
                $insura.helpers.initTelInput('input[type="tel"]');
                $insura.helpers.listenForChats();
                $insura.helpers.requireDropdownFields('form div.required select, form div.required div.dropdown input[type="hidden"]');
            });
        })(window.insura, window.jQuery);
    </script>
<?php $__env->stopSection(); ?>

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