<?php

echo heading($heading,3,'align="center"') ; 


/**
*
*	here $result_array is an array, not an array of objects
*	because we used $query->result_array() instead of $query->result() 
*
*/

if( count($result_array)>0 ): 

?>

<table width="600" align="center" cellpadding="6" cellspacing="2">

<tr class="tdcolor">
<td width="2%" align="center">No.</td>
<td width="48%" align="center">Title</td>
<td width="15%" align="center">Image</td>
<td width="15%" align="center">Order</td>
<td width="10%" align="center">Modify</td>
<td width="10%" align="center">Delete</td>
</tr>

<?php 

$i=1;

foreach($result_array as $row):

?>

<tr class="tdcolor2">
<td align="center"><?=$i?></td>
<td align="center"><?=$row['title']?></td>
<td align="center">
<?php if($row['img']!=''): ?>
<img src="<?php echo base_url('assets/images/'.$row['img']) ; ?>" width="60" height="60"/> 
<?php endif; ?>
</td>
<td align="center"><?=$row['order']?></td>

<td align="center">
<a href="<?php echo site_url('Type_admin/edit/'.$row['id']) ; ?>">
<img src="<?php echo base_url('assets/web_images/edit.png'); ?>" width="20" height="20" />
</a>
</td>

<td align="center">
<a href="<?php echo site_url('Type_admin/delete/'.$row['id'].'/1/'.$uniq_id) ; ?>" onClick="return confirm('Delete content ?')">
<img src="<?php echo base_url('assets/web_images/delete.gif'); ?>" width="20" height="20" />
</a> 
</td>
</tr>

<?php $i++; endforeach ; ?>


</table>

<?php endif; ?>