
<?php
$maisNotificados = $this->data['maisNotificados'];
$maisOcorrencias = $this->data['maisOcorrencias'];
?>

<div class="col-lg-12">
    <div class="portlet">
        <div class="portlet-heading bg-purple">
            <h3 class="portlet-title">
                <span class="icon"><i class="fa fa-signal"></i></span> Resultados por Unidades
            </h3>
            <div class="portlet-widgets">
                <a href="javascript:;" data-toggle="reload"><i class="zmdi zmdi-refresh"></i></a>
                <a data-toggle="collapse" data-parent="#accordion1" href="#bg-primaryOcorrenciasHome"><i class="zmdi zmdi-minus"></i></a>
                <a href="#" data-toggle="remove"><i class="zmdi zmdi-close"></i></a>
            </div>
            <div class="clearfix"></div>
        </div>
        <div id="bg-primaryOcorrenciasHome" class="panel-collapse collapse in">
            <div class="widget-content">

                <div class="container">
                    <div class="row">
                        <div class="col-md-6">
                            <section class="panel b-a">
                                <div class="panel-heading b-b">
                                    <span class="badge pull-right">5</span>
                                    <span class="label bg-success">Top 5</span>
                                    <a href="#" class="font-bold">Moradores Mais Notificados</a>
                                </div>
                                <div class="panel-body">
                                    <ul class="list-group no-radius">
                                        <?php
                                        $cont = 0;
                                        foreach ($maisNotificados as $m) {
                                            $cont++;
                                            $color = 'primary';
                                            if (($cont == 1) || ($cont == 2) || ($cont == 3)) {
                                                $color = 'danger';
                                            }
                                            if (($cont == 4) || ($cont == 5) || ($cont == 6)) {
                                                $color = 'warning';
                                            }
                                            ?>
                                            <!--                                    echo $m->blocoApartamento.'-'.$m->nr_apartamento.'-'.$m->maisNotificados.'<br>';-->
                                            <li class="list-group-item" style="font-size: 1.1em">
                                               <span class="pull-right"><?php echo $m->maisNotificados ?></span>
                                        <span style="float: left"
                                              class="label badge bg-<?php echo $color ?>"> <?php echo $cont ?></span>
                                                <?php echo '  &nbsp;[' . $m->nr_apartamento . '-' . $m->blocoApartamento . '] ' . $m->nm_morador ?>
                                            </li>
                                        <?php } ?>

                                    </ul>
                                </div>

                            </section>
                        </div>
                        <div class="col-md-6">
                            <section class="panel b-a">
                                <div class="panel-heading b-b">
                                    <!--                            <span class="badge bg-warning pull-right">08</span>-->
                                    <span class="label bg-success">Top 05</span>
                                    <a href="#" class="font-bold">Moradores com mais Ocorrências Registradas</a>
                                </div>


                                <ul class="list-group alt">
                                    <?php
                                    $contO = 0;
                                    foreach ($maisOcorrencias as $n) {
                                        $contO++;
                                        $colorO = 'primary';
                                        if (($contO == 1) || ($contO == 2) || ($contO == 3)) {
                                            $colorO = 'danger';
                                        }
                                        if (($contO == 4) || ($contO == 5) || ($contO == 6)) {
                                            $colorO = 'warning';
                                        }
                                        ?>
                                        <li class="list-group-item">
                                            <div class="media">
                                        <span class="pull-left thumb-sm"><img
                                                src="<?php echo base_url(); ?>assets/sistema/images/semFoto.jpg"
                                                alt="John said" class="img-circle"></span>
                                                <div class="pull-right text-<?php echo $colorO ?> m-t-sm">
                                            <span style="float: left"
                                                  class="label badge bg-<?php echo $colorO ?>"> <?php echo $contO ?></span>
                                                </div>

                                                <div class="media-body">
                                                    <div>
                                                        <a href="#"><?php echo ' [' . $n->nr_apartamento . '-' . $n->blocoApartamento . '] ' . $n->nm_morador ?></a>
                                                    </div>
                                                    <small class="text-muted">Registrou
                                                        <strong> <?php echo $n->maisOcorrencias ?></strong> Ocorrências
                                                    </small>
                                                </div>
                                            </div>
                                        </li>

                                    <?php } ?>

                                </ul>

                            </section>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>












