<?php
$eclass=$this->uri->segment('3');
$section=$this->uri->segment('4');
// $acedemic_session=$this->uri->segment('5');
?>

<div class="container-fluid mt-3 mb-3">
<div class="row">
<div class="col-sm-12">

 
<ul class="breadcrumb bg-white">
<li class="breadcrumb-item"><a href="<?php echo base_url();?>Welcome">Home</a></li>
<li class="breadcrumb-item"><a href="#">Exam</a></li>
<li class="breadcrumb-item"><a href="#">Class Students</a></li>
</ul>

<div class="table-responsive">
<table class="table table-bordered table-striped bg-white">
<thead>
<tr>
<th>S.No.</th>
<th>Student Name</th>
<th>Father's Name</th>
<th>Scholor No.</th>
<th>Class/Section</th>
<th>Marks</th>
<th>Report Card</th>
</tr>
</thead>
<tbody>
<?php 
$table='student';

$acedemic_session=$this->session->userdata('acedemic_session');
$count=0;
$students_list=$this->WelcomeModel->get_students_ac_session_by_class($acedemic_session,$eclass,$section);
if($students_list){
foreach($students_list as $students){
$sid=$students['sid'];
$student_info=$this->WelcomeModel->get_item_data($sid,$table);
if($student_info){
foreach($student_info as $student_data){
$count=$count + 1;
?>
<tr>
<td><?php echo $count; ?></td>
<td><?php echo $student_data['student_name']; ?></td>
<td><?php echo $student_data['father_name']; ?></td>
<td><?php echo $student_data['sch_no']; ?></td>
<td><?php echo $students['class']; echo "-"; echo $students['section']; ?></td>
<td><a href="<?php echo base_url();?>Exam/exam_log/<?php echo $student_data['id'];?>" class="btn btn-sm btn-success">View</a></td>

<td>
<?php 

if($student_data['class'] == 'PG' || $student_data['class'] == 'LKG' || $student_data['class'] == 'UKG'){
?>
<a href="http://exam.mtmhss.edu.in/result/puffins-report.php/<?php echo $student_data['id']; echo "/"; echo $students['class']; echo "/"; echo $students['section']; ?>" class="btn btn-info btn-sm">View</a>
<?php
}

else if($student_data['class'] == 1 || $student_data['class'] == 2){
?>
<a href="http://exam.mtmhss.edu.in/result/primary-class-report-card.php/<?php echo $student_data['id']; ?>" class="btn btn-info btn-sm">View</a>
<?php
}else if($student_data['class'] == 3 || $student_data['class'] == 4 || $student_data['class'] == 5){
?>
<a href="http://exam.mtmhss.edu.in/result/class_3_to_5_report_card.php/<?php echo $student_data['id']; ?>" class="btn btn-info btn-sm">View</a>
<?php
}else if($student_data['class']== 6 || $student_data['class'] == 7){
?>
<a href="http://exam.mtmhss.edu.in/result/class_6_report.php/<?php echo $student_data['id']; ?>" class="btn btn-info btn-sm">View</a>
<?php
}else if($student_data['class']== 8){
?>
<a href="http://exam.mtmhss.edu.in/result/class_8_report_card.php/<?php echo $student_data['id']; ?>" class="btn btn-info btn-sm">View</a>
<?php
}else if($student_data['class']== 9){
?>
<a href="http://exam.mtmhss.edu.in/result/class9_report_card.php/<?php echo $student_data['id']; ?>" class="btn btn-info btn-sm">View</a>
<a href="<?php echo base_url(); ?>SchoolResult/class_9_result/<?php echo $student_data['id']; ?>" class="btn btn-warning btn-sm">Generate Result</a>
<?php
}
?>

</td>

</tr>
<?php
}
}

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

</div>
</div>
</div>