<style>
body{background:#EAEDED;}
a{text-decoration:none;}
a:hover{text-decoration:none;}
.student-div{
background:#EAEDED;
/*background:
linear-gradient(#DF5314, transparent),
linear-gradient(to top left, #DF5314, transparent),
linear-gradient(to top right, #0ACCFF, transparent);*/
background-blend-mode: screen;
text-align:center;
margin-top:10px;
}
</style>
<?php
$table='student';
?>
<div class="container-fluid mt-3 mb-3 pt-3 pb-3 bg-white">
    <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">Student</li> 
            </ul>
        </div>
    </div>

    <div class="row">
    <?php
    $acedemic_session_table='academic_session_details';
    $acedemic_session=$this->session->userdata('acedemic_session');
    $ac_year='';
    $acedemic_session_data=$this->NewFeeModel->get_item_data($acedemic_session,$acedemic_session_table);
    if($acedemic_session_data){
        foreach($acedemic_session_data as $session_data){
            $ac_year=$session_data['year_long']; echo "<br>";

        }
    }
    ?>
    
        <div class="col-sm-4">

            <div class="p-3 student-div">
                <p>Academic Session <?php echo $ac_year; ?></p>


                    <?php
                    $count=0;
                    $get_session_students=$this->WelcomeModel->get_students_ac_session($acedemic_session);
                    if($get_session_students){
                        foreach($get_session_students as $session_students){
                            $sid=$session_students['sid'];
                            $get_student_data=$this->SchoolModel->get_item_data($sid,$table);
                            if($get_student_data){
                                foreach($get_student_data as $student_data){
                                    $count = $count + 1;        
                                }
                            }
                            
                        }
                    }
                    echo $count;
                    ?>

                </p>
                <a href="<?php echo base_url(); ?>School/students_academic_session_wise"><button class="btn btn-primary">View</button></a> 
            </div>
        </div>

        <div class="col-sm-4">
            <div class="p-3 student-div">
                <p>All Students</p>
                    <?php 
                    
                    $total_students=0;
                    $all_students=$this->WelcomeModel->get_data($table);
                    if($all_students){
                        foreach($all_students as $students){
                            $total_students = $total_students + 1;
                        }
                    }
                    ?>
                <p><?php echo $total_students;?></p>
                <a href="<?php echo base_url();?>School/view_all_students" class="btn btn-primary">View</a>
            </div>
        </div>


        <div class="col-sm-4">
            <div class="p-3 student-div">
                <p>Alumani Students</p>
                <p>--</p>
                <button class="btn btn-primary">View</button>
            </div>
        </div>
    </div>
</div>