<?php
// Get the category events

if (isset($events_side_categs) && count($events_side_categs) > 0) {
    ?>
    <div class="box box-info found-category-events">
        <div class="box-header with-border text-left">
            <b><i class="fa fa-info-circle fa-lg text-info"></i> Found <?=$total_records;?> Events</b>
        </div>
        <ul class="list-group">
            <?php
            foreach ($events_side_categs as $gr_id=>$gr_data) {
                ?>

                    <li class="list-group-item events-group">
                        <span class="badge"><?=$gr_data['total'];?></span>
                        <a href="<?= $gr_data['link']; ?>"><?= $gr_data['title']; ?></a>
                    </li>
                    <?php
                    if(count($gr_data['subs']) > 0) {
                        foreach($gr_data['subs'] as $cat) {
                            ?>
                            <li class="list-group-item events-categ">
                                <span class="badge"><?=$cat['total'];?></span>
                                <i class="fa fa-caret-right"></i> <a href="<?= $cat['link']; ?>"><?= $cat['title']; ?></a>
                            </li>
                            <?php
                        }
                    }
                    ?>
                <?php

            }
            ?>
        </ul>

    </div>
    <?php
}