<?php $__env->startSection('content'); ?>
    <h1><?php echo e(!empty($memberName) ? $memberName : ''); ?> Users</h1>
    <div id="users">
        <div class="list-filters-container">
            <label for="" class="list-filters-label">Filters:</label>
            <div class="list-filters">
                <div class="list-filter">
                    <?php
                        $status = [
                            '' => 'Filter by Status',
                            'active' => 'Active',
                            'inactive' => 'Inactive',
                            'pendingApproval' => 'Pending Approval',
                            'block' => 'Block',
                        ];
                    ?>
                    <?php echo Form::select('status_filter', $status, null, [
                        'id' => 'status_id_input',
                        'class' => 'form-control',
                    ]); ?>

                </div>
                <div class="list-filter">
                    <?php
                        $commEmpty = [
                            0 => 'Filter by Committees',
                        ];
                        $committeesArray = array_merge($commEmpty, $committees);
                    ?>
                    <?php echo Form::select('committees_filter', $committeesArray, null, [
                        'id' => 'committees_id_input',
                        'class' => 'form-control',
                    ]); ?>

                </div>
                <div class="list-filter">
                    <?php
                        $wgEmpty = [
                            0 => 'Filter by WG / TF',
                        ];
                        $wg = array_merge($wgEmpty, $workGroups);
                    ?>
                    <?php echo Form::select('wg_filter', $wg, null, [
                        'id' => 'wg_id_input',
                        'class' => 'form-control',
                    ]); ?>

                </div>
                <button type="button" data-toggle="tooltip" class="btn btn-default command-export list-export-btn"
                    title="Export to Excel">
                    <span class="icon glyphicon glyphicon-export"></span>
                </button>
                <form action="<?php echo e(url('/admin/member-usage/export')); ?>" method="GET" class="form-inline">
                    <input type="month" name="from" class="form-control"
                        value="<?php echo e(now()->tz('Europe/Berlin')->startOfMonth()->format('Y-m')); ?>"
                        aria-label="Usage report start month">
                    <input type="month" name="to" class="form-control"
                        value="<?php echo e(now()->tz('Europe/Berlin')->startOfMonth()->format('Y-m')); ?>" aria-label="Usage report end month">
                    <button type="submit" data-toggle="tooltip" class="btn btn-default"
                        title="Export member usage to Excel">
                        <span class="icon glyphicon glyphicon-stats"></span>
                    </button>
                </form>
            </div>
        </div>
        <table id="grid" class="table table-condensed table-hover table-striped">
            <thead>
                <tr>
                    <th data-column-id="id" data-type="numeric" data-sortable="true" data-identifier="true">ID</th>
                    <th data-column-id="name" data-order="asc">First Name</th>
                    <th data-column-id="last_name" data-sortable="true">Last Name</th>
                    <th data-column-id="email" data-sortable="true">Email</th>
                    <th data-column-id="member" data-formatter="member" data-sortable="false">Member</th>
                    <th data-column-id="department" data-sortable="true">Department</th>
                    <th data-column-id="function" data-sortable="true">Function</th>
                    <th data-column-id="created_at" data-order="asc">Registration Date</th>
                    <th data-column-id="state" data-sortable="false">State</th>
                    <th data-column-id="committees" data-sortable="false">Com / TF / WG</th>
                    <?php if($canEdit): ?>
                        <th data-column-id="commands" data-formatter="commands" data-sortable="false">
                            <?php echo e(trans('backend.actions')); ?></th>
                    <?php endif; ?>
                </tr>
            </thead>
        </table>
    </div>
    <script>
        $(function() {
            var manageUsersView = new Eae.View.BackendUserList({
                el: $('#users'),
                userId: <?php echo e($loggedUser->id); ?>,
                memberId: <?php echo e(!empty($memberId) ? intval($memberId) : 0); ?>,
            });
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.main', [
    'scripts' => [path_asset('path.backoffice.js_path') . '/view/user/user-list.js'],
], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/resources/views/admin/pages/users/users.blade.php ENDPATH**/ ?>