<style>
    body{background:#EAEDED;}
</style>
<div class="container bg-white p-3 mt-3 mb-3">
    <div class="row">
        <div class="col-sm-12">
            <ul class="breadcrumb">
                <li class="breadcrumb-item"><?php echo $this->session->userdata('ac_year'); ?></li> 
                <li class="breadcrumb-item"><a href="<?php echo base_url(); ?>Welcome">Home</a></li> 
                <li class="breadcrumb-item">Drop Out List</li> 
               
            </ul>
            <div class="table-responsive">
                <table class="table table-bordered table-striped" id="mytable">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Name</th>
                            <th>Father's Name </th>
                            <th>Class</th>
                            <th>Section</th>
                            <th>Status</th>
                            <th>Fee</th>
                            <th>Promote/Repeat</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
                        $acedemic_session=1;
                        $acedemic_session_2=2;
                        $count=0;
                        $all_students=$this->WelcomeModel->get_students_ac_session($acedemic_session);
                        if($all_students){
                            foreach($all_students as $students){
                                $sid=$students['sid'];
                                $check_student_in_new_session=$this->WelcomeModel->get_student_in_acedemic_session($sid,$acedemic_session_2);
                                if($check_student_in_new_session){
                                    
                                }else{
                                    $table='student';
                                    $get_student_info=$this->WelcomeModel->get_item_data($sid,$table);
                                    if($get_student_info){
                                        foreach($get_student_info as $info){
                                            if($info['status']==1){
                                        $count=$count + 1;
                                    ?>
                        <tr>
                            <td><?php echo $count;?></td>
                            <td><?php echo $info['student_name']; ?></td>
                            <td><?php echo $info['father_name']; ?></td>
                            <td><?php echo $info['class']; ?></td>
                            <td><?php echo $info['section']; ?></td>
                            <td><button class="btn btn-sm btn-success">Active</button></td>
                            <?php
                             $april=0;
                                        $may=0;
                                        $june=0;
                                        $july=0;
                                        $august=0;
                                        $september=0;
                                        $october=0;
                                        $november=0;
                                        $december=0;
                                        $january=0;
                                        $february=0;
                                        $march=0;
                                        $april=0;
                                        
                                        $fee_invoices=$this->NewFeeModel->get_fee_data_for($sid,$acedemic_session);
                                        if($fee_invoices){
                                            foreach($fee_invoices as $fee){
                                                if($fee['april']==1){
                                                 $april=$april + 1;   
                                                }
                                                if($fee['may']==1){
                                                 $may=$may + 1;   
                                                }
                                                if($fee['june']==1){
                                                 $june=$june + 1;   
                                                }
                                                if($fee['july']==1){
                                                 $july=$july + 1;   
                                                }
                                                if($fee['august']==1){
                                                 $august=$august + 1;   
                                                }
                                                if($fee['september']==1){
                                                 $september=$september + 1;   
                                                }
                                                if($fee['october']==1){
                                                 $october=$october + 1;   
                                                }
                                                if($fee['november']==1){
                                                 $november=$november + 1;   
                                                }
                                                if($fee['december']==1){
                                                 $december=$december + 1;   
                                                }
                                                if($fee['january']==1){
                                                 $january=$january + 1;   
                                                }
                                                if($fee['february']==1){
                                                 $february=$february + 1;   
                                                }
                                                if($fee['march']==1){
                                                 $march=$march + 1;   
                                                }
                                                
                                            }
                                        }
                                        if($april==0 || $may==0 || $june ==0 || $july==0 || $august==0 || $september ==0 || $october ==0 || $november ==0 || $december ==0 || $january ==0 || $february ==0 || $march ==0){
                                         ?>
                                         <td class="text-danger"> 
                                <?php if($april ==0){ echo "Apr ,";} ?>
                                <?php if($may ==0){ echo "May ,";} ?>
                                <?php if($june ==0){ echo "Jun ,";} ?>
                                <?php if($july ==0){ echo "Jul ,";} ?>
                                <?php if($august ==0){ echo "Aug ,";} ?>
                                <?php if($september ==0){ echo "Sep ,";} ?>
                                <?php if($october ==0){ echo "Oct ,";} ?>
                                <?php if($november ==0){ echo "Nov ,";} ?>
                                <?php if($december ==0){ echo "Dec ,";} ?>
                                <?php if($january ==0){ echo "Jan ,";} ?>
                                <?php if($february ==0){ echo "Feb ,";} ?>
                                <?php if($march ==0){ echo "Mar ,";} ?>
                                         </td>
                                         <?php
                                            
                                        }else{
                                ?>
                                <td class="text-success">No Fee Dues for Session 2020-2021</td>
                                <?php
                                        }
                            ?>
                            
                            
                            
                            <td><a href="<?php echo base_url();?>Management/change_academic_session/<?php echo $sid; ?>" class="btn btn-sm btn-warning text-white">Promote/Repeat</a></td>
                        </tr>
                                    <?php
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        ?>

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