<div class="span12" style="margin-top:10px;">
    <div class="subnav">
    <ul class="nav nav-pills">
      <li class="active"><a href="#typography">My Ads</a></li>
      <li class=""><a href="#navbar">My Inquiries</a></li>
      <li class=""><a href="#buttons">My Profile</a></li>
      <li class=""><a href="#forms">Edit Profile</a></li>
      <li class=""><a href="#tables">Change Password</a></li>
      
    </ul>
  </div>
     <h3>Your Ads</h3>
<table class="table table-bordered">
	<thead>
		<tr>
			<th>Title</th>
			<th>Category</th>
	        			<th>Views</th>
                                        <th>Inquiries</th>
	        			<th>Date</th>
			<th>&nbsp;</th>
		</tr>
	</thead>
	<tbody>
<?php foreach($listings as $listing){ 
		$images=$this->postings_model->getPostingImages($listing->id);
		$category=$this->categories_model->getCategory($listing->category_id);
		
		if(count($images)>0){
			$item_image=$images->image_url;
		}else{
			$item_image='default.png';
		}
		?>
		<tr>
                    <td><a title="<?php echo $listing->title;?>" href="<?php echo base_url();?>details/<?php echo formatText($listing->title);?>/<?php echo $listing->id;?>" ><?php echo substr($listing->title,0,15).'...';?></a></td>
        <td><?php echo $category->name;?></td>
                <td><?php echo $listing->views;?></td>
                <td><?php echo $this->inquiries_model->getInquiriesCount($listing->id);?></td>
                <td><?php echo formatDate($listing->dt_created);?></td>
        <td class="action">
        	<a class="btn btn-primary" href="<?php echo base_url();?>account/editad/<?php echo $listing->id;?>">
            	<i class="icon-edit icon-white"></i>
            </a>
             <!--           <a class="btn btn-warning" onclick="return confirm('Deactivate?');" href="#deactivate">
            	<i class="icon-remove icon-white"></i>
            </a> -->
            
                        <a class="btn btn-danger" onclick="return deleteItem(<?php echo $listing->id;?>);" 
            	href="#delete">
            	<i class="icon-trash icon-white"></i>
            </a>
        </td>
        	
	</tr>
 <?php } ?>
	    </tbody>
</table>
</div>
