File: //home/cafsindia/.trash/application.1/views/approval/view_approval_status.php
<div id='table_holder' style='min-height:500px;'>
<?php
$tr_line = "";
foreach ($leave_approval_result as $key => $value) {
if($value->leave_status === "Approved"){
$leave_status = 'style = "color: green"';
}else
if($value->leave_status === "Rejected"){
$leave_status = 'style = "color: red"';
}else{
$leave_status = '';
}
$tr_line .= "<tr>
<td>".$value->employee_code."</td>
<td>".$emp_name."</td>
<td>".date("d-m-Y",strtotime($value->applied_on))."</td>
<td>".$value->request_type."</td>
<td $leave_status>".$value->leave_status."</td>
</tr>";
}
?>
<table id='view_table' class='table table-hover'>
<thead>
<tr style='background-color: #136eab;color: #FFFFFF;'>
<th>Employee Code</th>
<th>Employee Name</th>
<th>Applied Date</th>
<th>Request Type</th>
<!-- <th>Leave Type</th>
<th>From Date</th>
<th>To Date</th>
<th>Days of Leave</th>
<th>IN Time</th>
<th>Out Time</th>
<th>Current Shift</th>
<th>Change Shift</th> -->
<th>Leave Status</th>
</tr>
</thead>
<tbody>
<?php echo $tr_line; ?>
</tbody>
</table>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#view_table').DataTable();
});
</script>