  


    <div class="col-md-4 col-sm-6 col-xs-12">
      <div class="info-box">
        <span class="info-box-icon bg-aqua"><i class="fa fa-users"></i></span>
        <div class="info-box-content">
          <span class="info-box-text">Registered Users</span>
          <span class="info-box-number"><?php echo number_format($users); ?></span>
        </div><!-- /.info-box-content -->
      </div><!-- /.info-box -->
    </div><!-- /.col -->

     <div class="col-md-4 col-sm-6 col-xs-12">
      <div class="info-box">
        <span class="info-box-icon bg-green"><i class="fa fa-globe"></i></span>
        <div class="info-box-content">
          <span class="info-box-text">Sites</span>
          <span class="info-box-number"><?php echo number_format($sites); ?></span>
        </div><!-- /.info-box-content -->
      </div><!-- /.info-box -->
    </div><!-- /.col -->

     <div class="col-md-4 col-sm-6 col-xs-12">
    <div class="info-box">
      <span class="info-box-icon bg-red"><i class="fa fa-bookmark"></i></span>
      <div class="info-box-content">
        <span class="info-box-text">Bookmark</span>
        <span class="info-box-number"><?php echo number_format($bookmarks); ?></span>
      </div><!-- /.info-box-content -->
    </div><!-- /.info-box -->
  </div><!-- /.col -->




<div class="col-md-6">
  <div class="box box-primary">
    <div class="box-header with-border">
      <h3 class="box-title"><i class="fa fa-users"></i> Users Registered Last 12 Months</h3>
    </div><!-- /.box-header -->
    <!-- form start -->
  
      <div class="box-body">
      <table class="table table-bordered table-hover table-striped">
              <tr>
                <th>Month</th>
                <th>Users</th>
              </tr>
              <?php
                foreach ($registered->result() as $row) 
                {
              ?>
              <tr>
                <td><?php echo $row->month; ?></td>
                <td style="width:20px"><span class="badge bg-red"><?php echo number_format($row->n); ?></span></td>
              </tr>
              <?php
            
            }
            ?>
            </table>
      </div><!-- /.box-body -->
  

          <div id="bar-chart" style="height: 300px;"></div>



  </div>
</div>


<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="<?php echo base_url(); ?>assets/admin/js/plugins/morris/morris.min.js" type="text/javascript"></script>

<script>
<?php

          foreach ($registered->result() as $row) {
            $data .= "{y:'". $row->month."',a:".$row->n."},";           
            
          }
          $data = substr($data ,0,-1);
           
?>
$(function () {
      
    $('.popover-class').popover();
                  //BAR CHART
                var bar = new Morris.Bar({
                    element: 'bar-chart',
                    resize: true,
                    data: [
                       <?php echo $data ; ?>
                    ],
                    barColors: ['#3C8DBC', '#F56954'],
                    xkey: 'y',
                    ykeys: ['a'],
                    labels: ['Users'],
                    hideHover: 'auto'
                });

});
</script>
