<?php
$course=$this->uri->segment('3');
$get_course_students=$this->OpeningBalanceModel->get_course_opening_data($course);

?>

<div class="container-fluid 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>#</th>
                           <!--<th>Id.</th>-->
                           <th>S.Id.</th>
                           <th>Student Name</th>
                           <th>Father Name</th>
                            <th>New S.Id.</th>
                            <th>Student Name</th>
                            <th>Father Name</th>
                       </tr>
                    </thead>
                    <tbody>
                       <?php
                       $count=0;
                       if($get_course_students){
                           foreach($get_course_students as $students){
                               $count=$count + 1;
                               $sid=$students['sid'];
                               $name=$students['student_name'];
                               $fname=$students['father_name'];
                       ?>
                       <tr>
                            <td><?php echo $count;?></td>
                            <!--<td><?php echo $students['id'];?></td>-->
                            <td><?php echo $students['sid']; ?></td>
                            <td><?php echo $students['student_name']; ?></td>
                            <td><?php echo $students['father_name']; ?></td>
                            <?php
                                $get_student_info=$this->OpeningBalanceModel->get_student_info_new($sid);
                                if($get_student_info){
                                    foreach($get_student_info as $info){
                                    

                            ?>
                                        <td><?php echo $info['id'];?></td>
                                        <td><?php echo $info['student_name']; ?></td>
                                        <td><?php echo $info['father_name']; ?></td>
                           
                        
                        <?php 
                                    }
                                }else{
                        ?>
                                        <td>---</td>
                                        <td>---</td>
                                        <td>---</td>
                                        
                        <?php
                                }
                        ?>
                        </tr>
                        <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </div> 
            
            
        </div>
    </div>
</div>