<?php 
$sch_id=$this->uri->segment("3");
?>
<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">
                    <a href="<?php echo base_url(); ?>TimeTableManagement">Time Table Management</a>
                </li>
                <li class="breadcrumb-item">All Teachers</li>
            </ul>
            
            <div class="table-responsive">
                <table class="table table-bordered" id="mytable">
                    <thead>
                        <tr>
                            <th>Sl. No.</th>
                            <th>Teacher Name</th>
                            <th>View Time Table</th>
                            <th>PDF</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
                        $i=0;
                        $staff_table="school_staff";
                        $all_staff=$this->TimeTableModel->get_all_teaching_staff($staff_table);
                        
                        if($all_staff){
                            foreach($all_staff as $staff){
                                $i++;
                        ?>
                        <tr>
                            <td><?php echo $i; ?></td>
                            <td><?php echo $staff['salutation']." ".$staff['name']; ?></td>
                            <td>
                                <a href="<?php echo base_url(); ?>TimeTableManagement/teacher_time_table/<?php echo $staff['id']."/".$sch_id; ?>" class="btn btn-sm btn-outline-info" target="_blank">View</a>
                            </td>
                            <td>
                                <a href="<?php echo base_url()."TimeTableManagement/time_table_pdf/".$staff['id']."/".$sch_id; ?>" class="btn btn-outline-warning" target="_blank">PDF</a>
                            </td>
                        </tr>
                        <?php
                            }
                        }
                        
                        
                        ?>
                        
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>