<div class="container-fluid mt-3 mb-3 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">Time Table</li>
            </ul>
            <a href="<?php echo base_url(); ?>TimeTableManagement/add_new" class="btn btn-sm btn-outline-success mb-2 add_time_table">Add New Time Table</a>
            <a href="<?php echo base_url(); ?>TimeTableManagement/subjects" class="btn btn-sm btn-success mb-2">Subject</a>
            <div class="table-responsive">
                
                <table class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th class="sl_no">Sl.No.</th>
                            <th>Title</th>
                            <th>Acedemic Session</th>
                            <th>Status</th>
                            <th>Periods</th>
                            <th>View /Update</th>
                            <th>Teachers</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
                        $table="time_table";
                        $all_time_tables=$this->TimeTableModel->get_data($table);
                        $count=0;
                        if($all_time_tables){
                            foreach($all_time_tables as $schedule_data){
                                $count=$count + 1;
                                $status=$schedule_data['status'];
                        ?>
                        <tr>
                            <td><?php echo $count; ?></td>
                            <td><?php echo $schedule_data['title']; ?></td>
                            <td><?php echo $schedule_data['y1']."-".$schedule_data['y2']; ?></td>
                            <td class="<?php if($status == 'active'){ echo 'text-success'; }else{ echo 'text-danger'; }?>" style="text-transform:capitalize;"><?php echo $status; ?></td>
                            <td>
                                <a href="<?php echo base_url(); ?>TimeTableManagement/periods/<?php echo $schedule_data['id']; ?>">View</a>
                            </td>
                            <td>
                                <a href="<?php echo base_url()."TimeTableManagement/add_time_table_records/".$schedule_data['id']; ?>" class="btn btn-sm btn-outline-info" target="_blank">View/Update</a>
                            </td>
                            <td>
                                <a href="<?php echo base_url()."TimeTableManagement/all_teachers/".$schedule_data['id']; ?>" class="btn btn-sm btn-outline-warning">View</a>
                            </td>
                        </tr>
                        <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>


