<?php if(!defined('ACCESS_CONTROL')) {header($_SERVER['SERVER_PROTOCOL']. ' 404'); exit('404 not found');}?>
<div class="row">
    <div class="col-md-6">
        <table class="table table-small table-responsive table-condensed table-hover table-striped">
            <thead>
            <tr>
                <th>Platform</th>
                <th style="width: 10%">Count</th>
            </tr>
            </thead>
            <?php if($stats['os']):?>
                <tbody>
                <?php $i=0; foreach($stats['os'] as $os=>$stat):?>
                    <tr>
                        <td><?php echo isset($platforms[$os]) ? $platforms[$os]: 'Unknown' ?></td>
                        <td><?php echo($stat)?></td>
                    </tr>
                    <?php $i++; endforeach?>
                </tbody>
            <?php else:?>
                <tbody>
                <tr>
                    <td colspan="3">No data</td>
                </tr>
                </tbody>
            <?php endif?>
        </table>

        <table class="table table-small table-responsive table-condensed table-hover table-striped">
            <thead>
            <tr>
                <th>Privileges</th>
                <th style="width: 10%">Count</th>
            </tr>
            </thead>
            <?php if($stats['pl']):?>
                <tbody>
                <?php $i=0; foreach($stats['pl'] as $pl=>$stat):?>
                    <tr>
                        <td><?php echo $pl ? 'Admin': 'User' ?></td>
                        <td><?php echo($stat)?></td>
                    </tr>
                    <?php $i++; endforeach?>
                </tbody>
            <?php else:?>
                <tbody>
                <tr>
                    <td colspan="3">No data</td>
                </tr>
                </tbody>
            <?php endif?>
        </table>


        <table class="table table-small table-responsive table-condensed table-hover table-striped">
            <thead>
            <tr>
                <th>Bit</th>
                <th style="width: 10%">Count</th>
            </tr>
            </thead>
            <?php if($stats['bits']):?>
                <tbody>
                <?php $i=0; foreach($stats['bits'] as $bit=>$stat):?>
                    <tr>
                        <td><?php echo($bit) ?> bit</td>
                        <td><?php echo($stat)?></td>
                    </tr>
                    <?php $i++; endforeach?>
                </tbody>
            <?php else:?>
                <tbody>
                <tr>
                    <td colspan="3">No data</td>
                </tr>
                </tbody>
            <?php endif?>
        </table>

    </div>
    <div class="col-md-6">

        <table class="table table-small table-responsive table-condensed table-hover table-striped">
            <thead>
            <tr>
                <th>Country</th>
                <th style="width: 10%">Count</th>
            </tr>
            </thead>
            <?php if($stats['countries']):?>
                <tbody>
                <?php $i=0; foreach($stats['countries'] as $country=>$stat):?>
                    <tr>
                        <td><img class="flag flag-<?php echo(strtolower($country))?>" width="16" height="11" /> <?php echo($country)?> <small><?php echo(isset($countries[$country]) ? $countries[$country]: 'Unknown')?></small> </td>
                        <td><?php echo($stat)?></td>
                    </tr>
                    <?php $i++; endforeach?>
                </tbody>
            <?php else:?>
                <tbody>
                <tr>
                    <td colspan="3">No data</td>
                </tr>
                </tbody>
            <?php endif?>
        </table>
    </div>
</div>