      <!-- Breadcrumbs-->
      <ol class="breadcrumb">
        <li class="breadcrumb-item">
          <a href="<?= base_url('instructor/dashboard'); ?>">Dashboard</a>
        </li>
        <li class="breadcrumb-item active"><?php echo $breadcrumb_title; ?></li>
      </ol>

      <div class="row">
        <div class="col-12">
                        <div class="w3-bar">
                                <div class="w3-left">
                                        <h2><?php echo $title; ?></h2>
                                </div>
                                <div class="w3-right"> 
                                                      
                                        <div class="search-container">
                                                        <?php echo form_open('humanresource/search_employee'); ?>
                                                                <?php if(!validation_errors()===TRUE) echo "<br>"; else echo form_error('search', '<div class="help-block with-errors">', '</div>'); ?>
                                                                <?php echo form_input(['name'=>'search','required'=>'required','placeholder'=>'Search..','value'=>set_value('search')]); ?>
                                                                <button type="submit"><i class="fa fa-search"></i></button>
                                                        <?php echo form_close(); ?>
                                        </div>
                                </div>
                        </div>      






                                        <hr>
                        <div class="w3-container">
                                    <br>  
                                <div class="w3-row">

                                        <div class="col-md-10">
                                                <?php if($employees): ?>
                                                        <table  class="table table-striped table-bordered table-hover">
                                                        <thead>
                                                                <tr>
                                                                <th>#</th>
                                                                <th>Type/Emp.ID</th>
                                                                <th>Name</th>
                                                                <th>Photo</th>
                                                                <th>Email</th>
                                                                <th>Phone</th>
                                                                <th>Username</th>
                                                                <th>Entry Time</th>
                                                                <th>Status</th>
                                                                <th>Action</th>
                                                                </tr>
                                                        </thead>

                                                        <?php $i=0; $j=0; foreach($employees as $employee):  $i++; $j++; ?>

                                                                <!--onclick model-->
                                                                <div id="<?php echo $i.$j; ?>" class="w3-modal">
                                                                        <div class="w3-modal-content w3-card-4">
                                                                        <!--div class="card card-login mx-auto mt-5"-->
                                                                                <div class="card-header"><h3>Terminate Employee:</h3>Employee ID-<?php echo $employee['emp_id']; ?>Employee Name-<?php echo $employee['firstname']." ".$employee['lastname']; ?></div>
                                                                                <span onclick="document.getElementById('<?php echo $i.$j; ?>').style.display='none'" class="w3-button w3-display-topright" style="color:red;font-size:30px;font-weight:strong;">&times;</span>
                                                                                <div class="card-body">
                                                                                        <?php if(validation_errors()):$error=validation_errors();echo "<script>alert(".$error.");</script>";endif; ?>
                                                                                        <?php echo form_open('humanresource/terminate_employee'); ?>
                                                                                        <?php echo form_input(['name'=>'emp_id','id'=>'emp_id','hidden'=>'hidden','value'=>$employee['emp_id']]); ?>
                                                                                        
                                                                                        <div class="form-group">
                                                                                        <label>Terminatation Remarks</label>
                                                                                        <?php echo form_textarea(['name'=>'remarks','id'=>'remarks','placeholder'=>'Enter Termination Remarks','class'=>'form-control','required'=>'required']); ?>
                                                                                        </div>
                                                                                        <!--<div class="form-group">
                                                                                        <label>Employee Last Name</label>
                                                                                        <?php //echo form_textarea(['name'=>'category_description','id'=>'category_description'.$i,'placeholder'=>'Enter Category Description','class'=>'form-control','value'=>$employee['lastname']]); ?>
                                                                                        <script>CKEDITOR.replace( '<?php //echo "category_description".$i; ?>' );</script>
                                                                                        </div>-->
                                                                                        <button onclick = "return confirm('Once Terminated, No More functional!!! Terminate Employee ID: <?php echo $employee['emp_id']; ?> ?')" class="btn btn-primary btn-block" type="submit">Terminate Now</button>
                                                                                        <?php echo form_close(); ?>
                                                                                </div>
                                                                        <!--/div-->
                                                                        </div>
                                                                </div>
                                                                <script>
                                                                        // Get the modal
                                                                        var modal = document.getElementById('<?php echo $i.$j; ?>');

                                                                        // When the user clicks anywhere outside of the modal, close it
                                                                        window.onclick = function(event) {
                                                                        if (event.target == modal) {
                                                                                modal.style.display = "none";
                                                                                }
                                                                        }
                                                                </script>

                                                        <tbody>
                                                                <tr>
                                                                        <td><?php echo $i; ?></td>
                                                                        <td><?php echo $employee['stakeholder_type']."/".$employee['emp_id']; ?></td>
                                                                        <td><?php echo $employee['firstname']." ".$employee['lastname']; ?></td>
                                                                        <td><?php echo $employee['profile_photo']; ?></td>
                                                                        <td><?php echo $employee['email_id']; ?></td>
                                                                        <td><?php echo $employee['phone_no']; ?></td>
                                                                        <td><?php echo $employee['username']; ?></td>
                                                                        <td><?php echo $employee['emp_create_time']; ?></td>
                                                                        <td><?php echo $employee['emp_status']; ?></td>
                                                                        <td>
                                                                        <div class="btn-group">
                                                                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                                                                        Select Action
                                                                        <span class="caret"></span>
                                                                        </button>
                                                                        <ul class="dropdown-menu" >
                                                                                        <li><a href="<?php echo base_url('humanresource/single_employee_detail/').$employee['emp_id']; ?>" class="w3-button" style="width:100%;text-align:left;padding:0px;">View</a></li>
                                                                                <?php if($employee['emp_status']==="active"): ?>
                                                                                        <li><a  onclick = "return confirm('De-Activate Employee ID: <?php echo $employee['emp_id']; ?> ?')" href="<?php echo base_url('humanresource/deactivate_employee/').$employee['emp_id']; ?>" class="w3-button" style="width:100%;text-align:left;padding:0px;">De-Activate</a></li>
                                                                                <?php elseif($employee['emp_status']==="inactive"): ?>
                                                                                        <li><a  onclick = "return confirm('Activate Employee ID: <?php echo $employee['emp_id']; ?> ?')" href="<?php echo base_url('humanresource/activate_employee/').$employee['emp_id']; ?>" class="w3-button" style="width:100%;text-align:left;padding:0px;">Activate</a></li>
                                                                                <?php endif; ?>
                                                                                        <li><a href="<?php echo base_url('humanresource/update_employee_view/').$employee['emp_id']; ?>" class="w3-button" style="width:100%;text-align:left;padding:0px;">Update</a></li>
                                                                                        <li><a href="#" onclick="document.getElementById('<?php echo $i.$j; ?>').style.display='block'" class="w3-button" style="width:100%;text-align:left;left;padding:0px;">Terminate</a></li>
                                                                        </ul>
                                                                        </div>
                                                                        </td>
                                                                </tr>
                                                        </tbody>
                                                        <?php endforeach; ?>
                                                        </table>
                                                        <?php else: ?>
                                                        <?php echo "<div class='row'><p><pre><center><h2>No Employee recruited yet.</h2></center></pre></p></div>"; ?>
                                                        <?php endif; ?>
                                        </div>


                                </div>

                               
                        </div>














        </div>
      </div>
  
 