   
<div class="row">
    <div class="col-sm-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h6 class="panel-title"><i class="fa fa-table"></i> Teacher Attandance Info.</h6>
                <a href="<?php echo site_url('everbright/teacherattandance_add'); ?>" class="pull-right btn btn-circle btn-xs btn-default"><i class="fa fa-plus"></i>Add</a>
            </div>
            <div class="datatable">
                <table class="table table-bordered table-hover">
                    <thead><tr>
                        <th>S/L</th>                        
                        <th>Date</th>                        
                        <th>Teacher</th> 
                        <th>Present/Absent</th>
						<th>Time</th>
						<th>Remarks</th> 
                        <th>Action</th>
                    </tr></thead>
                    <tbody>
                        <?php
						$i=1;
						$this->db->order_by("date", "desc");
                        $query = $this->main_model->teacherattandance();
                        foreach($query as $row):
						$date=$row['date'];  $f=explode(" ",$date);
						
						$fc=$f['0'];
						$fcd=explode("-",$fc);
                        ?>
                        <tr>
                             <td><?php echo $i; ?></td>
							<td><?php  echo $fcd['2'].'-'.$fcd['1'].'-'.$fcd['0'];  ?></td>
                            <td>
							
							
							<?php 
									$query111 = $this->main_model->teacher();
									foreach($query111 as $row123):
								?>
								<?php if($row['user_ID']==$row123['tid']): ?><?php echo $row123['name']; ?><?php endif; ?>
                            <?php endforeach; ?>
							
							
							
							
							</td>
							<td><?php if($row['user_present']==1) { echo "Yes"; } else { echo "No" ; } ?></td>
							<td><?php  echo $f['1'];  ?></td>
                            <td><?php echo $row['remark']; ?></td>
                            <td class="center">
                                <a href="<?php echo site_url('everbright/teacherattandance_delete/'.$row['ad_ID']); ?>" class="btn btn-icon"><i class="fa fa-desktop"></i> Delete</a>
                            </td>
                        </tr>
						<?php $i=$i+1; ?>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>