
 <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1 class="m-0 text-dark">All Course Outline</h1>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="<?php echo base_url() ?>admin/admin/dashboard">Dashboard</a></li>
              <li class="breadcrumb-item"><a href="#">Course</a></li>
              <li class="breadcrumb-item active">All Course Outline</li>

            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->
    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <div class="card card-default">
          <div class="card-header">
            <h3 class="card-title">View All Course Outline</h3>
            <div class="card-tools">
              <a href="<?php echo base_url()?>/admin/course/add_new_lession_and_chapter" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Course Outline</a>
            </div>
          </div>
            <!-- /.card-header -->
            <div class="card-body">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th>ID</th>
                  <th>Course Name</th>
                  <th>Chapter Name</th>
                  <th></th>
                </tr>
                </thead>
                <tbody>
                <?php $i=1; foreach ($all_lession as $lession):
                $user_di = user_id();
                $this->db->select('ch_lession_name');
                $this->db->where('ch_course_id', $lession->ch_course_id);
                $this->db->where('ch_added_by', $user_di);
                $all_lession_name = $this->db->get('course_lession_and_chapter')->result();
                ?>
                <tr>
                  <td><?php echo $i ?></td>
                  <td><?php echo $lession->title ?></td>
                  <td><?php foreach ($all_lession_name as $l_name) 
                  {
                    echo $l_name->ch_lession_name.', ';
                  }; ?></td>
                  <td>
                    <div class="input-group mb-3">
                      <div class="input-group-prepend">
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                        Action
                        </button>
                        <div class="dropdown-menu">
                          <a class="dropdown-item" href="<?php echo base_url(); ?>/admin/course/edit_course_lession/<?php echo $lession->ch_course_id  ?>"><i class="fas fa-edit"></i>&nbsp;&nbsp;Edit</a>
                          <div class="dropdown-divider"></div>
                          <a class="dropdown-item" onclick="return confirm('Are you sure?')" href="<?php echo base_url(); ?>/admin/course/delete_course_lession/<?php echo $lession->ch_course_id  ?>"><i class="fas fa-trash"></i>&nbsp;&nbsp;Delete</a>
                        </div>
                      </div>
                    </div>
                  </td>
                </tr>
                <?php $i++; ?>
                <?php endforeach; ?>
                </tbody>
              </table>
            </div>
       
      </div><!--/. container-fluid -->
    </section>
    <!-- /.content -->
  </div>
