<div class="container bg-white">
    <div class="row">
        <div class="col-sm-12">
            

                            <div class="table-responsive">
                                <table class="table table-bordered table-striped" id="mytable">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>S. Id.</th>
                                            <th>Name</th>
                                            <th>Father Name</th>
                                            <th>Bal Ref No</th>
                                            <th>Course</th>
                                            <th>Bal Ref Closed Status</th>
                                        </tr>
                                    </thead>
                                    <tbody>
<?php
$count=0;
$acedemic_session=$this->session->userdata('acedemic_session');
        $all_students=$this->WelcomeModel->get_students_ac_session($acedemic_session);
        if($all_students){
            foreach($all_students as $students){
                $student_table='student';
                $sid=$students['sid'];
                $get_students_info=$this->DeveloperModel->get_item_data($sid,$student_table);
                
                $get_students_fee_data=$this->DeveloperModel->get_student_fee_data($sid,$acedemic_session);
                if($get_students_fee_data){
                    foreach($get_students_fee_data as $students_fee_data){
                        if($students_fee_data['balance_amount_added_refrence'] !=0){
                            $count = $count + 1;
                            ?>
                            <tr>
                                <td><?php echo $count;?></td>
                                <td><?php echo $sid;?></td>
                                <?php 
                                if($get_students_info){
                                    foreach($get_students_info as $students_info){
                                        ?>
                                        <td></td>
                                        <td></td>
                                        
                                        <?php
                                    }
                                }else{
                                    ?>
                                    
                                    <td></td>
                                    <td></td>
                                    <?php
                                }
                                ?>
                                <td></td>
                                <td><?php echo $students_fee_data['balance_amount_added_refrence'];?></td>
                                <?php
                                $bal_fee_ref_no=$students_fee_data['balance_amount_added_refrence'];
                                $check_bal_added_ref_no_closed_status=$this->NewFeeModel->get_invoice_data($bal_fee_ref_no);
                                if($check_bal_added_ref_no_closed_status){
                                    foreach($check_bal_added_ref_no_closed_status as $ref_no_closed_status){
                                        $ref_status=$ref_no_closed_status['balance_amount_status'];
                                        // if($ref_status == ){}
                                    }
                                }
                                ?>
                                
                                <td></td>
                            </tr>
                            <?php
                        }
                    }
                }
                
                if($get_students_info){
                    foreach($get_students_info as $students_info){
                        
                    }
                }
                
                
            }
        }
        
?>

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

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