<?php if(!defined('ACCESS_CONTROL')) {header($_SERVER['SERVER_PROTOCOL']. ' 404'); exit('404 not found');}?>
<div class="pull-right">
    <a class="btn btn-danger btn-sm remote-button" data-remote-url="?do=bots&action=clear" data-method="delete" data-confirm="Are you sure?" ><i class="glyphicon glyphicon-trash"></i> Clear all bots</a>
</div>
<table class="table table-small table-striped table-condensed table-bordered table-hover">
    <thead>
    <tr style="background-color: #646465; color: #fff">
        <th>Guid</th>
        <th>IP</th>
        <th>Country</th>
        <th>OS</th>
        <th>Bits</th>
        <th>Privileges</th>
        <th>Registry date</th>
    </tr>
    </thead>
    <tbody>
    <?php if($bots):?>
        <?php $i=1; foreach($bots as $bot):?>
            <tr>
                <td><?php echo($bot['guid'])?></td>
                <td><?php echo($bot['ip'])?></td>
                <td> <img class="flag flag-<?php echo(strtolower($bot['country']))?>" width="16" height="11" /> <?php echo($bot['country'])?> <small><?php echo(isset($countries[$bot['country']]) ? $countries[$bot['country']] : 'Unknown')?></small>  </td>
                <td><?php echo  isset($platforms[$bot['os']]) ? $platforms[$bot['os']] : 'Unknown' ?></td>
                <td><?php echo $bot['bits']?> bit</td>
                <td><?php echo $bot['pl'] ? 'Admin' : 'User'?></td>
                <td><?php echo $bot['created_at']?></td>
            </tr>
            <?php $i++; endforeach?>
    <?php else:?>
        <tr>
            <td colspan="7">No data</td>
        </tr>
    <?php endif?>
    </tbody>
</table>

<?php if ($count_pages > 1): ?>
    <?php for($i=1; $i <= $count_pages;$i++): ?>
        <a class="btn btn-<?php echo($current_page == $i ? 'success' : 'default')?> btn-sm" href="?do=bots&page=<?php echo($i)?>"><?php echo($i)?></a>
    <?php endfor ?>
<?php endif?>
