session->userdata('id');
$this->db->where('student_id',$student_id);
$getenolled=$this->db->get('enroll_course');
foreach($getenolled->result() as $enrolled){
$this->db->where('id',$enrolled->lesson_id);
$get=$this->db->get('lessons');
foreach($get->result() as $row){
$i++;
$t=$all=0;
$this->db->where('lesson_id',$row->id);
$get=$this->db->get('enroll_course');
foreach($get->result() as $rowss){
$all = $rowss->read_progress;
}
//check if enrolled
$student_id=$this->session->userdata('id');
$this->db->where('lesson_id',$row->id);
$this->db->where('student_id',$student_id);
$count_enrolled=$this->db->count_all_results('enroll_course');
?>