<div class="usc_app_page_wrap" style="min-height:500px">
{if $users}
<div class="row">
    <div class="col-xs-12">
        <div class="panel">
            <header class="panel-heading">Operators</header>
            <button class="btn btn-block btn-primary op_button" onclick="window.location.href = applicationPath + 'users/add'">Add New</button>
            <span id="error_handling" class="op_error_handeling"></span>
            <div class="panel-body table-responsive">
           
                <table class="table table-hover">
                    <tr>
                        <th>AVATAR</th>
                        <th>DISPLAY NAME</th>
                        <th>FIRST NAME</th>
                        <th>LAST NAME</th>
                        <th>EMAIL</th>
                        <th>ADMIN</th>
                        <th>STATUS</th>
                    </tr>

                    {foreach from=$users item=i}

                    <tr>
                        <td><img src="{if $i.avatar != ''}{$data_server}{$i.avatar}{else}{$data_server}config/themes/img/avatars/default.png{/if}" width="30" height="30"/></td>
                        <td>{$i.username}</td>
                        <td>{$i.firstname}</td>
                        <td>{$i.lastname}</td>
                        <td>{$i.email}</td>
                        <td>{if $i.permissions == '1'}<i class="fa fa-check"></i>{else}<i class="fa fa-close"></i>{/if}</td>
                        <td><span id="operator_{$i.user_id}_status" class="label label-{if $i.status > $time_expired}primary{elseif $i.status == 'away'}warning{else}danger{/if}">{if $i.status > $time_expired}Online{else}Offline{/if}</span></td>
                        <td onclick="edit({$i.user_id})"><i class="fa fa-edit tip_tip" title="Edit"></i></td>
                        <td onclick="delete_operator({$i.user_id})"><i class="fa fa-trash tip_tip" title="Delete"></i></td>
                    </tr>

                    {/foreach}

                </table>
            </div><!-- /.box-body -->
        </div><!-- /.box -->
    </div>
</div>
{/if}
</div>

<script src="{$data_server}js/users.min.js" type="text/javascript"></script>