<style>
 a .btn-warning{text-decoration:none;color:#fff;}    
</style>
<div class="container-fluid mt-3 mb-3 bg-white ">
    <div class="row">
        <div class="col-sm-12 pt-3 pb-3">
        <?php
        $my_class=$this->session->userdata('class_teacher');
        $class_teacher_section=$this->session->userdata('class_teacher_section');
        ?>    
        <ul class="breadcrumb">
            <li class="breadcrumb-item"><a href="#">Home</a></li>
            <li class="breadcrumb-item"><a href="#"><?php echo $this->session->userdata('teacher_name');?></a></li>
            <li class="breadcrumb-item"><a href="#"><?php echo $my_class; ?></a></li>
            <li class="breadcrumb-item"><a href="#"><?php echo $class_teacher_section; ?></a></li>
        </ul>    
    

        <div class="table-responsive">
            <table class="table table-bordered table-striped" id="mytable">
                <thead>
                    <tr>
                        <th>Count</th>
                        <th>Sch No</th>
                        <th>Name</th>
                        <th>Fathers Name</th>
                        <th>D.O.B.</th>
                        <th>Contact No.</th>
                        <th>Alt. No.</th>
                        <th>Apr</th>
                        <th>May</th>
                        <th>Jun</th>
                        <th>Jul</th>
                        <th>Aug</th>
                        <th>Sep</th>
                        <th>Oct</th>
                        <th>Nov</th>
                        <th>Dec</th>
                        <th>Jan</th>
                        <th>Feb</th>
                        <th>Mar</th>
                    </tr>    
                </thead>    
                <tbody>

                    <?php
                    $acedemic_session=$this->session->userdata('acedemic_session');
                    $student_table='student';
                    $get_data=$this->WelcomeModel->class_section_students($my_class,$class_teacher_section,$acedemic_session);
                    // $get_data=$this->WelcomeModel->get_data_in_alp_order($student_table);
                    $count=0;
                    if($get_data){
                        foreach($get_data as $students){
                            $sid=$students['id'];
                            // $get_student_courses_data=$this->WelcomeModel->get_student_in_acedemic_session($sid,$acedemic_session);
                            // if($get_student_courses_data){
                            //     foreach($get_student_courses_data as $student_courses_data){
                            //         if($students['status'] ==1 && $student_courses_data['class'] == $my_class){
                                    $count=$count + 1;
                                    
                                    $apr_status=0;
                                    $may_status=0;
                                    $jun_status=0;
                                    $jul_status=0;
                                    $aug_status=0;
                                    $sep_status=0;
                                    $oct_status=0;
                                    $nov_status=0;
                                    $dec_status=0;
                                    $jan_status=0;
                                    $feb_status=0;
                                    $mar_status=0;
                                    
                                    $get_fee_data=$this->NewFeeModel->get_fee_data_for($sid,$acedemic_session);
                                    if($get_fee_data){
                                        foreach($get_fee_data as $fee_data){
                                            if($fee_data['april'] ==1){
                                                $apr_status=$apr_status + 1;
                                            }
                                            
                                            if($fee_data['may'] ==1){
                                                $may_status=$may_status + 1;
                                            }
                                            
                                            if($fee_data['june'] ==1){
                                                $jun_status=$jun_status + 1;
                                            }
                                            
                                            if($fee_data['july'] ==1){
                                                $jul_status=$jul_status + 1;
                                            }
                                            
                                            if($fee_data['august'] ==1){
                                                $aug_status=$aug_status + 1;
                                            }
                                            
                                            if($fee_data['september'] ==1){
                                                $sep_status=$sep_status + 1;
                                            }
                                            
                                            if($fee_data['october'] ==1){
                                                $oct_status=$oct_status + 1;
                                            }
                                            
                                            if($fee_data['november'] ==1){
                                                $nov_status=$nov_status + 1;
                                            }
                                            
                                            if($fee_data['december'] ==1){
                                                $dec_status=$dec_status + 1;
                                            }
                                            
                                            if($fee_data['january'] ==1){
                                                $jan_status=$jan_status + 1;
                                            }
                                            
                                            if($fee_data['february'] ==1){
                                                $feb_status=$feb_status + 1;
                                            }
                                            
                                            if($fee_data['march'] ==1){
                                                $mar_status=$mar_status + 1;
                                            }
                                            
                                        }
                                    }
                    ?>
                        <tr>
                            <th><?php echo $count; ?></th>
                            <td><?php echo $students['sch_no']; ?></td>
                            <td><?php echo $students['student_name']; ?></td>
                            <td><?php echo $students['father_name']; ?></td>
                            <td><?php echo date('d-m-Y',strtotime($students['dob'])); ?></td>
                            <td><?php echo $students['contact_no']; ?></td>
                            <td><?php echo $students['alternate_no']; ?></td>
                            <td><?php  if($apr_status ==1 ){echo "<span class='text-success'>Paid</span>";}else{echo "<span class='text-warning'>Pending</span>";}?></td>
                            <td><?php  if($may_status ==1 ){echo "<span class='text-success'>Paid</span>";}else{echo "<span class='text-warning'>Pending</span>";}?></td>
                            <td><?php  if($jun_status ==1 ){echo "<span class='text-success'>Paid</span>";}else{echo "<span class='text-warning'>Pending</span>";}?></td>
                            <td><?php  if($jul_status ==1 ){echo "<span class='text-success'>Paid</span>";}else{echo "<span class='text-warning'>Pending</span>";}?></td>
                            <td><?php  if($aug_status ==1 ){echo "<span class='text-success'>Paid</span>";}else{echo "<span class='text-warning'>Pending</span>";}?></td>
                            <td><?php  if($sep_status ==1 ){echo "<span class='text-success'>Paid</span>";}else{echo "<span class='text-warning'>Pending</span>";}?></td>
                            <td><?php  if($oct_status ==1 ){echo "<span class='text-success'>Paid</span>";}else{echo "<span class='text-warning'>Pending</span>";}?></td>
                            <td><?php  if($nov_status ==1 ){echo "<span class='text-success'>Paid</span>";}else{echo "<span class='text-warning'>Pending</span>";}?></td>
                            <td><?php  if($dec_status ==1 ){echo "<span class='text-success'>Paid</span>";}else{echo "<span class='text-warning'>Pending</span>";}?></td>
                            <td><?php  if($jan_status ==1 ){echo "<span class='text-success'>Paid</span>";}else{echo "<span class='text-warning'>Pending</span>";}?></td>
                            <td><?php  if($feb_status ==1 ){echo "<span class='text-success'>Paid</span>";}else{echo "<span class='text-warning'>Pending</span>";}?></td>
                            <td><?php  if($mar_status ==1 ){echo "<span class='text-success'>Paid</span>";}else{echo "<span class='text-warning'>Pending</span>";}?></td>
                        </tr>
                        <?php
                            //         }
                            //     }
                            // }
                    
                            }
                        }
                        ?>
                    </tbody>
                </table>    
    
    
    
            </div>
    
        </div>    
    </div>
</div>  