   
<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> Student Group SMS Information</h6>
                <a href="<?php echo site_url('everbright/studentsms_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>Serial</th>
 <th>Date</th>
 <th>time</th>
 <th>Picture</th>
<th>U:ID</th> 
<th>Name</th>
<th>Class</th>   
                         
<th>SMS</th>						
                        <th>Action</th>
                    </tr></thead>
                    <tbody>
                        <?php 
						$i=1;
						$this->db->order_by("date", "desc");
                        $query = $this->main_model->studentsms();
                        foreach($query as $row):
                        ?>
						<?php  $fnames=$row['date']; 
				 $fs=explode(" ",$fnames);
				 $fname=$fs[0];
				?>
				<?php $f=explode("-",$fname); ?>
                        <tr>
                            <td><?php echo $i; ?></td>
							<td><?php echo $f[2].'-'.$f[1].'-'.$f[0]; ?></td>
							<td><?php echo $fs[1]; ?></td>
							<?php 
									$query111 = $this->main_model->student();
									foreach($query111 as $row123):
								?>
								<?php if($row['sID']==$row123['sID']): ?>
							 <td>	<img width="80" src="<?php echo base_url();?>uploads/<?php echo $row123['thumb_image']; ?>"></td>
                           
							<td><?php echo $row123['jbID']; ?></td>
                          
							
							<td><?php echo $row123['name']; ?></td>
							<td>
							<?php 
									$query111c = $this->main_model->sclass();
									foreach($query111c as $row123c):
								?>
								<?php if($row123['class_name']==$row123c['scid']): ?><?php echo $row123c['name']; ?><?php endif; ?>
                            <?php endforeach; ?>
							<br>
							<?php if($row['shift_name']==1): ?><?php echo 'A'; ?><?php else: ?><?php echo 'B'; ?><?php endif; ?>
							<br>
							<?php echo $row['section_name']; ?>
							</td>
							<?php endif; ?>
							
							 <?php endforeach; ?>
							<td><?php echo $row['sms']; ?></td>
                           <td class="center">
                               
                                <a href="<?php echo site_url('everbright/studentsms_delete/'.$row['id']); ?>" class="btn btn-icon"><i class="fa fa-try"></i> Delete</a>
                            </td>
                        </tr>
						<?php $i=$i+1; ?>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>