 <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 Follow Up</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 Follow Up</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">Student Name : <b><?php echo $studnt_details->user_name; ?></b></h3>
            <div class="card-tools">
              <a href="javascript:void(0)" data-toggle="modal" data-target="#addLead" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Follow Up</a>
              <a href="<?php echo base_url()?>admin/students/all_enquiry" class="btn btn-primary btn-sm"><i class="fa fa-eye" aria-hidden="true"></i> View All Enquiry</a>
            </div>
          </div>
            <!-- /.card-header -->
            <div class="card-body">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th>Follow Up Date</th>
                  <th>Next Follow Up Date</th>
                  <th>Follow Up Note</th>
                  <th>Follow Up Mode</th>
                  <th>Attend By</th>
                </tr>
                </thead>
                <tbody>
                <?php $i = 1;
                foreach ($all_followup as $follow):
                  if($follow->details_attand_emp_id == user()->user_id)
                  {
                    $emp_data = 'You';
                  } else {
                    $this->db->select('user_name');
                    $this->db->where('user_id', $follow->details_attand_emp_id);
                    $rt = $this->db->get('users')->row();
                    $emp_data = $rt->user_name;
                  }
                ?>
                <tr>
                  <td><?php echo $follow->details_date ?></td>
                  <td><?php echo $follow->details_next_date ?></td>
                  <td><?php echo $follow->details_note ?></td>
                  <td><?php echo $follow->mode_name ?></td>
                  <td><?php echo $emp_data; ?></td>
                </tr>
                <?php $i++; ?>
                <?php endforeach; ?>
                </tbody>
              </table>
            </div>
          </div>
      </div><!--/. container-fluid -->
    </section>
    <!-- /.content -->
  </div>


<div class="modal fade" id="addLead" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add New Follow Up Details</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <?php echo form_open(base_url().'admin/students/add_new_follow_up_details/'.$student_id.'/'.$studnt_details->user_atp);?>
        <div class="modal-body">
            <div class="form-group">
              <label class="col-form-label">Followup Mode <span style="color:red">*</span></label>
              <select type="text" class="form-control" required placeholder="Enter Mode Name" name="details_mode">
                <option value="">Select</option>
                <?php foreach ($all_mode as $mode): ?>
                  <option value="<?php echo $mode->mode_id; ?>"><?php echo $mode->mode_name; ?></option>
                <?php endforeach ?>
              </select>
            </div>
            <div class="form-group">
              <label class="col-form-label">Next follow-up date <span style="color:red">*</span></label>
              <input type="date" class="form-control" required placeholder="Enter Mode Name" name="details_next_date">
            </div>
            <div class="form-group">
              <label class="col-form-label">Follow-up Note<span style="color:red">*</span></label>
              <textarea class="form-control" required placeholder="Enter follow-up Note" name="details_note"></textarea>
            </div>
        </div>
        <div class="modal-footer">
          <button type="submit" class="btn btn-primary">Add</button>
        </div>
      <?php echo form_close();?>
    </div>
  </div>
</div>