<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Count</th>
<th>Sch No</th>
<th>Name</th>
<th>Father Name</th>
<th>D.O.B.</th>
<th>Contact No.</th>
<th>Alt Contact No</th>
<th>Fee</th>
</tr>
</thead>
<tbody>
<?php
$table="student";
$acedemic_session=$this->session->userdata('acedemic_session');
$class=$this->uri->segment('3');
$section=$this->uri->segment('4');
$fetch_all_student_for_class = $this->WelcomeModel->get_students_ac_session_by_class($acedemic_session,$class,$section);
if($fetch_all_student_for_class){
$count =0;
foreach($fetch_all_student_for_class as $data){ 

$get_student_data=$this->WelcomeModel->get_item_data($data['id'],$table);
if($get_student_data ){
foreach($get_student_data as $students){
if($students['status'] ==1){    
$count++;
?>
<tr>
<td><?php echo $count; ?></td>
<td><?php echo $students['sch_no']; ?></td>
<td><?php echo $students['student_name']; ?></td>
<td><?php echo $students['father_name']; ?></td>
<td><?php echo $students['dob']; ?></td>
<td><?php echo $students['contact_no']; ?></td>
<td><?php echo $students['alternate_no']; ?></td>
<?php 
$apr=0;
$may=0;
$jun=0;
$jul=0;
$aug=0;
$sep=0;
$oct=0;
$nov=0;
$dec=0;
$jan=0;
$feb=0;
$mar=0;

$fee_info=$this->NewFeeModel->get_fee_data_for($students['id'],$acedemic_session);
if($fee_info){
foreach($fee_info as $fee){

if($fee['april']==1){
$apr=$apr + 1;
}
if($fee['may']==1){
$may=$may + 1;
}
if($fee['june']==1){
$jun=$jun + 1;
}

if($fee['july']==1){
$jul=$jul + 1;
}

if($fee['august']==1){
$aug=$aug + 1;
}

if($fee['september']==1){
$sep=$sep + 1;
}

if($fee['october']==1){
$oct=$oct + 1;
}

if($fee['november']==1){
$nov=$nov + 1;
}


if($fee['december']==1){
$dec=$dec + 1;
}


if($fee['january']==1){
$jan=$jan + 1;
}


if($fee['february']==1){
$feb=$feb + 1;
}


if($fee['march']==1){
$mar=$mar + 1;
}



?>
<?php


}
}
?>

<td>
<?php
if($apr==1){
echo "Apr,";    
}
if($may==1){
echo "May,";
}

if($jun==1){
echo "Jun,";
}
if($jul==1){
echo "Jul,";
}

if($aug ==1){
echo "Aug,";
}

if($sep == 1){
echo "Sep,";
}

if($oct ==1){
echo "Oct,";
}

if($nov == 1){
echo "Nov,";
}

if($dec == 1){
echo "Dec,";
}

if($jan==1){
echo "Jan,";
}

if($feb==1){
echo "Feb,";
}
if($mar==1){
echo "Mar";
}
?>
</td>


</tr>
<?php
}

}
}


}
}
?>

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

</div>
</div>

<div class="col-sm-12">

</div>
</div>

