<?php 
 $subject_id=$this->uri->segment(3);
 $tid=$this->uri->segment(4);
 $chapter_id=$this->uri->segment(5);
$staff_name='';

$staff_data=$this->EContentModel->staff_data($tid);
if($staff_data){
foreach($staff_data as $staff){
$staff_name= $staff['name'];
}
}

$subject_title='';
$class='';
$section='';
$subject_data=$this->EContentModel->subject_data($subject_id);
if($subject_data){
foreach($subject_data as $data){
$subject_title=$data['subject'];    
$class=$data['class'];
$section=$data['section'];
}    
}

$chapter_title='';
$chapter_data=$this->EContentModel->chapter_data($chapter_id);
if($chapter_data){
foreach($chapter_data as $chapter){
$chapter_title=$chapter['chapter_title'];    
}    
}
?>
<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>
<li class="breadcrumb-item"><a href="<?php echo base_url();?>ContentManagement/subjects/<?php echo $tid;?>"><?php echo $staff_name;?></a></li>
<li class="breadcrumb-item "><a href="#"><?php echo $subject_title; echo ","; echo $class; echo "-"; echo $section; ?> </a></li>
<li class="breadcrumb-item active"><a href="#"><?php echo htmlspecialchars_decode($chapter_title); ?></a></li>
</ul>    
    
    
    
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>#</th>
<th>Title</th>
<th>Content Summery</th>
<th>View</th>
</tr>    
</thead>
<tbody>
<?php
$cont_count=0;
$all_content=$this->EContentModel->get_teachers_subject_content($tid,$subject_id);
if($all_content){
foreach($all_content as $content_data){
$cont_count=$cont_count +1;    
?>
<tr>
<td><?php echo $cont_count; ?></td>    
<td><?php echo htmlspecialchars_decode($content_data['title']); ?></td>
<td><?php echo htmlspecialchars_decode($content_data['content']); ?></td>
<td><a href="<?php echo base_url();?>ContentManagement/content_detail/<?php echo $content_data['id']; echo "/"; echo $tid;?>" class="btn btn-sm btn-success text-white">View</a></td>
</tr>   
<?php
}    
}
?>
</tbody>
</table>    
</div>    
</div>
</div>
</div>