<div class="container-fluid bg-white mt-3 mb-3">
    <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>
            </ul>
            
            <div class="table-responsive">
                <table class="table table-bordered table-striped" id="mytable">
                    <thead>
                        <tr>
                            <th class="sl_no">Sl. No.</th>
                            <th>Exam Title</th>
                            <th>Academic Sesion</th>
                            <th>Status</th>
                            
                            <th>Courses</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        $i=0;
                        if($all_exams){
                            foreach($all_exams as $exam){
                                $i=$i + 1;
                                $status=$exam['status'];
                        ?>
                        <tr>
                            <td><?php echo $i; ?></td>
                            <td><?php echo $exam['exam_title']; ?></td>
                            <td><?php echo $exam['year_long']; ?></td>
                            <td>
                                <?php
                                if($status == "active"){
                                ?>
                                <button class="btn btn-sm btn-outline-success">Active</button>
                                <?php
                                }else if($status == "inactive"){
                                ?>
                                <button class="btn btn-sm btn-outline-danger">Inactive</button>
                                <?php
                                }
                                ?>
                            </td>
                            
                            <td>
                                <a href="<?php echo base_url()."ExamManagement/class_and_sections/".$exam['id']; ?>" class="btn btn-sm btn-outline-info" target="_blank">View</a>
                            </td>
                        </tr>
                        <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </div>
            
        </div>
    </div>
</div>