<div class="container mt-3 mb-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();?>ContentManagement">E-Content</a></li>
</ul>


<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>#</th>    
<th>Name</th>
<th>Subjects / Content</th>
<th>View</th>
</tr>  
</thead>
<tbody>
<?php
$count=0;
$all_teacheing_staff = $this->EContentModel->get_teaching_staff();
if($all_teacheing_staff){
foreach($all_teacheing_staff as $teacheing_staff){
$count=$count + 1;    
$subject_count=0;
$content_count=0;
$tid= $teacheing_staff['id'];
$get_subjects = $this->EContentModel->get_teachers_subjects($tid);
if($get_subjects){
foreach($get_subjects as $subjects){
$subject_count = $subject_count + 1;
}
}

$teachers_content=$this->EContentModel->get_teachers_content($tid);
if($teachers_content){
foreach($teachers_content as $content){
$content_count=$content_count + 1;    
}
}

?>
<tr>
<td><?php echo $count; ?></td>
<td><?php echo $teacheing_staff['name']; ?></td>
<td><?php echo $subject_count; echo "/";  echo $content_count;?></td>
<td><a href="<?php echo base_url();?>ContentManagement/subjects/<?php echo $teacheing_staff['id'];?>" class="btn btn-sm btn-success text-white">View</a></td>
</tr>
<?php
}
}
?>
    
</tbody>
</table>    
</div>
</div>
</div>
</div>