<div class="container bg-white mt-3 mb-3 pt-3 pb-3">
    <div class="row">
        <div class="col-sm-12">
            
            <div class="table-responsive">
                <table class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>Course</th>
                            <th>Strength</th>
                            <th>Opening Strength</th>
                            </tr>
                    </thead>
                    <tbody>
                        <?php 
                        $acedemic_session=$this->session->userdata('acedemic_session');
                        $course_table='courses';
                        $all_courses=$this->DeveloperModel->get_data($course_table);
                        if($all_courses){
                            foreach($all_courses as $courses){
                                $course=$courses['course'];
                                $course_id=$courses['id'];
                                
                                $course_student_count=0;
                                $get_all_course_students=$this->WelcomeModel->get_course_students_by_ac_session_by_course_id($acedemic_session,$course_id);
                                if($get_all_course_students){
                                    foreach($get_all_course_students as $course_students){
                                        $course_student_count=$course_student_count + 1;
                                    }
                                } 
                        ?>
                        <tr>
                            <td><?php echo $courses['course']; echo " "; echo $courses['subject_stream'];?></td>
                            <td><?php echo $course_student_count;?></td>
                            <?php
                            $course_opening_count=0;
                            $get_course_opening_data=$this->OpeningBalanceModel->get_course_opening_data($course);
                            if($get_course_opening_data){
                                foreach($get_course_opening_data as $dataa){
                                    if($dataa['opening_fee_amount'] !=0){
                                    $course_opening_count=$course_opening_count + 1;
                                    }
                                }
                            }
                            ?>
                            
                            <td><a href="<?php echo base_url();?>OpeningFee/view_course_data/<?php echo $courses['course']; ?>"><?php echo $course_opening_count;?></a></td>
                        </tr>                                
                                
                        <?php
                            }
                        }
                        ?>

                    </tbody>
                </table>
            </div>
            
        </div>
    </div>
</div>