<?php
$class=$this->uri->segment("3");
$section=$this->uri->segment("4");
$exam_id=$this->uri->segment("5");
?>
<div class="container-fluid bg-white">
    <div class="row">
        <div class="col-sm-12 pt-3 pb-3">
            <ul class="breadcrumb">
                <li class="breadcrumb-item">
                    <a href="<?php echo base_url(); ?>Welcome">Home</a>
                </li>
                <li class="breadcrumb-item">Examination</li>
                <li class="breadcrumb-item"><a href="<?php echo base_url(); ?>ExamManagement/class_structure/<?php echo $exam_id; ?>">All Courses</a></li>
                <li class="breadcrumb-item"><?php echo $class."-".$section; ?></li>
            </ul>
            
            <div class="table-responsive">
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th class="sl_no">Sl.No</th>
                            <th>Student Name</th>
                            <th>Father's Name</th>
                            <th>Mother's Name</th>
                            <th>Exam Log</th>
                            <th>Subjects</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        $i=0;
                        $academic_session=$this->session->userdata("acedemic_session");
                        // $all_class_and_sections=$this->ExamManagementModel->get_class_section_structure($academic_session);
                        $all_students=$this->ExamManagementModel->get_students_ac_session_by_course_and_class($academic_session,$class,$section);
                        if($all_students){
                            foreach($all_students as $student){
                                $i=$i + 1;
                                
                                // var_dump($student);
                        ?>
                        <tr>
                            <td><?php echo $i; ?></td>
                            <td><?php echo $student['student_name']; ?></td>
                            <td><?php echo $student['father_name']; ?></td>
                            <td><?php echo $student['mother_name']; ?></td>
                            <td>
                                <a href="<?php echo base_url()."ExamManagement/exam_log/".$student['id']."/".$exam_id; ?>" class="btn btn-sm btn-outline-info" target="_blank">View </a>
                            </td>
                            <td>
                                <a href="<?php echo base_url(); ?>ExamManagement/allot_subjects/<?php echo $student['id']; ?>" class="btn btn-sm btn-outline-info" target="_blank">View</a>
                            </td>
                        </tr>
                        <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>