   
<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> Gallery Information</h6>
                <a href="<?php echo site_url('everbright/gallery_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>Album Name</th> 
						<th>Picture</th> 						
						<th>Title</th>
                        <th>Edit</th>
                    </tr></thead>
                    <tbody>
                        <?php 
						$i=1;
						$this->db->order_by("album", "asc");
                        $query = $this->main_model->gallery();
                        foreach($query as $row):
						$fc=$row['date']; 
						$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->album();
									foreach($query111 as $row123):
								?>
								<?php if($row['album']==$row123['album_id']): ?><?php echo $row123['name']; ?><?php endif; ?>
                            
							<?php endforeach; ?>
							
							
							
							</td>
							
							
							<td><img width="80" src="<?php echo base_url();?>uploads/<?php echo $row['image']; ?>"></td>
							
							<td><?php echo $row['title']; ?></td>
                           <td class="center">
                                <a href="<?php echo site_url('everbright/gallery_edit/'.$row['id']); ?>" class="btn btn-icon"><i class="fa fa-edit"></i> Info</a>
                                <a href="<?php echo site_url('everbright/gallery_edit_file/'.$row['id']); ?>" class="btn btn-icon"><i class="fa fa-edit"></i> Picture</a>
								<a href="<?php echo site_url('everbright/gallery_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>