<style>
body{background:#EAEDED;}
a{color:black;}
a:hover{text-decoration:none;}
</style>
<div class="container-fluid mt-3 mb-3">
    <div class="row">
        <div class="col-sm-12 bg-white p-3">
            <ul class="breadcrumb">
                
                <li class="breadcrumb-item"><a href="<?php echo base_url(); ?>Welcome">Home</a></li> 
                <li class="breadcrumb-item"><a href="<?php echo base_url(); ?>School/students">Student</a></li> 
                <li class="breadcrumb-item">All Student</li>
                <li class="breadcrumb-item"><?php echo $this->session->userdata('ac_year'); ?></li> 
            </ul>  
            <div class="all-student">
                <div class="table-responsive">
                    <table id="mytable" class="table table-striped table-bordered">
                        <thead>
                            <tr>
                                <th>Sr. No.</th>
                                <th>Name</th>
                                <th>Sch. No.</th>
                                <th>Class</th>
                                <th>Section</th>
                                <th>Father Name</th>
                                <th>Contact No</th> 
                                <th>Current status</th>
                                <th>Active / Inactive</th>
                                <th>View Profile</th> 
                            </tr>    
                        </thead>    
                        <tbody>
                        <?php
                        $table="student";
                        $acedemic_session=$this->session->userdata('acedemic_session');
                        // $fetch_all_student = $this->WelcomeModel->get_students_ac_session($acedemic_session);
                        $fetch_all_student = $this->WelcomeModel->get_students_ac_session_combined($acedemic_session);
                        if($fetch_all_student){
                            $count =0;
                            foreach($fetch_all_student as $records){ 
                                $count++;
                                // $get_student_data=$this->WelcomeModel->get_item_data($data['sid'],$table);
                                // if($get_student_data ){
                                //     foreach($get_student_data as $records){
                        ?>
                            <tr>
                                <td><?php echo $records['id'];?></td>
                                <td><?php echo $records['student_name'];?></td>
                                <td><?php echo $records['sch_no'];?></td>    
                                <td><?php echo $records['ac_class'];?></td>
                                <td><?php echo $records['ac_section'];?></td>
                                <td><?php echo $records['father_name'];?></td>
                                <td><?php echo $records['contact_no'];?></td>

                                <td class="text-primary bg-white">
                                <?php echo $records['status_description'];?>    
                                </td>
                                <td>

                                <?php
                                  if($records['status']==0){  ?>
                                <button class='btn btn-danger active_button inactive' active_attr='0' db_id='<?php echo $records['id']; ?>'>Inactive</button>
                                <?php }else if($records['status']==1){  ?>
                                <button class='btn btn-success active_button active' active_attr='1' db_id='<?php $records['id']; ?>'>Active</button>
                                <?php  }  ?>
    
                                </td>
                                <td>
                                    <a class='btn btn-info' href="<?php echo base_url().'School/manage_student_profile/'.$records['id']; ?>" target="_blank">
                                        Profile</a>
                                </td>


                            </tr>
                        <?php 
                                //     }
                                // }
                            } 
                        }
                        ?>    
                        </tbody>
                    </table>    
                </div>    
            </div>    
        </div>    
    </div>    
</div>