<?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="800" align="center" cellpadding="6" cellspacing="2">

<tr class="tdcolor">
<td width="4%" align="center">No.</td>
<td width="42%" align="center">Title</td>
<td width="18%" align="center">Order</td>
<td width="12%" align="center">Status</td>
<td width="12%" align="center">Modify</td>
<td width="12%" 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"><?=$row['order']?></td>
<td align="center">

<?php if($row['active']=="N"): ?>

<img src="<?php echo base_url('assets/web_images/incorrect.png'); ?>" width="20" height="20" />
<br />
<a href="<?php echo site_url('Basic_functions/change_status/shop_pages/active/Y/aid/'.$row['aid'].'/'.$type.'_admin/view' ); ?>">Activate?</a>

<?php elseif($row['active']=="Y") : ?>

<img src="<?php echo base_url('assets/web_images/ok.png'); ?>" width="20" height="20" />
<br />
<a href="<?php echo site_url('Basic_functions/change_status/shop_pages/active/N/aid/'.$row['aid'].'/'.$type.'_admin/view' ); ?>">Suspend?</a>

<?php endif; ?>

</td>    

<td align="center">
<a href="<?php echo site_url($type.'_admin/edit/'.$row['aid']) ; ?>">
<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['aid'].'/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; ?>