<?php
$exam_id=$this->uri->segment('3');
?>

<div class="container mt-3 mb-3 bg-white pt-3 pb-3">
    <div class="row">
        <div class="col-sm-12">
            <ul class="breadcrumb">
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>Welcome">Home</a></li>
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>Examination">Exam</a></li>
                <li class="breadcrumb-item">Exam Shift</li>
            </ul>
            <a href="<?php echo base_url();?>Examination/add_exam_shift/<?php echo $exam_id;?>" class="btn btn-sm btn-info mt-3 mb-3">Add New Exam Shift</a>
            
            <div class="table-responsive">
                
                <table class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>Exam</th>
                            <th>Acedemic Session</th>
                            <th>Exam Timinig</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
                        $exam_shift_table='exam_shift';
                        $all_exam_shift=$this->NewExamModel->get_exam_shifts($exam_id,$exam_shift_table);
                        if($all_exam_shift){
                            foreach($all_exam_shift as $exam_shift){
                                
                        ?>
                        <tr>
                            <?php 
                            $exam_table='all_exams';
                            $exam_info=$this->NewExamModel->get_item_data($exam_id,$exam_table);
                            if($exam_info){
                                foreach($exam_info as $examinfo){
                            ?>
                            <td><?php echo $examinfo['exam_title'];?></td>
                            <?php
                                }
                            }
                            ?>
                            
                            <td><?php echo $exam_shift['acedemic_session_info'];?></td>
                            <td><?php echo $exam_shift['start_time']; echo " to "; echo $exam_shift['end_time'];?></td>
                        </tr>
                        <?php
                            }
                        }
                        ?>
                        
                    </tbody>
                </table>
                
                
            </div>
            
        </div>
    </div>
</div>