<?php
if ($upcomming_course) {
    $counter = 0;
    foreach ($upcomming_course as $course_value) {
        ++$counter;
        ?>
        <a target="_blank" 
           href="<?php echo base_url() . $course_value->url; ?>" 
           class="list-group-item text-justify"><i class="fa fa-book"> </i> <?php echo $course_value->course_name; ?> &nbsp;</a>
           <?php
       }
       if ($total_upcomming_course->total > $counter) {
           ?>
        <a href="javascript:void(0)"
           onclick="getMoreUpcommingCourse('<?php echo base_url() . 'user/get-upcomming-course' ?>', '<?php echo $counter ?>')"
           class="list-group-item text-right">More</a>
        <?php
    }
}