<div class="container bg-white mt-3">
    <div class="row">
        <div class="col-sm-12 pt-3 pb-3">

            <div class="table-responsive">
                <table class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>Course</th>
                            <th>Class Teacher</th>
                            <th>View</th>
                            <th>Promote</th>
                        </tr>
                    </thead>
                    <tbody>

                    <?php 
                        $acedemic_session=$this->session->userdata('acedemic_session');
                        $table='school_classes_structure';
                        $get_courses=$this->WelcomeModel->get_data($table);
                        if($get_courses){
                            foreach($get_courses as $courses){
                                if($courses['acedemic_session'] == $acedemic_session){
                    ?>
                    <tr>
                        <td><?php echo $courses['class']; echo "-"; echo $courses['section'] ;?></td>
                        <td>
                        <?php
                            $staff_table='school_staff';
                            $get_teacher_data=$this->WelcomeModel->get_item_data($courses['class_teacher'],$staff_table);
                            if($get_teacher_data){
                                foreach($get_teacher_data as $data){
                                    echo $data['salutation']; echo " "; echo $data['name'];
                                }
                            }
                            ?>
                        </td>

                        <td>
                            <a href="<?php echo base_url(); ?>Management/students/<?php echo $courses['class']; echo "/"; echo $courses['section'];?>" class="btn btn-info btn-sm">View</a>
                        </td>
                        <td><a href="<?php echo base_url(); ?>Management/promote_students/<?php echo $courses['class'];?>/<?php echo $courses['section']; ?>" class="btn btn-warning btn-sm text-white">Promote</a></td>
                    </tr>
                    <?php
                            }
                        }
                    }
                ?>

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



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