 <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">Batch Progress</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="#">Batch</a></li>
              <li class="breadcrumb-item active">Batch Progress</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 Details</h3>
            <div class="card-tools">
              <?php echo form_open(base_url().'admin/master/batch_progress'); ?>
                <div class="d-inline-block">
                  <select name="batch" required class="form-control">
                    <option value="">Select A Batch</option>
                    <?php foreach ($all_batch as $batch): ?>
                      <option value="<?php echo $batch->batch_id; ?>"><?php echo $batch->batch_name; ?></option>
                    <?php endforeach ?>
                  </select>
                </div>
                <div class="d-inline-block">
                  <button class="btn btn-info" type="submit" name="search">Search</button>
                </div>
              <?php echo form_close(); ?>
            </div>
          </div>
            <?php if($batch_progress): ?>
              <div class="card-body ">
                <h3 class="mb-5 text-center">Total Progress</h3>
                <div class="rocket-progress">
                    <div class="rocket-progress__progress" style="width: <?php echo $batch_progress; ?>%;">
                        <div class="rocket-progress__goal"></div>
                        <div class="rocket-progress__rocket-wrapper">
                            <div class="rocket-progress__success">
                                <div class="rocket-progress__success-wrapper">
                                    <div class="rocket-progress__success-title">
                                        Great!                                        </div>
                                    <div class="rocket-progress__success-text">
                                        You have completed the checklist                                        </div>
                                </div>
                            </div>
                            <div class="rocket-progress__rocket"></div>
                            <div class="rocket-progress__rocket-shadow"></div>
                        </div>
                    </div>
                    <div class="rocket-progress__bar"></div>
                </div>
              </div>
              <div class="card-body pt-5">
                <h5>Student Details</h5>
                <ul style="list-style-type: none;">
                  <?php $total_chapter = 0; ?>
                      <?php foreach ($all_lession as $key => $l_details):
                          $total_chapter += count(json_decode($l_details->ch_chapters)); ?>
                          <?php
                      endforeach; 
                      

                    ?>
                    <?php foreach ($all_student as $student): 

                      $this->db->where('batch_id', $student->st_course_batch);
                      $inst_id = $this->db->get('student_batch')->row();

                      $user_id = $student->user_id;
                      $this->db->where('inst_att_course_id', $student->st_course_course_id);
                      $this->db->where('inst_att_user_id', $user_id);
                      $complete_task = $this->db->get('instructor_attendance')->num_rows();

                      $percent_2 = (($total_chapter - $complete_task)*100) /$total_chapter ;


                      ?>
                      
                      <li class="mt-3">
                        <div class="d-inline-block">
                          Name : <b><?php echo $student->user_name; ?></b>
                        </div>
                        <div class="rocket-progress mt-3" style="margin-left:0">
                            <div class="rocket-progress__progress" style="width: <?php echo $percent_2; ?>%;">
                                <div class="rocket-progress__goal"></div>
                                <div class="rocket-progress__rocket-wrapper">
                                    <div class="rocket-progress__success">
                                        <div class="rocket-progress__success-wrapper">
                                            <div class="rocket-progress__success-title">
                                                Great!                                        </div>
                                            <div class="rocket-progress__success-text">
                                                You have completed the checklist                                        </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="rocket-progress__bar"></div>
                        </div>
                      </li>
                    <?php endforeach ?>
                </ul>
              </div>
            <?php endif; ?>
          </div>
      </div>
    </section>
  </div>

<style type="text/css">
  .rocket-progress {
    height: 8px;
    position: relative;
        margin-left: 70px;
    margin-right: 70px;
}
.rocket-progress__progress {
    height: 8px;
    border-radius: 10px;
    background-color: #ded8cf;
    position: absolute;
    z-index: 1;
    right: 0;
    top: 0;
    transition: width .3s ease-out;
}
.rocket-progress__goal {
    width: 32px;
    height: 34px;
    background: url("https://collaborator.pro/images/rocket-progress/goal.svg") no-repeat 50%;
    background-size: cover;
    position: absolute;
    z-index: 0;
    right: 0;
    top: 50%;
    transform: translate(50%,-50%);
}
.rocket-progress__rocket-wrapper {
    width: 0;
    height: 0;
    position: absolute;
    left: 0;
    top: 4px;
}
.rocket-progress__success-wrapper {
    padding-right: 12px;
    text-align: left;
    flex-grow: 1;
}
.rocket-progress__success-title {
    margin-bottom: 3px;
    font-size: 22px;
    font-weight: 700;
    line-height: 20px;
}
.rocket-progress__success-text {
    font-size: 14px;
    line-height: 18px;
}
.rocket-progress__rocket {
    width: 163px;
    height: 58px;
    background: url("https://collaborator.pro/images/rocket-progress/rocket.svg") no-repeat 50%;
    background-size: contain;
    transform: translate(-66%,-50%);
    position: relative;
    z-index: 1;
}
.rocket-progress__success {
    width: 207px;
    height: 85px;
    padding: 10px 8px 8px 13px;
    color: #fff;
    border-radius: 10px;
    background-color: #32ba7c;
    display: flex;
    align-items: center;
    transform: translate(-170px,-50%);
    display: none;
}
.rocket-progress__rocket-shadow {
    width: 232px;
    height: 127px;
    background: url("https://collaborator.pro/images/rocket-progress/rocket-shadow.png") no-repeat 50%;
    background-size: contain;
    transform: translate(-60%,-90%);
    z-index: 0;
    position: relative;
}
.rocket-progress__bar {
    height: 8px;
    border-radius: 10px;
    background: #32ba7c url("https://collaborator.pro/images/rocket-progress/progress-bg.jpg") repeat-y 0 0;
    background-size: 100% 1px;
}


</style>