
 <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 Admitted Student</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="#">Student</a></li>
              <li class="breadcrumb-item active">All Admitted Student</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 Student <strong><small>( PP = Payment Panding && PC = Payment Complete )</small></strong></h3>
          </div>
            <!-- /.card-header -->
            <div class="card-body">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th>Name & Photo</th>
                  <th>Details</th>
                  <th>Course</th>
                  <th>Status</th>
                </tr>
                </thead>
                <tbody>
                <?php $i=1; foreach ($all_students as $student):?>
                <tr>
                  <td><?php echo $student->user_name ?>
                    <br/>
                    <img src="<?php echo base_url(); ?><?php echo $student->user_photo ?>" width="50px">
                  </td>
                  <td>
                    Reg. No. : <b><?php echo $student->user_reg_id ?></b>
                    <br/>
                    Mob. : <b><?php echo $student->user_mobile ?></b>
                    <?php if($student->user_email): ?>
                      <br/>
                      Email : <b><?php echo $student->user_email ?></b>
                    <?php endif;?>
                    <br/>
                    Gender : <b><?php echo $student->user_gender ?></b>
                    <?php if($student->user_dob != '0000-00-00'): ?>
                      <br/>
                      DOB : <b><?php echo date('d-m-Y', strtotime($student->user_dob)); ?></b>
                    <?php endif; ?>
                    <?php if($student->user_qualification): ?>
                      <br/>
                      Qulification : <b><?php echo $student->user_qualification ?></b>
                    <?php endif; ?>
                    <?php if($student->user_pin_code): ?>
                      <br/>
                      Address : <b>
                      <?php echo $student->user_village ?>, <?php echo $student->user_taluka ?>, <?php echo $student->user_dist ?>, <?php echo $student->user_state ?> - <?php echo $student->user_pin_code ?></b>
                    <?php endif;?>
                    <?php 
                    $this->db->select('user_business_name');
                    $this->db->where('user_id', $student->user_atp);
                    $atp_name = $this->db->get('users')->row();
                    ?>
                    <br/>
                    ATP : <b><?php echo $atp_name->user_business_name; ?></b>
                  </td>
                  <td>
                    <?php 
                    $pay_amount = 0;
                    $this->db->select('a.*, b.title, b.atp_course_price');
                    $this->db->from('student_course a');
                    $this->db->join('course b', 'b.id = a.st_course_course_id', 'left');
                    $this->db->where('a.st_course_student_id', $student->user_id);
                    $all_course = $this->db->get()->result();
                    foreach ($all_course as $course) 
                    {
                      $pay_amount += $course->atp_course_price;
                    ?>
                    <span style="font-size: 14px" class="badge badge-warning mt-2"><?php echo $course->title; ?> 
                    <?php if($course->st_course_status == 0): ?>
                      <span class="badge badge-danger">PP</span>
                    <?php else: ?>
                      <span class="badge badge-success">PC</span>
                    <?php endif;?>
                    </span>
                    <?php if($course->st_course_batch == 0): ?>
                    <br/>
                    <span class="badge badge-danger">Batch Not Assign</span>
                    <br/>
                    <?php endif; ?>
                  <?php }?>

                  </td>
                  <td>
                    <?php if($student->user_status == 0): ?>
                      <span class="badge badge-warning">Admission Pending</span>
                      
                    <?php elseif($student->user_status == 1): ?>
                      <span class="badge badge-success">Admitted</span>
                    <?php elseif($student->user_status == 2): ?>
                      <span class="badge badge-success">Admitted</span>
                    <?php elseif($student->user_status == 3): ?> 
                      <span class="badge badge-danger">Lost</span>
                    <?php endif;?>
                  </td>
                </tr>
                <?php $i++; ?>
                <?php endforeach; ?>
                </tbody>
              </table>
            </div>
          </div>
      </div><!--/. container-fluid -->
    </section>
    <!-- /.content -->
  </div>
