<div class="container mt-3 mb-3 pt-3 pb-3 bg-white">
    <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>Subject Stream</th>
                        <th>Strength</th>
                        <th>Fee Invoices</th>
                        <th>View</th>
                    </tr>
                </thead>
                <tbody>
                    <?php 
                    $courses_table='courses';
                    $all_secondary_courses=$this->DeveloperModel->get_data($courses_table);
                    if($all_secondary_courses){
                        foreach($all_secondary_courses as $courses){
                            if($courses['course'] == 9 || $courses['course'] == 10 || $courses['course'] == 11 || $courses['course'] == 12){
                                $course_id=$courses['id'];
                                $course_strength=0;
                                $inv_count=0;
                                $course_fee_students=0;
                                $acedemic_session=$this->session->userdata('acedemic_session');
                                $get_courses_data=$this->DeveloperModel->get_course_students_data($course_id,$acedemic_session);
                                if($get_courses_data){
                                    foreach($get_courses_data as $data){
                                        $course_strength=$course_strength + 1;        
                                        $sid=$data['sid'];
                                        $student_fee_invoices=0;
                                        $check_student_fee_invoices=$this->DeveloperModel->get_student_fee_data($sid,$acedemic_session);
                                        if($check_student_fee_invoices){
                                            foreach($check_student_fee_invoices as $fee_invoices){
                                                $inv_count =$inv_count + 1;
                                                $student_fee_invoices=$student_fee_invoices + 1;
                                                
                                            }
                                        }
                                        if($student_fee_invoices >=1){
                                            $course_fee_students = $course_fee_students + 1;
                                        }
                                        
                                    }
                                }
                                

                    ?>
                    <tr>
                        <td><?php echo $courses['course'];?></td>
                        <td><?php echo $courses['subject_stream'];?></td>
                        <td><?php echo $course_strength;?></td>
                        <td><?php echo $course_fee_students; echo "/"; echo $inv_count;?></td>
                        <td><a href="<?php echo base_url();?>Developer/get_course_fee_data/<?php echo $courses['id'];?>">View</a></td>
                    </tr>
                    
                            
                    <?php       
                            }
                        }
                    }?>
                </tbody>
                </table>                
            </div>

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