
<?php $__env->startSection('subtitle'); ?>
User Administration
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

<div class="row">
    <div class="col-lg-12">
        <h1>User <small>Administration</small></h1>
        <ol class="breadcrumb">
            <li>
                <i class="fa fa-dashboard"></i> Dashboard
            </li>
            <li class="active">
                <i class="icon-file-alt"></i> Users
            </li>
        </ol>
    </div>
</div><!-- /.row -->

<div class="row">
    <div class="col-lg-12">
        <table class="table tablesorter">
            <thead>
                <tr>
                    <th> Username <i class="fa fa-sort"></i></th>
                    <th> Email <i class="fa fa-sort"></i></th>
                    <th> Role <i class="fa fa-sort"></i></th>
                    <th> Converted <i class="fa fa-sort"></i></th>
                    <th> Confirmed <i class="fa fa-sort"></i></th>
                    <th> Created at <i class="fa fa-sort"></i></th>
                    <th> Updated at <i class="fa fa-sort"></i></th>
                    <th> Disabled until <i class="fa fa-sort"></i></th>
                    <th> Failed Attempts <i class="fa fa-sort"></i></th>
                    <th> Loadouts <i class="fa fa-sort"></i></th>
                    <th> Actions </th>
                </tr>
            </thead>
            <tbody>
                <?php foreach($users as $user): ?>
                <tr>
                    <td>
                        <a href="<?php echo route('userSubmissions', $user -> email); ?>">
                            <?php if (strlen($user -> username) <= 25): ?>
                            <?php echo $user -> username; ?>
                            <?php else: ?>
                            <?php echo substr($user -> username, 0, 24); ?>...
                            <?php endif; ?>
                        </a>
                    </td>
                    <td>
                        <?php if (strlen($user -> email) <= 30): ?>
                        <?php echo $user -> email; ?>
                        <?php else: ?>
                        <?php echo substr($user -> email, 0, 29); ?>...
                        <?php endif; ?>
                    </td>
                    <td>
                        <?php echo $user -> role; ?>
                    </td>
                    <td>
                        <?php echo $user -> converted_guest; ?>
                    </td>
                    <td>
                        <?php if($user -> confirm_token == 1): ?>
                            Yes
                        <?php else: ?>
                            No
                        <?php endif; ?>
                    </td>
                    <td>
                        <?php echo $user -> created_at; ?>
                    </td>
                    <td>
                        <?php echo $user -> updated_at; ?>
                    </td>
                    <td>
                        <?php echo $user -> disabled_until; ?>
                    </td>
                    <td>
                        <?php echo $user -> failed_attempts; ?>
                    </td>
                    <td>
                        <?php echo $user -> loadouts -> count(); ?>
                    </td>
                    <td>
                        <a href="<?php echo route('editUser', array('email' => $user -> email)); ?>" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
                        &nbsp;<a href="<?php echo route('deleteUser', array('email' => $user -> email) ); ?>" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
                    </td>
                </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div><!-- /.row -->

<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-scripts'); ?>

<script src="<?php echo asset('js/tablesorter/jquery.tablesorter.js'); ?>"></script>
<script src="<?php echo asset('js/tablesorter/tables.js'); ?>"></script>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>