<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>Edit</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="#" class="btn btn-sm btn-outline-warning">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-square" viewBox="0 0 16 16">
                                        <path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/>
                                        <path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"/>
                                    </svg>
                                </a>
                            </td>
                            <td>
                                <a href="<?php echo base_url()."ExamManagement/class_structure/".$exam['id']; ?>" class="btn btn-sm btn-outline-info" target="_blank">View</a>
                            </td>
                        </tr>
                        <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </div>
            
        </div>
    </div>
</div>