 <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 Batch</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="#">Master</a></li>
              <li class="breadcrumb-item active">All Batch</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 Batch</h3>
            <div class="card-tools">
              <a href="<?php echo base_url()?>/admin/master/add_batch" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add New Batch</a>
            </div>
          </div>
            <!-- /.card-header -->
            <div class="card-body">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th>ID</th>
                  <th>Batch Name</th>
                  <th>Batch Size</th>
                  <th>Admitted Students</th>
                  <th>Batch Date</th>
                  <th>Batch Time</th>
                  <th>Instructor Name</th>
                  <th></th>
                </tr>
                </thead>
                <tbody>
                <?php $i=1; foreach ($all_batch as $batch):?>
                <tr>
                  <td><?php echo $i ?></td>
                  <td><?php echo $batch->batch_name ?></td>
                  <td><?php echo $batch->batch_size ?></td>
                  <td>
                    <?php 
                      $this->db->where('st_course_batch', $batch->batch_id);
                      $this->db->where('st_course_is_exam_approve', 0);
                      echo $this->db->get('student_course')->num_rows();
                    ?>
                  </td>
                  <td><?php echo date('d-m-Y', strtotime($batch->batch_start_date)) ?> to <?php echo date('d-m-Y', strtotime($batch->batch_end_date)) ?></td>
                  <td><?php echo date('h:i A', strtotime($batch->batch_start_time)) ?> to <?php echo date('h:i A', strtotime($batch->batch_end_time)) ?></td>
                  <td><?php echo $batch->user_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/master/edit_batch/<?php echo $batch->batch_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/master/delete_batch/<?php echo $batch->batch_id ?>"><i class="fas fa-trash"></i>&nbsp;&nbsp;Delete</a>
                        </div>
                      </div>
                    </div>
                  </td>
                </tr>
                <?php $i++; ?>
                <?php endforeach; ?>
                </tbody>
              </table>
            </div>
          </div>
      </div><!--/. container-fluid -->
    </section>
    <!-- /.content -->
  </div>
